From 8a0efa53e44919bcf5ccb1d3353618a82afdf8bc Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 17 Feb 2000 19:39:52 +0000 Subject: [PATCH] import newlib-2000-02-17 snapshot --- newlib/ChangeLog | 6797 +++++++++++++++++ newlib/Makefile.am | 191 + newlib/Makefile.in | 625 ++ newlib/NEWS | 79 + newlib/README | 231 + newlib/acinclude.m4 | 144 + newlib/aclocal.m4 | 282 + newlib/configure | 1865 +++++ newlib/configure.host | 457 ++ newlib/configure.in | 64 + newlib/doc/Makefile.am | 21 + newlib/doc/Makefile.in | 246 + newlib/doc/aclocal.m4 | 282 + newlib/doc/ansidecl.h | 116 + newlib/doc/configure | 1714 +++++ newlib/doc/configure.in | 41 + newlib/doc/doc.str | 178 + newlib/doc/makedoc.c | 1469 ++++ newlib/libc/Makefile.am | 119 + newlib/libc/Makefile.in | 632 ++ newlib/libc/aclocal.m4 | 282 + newlib/libc/configure | 1887 +++++ newlib/libc/configure.in | 70 + newlib/libc/ctype/Makefile.am | 57 + newlib/libc/ctype/Makefile.in | 332 + newlib/libc/ctype/_tolower.c | 9 + newlib/libc/ctype/_toupper.c | 9 + newlib/libc/ctype/ctype.tex | 68 + newlib/libc/ctype/ctype_.c | 62 + newlib/libc/ctype/isalnum.c | 46 + newlib/libc/ctype/isalpha.c | 44 + newlib/libc/ctype/isascii.c | 43 + newlib/libc/ctype/iscntrl.c | 48 + newlib/libc/ctype/isdigit.c | 43 + newlib/libc/ctype/islower.c | 43 + newlib/libc/ctype/isprint.c | 60 + newlib/libc/ctype/ispunct.c | 46 + newlib/libc/ctype/isspace.c | 44 + newlib/libc/ctype/isupper.c | 43 + newlib/libc/ctype/isxdigit.c | 45 + newlib/libc/ctype/toascii.c | 41 + newlib/libc/ctype/tolower.c | 55 + newlib/libc/ctype/toupper.c | 54 + newlib/libc/errno/Makefile.am | 26 + newlib/libc/errno/Makefile.in | 297 + newlib/libc/errno/errno.c | 16 + newlib/libc/include/_ansi.h | 71 + newlib/libc/include/_syslist.h | 29 + newlib/libc/include/ar.h | 69 + newlib/libc/include/assert.h | 29 + newlib/libc/include/ctype.h | 73 + newlib/libc/include/dirent.h | 7 + newlib/libc/include/errno.h | 1 + newlib/libc/include/fastmath.h | 13 + newlib/libc/include/fcntl.h | 1 + newlib/libc/include/grp.h | 85 + newlib/libc/include/ieeefp.h | 241 + newlib/libc/include/locale.h | 60 + newlib/libc/include/machine/fastmath.h | 100 + newlib/libc/include/machine/ieeefp.h | 157 + newlib/libc/include/machine/setjmp-dj.h | 44 + newlib/libc/include/machine/setjmp.h | 168 + newlib/libc/include/machine/time.h | 10 + newlib/libc/include/machine/types.h | 9 + newlib/libc/include/malloc.h | 97 + newlib/libc/include/math.h | 273 + newlib/libc/include/paths.h | 7 + newlib/libc/include/process.h | 60 + newlib/libc/include/pwd.h | 76 + newlib/libc/include/reent.h | 87 + newlib/libc/include/regdef.h | 7 + newlib/libc/include/setjmp.h | 22 + newlib/libc/include/signal.h | 37 + newlib/libc/include/stdio.h | 313 + newlib/libc/include/stdlib.h | 142 + newlib/libc/include/string.h | 92 + newlib/libc/include/sys/_types.h | 15 + newlib/libc/include/sys/config.h | 115 + newlib/libc/include/sys/dirent.h | 15 + newlib/libc/include/sys/errno.h | 154 + newlib/libc/include/sys/fcntl.h | 178 + newlib/libc/include/sys/file.h | 2 + newlib/libc/include/sys/param.h | 18 + newlib/libc/include/sys/reent.h | 238 + newlib/libc/include/sys/resource.h | 15 + newlib/libc/include/sys/signal.h | 182 + newlib/libc/include/sys/stat-dj.h | 59 + newlib/libc/include/sys/stat.h | 149 + newlib/libc/include/sys/time.h | 51 + newlib/libc/include/sys/timeb.h | 39 + newlib/libc/include/sys/times.h | 27 + newlib/libc/include/sys/types.h | 174 + newlib/libc/include/sys/unistd.h | 175 + newlib/libc/include/sys/utime.h | 22 + newlib/libc/include/sys/wait.h | 40 + newlib/libc/include/termios.h | 7 + newlib/libc/include/time.h | 90 + newlib/libc/include/unctrl.h | 46 + newlib/libc/include/unistd.h | 6 + newlib/libc/include/utime.h | 10 + newlib/libc/include/utmp.h | 8 + newlib/libc/libc.texinfo | 427 ++ newlib/libc/locale/Makefile.am | 26 + newlib/libc/locale/Makefile.in | 297 + newlib/libc/locale/locale.c | 198 + newlib/libc/locale/locale.tex | 123 + newlib/libc/machine/Makefile.am | 23 + newlib/libc/machine/Makefile.in | 401 + newlib/libc/machine/a29k/Makefile.am | 12 + newlib/libc/machine/a29k/Makefile.in | 294 + newlib/libc/machine/a29k/aclocal.m4 | 282 + newlib/libc/machine/a29k/configure | 1687 ++++ newlib/libc/machine/a29k/configure.in | 12 + newlib/libc/machine/aclocal.m4 | 282 + newlib/libc/machine/arm/Makefile.am | 12 + newlib/libc/machine/arm/Makefile.in | 294 + newlib/libc/machine/arm/aclocal.m4 | 282 + newlib/libc/machine/arm/configure | 1687 ++++ newlib/libc/machine/arm/configure.in | 12 + newlib/libc/machine/configure | 1802 +++++ newlib/libc/machine/configure.in | 18 + newlib/libc/machine/d10v/Makefile.am | 12 + newlib/libc/machine/d10v/Makefile.in | 297 + newlib/libc/machine/d10v/aclocal.m4 | 282 + newlib/libc/machine/d10v/configure | 1687 ++++ newlib/libc/machine/d10v/configure.in | 12 + newlib/libc/machine/d10v/setjmp.S | 55 + newlib/libc/machine/d30v/Makefile.am | 12 + newlib/libc/machine/d30v/Makefile.in | 297 + newlib/libc/machine/d30v/aclocal.m4 | 282 + newlib/libc/machine/d30v/configure | 1687 ++++ newlib/libc/machine/d30v/configure.in | 12 + newlib/libc/machine/d30v/setjmp.S | 106 + newlib/libc/machine/fr30/Makefile.am | 12 + newlib/libc/machine/fr30/Makefile.in | 297 + newlib/libc/machine/fr30/aclocal.m4 | 282 + newlib/libc/machine/fr30/configure | 1687 ++++ newlib/libc/machine/fr30/configure.in | 12 + newlib/libc/machine/fr30/setjmp.S | 64 + newlib/libc/machine/h8300/Makefile.am | 13 + newlib/libc/machine/h8300/Makefile.in | 299 + newlib/libc/machine/h8300/aclocal.m4 | 282 + newlib/libc/machine/h8300/configure | 1687 ++++ newlib/libc/machine/h8300/configure.in | 12 + newlib/libc/machine/h8300/defines.h | 86 + newlib/libc/machine/h8300/memcpy.S | 48 + newlib/libc/machine/h8300/memset.S | 51 + newlib/libc/machine/h8300/reg_memcpy.S | 33 + newlib/libc/machine/h8300/reg_memset.S | 32 + newlib/libc/machine/h8300/setjmp.S | 72 + newlib/libc/machine/h8300/strcmp.S | 45 + newlib/libc/machine/h8500/Makefile.am | 12 + newlib/libc/machine/h8500/Makefile.in | 298 + newlib/libc/machine/h8500/aclocal.m4 | 282 + newlib/libc/machine/h8500/cmpsi.c | 126 + newlib/libc/machine/h8500/configure | 1687 ++++ newlib/libc/machine/h8500/configure.in | 12 + newlib/libc/machine/h8500/divhi3.S | 54 + newlib/libc/machine/h8500/divsi3.c | 134 + newlib/libc/machine/h8500/mulhi3.c | 21 + newlib/libc/machine/h8500/mulsi3.c | 72 + newlib/libc/machine/h8500/negsi2.c | 7 + newlib/libc/machine/h8500/psi.S | 136 + newlib/libc/machine/h8500/setjmp.S | 27 + newlib/libc/machine/h8500/shifts.c | 45 + newlib/libc/machine/hppa/DEFS.h | 160 + newlib/libc/machine/hppa/Makefile.am | 14 + newlib/libc/machine/hppa/Makefile.in | 300 + newlib/libc/machine/hppa/aclocal.m4 | 282 + newlib/libc/machine/hppa/configure | 1687 ++++ newlib/libc/machine/hppa/configure.in | 12 + newlib/libc/machine/hppa/memchr.S | 48 + newlib/libc/machine/hppa/memcmp.S | 183 + newlib/libc/machine/hppa/memcpy.S | 146 + newlib/libc/machine/hppa/memset.S | 85 + newlib/libc/machine/hppa/pcc_prefix.s | 389 + newlib/libc/machine/hppa/setjmp.S | 139 + newlib/libc/machine/hppa/strcat.S | 178 + newlib/libc/machine/hppa/strcmp.S | 282 + newlib/libc/machine/hppa/strcpy.S | 285 + newlib/libc/machine/hppa/strlen.S | 79 + newlib/libc/machine/hppa/strncat.S | 238 + newlib/libc/machine/hppa/strncmp.S | 189 + newlib/libc/machine/hppa/strncpy.S | 256 + newlib/libc/machine/i386/Makefile.am | 20 + newlib/libc/machine/i386/Makefile.in | 327 + newlib/libc/machine/i386/aclocal.m4 | 282 + newlib/libc/machine/i386/configure | 1699 ++++ newlib/libc/machine/i386/configure.in | 14 + newlib/libc/machine/i386/f_atan2.S | 32 + newlib/libc/machine/i386/f_atan2f.S | 32 + newlib/libc/machine/i386/f_exp.c | 45 + newlib/libc/machine/i386/f_expf.c | 45 + newlib/libc/machine/i386/f_frexp.S | 43 + newlib/libc/machine/i386/f_frexpf.S | 43 + newlib/libc/machine/i386/f_ldexp.S | 33 + newlib/libc/machine/i386/f_ldexpf.S | 33 + newlib/libc/machine/i386/f_log.S | 35 + newlib/libc/machine/i386/f_log10.S | 35 + newlib/libc/machine/i386/f_log10f.S | 35 + newlib/libc/machine/i386/f_logf.S | 35 + newlib/libc/machine/i386/f_math.h | 29 + newlib/libc/machine/i386/f_pow.c | 44 + newlib/libc/machine/i386/f_powf.c | 44 + newlib/libc/machine/i386/f_tan.S | 32 + newlib/libc/machine/i386/f_tanf.S | 32 + newlib/libc/machine/i386/i386mach.h | 69 + newlib/libc/machine/i386/memchr.S | 41 + newlib/libc/machine/i386/memcmp.S | 75 + newlib/libc/machine/i386/memcpy.S | 73 + newlib/libc/machine/i386/memmove.S | 145 + newlib/libc/machine/i386/memset.S | 59 + newlib/libc/machine/i386/setjmp.S | 136 + newlib/libc/machine/i386/strchr.S | 84 + newlib/libc/machine/i386/strlen.S | 34 + newlib/libc/machine/i960/Makefile.am | 12 + newlib/libc/machine/i960/Makefile.in | 294 + newlib/libc/machine/i960/aclocal.m4 | 282 + newlib/libc/machine/i960/configure | 1687 ++++ newlib/libc/machine/i960/configure.in | 12 + newlib/libc/machine/i960/memccpy.S | 143 + newlib/libc/machine/i960/memccpy_ca.S | 245 + newlib/libc/machine/i960/memchr.S | 130 + newlib/libc/machine/i960/memchr_ca.S | 153 + newlib/libc/machine/i960/memcmp.S | 128 + newlib/libc/machine/i960/memcmp_ca.S | 205 + newlib/libc/machine/i960/memcpy.S | 160 + newlib/libc/machine/i960/memcpy_ca.S | 353 + newlib/libc/machine/i960/memset.S | 121 + newlib/libc/machine/i960/setjmp.S | 96 + newlib/libc/machine/i960/strchr.S | 123 + newlib/libc/machine/i960/strchr_ca.S | 152 + newlib/libc/machine/i960/strcmp.S | 118 + newlib/libc/machine/i960/strcmp_ca.S | 246 + newlib/libc/machine/i960/strcpy.S | 177 + newlib/libc/machine/i960/strcpy_ca.S | 284 + newlib/libc/machine/i960/strcspn.S | 94 + newlib/libc/machine/i960/strdup.S | 66 + newlib/libc/machine/i960/strlen.S | 117 + newlib/libc/machine/i960/strlen_ca.S | 146 + newlib/libc/machine/i960/strncat.S | 155 + newlib/libc/machine/i960/strncat_ca.S | 300 + newlib/libc/machine/i960/strncmp.S | 129 + newlib/libc/machine/i960/strncmp_ca.S | 253 + newlib/libc/machine/i960/strncpy.S | 154 + newlib/libc/machine/i960/strncpy_ca.S | 289 + newlib/libc/machine/i960/strpbrk.S | 100 + newlib/libc/machine/i960/strrchr.S | 137 + newlib/libc/machine/m32r/Makefile.am | 12 + newlib/libc/machine/m32r/Makefile.in | 297 + newlib/libc/machine/m32r/aclocal.m4 | 282 + newlib/libc/machine/m32r/configure | 1687 ++++ newlib/libc/machine/m32r/configure.in | 12 + newlib/libc/machine/m32r/setjmp.S | 52 + newlib/libc/machine/m68k/Makefile.am | 12 + newlib/libc/machine/m68k/Makefile.in | 297 + newlib/libc/machine/m68k/aclocal.m4 | 282 + newlib/libc/machine/m68k/configure | 1687 ++++ newlib/libc/machine/m68k/configure.in | 12 + newlib/libc/machine/m68k/setjmp.S | 88 + newlib/libc/machine/m68k/strcpy.c | 36 + newlib/libc/machine/m68k/strlen.c | 35 + newlib/libc/machine/m88k/Makefile.am | 12 + newlib/libc/machine/m88k/Makefile.in | 297 + newlib/libc/machine/m88k/aclocal.m4 | 282 + newlib/libc/machine/m88k/configure | 1687 ++++ newlib/libc/machine/m88k/configure.in | 12 + newlib/libc/machine/m88k/setjmp.S | 48 + newlib/libc/machine/mips/Makefile.am | 12 + newlib/libc/machine/mips/Makefile.in | 297 + newlib/libc/machine/mips/aclocal.m4 | 282 + newlib/libc/machine/mips/configure | 1687 ++++ newlib/libc/machine/mips/configure.in | 12 + newlib/libc/machine/mips/machine/regdef.h | 38 + newlib/libc/machine/mips/setjmp.S | 65 + newlib/libc/machine/mn10200/Makefile.am | 12 + newlib/libc/machine/mn10200/Makefile.in | 297 + newlib/libc/machine/mn10200/aclocal.m4 | 282 + newlib/libc/machine/mn10200/configure | 1687 ++++ newlib/libc/machine/mn10200/configure.in | 12 + newlib/libc/machine/mn10200/setjmp.S | 33 + newlib/libc/machine/mn10300/Makefile.am | 13 + newlib/libc/machine/mn10300/Makefile.in | 321 + newlib/libc/machine/mn10300/aclocal.m4 | 282 + newlib/libc/machine/mn10300/configure | 1687 ++++ newlib/libc/machine/mn10300/configure.in | 12 + newlib/libc/machine/mn10300/memchr.S | 76 + newlib/libc/machine/mn10300/memcmp.S | 53 + newlib/libc/machine/mn10300/memcpy.S | 68 + newlib/libc/machine/mn10300/memset.S | 63 + newlib/libc/machine/mn10300/setjmp.S | 50 + newlib/libc/machine/mn10300/strchr.S | 88 + newlib/libc/machine/mn10300/strcmp.S | 54 + newlib/libc/machine/mn10300/strcpy.S | 51 + newlib/libc/machine/mn10300/strlen.S | 44 + newlib/libc/machine/necv70/Makefile.am | 12 + newlib/libc/machine/necv70/Makefile.in | 297 + newlib/libc/machine/necv70/aclocal.m4 | 282 + newlib/libc/machine/necv70/configure | 1687 ++++ newlib/libc/machine/necv70/configure.in | 12 + newlib/libc/machine/necv70/fastmath.s | 251 + .../libc/machine/necv70/machine/registers.h | 14 + newlib/libc/machine/necv70/necv70.tex | 99 + newlib/libc/machine/necv70/setjmp.s | 33 + newlib/libc/machine/powerpc/Makefile.am | 12 + newlib/libc/machine/powerpc/Makefile.in | 297 + newlib/libc/machine/powerpc/aclocal.m4 | 282 + newlib/libc/machine/powerpc/configure | 1687 ++++ newlib/libc/machine/powerpc/configure.in | 12 + newlib/libc/machine/powerpc/setjmp.S | 118 + newlib/libc/machine/sh/Makefile.am | 18 + newlib/libc/machine/sh/Makefile.in | 303 + newlib/libc/machine/sh/aclocal.m4 | 282 + newlib/libc/machine/sh/asm.h | 22 + newlib/libc/machine/sh/configure | 1687 ++++ newlib/libc/machine/sh/configure.in | 12 + newlib/libc/machine/sh/memcpy.S | 221 + newlib/libc/machine/sh/memset.S | 64 + newlib/libc/machine/sh/setjmp.S | 57 + newlib/libc/machine/sh/strcmp.S | 66 + newlib/libc/machine/sh/strcpy.S | 41 + newlib/libc/machine/sparc/Makefile.am | 12 + newlib/libc/machine/sparc/Makefile.in | 297 + newlib/libc/machine/sparc/aclocal.m4 | 282 + newlib/libc/machine/sparc/configure | 1687 ++++ newlib/libc/machine/sparc/configure.in | 12 + newlib/libc/machine/sparc/machine/sparclet.h | 32 + newlib/libc/machine/sparc/scan.c | 15 + newlib/libc/machine/sparc/setjmp.S | 148 + newlib/libc/machine/sparc/shuffle.c | 15 + newlib/libc/machine/tic80/Makefile.am | 12 + newlib/libc/machine/tic80/Makefile.in | 297 + newlib/libc/machine/tic80/aclocal.m4 | 282 + newlib/libc/machine/tic80/configure | 1687 ++++ newlib/libc/machine/tic80/configure.in | 12 + newlib/libc/machine/tic80/setjmp.S | 50 + newlib/libc/machine/v850/Makefile.am | 12 + newlib/libc/machine/v850/Makefile.in | 297 + newlib/libc/machine/v850/aclocal.m4 | 282 + newlib/libc/machine/v850/configure | 1687 ++++ newlib/libc/machine/v850/configure.in | 12 + newlib/libc/machine/v850/setjmp.S | 42 + newlib/libc/machine/w65/Makefile.am | 13 + newlib/libc/machine/w65/Makefile.in | 299 + newlib/libc/machine/w65/aclocal.m4 | 282 + newlib/libc/machine/w65/cmpsi.c | 28 + newlib/libc/machine/w65/configure | 1687 ++++ newlib/libc/machine/w65/configure.in | 12 + newlib/libc/machine/w65/divsi3.c | 134 + newlib/libc/machine/w65/lshrhi.s | 48 + newlib/libc/machine/w65/mulsi3.c | 17 + newlib/libc/machine/w65/sdivhi3.s | 35 + newlib/libc/machine/w65/smulhi3.s | 20 + newlib/libc/machine/w65/udivhi3.s | 30 + newlib/libc/machine/w65/umodhi3.s | 7 + newlib/libc/machine/z8k/Makefile.am | 12 + newlib/libc/machine/z8k/Makefile.in | 297 + newlib/libc/machine/z8k/aclocal.m4 | 282 + newlib/libc/machine/z8k/args.h | 13 + newlib/libc/machine/z8k/configure | 1687 ++++ newlib/libc/machine/z8k/configure.in | 12 + newlib/libc/machine/z8k/setjmp.S | 49 + newlib/libc/misc/Makefile.am | 26 + newlib/libc/misc/Makefile.in | 297 + newlib/libc/misc/dprintf.c | 266 + newlib/libc/misc/ffs.c | 42 + newlib/libc/misc/misc.tex | 10 + newlib/libc/misc/unctrl.c | 146 + newlib/libc/posix/Makefile.am | 29 + newlib/libc/posix/Makefile.in | 303 + newlib/libc/posix/closedir.c | 62 + newlib/libc/posix/creat.c | 11 + newlib/libc/posix/execl.c | 42 + newlib/libc/posix/execle.c | 44 + newlib/libc/posix/execlp.c | 42 + newlib/libc/posix/execv.c | 15 + newlib/libc/posix/execve.c | 10 + newlib/libc/posix/execvp.c | 88 + newlib/libc/posix/isatty.c | 17 + newlib/libc/posix/opendir.c | 84 + newlib/libc/posix/popen.c | 170 + newlib/libc/posix/readdir.c | 76 + newlib/libc/posix/rewinddir.c | 50 + newlib/libc/posix/scandir.c | 142 + newlib/libc/posix/seekdir.c | 56 + newlib/libc/posix/telldir.c | 133 + newlib/libc/reent/Makefile.am | 55 + newlib/libc/reent/Makefile.in | 329 + newlib/libc/reent/closer.c | 58 + newlib/libc/reent/execr.c | 144 + newlib/libc/reent/fstatr.c | 66 + newlib/libc/reent/impure.c | 13 + newlib/libc/reent/linkr.c | 102 + newlib/libc/reent/lseekr.c | 63 + newlib/libc/reent/openr.c | 64 + newlib/libc/reent/readr.c | 63 + newlib/libc/reent/reent.c | 107 + newlib/libc/reent/reent.tex | 108 + newlib/libc/reent/sbrkr.c | 66 + newlib/libc/reent/signalr.c | 98 + newlib/libc/reent/statr.c | 67 + newlib/libc/reent/timer.c | 112 + newlib/libc/reent/writer.c | 63 + newlib/libc/saber | 185 + newlib/libc/signal/Makefile.am | 26 + newlib/libc/signal/Makefile.in | 297 + newlib/libc/signal/raise.c | 80 + newlib/libc/signal/signal.c | 269 + newlib/libc/signal/signal.tex | 70 + newlib/libc/stdio/Makefile.am | 161 + newlib/libc/stdio/Makefile.in | 441 ++ newlib/libc/stdio/clearerr.c | 63 + newlib/libc/stdio/fclose.c | 82 + newlib/libc/stdio/fdopen.c | 116 + newlib/libc/stdio/feof.c | 40 + newlib/libc/stdio/ferror.c | 67 + newlib/libc/stdio/fflush.c | 99 + newlib/libc/stdio/fgetc.c | 46 + newlib/libc/stdio/fgetpos.c | 61 + newlib/libc/stdio/fgets.c | 127 + newlib/libc/stdio/fileno.c | 40 + newlib/libc/stdio/findfp.c | 153 + newlib/libc/stdio/fiprintf.c | 77 + newlib/libc/stdio/flags.c | 87 + newlib/libc/stdio/floatio.h | 27 + newlib/libc/stdio/fopen.c | 165 + newlib/libc/stdio/fprintf.c | 56 + newlib/libc/stdio/fputc.c | 51 + newlib/libc/stdio/fputs.c | 71 + newlib/libc/stdio/fread.c | 97 + newlib/libc/stdio/freopen.c | 151 + newlib/libc/stdio/fscanf.c | 60 + newlib/libc/stdio/fseek.c | 310 + newlib/libc/stdio/fsetpos.c | 54 + newlib/libc/stdio/ftell.c | 126 + newlib/libc/stdio/fvwrite.c | 195 + newlib/libc/stdio/fvwrite.h | 38 + newlib/libc/stdio/fwalk.c | 43 + newlib/libc/stdio/fwrite.c | 104 + newlib/libc/stdio/getc.c | 80 + newlib/libc/stdio/getchar.c | 96 + newlib/libc/stdio/gets.c | 102 + newlib/libc/stdio/iprintf.c | 118 + newlib/libc/stdio/local.h | 90 + newlib/libc/stdio/makebuf.c | 96 + newlib/libc/stdio/mktemp.c | 219 + newlib/libc/stdio/perror.c | 80 + newlib/libc/stdio/printf.c | 83 + newlib/libc/stdio/putc.c | 84 + newlib/libc/stdio/putchar.c | 94 + newlib/libc/stdio/puts.c | 101 + newlib/libc/stdio/refill.c | 113 + newlib/libc/stdio/remove.c | 69 + newlib/libc/stdio/rename.c | 86 + newlib/libc/stdio/rewind.c | 60 + newlib/libc/stdio/rget.c | 43 + newlib/libc/stdio/scanf.c | 75 + newlib/libc/stdio/setbuf.c | 79 + newlib/libc/stdio/setvbuf.c | 190 + newlib/libc/stdio/siprintf.c | 70 + newlib/libc/stdio/snprintf.c | 95 + newlib/libc/stdio/sprintf.c | 360 + newlib/libc/stdio/sscanf.c | 386 + newlib/libc/stdio/stdio.c | 92 + newlib/libc/stdio/stdio.tex | 183 + newlib/libc/stdio/tmpfile.c | 77 + newlib/libc/stdio/tmpnam.c | 208 + newlib/libc/stdio/ungetc.c | 145 + newlib/libc/stdio/vfieeefp.h | 205 + newlib/libc/stdio/vfprintf.c | 939 +++ newlib/libc/stdio/vfscanf.c | 956 +++ newlib/libc/stdio/vprintf.c | 35 + newlib/libc/stdio/vsnprintf.c | 73 + newlib/libc/stdio/vsprintf.c | 70 + newlib/libc/stdio/wbuf.c | 81 + newlib/libc/stdio/wsetup.c | 79 + newlib/libc/stdlib/Makefile.am | 166 + newlib/libc/stdlib/Makefile.in | 449 ++ newlib/libc/stdlib/__adjust.c | 44 + newlib/libc/stdlib/__exp10.c | 29 + newlib/libc/stdlib/__ten_mu.c | 23 + newlib/libc/stdlib/abort.c | 66 + newlib/libc/stdlib/abs.c | 43 + newlib/libc/stdlib/assert.c | 62 + newlib/libc/stdlib/atexit.c | 80 + newlib/libc/stdlib/atexit.h | 13 + newlib/libc/stdlib/atof.c | 72 + newlib/libc/stdlib/atoff.c | 9 + newlib/libc/stdlib/atoi.c | 54 + newlib/libc/stdlib/atol.c | 12 + newlib/libc/stdlib/bsearch.c | 100 + newlib/libc/stdlib/calloc.c | 69 + newlib/libc/stdlib/div.c | 132 + newlib/libc/stdlib/dtoa.c | 854 +++ newlib/libc/stdlib/dtoastub.c | 23 + newlib/libc/stdlib/ecvtbuf.c | 470 ++ newlib/libc/stdlib/efgcvt.c | 202 + newlib/libc/stdlib/environ.c | 23 + newlib/libc/stdlib/envlock.c | 48 + newlib/libc/stdlib/envlock.h | 12 + newlib/libc/stdlib/eprintf.c | 26 + newlib/libc/stdlib/exit.c | 73 + newlib/libc/stdlib/getenv.c | 101 + newlib/libc/stdlib/getenv_r.c | 129 + newlib/libc/stdlib/getopt.c | 117 + newlib/libc/stdlib/labs.c | 49 + newlib/libc/stdlib/ldiv.c | 109 + newlib/libc/stdlib/local.h | 8 + newlib/libc/stdlib/malign.c | 18 + newlib/libc/stdlib/malloc.c | 206 + newlib/libc/stdlib/mallocr.c | 3646 +++++++++ newlib/libc/stdlib/mbctype.h | 20 + newlib/libc/stdlib/mblen.c | 66 + newlib/libc/stdlib/mblen_r.c | 66 + newlib/libc/stdlib/mbstowcs.c | 80 + newlib/libc/stdlib/mbstowcs_r.c | 29 + newlib/libc/stdlib/mbtowc.c | 81 + newlib/libc/stdlib/mbtowc_r.c | 206 + newlib/libc/stdlib/mlock.c | 50 + newlib/libc/stdlib/mprec.c | 980 +++ newlib/libc/stdlib/mprec.h | 313 + newlib/libc/stdlib/msize.c | 17 + newlib/libc/stdlib/mstats.c | 151 + newlib/libc/stdlib/mtrim.c | 17 + newlib/libc/stdlib/putenv.c | 37 + newlib/libc/stdlib/putenv_r.c | 58 + newlib/libc/stdlib/qsort.c | 222 + newlib/libc/stdlib/rand.c | 86 + newlib/libc/stdlib/rand_r.c | 7 + newlib/libc/stdlib/realloc.c | 22 + newlib/libc/stdlib/setenv.c | 59 + newlib/libc/stdlib/setenv_r.c | 139 + newlib/libc/stdlib/std.h | 33 + newlib/libc/stdlib/stdlib.tex | 130 + newlib/libc/stdlib/strdup.c | 13 + newlib/libc/stdlib/strdup_r.c | 17 + newlib/libc/stdlib/strtod.c | 731 ++ newlib/libc/stdlib/strtol.c | 226 + newlib/libc/stdlib/strtoul.c | 206 + newlib/libc/stdlib/system.c | 179 + newlib/libc/stdlib/valloc.c | 24 + newlib/libc/stdlib/wcstombs.c | 80 + newlib/libc/stdlib/wcstombs_r.c | 32 + newlib/libc/stdlib/wctomb.c | 69 + newlib/libc/stdlib/wctomb_r.c | 110 + newlib/libc/string/Makefile.am | 66 + newlib/libc/string/Makefile.in | 343 + newlib/libc/string/bcmp.c | 50 + newlib/libc/string/bcopy.c | 38 + newlib/libc/string/bzero.c | 42 + newlib/libc/string/index.c | 44 + newlib/libc/string/memchr.c | 143 + newlib/libc/string/memcmp.c | 113 + newlib/libc/string/memcpy.c | 111 + newlib/libc/string/memmove.c | 143 + newlib/libc/string/memset.c | 110 + newlib/libc/string/rindex.c | 44 + newlib/libc/string/strcasecmp.c | 56 + newlib/libc/string/strcat.c | 104 + newlib/libc/string/strchr.c | 108 + newlib/libc/string/strcmp.c | 106 + newlib/libc/string/strcoll.c | 48 + newlib/libc/string/strcpy.c | 99 + newlib/libc/string/strcspn.c | 54 + newlib/libc/string/strerror.c | 650 ++ newlib/libc/string/strings.tex | 133 + newlib/libc/string/strlen.c | 88 + newlib/libc/string/strlwr.c | 50 + newlib/libc/string/strncasecmp.c | 64 + newlib/libc/string/strncat.c | 115 + newlib/libc/string/strncmp.c | 122 + newlib/libc/string/strncpy.c | 125 + newlib/libc/string/strpbrk.c | 58 + newlib/libc/string/strrchr.c | 61 + newlib/libc/string/strspn.c | 59 + newlib/libc/string/strstr.c | 73 + newlib/libc/string/strtok.c | 76 + newlib/libc/string/strtok_r.c | 85 + newlib/libc/string/strupr.c | 49 + newlib/libc/string/strxfrm.c | 75 + newlib/libc/string/u_strerr.c | 8 + newlib/libc/sys.tex | 436 ++ newlib/libc/sys/Makefile.am | 33 + newlib/libc/sys/Makefile.in | 415 + newlib/libc/sys/a29khif/Makefile.am | 48 + newlib/libc/sys/a29khif/Makefile.in | 337 + newlib/libc/sys/a29khif/_alloc.s | 55 + newlib/libc/sys/a29khif/_close.s | 40 + newlib/libc/sys/a29khif/_cycles.s | 39 + newlib/libc/sys/a29khif/_exit.s | 39 + newlib/libc/sys/a29khif/_fstat.s | 79 + newlib/libc/sys/a29khif/_getpsiz.s | 38 + newlib/libc/sys/a29khif/_gettz.s | 39 + newlib/libc/sys/a29khif/_ioctl.s | 39 + newlib/libc/sys/a29khif/_iostat.s | 43 + newlib/libc/sys/a29khif/_iowait.s | 39 + newlib/libc/sys/a29khif/_isatty.s | 22 + newlib/libc/sys/a29khif/_lseek.s | 42 + newlib/libc/sys/a29khif/_open.s | 39 + newlib/libc/sys/a29khif/_query.s | 39 + newlib/libc/sys/a29khif/_read.s | 38 + newlib/libc/sys/a29khif/_sbrk.s | 30 + newlib/libc/sys/a29khif/_setim.s | 39 + newlib/libc/sys/a29khif/_settrap.s | 39 + newlib/libc/sys/a29khif/_setvec.s | 38 + newlib/libc/sys/a29khif/_tmpnam.s | 41 + newlib/libc/sys/a29khif/_write.s | 40 + newlib/libc/sys/a29khif/aclocal.m4 | 282 + newlib/libc/sys/a29khif/alloc.s | 64 + newlib/libc/sys/a29khif/clock.s | 41 + newlib/libc/sys/a29khif/configure | 1687 ++++ newlib/libc/sys/a29khif/configure.in | 12 + newlib/libc/sys/a29khif/crt0.s | 226 + newlib/libc/sys/a29khif/getargs.s | 38 + newlib/libc/sys/a29khif/getenv.s | 48 + newlib/libc/sys/a29khif/getpid.c | 12 + newlib/libc/sys/a29khif/kill.c | 21 + newlib/libc/sys/a29khif/read.s | 54 + newlib/libc/sys/a29khif/remove.s | 43 + newlib/libc/sys/a29khif/rename.s | 41 + newlib/libc/sys/a29khif/signal.s | 452 ++ newlib/libc/sys/a29khif/stubs.s | 135 + newlib/libc/sys/a29khif/sys/cpudef.h | 270 + newlib/libc/sys/a29khif/sys/fpsymbol.h | 2970 +++++++ newlib/libc/sys/a29khif/sys/intrinsi.h | 457 ++ newlib/libc/sys/a29khif/sys/macros.h | 37 + newlib/libc/sys/a29khif/sys/proreg.h | 60 + newlib/libc/sys/a29khif/sys/romdcl.h | 392 + newlib/libc/sys/a29khif/sys/smartmac.h | 1491 ++++ newlib/libc/sys/a29khif/sys/sysmac.h | 165 + newlib/libc/sys/a29khif/systime.s | 44 + newlib/libc/sys/a29khif/vec.s | 35 + newlib/libc/sys/aclocal.m4 | 282 + newlib/libc/sys/arm/Makefile.am | 14 + newlib/libc/sys/arm/Makefile.in | 320 + newlib/libc/sys/arm/aclocal.m4 | 282 + newlib/libc/sys/arm/configure | 1687 ++++ newlib/libc/sys/arm/configure.in | 12 + newlib/libc/sys/arm/crt0.S | 244 + newlib/libc/sys/arm/libcfunc.c | 40 + newlib/libc/sys/arm/setjmp.S | 102 + newlib/libc/sys/arm/swi.h | 65 + newlib/libc/sys/arm/sys/param.h | 10 + newlib/libc/sys/arm/syscalls.c | 575 ++ newlib/libc/sys/arm/trap.S | 93 + newlib/libc/sys/configure | 1809 +++++ newlib/libc/sys/configure.in | 24 + newlib/libc/sys/cygwin/Makefile.am | 19 + newlib/libc/sys/cygwin/Makefile.in | 311 + newlib/libc/sys/cygwin/aclocal.m4 | 282 + newlib/libc/sys/cygwin/configure | 1687 ++++ newlib/libc/sys/cygwin/configure.in | 12 + newlib/libc/sys/cygwin/crt0.c | 49 + newlib/libc/sys/cygwin/sys/dirent.h | 58 + newlib/libc/sys/cygwin/sys/param.h | 43 + newlib/libc/sys/cygwin/sys/utime.h | 22 + newlib/libc/sys/cygwin/sys/utmp.h | 49 + newlib/libc/sys/d10v/Makefile.am | 14 + newlib/libc/sys/d10v/Makefile.in | 320 + newlib/libc/sys/d10v/aclocal.m4 | 282 + newlib/libc/sys/d10v/configure | 1687 ++++ newlib/libc/sys/d10v/configure.in | 12 + newlib/libc/sys/d10v/creat.c | 7 + newlib/libc/sys/d10v/crt0.S | 63 + newlib/libc/sys/d10v/sys/syscall.h | 38 + newlib/libc/sys/d10v/syscalls.c | 216 + newlib/libc/sys/d10v/trap.S | 296 + newlib/libc/sys/decstation/Makefile.am | 45 + newlib/libc/sys/decstation/Makefile.in | 332 + newlib/libc/sys/decstation/_main.c | 6 + newlib/libc/sys/decstation/aclocal.m4 | 282 + newlib/libc/sys/decstation/configure | 1687 ++++ newlib/libc/sys/decstation/configure.in | 12 + newlib/libc/sys/decstation/sys/dirent.h | 46 + newlib/libc/sys/go32/Makefile.am | 105 + newlib/libc/sys/go32/Makefile.in | 402 + newlib/libc/sys/go32/_exit.s | 20 + newlib/libc/sys/go32/_main.c | 3 + newlib/libc/sys/go32/abort.c | 8 + newlib/libc/sys/go32/access.c | 34 + newlib/libc/sys/go32/aclocal.m4 | 282 + newlib/libc/sys/go32/bdos.c | 12 + newlib/libc/sys/go32/bdosptr.c | 12 + newlib/libc/sys/go32/brk.s | 27 + newlib/libc/sys/go32/chdir.s | 27 + newlib/libc/sys/go32/chmod.c | 15 + newlib/libc/sys/go32/chown.c | 15 + newlib/libc/sys/go32/clock.S | 45 + newlib/libc/sys/go32/close.s | 27 + newlib/libc/sys/go32/configure | 1687 ++++ newlib/libc/sys/go32/configure.in | 12 + newlib/libc/sys/go32/copying.dj | 63 + newlib/libc/sys/go32/creat.s | 19 + newlib/libc/sys/go32/crlf2nl.c | 69 + newlib/libc/sys/go32/crt0.S | 233 + newlib/libc/sys/go32/dir.c | 95 + newlib/libc/sys/go32/dir.h | 53 + newlib/libc/sys/go32/djtime.h | 42 + newlib/libc/sys/go32/dos.h | 107 + newlib/libc/sys/go32/dosmem.S | 120 + newlib/libc/sys/go32/dpmi.c | 413 + newlib/libc/sys/go32/dpmi.h | 151 + newlib/libc/sys/go32/dup.s | 28 + newlib/libc/sys/go32/dup2.s | 28 + newlib/libc/sys/go32/exec.c | 509 ++ newlib/libc/sys/go32/fchmod.c | 18 + newlib/libc/sys/go32/findfirs.s | 18 + newlib/libc/sys/go32/findnext.s | 16 + newlib/libc/sys/go32/fixpath.c | 155 + newlib/libc/sys/go32/fstat.s | 19 + newlib/libc/sys/go32/fsync.s | 27 + newlib/libc/sys/go32/ftruncat.c | 25 + newlib/libc/sys/go32/gerrno.s | 33 + newlib/libc/sys/go32/getcwd.c | 37 + newlib/libc/sys/go32/getdate.c | 11 + newlib/libc/sys/go32/getdtabl.c | 18 + newlib/libc/sys/go32/getgid.c | 9 + newlib/libc/sys/go32/getkey.s | 59 + newlib/libc/sys/go32/getpages.c | 18 + newlib/libc/sys/go32/getpid.c | 18 + newlib/libc/sys/go32/getrusag.c | 35 + newlib/libc/sys/go32/gettime.c | 12 + newlib/libc/sys/go32/gettimeo.c | 61 + newlib/libc/sys/go32/gettimeo.s | 19 + newlib/libc/sys/go32/getuid.c | 9 + newlib/libc/sys/go32/getwd.s | 31 + newlib/libc/sys/go32/go32.h | 70 + newlib/libc/sys/go32/go32func.c | 69 + newlib/libc/sys/go32/infoblk.c | 4 + newlib/libc/sys/go32/inportb.s | 21 + newlib/libc/sys/go32/inportl.s | 19 + newlib/libc/sys/go32/inportsb.s | 25 + newlib/libc/sys/go32/inportsl.s | 24 + newlib/libc/sys/go32/inportsw.s | 24 + newlib/libc/sys/go32/inportw.s | 21 + newlib/libc/sys/go32/int86x.s | 103 + newlib/libc/sys/go32/intdos.c | 7 + newlib/libc/sys/go32/intdosx.c | 6 + newlib/libc/sys/go32/isatty.s | 33 + newlib/libc/sys/go32/kbhit.s | 51 + newlib/libc/sys/go32/kill.c | 6 + newlib/libc/sys/go32/link.s | 28 + newlib/libc/sys/go32/longjmp.S | 65 + newlib/libc/sys/go32/lseek.s | 36 + newlib/libc/sys/go32/lstat.s | 19 + newlib/libc/sys/go32/mkdir.s | 27 + newlib/libc/sys/go32/open.s | 31 + newlib/libc/sys/go32/outportb.s | 21 + newlib/libc/sys/go32/outportl.s | 20 + newlib/libc/sys/go32/outportw.s | 22 + newlib/libc/sys/go32/outprtsb.s | 25 + newlib/libc/sys/go32/outprtsl.s | 25 + newlib/libc/sys/go32/outprtsw.s | 25 + newlib/libc/sys/go32/pc.h | 71 + newlib/libc/sys/go32/read.s | 30 + newlib/libc/sys/go32/readv.c | 31 + newlib/libc/sys/go32/rename.s | 31 + newlib/libc/sys/go32/rmdir.s | 27 + newlib/libc/sys/go32/sbrk.s | 27 + newlib/libc/sys/go32/screen.S | 256 + newlib/libc/sys/go32/setjmp.S | 61 + newlib/libc/sys/go32/setmode.s | 19 + newlib/libc/sys/go32/setstack.S | 70 + newlib/libc/sys/go32/settimeo.s | 19 + newlib/libc/sys/go32/sleep.c | 27 + newlib/libc/sys/go32/stat.c | 151 + newlib/libc/sys/go32/stat.s | 19 + newlib/libc/sys/go32/stat_ast.s | 21 + newlib/libc/sys/go32/sys/dir.h | 33 + newlib/libc/sys/go32/sys/dirent.h | 39 + newlib/libc/sys/go32/sys/dos.h | 57 + newlib/libc/sys/go32/sys/dpmi.h | 151 + newlib/libc/sys/go32/sys/errno.h | 73 + newlib/libc/sys/go32/sys/fcntl.h | 12 + newlib/libc/sys/go32/sys/file.h | 31 + newlib/libc/sys/go32/sys/go32.h | 69 + newlib/libc/sys/go32/sys/param.h | 22 + newlib/libc/sys/go32/sys/pc.h | 56 + newlib/libc/sys/go32/sys/register.h | 28 + newlib/libc/sys/go32/sys/resource.h | 50 + newlib/libc/sys/go32/sys/setjmp.h | 44 + newlib/libc/sys/go32/sys/stdc.h | 15 + newlib/libc/sys/go32/sys/uio.h | 23 + newlib/libc/sys/go32/syserr.c | 38 + newlib/libc/sys/go32/system.s | 19 + newlib/libc/sys/go32/tell.s | 33 + newlib/libc/sys/go32/time.c | 53 + newlib/libc/sys/go32/truncate.c | 25 + newlib/libc/sys/go32/turbo.s | 30 + newlib/libc/sys/go32/umask.c | 4 + newlib/libc/sys/go32/unlink.s | 27 + newlib/libc/sys/go32/utime.c | 15 + newlib/libc/sys/go32/utimes.c | 15 + newlib/libc/sys/go32/write.s | 30 + newlib/libc/sys/go32/writestub.c | 6 + newlib/libc/sys/go32/writev.c | 31 + newlib/libc/sys/h8300hms/Makefile.am | 14 + newlib/libc/sys/h8300hms/Makefile.in | 299 + newlib/libc/sys/h8300hms/_exit.c | 23 + newlib/libc/sys/h8300hms/aclocal.m4 | 282 + newlib/libc/sys/h8300hms/configure | 1687 ++++ newlib/libc/sys/h8300hms/configure.in | 12 + newlib/libc/sys/h8300hms/crt0.S | 69 + newlib/libc/sys/h8300hms/crt1.c | 16 + newlib/libc/sys/h8300hms/misc.c | 34 + newlib/libc/sys/h8300hms/sbrk.c | 28 + newlib/libc/sys/h8300hms/sys/file.h | 30 + newlib/libc/sys/h8300hms/syscalls.c | 50 + newlib/libc/sys/h8300hms/write.c | 16 + newlib/libc/sys/h8500hms/Makefile.am | 14 + newlib/libc/sys/h8500hms/Makefile.in | 299 + newlib/libc/sys/h8500hms/aclocal.m4 | 282 + newlib/libc/sys/h8500hms/configure | 1687 ++++ newlib/libc/sys/h8500hms/configure.in | 12 + newlib/libc/sys/h8500hms/crt0.c | 32 + newlib/libc/sys/h8500hms/misc.c | 29 + newlib/libc/sys/h8500hms/syscalls.c | 129 + newlib/libc/sys/m88kbug/Makefile.am | 14 + newlib/libc/sys/m88kbug/Makefile.in | 299 + newlib/libc/sys/m88kbug/aclocal.m4 | 282 + newlib/libc/sys/m88kbug/configure | 1687 ++++ newlib/libc/sys/m88kbug/configure.in | 12 + newlib/libc/sys/m88kbug/crt0.c | 19 + newlib/libc/sys/m88kbug/sys/systraps.h | 9 + newlib/libc/sys/m88kbug/syscalls.c | 131 + newlib/libc/sys/netware/Makefile.am | 16 + newlib/libc/sys/netware/Makefile.in | 301 + newlib/libc/sys/netware/aclocal.m4 | 282 + newlib/libc/sys/netware/configure | 1687 ++++ newlib/libc/sys/netware/configure.in | 12 + newlib/libc/sys/netware/crt0.c | 4 + newlib/libc/sys/netware/getpid.c | 11 + newlib/libc/sys/netware/link.c | 17 + newlib/libc/sys/rtems/Makefile.am | 14 + newlib/libc/sys/rtems/Makefile.in | 299 + newlib/libc/sys/rtems/aclocal.m4 | 282 + newlib/libc/sys/rtems/configure | 1687 ++++ newlib/libc/sys/rtems/configure.in | 12 + newlib/libc/sys/rtems/crt0.c | 48 + newlib/libc/sys/rtems/dummysys.c | 1 + newlib/libc/sys/rtems/include/limits.h | 178 + newlib/libc/sys/rtems/include/signal.h | 142 + newlib/libc/sys/rtems/include/time.h | 218 + newlib/libc/sys/rtems/sys/dirent.h | 52 + newlib/libc/sys/rtems/sys/features.h | 111 + newlib/libc/sys/rtems/sys/sched.h | 56 + newlib/libc/sys/rtems/sys/siginfo.h | 176 + newlib/libc/sys/rtems/sys/signal.h | 6 + newlib/libc/sys/rtems/sys/time.h | 73 + newlib/libc/sys/rtems/sys/times.h | 31 + newlib/libc/sys/rtems/sys/types.h | 346 + newlib/libc/sys/sh/Makefile.am | 14 + newlib/libc/sys/sh/Makefile.in | 320 + newlib/libc/sys/sh/aclocal.m4 | 282 + newlib/libc/sys/sh/configure | 1687 ++++ newlib/libc/sys/sh/configure.in | 12 + newlib/libc/sys/sh/creat.c | 7 + newlib/libc/sys/sh/crt0.S | 55 + newlib/libc/sys/sh/sys/syscall.h | 31 + newlib/libc/sys/sh/syscalls.c | 170 + newlib/libc/sys/sh/trap.S | 15 + newlib/libc/sys/sparc64/Makefile.am | 119 + newlib/libc/sys/sparc64/Makefile.in | 412 + newlib/libc/sys/sparc64/_exit.S | 14 + newlib/libc/sys/sparc64/_main.c | 6 + newlib/libc/sys/sparc64/aclocal.m4 | 282 + newlib/libc/sys/sparc64/cerror.S | 29 + newlib/libc/sys/sparc64/closedir.c | 58 + newlib/libc/sys/sparc64/configure | 1687 ++++ newlib/libc/sys/sparc64/configure.in | 12 + newlib/libc/sys/sparc64/creat.c | 11 + newlib/libc/sys/sparc64/crt0.S | 123 + newlib/libc/sys/sparc64/dup2.S | 9 + newlib/libc/sys/sparc64/execve.S | 27 + newlib/libc/sys/sparc64/ieee.c | 115 + newlib/libc/sys/sparc64/isatty.c | 17 + newlib/libc/sys/sparc64/lstat.S | 5 + newlib/libc/sys/sparc64/opendir.c | 80 + newlib/libc/sys/sparc64/readdir.c | 72 + newlib/libc/sys/sparc64/rewinddir.c | 49 + newlib/libc/sys/sparc64/sbrk.S | 78 + newlib/libc/sys/sparc64/scandir.c | 138 + newlib/libc/sys/sparc64/seekdir.c | 52 + newlib/libc/sys/sparc64/sigsetjmp.S | 77 + newlib/libc/sys/sparc64/stat.S | 9 + newlib/libc/sys/sparc64/sys/dirent.h | 48 + newlib/libc/sys/sparc64/sys/fcntl.h | 178 + newlib/libc/sys/sparc64/sys/file.h | 3 + newlib/libc/sys/sparc64/sys/stat.h | 131 + newlib/libc/sys/sparc64/sys/syscall.h | 346 + newlib/libc/sys/sparc64/sys/syscallasm.h | 87 + newlib/libc/sys/sparc64/sys/termios.h | 122 + newlib/libc/sys/sparc64/sys/time.h | 22 + newlib/libc/sys/sparc64/sys/utime.h | 13 + newlib/libc/sys/sparc64/sys/utmp.h | 43 + newlib/libc/sys/sparc64/sys/wait.h | 43 + newlib/libc/sys/sparc64/telldir.c | 129 + newlib/libc/sys/sparc64/template.S | 14 + newlib/libc/sys/sparc64/template_r.S | 26 + newlib/libc/sys/sparc64/utime.S | 10 + newlib/libc/sys/sparc64/utime2.c | 26 + newlib/libc/sys/sparc64/wait.S | 35 + newlib/libc/sys/sun4/Makefile.am | 95 + newlib/libc/sys/sun4/Makefile.in | 388 + newlib/libc/sys/sun4/_main.c | 6 + newlib/libc/sys/sun4/aclocal.m4 | 282 + newlib/libc/sys/sun4/configure | 1687 ++++ newlib/libc/sys/sun4/configure.in | 12 + newlib/libc/sys/sun4/ieee.c | 115 + newlib/libc/sys/sun4/sys/dirent.h | 45 + newlib/libc/sys/sun4/sys/file.h | 3 + newlib/libc/sys/sun4/sys/termios.h | 122 + newlib/libc/sys/sun4/sys/utime.h | 13 + newlib/libc/sys/sun4/sys/utmp.h | 43 + newlib/libc/sys/sun4/sys/wait.h | 43 + newlib/libc/sys/sysmec/Makefile.am | 18 + newlib/libc/sys/sysmec/Makefile.in | 306 + newlib/libc/sys/sysmec/_exit.c | 34 + newlib/libc/sys/sysmec/access.c | 34 + newlib/libc/sys/sysmec/aclocal.m4 | 282 + newlib/libc/sys/sysmec/chmod.c | 16 + newlib/libc/sys/sysmec/chown.c | 17 + newlib/libc/sys/sysmec/close.c | 16 + newlib/libc/sys/sysmec/configure | 1687 ++++ newlib/libc/sys/sysmec/configure.in | 12 + newlib/libc/sys/sysmec/creat.c | 17 + newlib/libc/sys/sysmec/crt0.S | 65 + newlib/libc/sys/sysmec/crt1.c | 16 + newlib/libc/sys/sysmec/execv.c | 16 + newlib/libc/sys/sysmec/execve.c | 16 + newlib/libc/sys/sysmec/fork.c | 16 + newlib/libc/sys/sysmec/fstat.c | 19 + newlib/libc/sys/sysmec/getpid.c | 15 + newlib/libc/sys/sysmec/gettime.c | 17 + newlib/libc/sys/sysmec/isatty.c | 16 + newlib/libc/sys/sysmec/kill.c | 16 + newlib/libc/sys/sysmec/lseek.c | 19 + newlib/libc/sys/sysmec/open.c | 17 + newlib/libc/sys/sysmec/pipe.c | 16 + newlib/libc/sys/sysmec/read.c | 17 + newlib/libc/sys/sysmec/sbrk.c | 36 + newlib/libc/sys/sysmec/stat.c | 17 + newlib/libc/sys/sysmec/sys/syscall.h | 35 + newlib/libc/sys/sysmec/time.c | 16 + newlib/libc/sys/sysmec/times.c | 17 + newlib/libc/sys/sysmec/trap.S | 13 + newlib/libc/sys/sysmec/unlink.c | 16 + newlib/libc/sys/sysmec/utime.c | 18 + newlib/libc/sys/sysmec/wait.c | 17 + newlib/libc/sys/sysmec/write.c | 18 + newlib/libc/sys/sysnec810/Makefile.am | 14 + newlib/libc/sys/sysnec810/Makefile.in | 299 + newlib/libc/sys/sysnec810/aclocal.m4 | 282 + newlib/libc/sys/sysnec810/configure | 1687 ++++ newlib/libc/sys/sysnec810/configure.in | 12 + newlib/libc/sys/sysnec810/crt0.s | 22 + newlib/libc/sys/sysnec810/io.s | 41 + newlib/libc/sys/sysnec810/misc.c | 40 + newlib/libc/sys/sysnec810/sbrk.c | 12 + newlib/libc/sys/sysnec810/write.c | 36 + newlib/libc/sys/sysnecv850/Makefile.am | 19 + newlib/libc/sys/sysnecv850/Makefile.in | 307 + newlib/libc/sys/sysnecv850/_exit.c | 34 + newlib/libc/sys/sysnecv850/access.c | 34 + newlib/libc/sys/sysnecv850/aclocal.m4 | 282 + newlib/libc/sys/sysnecv850/chmod.c | 16 + newlib/libc/sys/sysnecv850/chown.c | 16 + newlib/libc/sys/sysnecv850/close.c | 16 + newlib/libc/sys/sysnecv850/configure | 1687 ++++ newlib/libc/sys/sysnecv850/configure.in | 12 + newlib/libc/sys/sysnecv850/creat.c | 17 + newlib/libc/sys/sysnecv850/crt0.S | 77 + newlib/libc/sys/sysnecv850/crt1.c | 16 + newlib/libc/sys/sysnecv850/execv.c | 16 + newlib/libc/sys/sysnecv850/execve.c | 16 + newlib/libc/sys/sysnecv850/fork.c | 16 + newlib/libc/sys/sysnecv850/fstat.c | 18 + newlib/libc/sys/sysnecv850/getpid.c | 15 + newlib/libc/sys/sysnecv850/gettime.c | 17 + newlib/libc/sys/sysnecv850/isatty.c | 16 + newlib/libc/sys/sysnecv850/kill.c | 19 + newlib/libc/sys/sysnecv850/link.c | 16 + newlib/libc/sys/sysnecv850/lseek.c | 18 + newlib/libc/sys/sysnecv850/open.c | 17 + newlib/libc/sys/sysnecv850/pipe.c | 16 + newlib/libc/sys/sysnecv850/read.c | 17 + newlib/libc/sys/sysnecv850/sbrk.c | 36 + newlib/libc/sys/sysnecv850/stat.c | 17 + newlib/libc/sys/sysnecv850/sys/syscall.h | 35 + newlib/libc/sys/sysnecv850/time.c | 16 + newlib/libc/sys/sysnecv850/times.c | 17 + newlib/libc/sys/sysnecv850/trap.S | 10 + newlib/libc/sys/sysnecv850/unlink.c | 16 + newlib/libc/sys/sysnecv850/utime.c | 18 + newlib/libc/sys/sysnecv850/wait.c | 17 + newlib/libc/sys/sysnecv850/write.c | 18 + newlib/libc/sys/sysvi386/Makefile.am | 23 + newlib/libc/sys/sysvi386/Makefile.in | 316 + newlib/libc/sys/sysvi386/_exit.s | 6 + newlib/libc/sys/sysvi386/_longjmp.s | 31 + newlib/libc/sys/sysvi386/_setjmp.s | 24 + newlib/libc/sys/sysvi386/access.s | 8 + newlib/libc/sys/sysvi386/aclocal.m4 | 282 + newlib/libc/sys/sysvi386/alarm.s | 5 + newlib/libc/sys/sysvi386/brk.s | 8 + newlib/libc/sys/sysvi386/cerror.s | 9 + newlib/libc/sys/sysvi386/chdir.s | 9 + newlib/libc/sys/sysvi386/chmod.s | 9 + newlib/libc/sys/sysvi386/close.s | 9 + newlib/libc/sys/sysvi386/closedir.c | 58 + newlib/libc/sys/sysvi386/configure | 1687 ++++ newlib/libc/sys/sysvi386/configure.in | 12 + newlib/libc/sys/sysvi386/crt0.c | 127 + newlib/libc/sys/sysvi386/dup.c | 6 + newlib/libc/sys/sysvi386/dup2.c | 7 + newlib/libc/sys/sysvi386/exec.c | 54 + newlib/libc/sys/sysvi386/execve.s | 7 + newlib/libc/sys/sysvi386/fcntl.s | 9 + newlib/libc/sys/sysvi386/fork.s | 12 + newlib/libc/sys/sysvi386/fpathconf.s | 6 + newlib/libc/sys/sysvi386/fps.s | 18 + newlib/libc/sys/sysvi386/fpx.c | 73 + newlib/libc/sys/sysvi386/fstat.s | 9 + newlib/libc/sys/sysvi386/getdents.s | 6 + newlib/libc/sys/sysvi386/getegid.s | 9 + newlib/libc/sys/sysvi386/geteuid.s | 9 + newlib/libc/sys/sysvi386/getgid.s | 8 + newlib/libc/sys/sysvi386/getgroups.s | 8 + newlib/libc/sys/sysvi386/getpid.s | 9 + newlib/libc/sys/sysvi386/getuid.s | 8 + newlib/libc/sys/sysvi386/ioctl.s | 9 + newlib/libc/sys/sysvi386/isatty.c | 11 + newlib/libc/sys/sysvi386/kill.s | 9 + newlib/libc/sys/sysvi386/link.s | 9 + newlib/libc/sys/sysvi386/lseek.s | 8 + newlib/libc/sys/sysvi386/mkdir.s | 9 + newlib/libc/sys/sysvi386/open.s | 9 + newlib/libc/sys/sysvi386/opendir.c | 80 + newlib/libc/sys/sysvi386/pathconf.s | 6 + newlib/libc/sys/sysvi386/pause.s | 6 + newlib/libc/sys/sysvi386/pipe.s | 12 + newlib/libc/sys/sysvi386/read.s | 8 + newlib/libc/sys/sysvi386/readdir.c | 72 + newlib/libc/sys/sysvi386/rename.s | 9 + newlib/libc/sys/sysvi386/rewinddir.c | 49 + newlib/libc/sys/sysvi386/rmdir.s | 9 + newlib/libc/sys/sysvi386/sbrk.c | 21 + newlib/libc/sys/sysvi386/scandir.c | 134 + newlib/libc/sys/sysvi386/seekdir.c | 52 + newlib/libc/sys/sysvi386/setgid.s | 9 + newlib/libc/sys/sysvi386/setuid.s | 9 + newlib/libc/sys/sysvi386/sigaction.s | 20 + newlib/libc/sys/sysvi386/signal.s | 16 + newlib/libc/sys/sysvi386/sigprocmask.s | 12 + newlib/libc/sys/sysvi386/sleep.c | 12 + newlib/libc/sys/sysvi386/speed.c | 24 + newlib/libc/sys/sysvi386/stat.s | 9 + newlib/libc/sys/sysvi386/sys/dirent.h | 36 + newlib/libc/sys/sysvi386/sys/param.h | 8 + newlib/libc/sys/sysvi386/sys/setjmp.h | 6 + newlib/libc/sys/sysvi386/sys/termio.h | 82 + newlib/libc/sys/sysvi386/sys/termios.h | 121 + newlib/libc/sys/sysvi386/sys/utime.h | 12 + newlib/libc/sys/sysvi386/sys/utmp.h | 43 + newlib/libc/sys/sysvi386/sys/wait.h | 42 + newlib/libc/sys/sysvi386/sysconf.s | 6 + newlib/libc/sys/sysvi386/tcgetattr.c | 6 + newlib/libc/sys/sysvi386/tcline.c | 84 + newlib/libc/sys/sysvi386/tcsetattr.c | 7 + newlib/libc/sys/sysvi386/telldir.c | 129 + newlib/libc/sys/sysvi386/time.s | 8 + newlib/libc/sys/sysvi386/times.s | 8 + newlib/libc/sys/sysvi386/unlink.s | 9 + newlib/libc/sys/sysvi386/utime.s | 8 + newlib/libc/sys/sysvi386/wait.s | 13 + newlib/libc/sys/sysvi386/waitpid.s | 18 + newlib/libc/sys/sysvi386/write.s | 8 + newlib/libc/sys/sysvnecv70/Makefile.am | 15 + newlib/libc/sys/sysvnecv70/Makefile.in | 301 + newlib/libc/sys/sysvnecv70/aclocal.m4 | 282 + newlib/libc/sys/sysvnecv70/cerror.s | 9 + newlib/libc/sys/sysvnecv70/close.s | 10 + newlib/libc/sys/sysvnecv70/configure | 1687 ++++ newlib/libc/sys/sysvnecv70/configure.in | 12 + newlib/libc/sys/sysvnecv70/crt0.s | 28 + newlib/libc/sys/sysvnecv70/exit.s | 7 + newlib/libc/sys/sysvnecv70/fps.s | 18 + newlib/libc/sys/sysvnecv70/fpx.c | 73 + newlib/libc/sys/sysvnecv70/fstat.s | 11 + newlib/libc/sys/sysvnecv70/ioctl.s | 9 + newlib/libc/sys/sysvnecv70/isatty.s | 19 + newlib/libc/sys/sysvnecv70/lseek.s | 9 + newlib/libc/sys/sysvnecv70/open.s | 10 + newlib/libc/sys/sysvnecv70/read.s | 9 + newlib/libc/sys/sysvnecv70/sbrk.s | 34 + newlib/libc/sys/sysvnecv70/sysv60.s | 9 + newlib/libc/sys/sysvnecv70/sysvnecv70.tex | 129 + newlib/libc/sys/sysvnecv70/write.s | 9 + newlib/libc/sys/tic80/Makefile.am | 19 + newlib/libc/sys/tic80/Makefile.in | 311 + newlib/libc/sys/tic80/aclocal.m4 | 282 + newlib/libc/sys/tic80/configure | 1687 ++++ newlib/libc/sys/tic80/configure.in | 12 + newlib/libc/sys/tic80/crt0.c | 22 + newlib/libc/sys/w65/Makefile.am | 14 + newlib/libc/sys/w65/Makefile.in | 299 + newlib/libc/sys/w65/aclocal.m4 | 282 + newlib/libc/sys/w65/configure | 1687 ++++ newlib/libc/sys/w65/configure.in | 12 + newlib/libc/sys/w65/crt0.c | 16 + newlib/libc/sys/w65/sys/syscall.h | 31 + newlib/libc/sys/w65/syscalls.c | 191 + newlib/libc/sys/w65/trap.c | 15 + newlib/libc/sys/z8ksim/Makefile.am | 14 + newlib/libc/sys/z8ksim/Makefile.in | 299 + newlib/libc/sys/z8ksim/aclocal.m4 | 282 + newlib/libc/sys/z8ksim/configure | 1687 ++++ newlib/libc/sys/z8ksim/configure.in | 12 + newlib/libc/sys/z8ksim/crt0.c | 58 + newlib/libc/sys/z8ksim/glue.c | 156 + newlib/libc/sys/z8ksim/sys/syscall.h | 23 + newlib/libc/syscalls/Makefile.am | 44 + newlib/libc/syscalls/Makefile.in | 319 + newlib/libc/syscalls/sysclose.c | 14 + newlib/libc/syscalls/sysexecve.c | 16 + newlib/libc/syscalls/sysfcntl.c | 17 + newlib/libc/syscalls/sysfork.c | 19 + newlib/libc/syscalls/sysfstat.c | 16 + newlib/libc/syscalls/sysgetpid.c | 13 + newlib/libc/syscalls/sysgettod.c | 20 + newlib/libc/syscalls/syskill.c | 15 + newlib/libc/syscalls/syslink.c | 15 + newlib/libc/syscalls/syslseek.c | 17 + newlib/libc/syscalls/sysopen.c | 43 + newlib/libc/syscalls/sysread.c | 17 + newlib/libc/syscalls/syssbrk.c | 18 + newlib/libc/syscalls/sysstat.c | 16 + newlib/libc/syscalls/systimes.c | 15 + newlib/libc/syscalls/sysunlink.c | 14 + newlib/libc/syscalls/syswait.c | 14 + newlib/libc/syscalls/syswrite.c | 17 + newlib/libc/time/Makefile.am | 48 + newlib/libc/time/Makefile.in | 323 + newlib/libc/time/asctime.c | 64 + newlib/libc/time/asctime_r.c | 27 + newlib/libc/time/clock.c | 69 + newlib/libc/time/ctime.c | 52 + newlib/libc/time/ctime_r.c | 15 + newlib/libc/time/difftime.c | 44 + newlib/libc/time/gmtime.c | 67 + newlib/libc/time/gmtime_r.c | 17 + newlib/libc/time/lcltime.c | 57 + newlib/libc/time/lcltime_r.c | 104 + newlib/libc/time/mktime.c | 204 + newlib/libc/time/strftime.c | 444 ++ newlib/libc/time/time.c | 59 + newlib/libc/time/time.tex | 86 + newlib/libc/unix/Makefile.am | 27 + newlib/libc/unix/Makefile.in | 300 + newlib/libc/unix/getcwd.c | 265 + newlib/libc/unix/getlogin.c | 40 + newlib/libc/unix/getpass.c | 94 + newlib/libc/unix/getpwent.c | 129 + newlib/libc/unix/getut.c | 85 + newlib/libc/unix/sigset.c | 61 + newlib/libc/unix/ttyname.c | 85 + newlib/libm/Makefile.am | 54 + newlib/libm/Makefile.in | 556 ++ newlib/libm/aclocal.m4 | 282 + newlib/libm/common/Makefile.am | 97 + newlib/libm/common/Makefile.in | 341 + newlib/libm/common/common.tex | 12 + newlib/libm/common/fdlibm.h | 261 + newlib/libm/common/s_cbrt.c | 123 + newlib/libm/common/s_copysign.c | 82 + newlib/libm/common/s_expm1.c | 271 + newlib/libm/common/s_finite.c | 35 + newlib/libm/common/s_ilogb.c | 92 + newlib/libm/common/s_infinity.c | 48 + newlib/libm/common/s_lib_ver.c | 35 + newlib/libm/common/s_log1p.c | 217 + newlib/libm/common/s_logb.c | 42 + newlib/libm/common/s_matherr.c | 123 + newlib/libm/common/s_modf.c | 131 + newlib/libm/common/s_nan.c | 47 + newlib/libm/common/s_nextafter.c | 121 + newlib/libm/common/s_rint.c | 90 + newlib/libm/common/s_scalbn.c | 103 + newlib/libm/common/sf_cbrt.c | 93 + newlib/libm/common/sf_copysign.c | 50 + newlib/libm/common/sf_expm1.c | 146 + newlib/libm/common/sf_finite.c | 47 + newlib/libm/common/sf_ilogb.c | 53 + newlib/libm/common/sf_infinity.c | 23 + newlib/libm/common/sf_log1p.c | 121 + newlib/libm/common/sf_logb.c | 48 + newlib/libm/common/sf_modf.c | 73 + newlib/libm/common/sf_nan.c | 23 + newlib/libm/common/sf_nextafter.c | 79 + newlib/libm/common/sf_rint.c | 81 + newlib/libm/common/sf_scalbn.c | 79 + newlib/libm/config.h.in | 1 + newlib/libm/configure | 1713 +++++ newlib/libm/configure.in | 21 + newlib/libm/libm.texinfo | 161 + newlib/libm/math/Makefile.am | 173 + newlib/libm/math/Makefile.in | 431 ++ newlib/libm/math/e_acos.c | 111 + newlib/libm/math/e_acosh.c | 70 + newlib/libm/math/e_asin.c | 120 + newlib/libm/math/e_atan2.c | 131 + newlib/libm/math/e_atanh.c | 75 + newlib/libm/math/e_cosh.c | 93 + newlib/libm/math/e_exp.c | 167 + newlib/libm/math/e_fmod.c | 140 + newlib/libm/math/e_hypot.c | 128 + newlib/libm/math/e_j0.c | 487 ++ newlib/libm/math/e_j1.c | 486 ++ newlib/libm/math/e_jn.c | 281 + newlib/libm/math/e_log.c | 146 + newlib/libm/math/e_log10.c | 98 + newlib/libm/math/e_pow.c | 312 + newlib/libm/math/e_rem_pio2.c | 185 + newlib/libm/math/e_remainder.c | 80 + newlib/libm/math/e_scalb.c | 55 + newlib/libm/math/e_sinh.c | 86 + newlib/libm/math/e_sqrt.c | 452 ++ newlib/libm/math/ef_acos.c | 84 + newlib/libm/math/ef_acosh.c | 53 + newlib/libm/math/ef_asin.c | 87 + newlib/libm/math/ef_atan2.c | 101 + newlib/libm/math/ef_atanh.c | 54 + newlib/libm/math/ef_cosh.c | 70 + newlib/libm/math/ef_exp.c | 102 + newlib/libm/math/ef_fmod.c | 108 + newlib/libm/math/ef_hypot.c | 82 + newlib/libm/math/ef_j0.c | 439 ++ newlib/libm/math/ef_j1.c | 439 ++ newlib/libm/math/ef_jn.c | 207 + newlib/libm/math/ef_log.c | 92 + newlib/libm/math/ef_log10.c | 62 + newlib/libm/math/ef_pow.c | 252 + newlib/libm/math/ef_rem_pio2.c | 193 + newlib/libm/math/ef_remainder.c | 68 + newlib/libm/math/ef_scalb.c | 53 + newlib/libm/math/ef_sinh.c | 63 + newlib/libm/math/ef_sqrt.c | 92 + newlib/libm/math/er_gamma.c | 32 + newlib/libm/math/er_lgamma.c | 309 + newlib/libm/math/erf_gamma.c | 34 + newlib/libm/math/erf_lgamma.c | 244 + newlib/libm/math/k_cos.c | 96 + newlib/libm/math/k_rem_pio2.c | 320 + newlib/libm/math/k_sin.c | 79 + newlib/libm/math/k_standard.c | 784 ++ newlib/libm/math/k_tan.c | 132 + newlib/libm/math/kf_cos.c | 59 + newlib/libm/math/kf_rem_pio2.c | 208 + newlib/libm/math/kf_sin.c | 49 + newlib/libm/math/kf_tan.c | 96 + newlib/libm/math/math.tex | 199 + newlib/libm/math/s_asinh.c | 107 + newlib/libm/math/s_atan.c | 181 + newlib/libm/math/s_ceil.c | 80 + newlib/libm/math/s_cos.c | 82 + newlib/libm/math/s_erf.c | 373 + newlib/libm/math/s_fabs.c | 73 + newlib/libm/math/s_floor.c | 134 + newlib/libm/math/s_frexp.c | 114 + newlib/libm/math/s_infconst.c | 15 + newlib/libm/math/s_isinf.c | 26 + newlib/libm/math/s_isnan.c | 122 + newlib/libm/math/s_ldexp.c | 81 + newlib/libm/math/s_signif.c | 34 + newlib/libm/math/s_sin.c | 132 + newlib/libm/math/s_tan.c | 114 + newlib/libm/math/s_tanh.c | 128 + newlib/libm/math/sf_asinh.c | 66 + newlib/libm/math/sf_atan.c | 129 + newlib/libm/math/sf_ceil.c | 69 + newlib/libm/math/sf_cos.c | 68 + newlib/libm/math/sf_erf.c | 246 + newlib/libm/math/sf_fabs.c | 47 + newlib/libm/math/sf_floor.c | 79 + newlib/libm/math/sf_frexp.c | 61 + newlib/libm/math/sf_isinf.c | 35 + newlib/libm/math/sf_isnan.c | 49 + newlib/libm/math/sf_ldexp.c | 44 + newlib/libm/math/sf_signif.c | 40 + newlib/libm/math/sf_sin.c | 62 + newlib/libm/math/sf_tan.c | 57 + newlib/libm/math/sf_tanh.c | 73 + newlib/libm/math/w_acos.c | 118 + newlib/libm/math/w_acosh.c | 122 + newlib/libm/math/w_asin.c | 121 + newlib/libm/math/w_atan2.c | 117 + newlib/libm/math/w_atanh.c | 140 + newlib/libm/math/w_cabs.c | 20 + newlib/libm/math/w_cosh.c | 116 + newlib/libm/math/w_drem.c | 15 + newlib/libm/math/w_exp.c | 136 + newlib/libm/math/w_fmod.c | 107 + newlib/libm/math/w_gamma.c | 193 + newlib/libm/math/w_hypot.c | 109 + newlib/libm/math/w_j0.c | 229 + newlib/libm/math/w_j1.c | 121 + newlib/libm/math/w_jn.c | 141 + newlib/libm/math/w_lgamma.c | 89 + newlib/libm/math/w_log.c | 115 + newlib/libm/math/w_log10.c | 115 + newlib/libm/math/w_pow.c | 231 + newlib/libm/math/w_remainder.c | 108 + newlib/libm/math/w_scalb.c | 94 + newlib/libm/math/w_sinh.c | 120 + newlib/libm/math/w_sqrt.c | 93 + newlib/libm/math/wf_acos.c | 69 + newlib/libm/math/wf_acosh.c | 70 + newlib/libm/math/wf_asin.c | 71 + newlib/libm/math/wf_atan2.c | 71 + newlib/libm/math/wf_atanh.c | 83 + newlib/libm/math/wf_cabs.c | 20 + newlib/libm/math/wf_cosh.c | 78 + newlib/libm/math/wf_drem.c | 19 + newlib/libm/math/wf_exp.c | 103 + newlib/libm/math/wf_fmod.c | 73 + newlib/libm/math/wf_gamma.c | 93 + newlib/libm/math/wf_hypot.c | 79 + newlib/libm/math/wf_j0.c | 137 + newlib/libm/math/wf_j1.c | 139 + newlib/libm/math/wf_jn.c | 138 + newlib/libm/math/wf_lgamma.c | 87 + newlib/libm/math/wf_log.c | 85 + newlib/libm/math/wf_log10.c | 88 + newlib/libm/math/wf_pow.c | 179 + newlib/libm/math/wf_remainder.c | 74 + newlib/libm/math/wf_scalb.c | 118 + newlib/libm/math/wf_sinh.c | 78 + newlib/libm/math/wf_sqrt.c | 72 + newlib/libm/math/wr_gamma.c | 76 + newlib/libm/math/wr_lgamma.c | 77 + newlib/libm/math/wrf_gamma.c | 74 + newlib/libm/math/wrf_lgamma.c | 75 + newlib/libm/mathfp/Makefile.am | 184 + newlib/libm/mathfp/Makefile.in | 410 + newlib/libm/mathfp/e_acosh.c | 135 + newlib/libm/mathfp/e_atanh.c | 139 + newlib/libm/mathfp/e_hypot.c | 170 + newlib/libm/mathfp/e_j0.c | 487 ++ newlib/libm/mathfp/e_j1.c | 486 ++ newlib/libm/mathfp/e_remainder.c | 113 + newlib/libm/mathfp/e_scalb.c | 55 + newlib/libm/mathfp/ef_acosh.c | 53 + newlib/libm/mathfp/ef_atanh.c | 54 + newlib/libm/mathfp/ef_hypot.c | 82 + newlib/libm/mathfp/ef_j0.c | 439 ++ newlib/libm/mathfp/ef_j1.c | 439 ++ newlib/libm/mathfp/ef_remainder.c | 68 + newlib/libm/mathfp/ef_scalb.c | 53 + newlib/libm/mathfp/er_gamma.c | 32 + newlib/libm/mathfp/er_lgamma.c | 422 + newlib/libm/mathfp/erf_gamma.c | 34 + newlib/libm/mathfp/erf_lgamma.c | 244 + newlib/libm/mathfp/mathfp.tex | 199 + newlib/libm/mathfp/s_acos.c | 93 + newlib/libm/mathfp/s_asin.c | 29 + newlib/libm/mathfp/s_asine.c | 186 + newlib/libm/mathfp/s_asinh.c | 107 + newlib/libm/mathfp/s_atan.c | 83 + newlib/libm/mathfp/s_atan2.c | 89 + newlib/libm/mathfp/s_atangent.c | 213 + newlib/libm/mathfp/s_ceil.c | 38 + newlib/libm/mathfp/s_cos.c | 29 + newlib/libm/mathfp/s_cosh.c | 80 + newlib/libm/mathfp/s_erf.c | 373 + newlib/libm/mathfp/s_exp.c | 133 + newlib/libm/mathfp/s_fabs.c | 80 + newlib/libm/mathfp/s_floor.c | 92 + newlib/libm/mathfp/s_fmod.c | 187 + newlib/libm/mathfp/s_frexp.c | 110 + newlib/libm/mathfp/s_infconst.c | 15 + newlib/libm/mathfp/s_isinf.c | 37 + newlib/libm/mathfp/s_isnan.c | 125 + newlib/libm/mathfp/s_ispos.c | 35 + newlib/libm/mathfp/s_ldexp.c | 125 + newlib/libm/mathfp/s_log.c | 29 + newlib/libm/mathfp/s_log10.c | 68 + newlib/libm/mathfp/s_logarithm.c | 135 + newlib/libm/mathfp/s_mathcnst.c | 24 + newlib/libm/mathfp/s_numtest.c | 58 + newlib/libm/mathfp/s_pow.c | 146 + newlib/libm/mathfp/s_signif.c | 34 + newlib/libm/mathfp/s_sin.c | 29 + newlib/libm/mathfp/s_sine.c | 166 + newlib/libm/mathfp/s_sineh.c | 185 + newlib/libm/mathfp/s_sinf.c | 34 + newlib/libm/mathfp/s_sinh.c | 29 + newlib/libm/mathfp/s_sqrt.c | 129 + newlib/libm/mathfp/s_tan.c | 139 + newlib/libm/mathfp/s_tanh.c | 117 + newlib/libm/mathfp/sf_acos.c | 33 + newlib/libm/mathfp/sf_asin.c | 34 + newlib/libm/mathfp/sf_asine.c | 105 + newlib/libm/mathfp/sf_asinh.c | 66 + newlib/libm/mathfp/sf_atan.c | 45 + newlib/libm/mathfp/sf_atan2.c | 34 + newlib/libm/mathfp/sf_atangent.c | 140 + newlib/libm/mathfp/sf_ceil.c | 42 + newlib/libm/mathfp/sf_cos.c | 34 + newlib/libm/mathfp/sf_cosh.c | 33 + newlib/libm/mathfp/sf_erf.c | 246 + newlib/libm/mathfp/sf_exp.c | 92 + newlib/libm/mathfp/sf_fabs.c | 45 + newlib/libm/mathfp/sf_floor.c | 43 + newlib/libm/mathfp/sf_fmod.c | 103 + newlib/libm/mathfp/sf_frexp.c | 58 + newlib/libm/mathfp/sf_isinf.c | 33 + newlib/libm/mathfp/sf_isnan.c | 33 + newlib/libm/mathfp/sf_ispos.c | 40 + newlib/libm/mathfp/sf_ldexp.c | 81 + newlib/libm/mathfp/sf_log.c | 34 + newlib/libm/mathfp/sf_log10.c | 34 + newlib/libm/mathfp/sf_logarithm.c | 72 + newlib/libm/mathfp/sf_numtest.c | 63 + newlib/libm/mathfp/sf_pow.c | 107 + newlib/libm/mathfp/sf_signif.c | 40 + newlib/libm/mathfp/sf_sin.c | 34 + newlib/libm/mathfp/sf_sine.c | 112 + newlib/libm/mathfp/sf_sineh.c | 110 + newlib/libm/mathfp/sf_sinh.c | 34 + newlib/libm/mathfp/sf_sqrt.c | 100 + newlib/libm/mathfp/sf_tan.c | 104 + newlib/libm/mathfp/sf_tanh.c | 77 + newlib/libm/mathfp/w_cabs.c | 20 + newlib/libm/mathfp/w_drem.c | 15 + newlib/libm/mathfp/w_jn.c | 248 + newlib/libm/mathfp/wf_cabs.c | 20 + newlib/libm/mathfp/wf_drem.c | 19 + newlib/libm/mathfp/wf_jn.c | 138 + newlib/libm/mathfp/zmath.h | 55 + newlib/libm/test/Makefile.in | 190 + newlib/libm/test/acos_vec.c | 288 + newlib/libm/test/acosf_vec.c | 288 + newlib/libm/test/acosh_vec.c | 288 + newlib/libm/test/acoshf_vec.c | 288 + newlib/libm/test/asin_vec.c | 288 + newlib/libm/test/asinf_vec.c | 288 + newlib/libm/test/asinh_vec.c | 288 + newlib/libm/test/asinhf_vec.c | 288 + newlib/libm/test/atan2_vec.c | 1604 ++++ newlib/libm/test/atan2f_vec.c | 1604 ++++ newlib/libm/test/atan_vec.c | 288 + newlib/libm/test/atanf_vec.c | 288 + newlib/libm/test/atanh_vec.c | 288 + newlib/libm/test/atanhf_vec.c | 288 + newlib/libm/test/ceil_vec.c | 288 + newlib/libm/test/ceilf_vec.c | 288 + newlib/libm/test/conv_vec.c | 3640 +++++++++ newlib/libm/test/convert.c | 366 + newlib/libm/test/cos_vec.c | 288 + newlib/libm/test/cosf_vec.c | 287 + newlib/libm/test/cosh_vec.c | 288 + newlib/libm/test/coshf_vec.c | 288 + newlib/libm/test/dcvt.c | 605 ++ newlib/libm/test/dvec.c | 602 ++ newlib/libm/test/erf_vec.c | 288 + newlib/libm/test/erfc_vec.c | 286 + newlib/libm/test/erfcf_vec.c | 286 + newlib/libm/test/erff_vec.c | 286 + newlib/libm/test/exp_vec.c | 288 + newlib/libm/test/expf_vec.c | 288 + newlib/libm/test/fabs_vec.c | 288 + newlib/libm/test/fabsf_vec.c | 288 + newlib/libm/test/floor_vec.c | 288 + newlib/libm/test/floorf_vec.c | 288 + newlib/libm/test/fmod_vec.c | 288 + newlib/libm/test/fmodf_vec.c | 288 + newlib/libm/test/gamma_vec.c | 288 + newlib/libm/test/gammaf_vec.c | 288 + newlib/libm/test/hypot_vec.c | 288 + newlib/libm/test/hypotf_vec.c | 288 + newlib/libm/test/iconv_vec.c | 1159 +++ newlib/libm/test/j0_vec.c | 288 + newlib/libm/test/j0f_vec.c | 288 + newlib/libm/test/j1_vec.c | 285 + newlib/libm/test/j1f_vec.c | 288 + newlib/libm/test/jn_vec.c | 204 + newlib/libm/test/jnf_vec.c | 204 + newlib/libm/test/log10_vec.c | 288 + newlib/libm/test/log10f_vec.c | 288 + newlib/libm/test/log1p_vec.c | 288 + newlib/libm/test/log1pf_vec.c | 288 + newlib/libm/test/log2_vec.c | 400 + newlib/libm/test/log2f_vec.c | 402 + newlib/libm/test/log_vec.c | 288 + newlib/libm/test/logf_vec.c | 288 + newlib/libm/test/math.c | 472 ++ newlib/libm/test/math2.c | 232 + newlib/libm/test/sin_vec.c | 288 + newlib/libm/test/sinf_vec.c | 286 + newlib/libm/test/sinh_vec.c | 288 + newlib/libm/test/sinhf_vec.c | 288 + newlib/libm/test/sprint_ivec.c | 5017 ++++++++++++ newlib/libm/test/sprint_vec.c | 3985 ++++++++++ newlib/libm/test/sqrt_vec.c | 288 + newlib/libm/test/sqrtf_vec.c | 288 + newlib/libm/test/string.c | 556 ++ newlib/libm/test/tan_vec.c | 288 + newlib/libm/test/tanf_vec.c | 288 + newlib/libm/test/tanh_vec.c | 288 + newlib/libm/test/tanhf_vec.c | 288 + newlib/libm/test/test.c | 291 + newlib/libm/test/test.h | 145 + newlib/libm/test/test_ieee.c | 180 + newlib/libm/test/test_is.c | 2031 +++++ newlib/libm/test/y0_vec.c | 288 + newlib/libm/test/y0f_vec.c | 288 + newlib/libm/test/y1_vec.c | 288 + newlib/libm/test/y1f_vec.c | 288 + newlib/libm/test/yn_vec.c | 204 + newlib/libm/test/ynf_vec.c | 199 + 1520 files changed, 282219 insertions(+) create mode 100644 newlib/ChangeLog create mode 100644 newlib/Makefile.am create mode 100644 newlib/Makefile.in create mode 100644 newlib/NEWS create mode 100644 newlib/README create mode 100644 newlib/acinclude.m4 create mode 100644 newlib/aclocal.m4 create mode 100755 newlib/configure create mode 100644 newlib/configure.host create mode 100644 newlib/configure.in create mode 100644 newlib/doc/Makefile.am create mode 100644 newlib/doc/Makefile.in create mode 100644 newlib/doc/aclocal.m4 create mode 100644 newlib/doc/ansidecl.h create mode 100755 newlib/doc/configure create mode 100644 newlib/doc/configure.in create mode 100644 newlib/doc/doc.str create mode 100644 newlib/doc/makedoc.c create mode 100644 newlib/libc/Makefile.am create mode 100644 newlib/libc/Makefile.in create mode 100644 newlib/libc/aclocal.m4 create mode 100755 newlib/libc/configure create mode 100644 newlib/libc/configure.in create mode 100644 newlib/libc/ctype/Makefile.am create mode 100644 newlib/libc/ctype/Makefile.in create mode 100644 newlib/libc/ctype/_tolower.c create mode 100644 newlib/libc/ctype/_toupper.c create mode 100644 newlib/libc/ctype/ctype.tex create mode 100644 newlib/libc/ctype/ctype_.c create mode 100644 newlib/libc/ctype/isalnum.c create mode 100644 newlib/libc/ctype/isalpha.c create mode 100644 newlib/libc/ctype/isascii.c create mode 100644 newlib/libc/ctype/iscntrl.c create mode 100644 newlib/libc/ctype/isdigit.c create mode 100644 newlib/libc/ctype/islower.c create mode 100644 newlib/libc/ctype/isprint.c create mode 100644 newlib/libc/ctype/ispunct.c create mode 100644 newlib/libc/ctype/isspace.c create mode 100644 newlib/libc/ctype/isupper.c create mode 100644 newlib/libc/ctype/isxdigit.c create mode 100644 newlib/libc/ctype/toascii.c create mode 100644 newlib/libc/ctype/tolower.c create mode 100644 newlib/libc/ctype/toupper.c create mode 100644 newlib/libc/errno/Makefile.am create mode 100644 newlib/libc/errno/Makefile.in create mode 100644 newlib/libc/errno/errno.c create mode 100644 newlib/libc/include/_ansi.h create mode 100644 newlib/libc/include/_syslist.h create mode 100644 newlib/libc/include/ar.h create mode 100644 newlib/libc/include/assert.h create mode 100644 newlib/libc/include/ctype.h create mode 100644 newlib/libc/include/dirent.h create mode 100644 newlib/libc/include/errno.h create mode 100644 newlib/libc/include/fastmath.h create mode 100644 newlib/libc/include/fcntl.h create mode 100644 newlib/libc/include/grp.h create mode 100644 newlib/libc/include/ieeefp.h create mode 100644 newlib/libc/include/locale.h create mode 100644 newlib/libc/include/machine/fastmath.h create mode 100644 newlib/libc/include/machine/ieeefp.h create mode 100644 newlib/libc/include/machine/setjmp-dj.h create mode 100644 newlib/libc/include/machine/setjmp.h create mode 100644 newlib/libc/include/machine/time.h create mode 100644 newlib/libc/include/machine/types.h create mode 100644 newlib/libc/include/malloc.h create mode 100644 newlib/libc/include/math.h create mode 100644 newlib/libc/include/paths.h create mode 100644 newlib/libc/include/process.h create mode 100644 newlib/libc/include/pwd.h create mode 100644 newlib/libc/include/reent.h create mode 100644 newlib/libc/include/regdef.h create mode 100644 newlib/libc/include/setjmp.h create mode 100644 newlib/libc/include/signal.h create mode 100644 newlib/libc/include/stdio.h create mode 100644 newlib/libc/include/stdlib.h create mode 100644 newlib/libc/include/string.h create mode 100644 newlib/libc/include/sys/_types.h create mode 100644 newlib/libc/include/sys/config.h create mode 100644 newlib/libc/include/sys/dirent.h create mode 100644 newlib/libc/include/sys/errno.h create mode 100644 newlib/libc/include/sys/fcntl.h create mode 100644 newlib/libc/include/sys/file.h create mode 100644 newlib/libc/include/sys/param.h create mode 100644 newlib/libc/include/sys/reent.h create mode 100644 newlib/libc/include/sys/resource.h create mode 100644 newlib/libc/include/sys/signal.h create mode 100644 newlib/libc/include/sys/stat-dj.h create mode 100644 newlib/libc/include/sys/stat.h create mode 100644 newlib/libc/include/sys/time.h create mode 100644 newlib/libc/include/sys/timeb.h create mode 100644 newlib/libc/include/sys/times.h create mode 100644 newlib/libc/include/sys/types.h create mode 100644 newlib/libc/include/sys/unistd.h create mode 100644 newlib/libc/include/sys/utime.h create mode 100644 newlib/libc/include/sys/wait.h create mode 100644 newlib/libc/include/termios.h create mode 100644 newlib/libc/include/time.h create mode 100644 newlib/libc/include/unctrl.h create mode 100644 newlib/libc/include/unistd.h create mode 100644 newlib/libc/include/utime.h create mode 100644 newlib/libc/include/utmp.h create mode 100644 newlib/libc/libc.texinfo create mode 100644 newlib/libc/locale/Makefile.am create mode 100644 newlib/libc/locale/Makefile.in create mode 100644 newlib/libc/locale/locale.c create mode 100644 newlib/libc/locale/locale.tex create mode 100644 newlib/libc/machine/Makefile.am create mode 100644 newlib/libc/machine/Makefile.in create mode 100644 newlib/libc/machine/a29k/Makefile.am create mode 100644 newlib/libc/machine/a29k/Makefile.in create mode 100644 newlib/libc/machine/a29k/aclocal.m4 create mode 100755 newlib/libc/machine/a29k/configure create mode 100644 newlib/libc/machine/a29k/configure.in create mode 100644 newlib/libc/machine/aclocal.m4 create mode 100644 newlib/libc/machine/arm/Makefile.am create mode 100644 newlib/libc/machine/arm/Makefile.in create mode 100644 newlib/libc/machine/arm/aclocal.m4 create mode 100755 newlib/libc/machine/arm/configure create mode 100644 newlib/libc/machine/arm/configure.in create mode 100755 newlib/libc/machine/configure create mode 100644 newlib/libc/machine/configure.in create mode 100644 newlib/libc/machine/d10v/Makefile.am create mode 100644 newlib/libc/machine/d10v/Makefile.in create mode 100644 newlib/libc/machine/d10v/aclocal.m4 create mode 100755 newlib/libc/machine/d10v/configure create mode 100644 newlib/libc/machine/d10v/configure.in create mode 100644 newlib/libc/machine/d10v/setjmp.S create mode 100644 newlib/libc/machine/d30v/Makefile.am create mode 100644 newlib/libc/machine/d30v/Makefile.in create mode 100644 newlib/libc/machine/d30v/aclocal.m4 create mode 100755 newlib/libc/machine/d30v/configure create mode 100644 newlib/libc/machine/d30v/configure.in create mode 100644 newlib/libc/machine/d30v/setjmp.S create mode 100644 newlib/libc/machine/fr30/Makefile.am create mode 100644 newlib/libc/machine/fr30/Makefile.in create mode 100644 newlib/libc/machine/fr30/aclocal.m4 create mode 100755 newlib/libc/machine/fr30/configure create mode 100644 newlib/libc/machine/fr30/configure.in create mode 100644 newlib/libc/machine/fr30/setjmp.S create mode 100644 newlib/libc/machine/h8300/Makefile.am create mode 100644 newlib/libc/machine/h8300/Makefile.in create mode 100644 newlib/libc/machine/h8300/aclocal.m4 create mode 100755 newlib/libc/machine/h8300/configure create mode 100644 newlib/libc/machine/h8300/configure.in create mode 100644 newlib/libc/machine/h8300/defines.h create mode 100644 newlib/libc/machine/h8300/memcpy.S create mode 100644 newlib/libc/machine/h8300/memset.S create mode 100644 newlib/libc/machine/h8300/reg_memcpy.S create mode 100644 newlib/libc/machine/h8300/reg_memset.S create mode 100644 newlib/libc/machine/h8300/setjmp.S create mode 100644 newlib/libc/machine/h8300/strcmp.S create mode 100644 newlib/libc/machine/h8500/Makefile.am create mode 100644 newlib/libc/machine/h8500/Makefile.in create mode 100644 newlib/libc/machine/h8500/aclocal.m4 create mode 100644 newlib/libc/machine/h8500/cmpsi.c create mode 100755 newlib/libc/machine/h8500/configure create mode 100644 newlib/libc/machine/h8500/configure.in create mode 100644 newlib/libc/machine/h8500/divhi3.S create mode 100644 newlib/libc/machine/h8500/divsi3.c create mode 100644 newlib/libc/machine/h8500/mulhi3.c create mode 100644 newlib/libc/machine/h8500/mulsi3.c create mode 100644 newlib/libc/machine/h8500/negsi2.c create mode 100644 newlib/libc/machine/h8500/psi.S create mode 100644 newlib/libc/machine/h8500/setjmp.S create mode 100644 newlib/libc/machine/h8500/shifts.c create mode 100644 newlib/libc/machine/hppa/DEFS.h create mode 100644 newlib/libc/machine/hppa/Makefile.am create mode 100644 newlib/libc/machine/hppa/Makefile.in create mode 100644 newlib/libc/machine/hppa/aclocal.m4 create mode 100755 newlib/libc/machine/hppa/configure create mode 100644 newlib/libc/machine/hppa/configure.in create mode 100644 newlib/libc/machine/hppa/memchr.S create mode 100644 newlib/libc/machine/hppa/memcmp.S create mode 100644 newlib/libc/machine/hppa/memcpy.S create mode 100644 newlib/libc/machine/hppa/memset.S create mode 100644 newlib/libc/machine/hppa/pcc_prefix.s create mode 100644 newlib/libc/machine/hppa/setjmp.S create mode 100644 newlib/libc/machine/hppa/strcat.S create mode 100644 newlib/libc/machine/hppa/strcmp.S create mode 100644 newlib/libc/machine/hppa/strcpy.S create mode 100644 newlib/libc/machine/hppa/strlen.S create mode 100644 newlib/libc/machine/hppa/strncat.S create mode 100644 newlib/libc/machine/hppa/strncmp.S create mode 100644 newlib/libc/machine/hppa/strncpy.S create mode 100644 newlib/libc/machine/i386/Makefile.am create mode 100644 newlib/libc/machine/i386/Makefile.in create mode 100644 newlib/libc/machine/i386/aclocal.m4 create mode 100755 newlib/libc/machine/i386/configure create mode 100644 newlib/libc/machine/i386/configure.in create mode 100644 newlib/libc/machine/i386/f_atan2.S create mode 100644 newlib/libc/machine/i386/f_atan2f.S create mode 100644 newlib/libc/machine/i386/f_exp.c create mode 100644 newlib/libc/machine/i386/f_expf.c create mode 100644 newlib/libc/machine/i386/f_frexp.S create mode 100644 newlib/libc/machine/i386/f_frexpf.S create mode 100644 newlib/libc/machine/i386/f_ldexp.S create mode 100644 newlib/libc/machine/i386/f_ldexpf.S create mode 100644 newlib/libc/machine/i386/f_log.S create mode 100644 newlib/libc/machine/i386/f_log10.S create mode 100644 newlib/libc/machine/i386/f_log10f.S create mode 100644 newlib/libc/machine/i386/f_logf.S create mode 100644 newlib/libc/machine/i386/f_math.h create mode 100644 newlib/libc/machine/i386/f_pow.c create mode 100644 newlib/libc/machine/i386/f_powf.c create mode 100644 newlib/libc/machine/i386/f_tan.S create mode 100644 newlib/libc/machine/i386/f_tanf.S create mode 100644 newlib/libc/machine/i386/i386mach.h create mode 100644 newlib/libc/machine/i386/memchr.S create mode 100644 newlib/libc/machine/i386/memcmp.S create mode 100644 newlib/libc/machine/i386/memcpy.S create mode 100644 newlib/libc/machine/i386/memmove.S create mode 100644 newlib/libc/machine/i386/memset.S create mode 100644 newlib/libc/machine/i386/setjmp.S create mode 100644 newlib/libc/machine/i386/strchr.S create mode 100644 newlib/libc/machine/i386/strlen.S create mode 100644 newlib/libc/machine/i960/Makefile.am create mode 100644 newlib/libc/machine/i960/Makefile.in create mode 100644 newlib/libc/machine/i960/aclocal.m4 create mode 100755 newlib/libc/machine/i960/configure create mode 100644 newlib/libc/machine/i960/configure.in create mode 100644 newlib/libc/machine/i960/memccpy.S create mode 100644 newlib/libc/machine/i960/memccpy_ca.S create mode 100644 newlib/libc/machine/i960/memchr.S create mode 100644 newlib/libc/machine/i960/memchr_ca.S create mode 100644 newlib/libc/machine/i960/memcmp.S create mode 100644 newlib/libc/machine/i960/memcmp_ca.S create mode 100644 newlib/libc/machine/i960/memcpy.S create mode 100644 newlib/libc/machine/i960/memcpy_ca.S create mode 100644 newlib/libc/machine/i960/memset.S create mode 100644 newlib/libc/machine/i960/setjmp.S create mode 100644 newlib/libc/machine/i960/strchr.S create mode 100644 newlib/libc/machine/i960/strchr_ca.S create mode 100644 newlib/libc/machine/i960/strcmp.S create mode 100644 newlib/libc/machine/i960/strcmp_ca.S create mode 100644 newlib/libc/machine/i960/strcpy.S create mode 100644 newlib/libc/machine/i960/strcpy_ca.S create mode 100644 newlib/libc/machine/i960/strcspn.S create mode 100644 newlib/libc/machine/i960/strdup.S create mode 100644 newlib/libc/machine/i960/strlen.S create mode 100644 newlib/libc/machine/i960/strlen_ca.S create mode 100644 newlib/libc/machine/i960/strncat.S create mode 100644 newlib/libc/machine/i960/strncat_ca.S create mode 100644 newlib/libc/machine/i960/strncmp.S create mode 100644 newlib/libc/machine/i960/strncmp_ca.S create mode 100644 newlib/libc/machine/i960/strncpy.S create mode 100644 newlib/libc/machine/i960/strncpy_ca.S create mode 100644 newlib/libc/machine/i960/strpbrk.S create mode 100644 newlib/libc/machine/i960/strrchr.S create mode 100644 newlib/libc/machine/m32r/Makefile.am create mode 100644 newlib/libc/machine/m32r/Makefile.in create mode 100644 newlib/libc/machine/m32r/aclocal.m4 create mode 100755 newlib/libc/machine/m32r/configure create mode 100644 newlib/libc/machine/m32r/configure.in create mode 100644 newlib/libc/machine/m32r/setjmp.S create mode 100644 newlib/libc/machine/m68k/Makefile.am create mode 100644 newlib/libc/machine/m68k/Makefile.in create mode 100644 newlib/libc/machine/m68k/aclocal.m4 create mode 100755 newlib/libc/machine/m68k/configure create mode 100644 newlib/libc/machine/m68k/configure.in create mode 100644 newlib/libc/machine/m68k/setjmp.S create mode 100644 newlib/libc/machine/m68k/strcpy.c create mode 100644 newlib/libc/machine/m68k/strlen.c create mode 100644 newlib/libc/machine/m88k/Makefile.am create mode 100644 newlib/libc/machine/m88k/Makefile.in create mode 100644 newlib/libc/machine/m88k/aclocal.m4 create mode 100755 newlib/libc/machine/m88k/configure create mode 100644 newlib/libc/machine/m88k/configure.in create mode 100644 newlib/libc/machine/m88k/setjmp.S create mode 100644 newlib/libc/machine/mips/Makefile.am create mode 100644 newlib/libc/machine/mips/Makefile.in create mode 100644 newlib/libc/machine/mips/aclocal.m4 create mode 100755 newlib/libc/machine/mips/configure create mode 100644 newlib/libc/machine/mips/configure.in create mode 100644 newlib/libc/machine/mips/machine/regdef.h create mode 100644 newlib/libc/machine/mips/setjmp.S create mode 100644 newlib/libc/machine/mn10200/Makefile.am create mode 100644 newlib/libc/machine/mn10200/Makefile.in create mode 100644 newlib/libc/machine/mn10200/aclocal.m4 create mode 100755 newlib/libc/machine/mn10200/configure create mode 100644 newlib/libc/machine/mn10200/configure.in create mode 100644 newlib/libc/machine/mn10200/setjmp.S create mode 100644 newlib/libc/machine/mn10300/Makefile.am create mode 100644 newlib/libc/machine/mn10300/Makefile.in create mode 100644 newlib/libc/machine/mn10300/aclocal.m4 create mode 100755 newlib/libc/machine/mn10300/configure create mode 100644 newlib/libc/machine/mn10300/configure.in create mode 100644 newlib/libc/machine/mn10300/memchr.S create mode 100644 newlib/libc/machine/mn10300/memcmp.S create mode 100644 newlib/libc/machine/mn10300/memcpy.S create mode 100644 newlib/libc/machine/mn10300/memset.S create mode 100644 newlib/libc/machine/mn10300/setjmp.S create mode 100644 newlib/libc/machine/mn10300/strchr.S create mode 100644 newlib/libc/machine/mn10300/strcmp.S create mode 100644 newlib/libc/machine/mn10300/strcpy.S create mode 100644 newlib/libc/machine/mn10300/strlen.S create mode 100644 newlib/libc/machine/necv70/Makefile.am create mode 100644 newlib/libc/machine/necv70/Makefile.in create mode 100644 newlib/libc/machine/necv70/aclocal.m4 create mode 100755 newlib/libc/machine/necv70/configure create mode 100644 newlib/libc/machine/necv70/configure.in create mode 100644 newlib/libc/machine/necv70/fastmath.s create mode 100644 newlib/libc/machine/necv70/machine/registers.h create mode 100644 newlib/libc/machine/necv70/necv70.tex create mode 100644 newlib/libc/machine/necv70/setjmp.s create mode 100644 newlib/libc/machine/powerpc/Makefile.am create mode 100644 newlib/libc/machine/powerpc/Makefile.in create mode 100644 newlib/libc/machine/powerpc/aclocal.m4 create mode 100755 newlib/libc/machine/powerpc/configure create mode 100644 newlib/libc/machine/powerpc/configure.in create mode 100644 newlib/libc/machine/powerpc/setjmp.S create mode 100644 newlib/libc/machine/sh/Makefile.am create mode 100644 newlib/libc/machine/sh/Makefile.in create mode 100644 newlib/libc/machine/sh/aclocal.m4 create mode 100644 newlib/libc/machine/sh/asm.h create mode 100755 newlib/libc/machine/sh/configure create mode 100644 newlib/libc/machine/sh/configure.in create mode 100644 newlib/libc/machine/sh/memcpy.S create mode 100644 newlib/libc/machine/sh/memset.S create mode 100644 newlib/libc/machine/sh/setjmp.S create mode 100644 newlib/libc/machine/sh/strcmp.S create mode 100644 newlib/libc/machine/sh/strcpy.S create mode 100644 newlib/libc/machine/sparc/Makefile.am create mode 100644 newlib/libc/machine/sparc/Makefile.in create mode 100644 newlib/libc/machine/sparc/aclocal.m4 create mode 100755 newlib/libc/machine/sparc/configure create mode 100644 newlib/libc/machine/sparc/configure.in create mode 100644 newlib/libc/machine/sparc/machine/sparclet.h create mode 100644 newlib/libc/machine/sparc/scan.c create mode 100644 newlib/libc/machine/sparc/setjmp.S create mode 100644 newlib/libc/machine/sparc/shuffle.c create mode 100644 newlib/libc/machine/tic80/Makefile.am create mode 100644 newlib/libc/machine/tic80/Makefile.in create mode 100644 newlib/libc/machine/tic80/aclocal.m4 create mode 100755 newlib/libc/machine/tic80/configure create mode 100644 newlib/libc/machine/tic80/configure.in create mode 100644 newlib/libc/machine/tic80/setjmp.S create mode 100644 newlib/libc/machine/v850/Makefile.am create mode 100644 newlib/libc/machine/v850/Makefile.in create mode 100644 newlib/libc/machine/v850/aclocal.m4 create mode 100755 newlib/libc/machine/v850/configure create mode 100644 newlib/libc/machine/v850/configure.in create mode 100644 newlib/libc/machine/v850/setjmp.S create mode 100644 newlib/libc/machine/w65/Makefile.am create mode 100644 newlib/libc/machine/w65/Makefile.in create mode 100644 newlib/libc/machine/w65/aclocal.m4 create mode 100644 newlib/libc/machine/w65/cmpsi.c create mode 100755 newlib/libc/machine/w65/configure create mode 100644 newlib/libc/machine/w65/configure.in create mode 100644 newlib/libc/machine/w65/divsi3.c create mode 100644 newlib/libc/machine/w65/lshrhi.s create mode 100644 newlib/libc/machine/w65/mulsi3.c create mode 100644 newlib/libc/machine/w65/sdivhi3.s create mode 100644 newlib/libc/machine/w65/smulhi3.s create mode 100644 newlib/libc/machine/w65/udivhi3.s create mode 100644 newlib/libc/machine/w65/umodhi3.s create mode 100644 newlib/libc/machine/z8k/Makefile.am create mode 100644 newlib/libc/machine/z8k/Makefile.in create mode 100644 newlib/libc/machine/z8k/aclocal.m4 create mode 100644 newlib/libc/machine/z8k/args.h create mode 100755 newlib/libc/machine/z8k/configure create mode 100644 newlib/libc/machine/z8k/configure.in create mode 100644 newlib/libc/machine/z8k/setjmp.S create mode 100644 newlib/libc/misc/Makefile.am create mode 100644 newlib/libc/misc/Makefile.in create mode 100644 newlib/libc/misc/dprintf.c create mode 100644 newlib/libc/misc/ffs.c create mode 100644 newlib/libc/misc/misc.tex create mode 100644 newlib/libc/misc/unctrl.c create mode 100644 newlib/libc/posix/Makefile.am create mode 100644 newlib/libc/posix/Makefile.in create mode 100644 newlib/libc/posix/closedir.c create mode 100644 newlib/libc/posix/creat.c create mode 100644 newlib/libc/posix/execl.c create mode 100644 newlib/libc/posix/execle.c create mode 100644 newlib/libc/posix/execlp.c create mode 100644 newlib/libc/posix/execv.c create mode 100644 newlib/libc/posix/execve.c create mode 100644 newlib/libc/posix/execvp.c create mode 100644 newlib/libc/posix/isatty.c create mode 100644 newlib/libc/posix/opendir.c create mode 100644 newlib/libc/posix/popen.c create mode 100644 newlib/libc/posix/readdir.c create mode 100644 newlib/libc/posix/rewinddir.c create mode 100644 newlib/libc/posix/scandir.c create mode 100644 newlib/libc/posix/seekdir.c create mode 100644 newlib/libc/posix/telldir.c create mode 100644 newlib/libc/reent/Makefile.am create mode 100644 newlib/libc/reent/Makefile.in create mode 100644 newlib/libc/reent/closer.c create mode 100644 newlib/libc/reent/execr.c create mode 100644 newlib/libc/reent/fstatr.c create mode 100644 newlib/libc/reent/impure.c create mode 100644 newlib/libc/reent/linkr.c create mode 100644 newlib/libc/reent/lseekr.c create mode 100644 newlib/libc/reent/openr.c create mode 100644 newlib/libc/reent/readr.c create mode 100644 newlib/libc/reent/reent.c create mode 100644 newlib/libc/reent/reent.tex create mode 100644 newlib/libc/reent/sbrkr.c create mode 100644 newlib/libc/reent/signalr.c create mode 100644 newlib/libc/reent/statr.c create mode 100644 newlib/libc/reent/timer.c create mode 100644 newlib/libc/reent/writer.c create mode 100644 newlib/libc/saber create mode 100644 newlib/libc/signal/Makefile.am create mode 100644 newlib/libc/signal/Makefile.in create mode 100644 newlib/libc/signal/raise.c create mode 100644 newlib/libc/signal/signal.c create mode 100644 newlib/libc/signal/signal.tex create mode 100644 newlib/libc/stdio/Makefile.am create mode 100644 newlib/libc/stdio/Makefile.in create mode 100644 newlib/libc/stdio/clearerr.c create mode 100644 newlib/libc/stdio/fclose.c create mode 100644 newlib/libc/stdio/fdopen.c create mode 100644 newlib/libc/stdio/feof.c create mode 100644 newlib/libc/stdio/ferror.c create mode 100644 newlib/libc/stdio/fflush.c create mode 100644 newlib/libc/stdio/fgetc.c create mode 100644 newlib/libc/stdio/fgetpos.c create mode 100644 newlib/libc/stdio/fgets.c create mode 100644 newlib/libc/stdio/fileno.c create mode 100644 newlib/libc/stdio/findfp.c create mode 100644 newlib/libc/stdio/fiprintf.c create mode 100644 newlib/libc/stdio/flags.c create mode 100644 newlib/libc/stdio/floatio.h create mode 100644 newlib/libc/stdio/fopen.c create mode 100644 newlib/libc/stdio/fprintf.c create mode 100644 newlib/libc/stdio/fputc.c create mode 100644 newlib/libc/stdio/fputs.c create mode 100644 newlib/libc/stdio/fread.c create mode 100644 newlib/libc/stdio/freopen.c create mode 100644 newlib/libc/stdio/fscanf.c create mode 100644 newlib/libc/stdio/fseek.c create mode 100644 newlib/libc/stdio/fsetpos.c create mode 100644 newlib/libc/stdio/ftell.c create mode 100644 newlib/libc/stdio/fvwrite.c create mode 100644 newlib/libc/stdio/fvwrite.h create mode 100644 newlib/libc/stdio/fwalk.c create mode 100644 newlib/libc/stdio/fwrite.c create mode 100644 newlib/libc/stdio/getc.c create mode 100644 newlib/libc/stdio/getchar.c create mode 100644 newlib/libc/stdio/gets.c create mode 100644 newlib/libc/stdio/iprintf.c create mode 100644 newlib/libc/stdio/local.h create mode 100644 newlib/libc/stdio/makebuf.c create mode 100644 newlib/libc/stdio/mktemp.c create mode 100644 newlib/libc/stdio/perror.c create mode 100644 newlib/libc/stdio/printf.c create mode 100644 newlib/libc/stdio/putc.c create mode 100644 newlib/libc/stdio/putchar.c create mode 100644 newlib/libc/stdio/puts.c create mode 100644 newlib/libc/stdio/refill.c create mode 100644 newlib/libc/stdio/remove.c create mode 100644 newlib/libc/stdio/rename.c create mode 100644 newlib/libc/stdio/rewind.c create mode 100644 newlib/libc/stdio/rget.c create mode 100644 newlib/libc/stdio/scanf.c create mode 100644 newlib/libc/stdio/setbuf.c create mode 100644 newlib/libc/stdio/setvbuf.c create mode 100644 newlib/libc/stdio/siprintf.c create mode 100644 newlib/libc/stdio/snprintf.c create mode 100644 newlib/libc/stdio/sprintf.c create mode 100644 newlib/libc/stdio/sscanf.c create mode 100644 newlib/libc/stdio/stdio.c create mode 100644 newlib/libc/stdio/stdio.tex create mode 100644 newlib/libc/stdio/tmpfile.c create mode 100644 newlib/libc/stdio/tmpnam.c create mode 100644 newlib/libc/stdio/ungetc.c create mode 100644 newlib/libc/stdio/vfieeefp.h create mode 100644 newlib/libc/stdio/vfprintf.c create mode 100644 newlib/libc/stdio/vfscanf.c create mode 100644 newlib/libc/stdio/vprintf.c create mode 100644 newlib/libc/stdio/vsnprintf.c create mode 100644 newlib/libc/stdio/vsprintf.c create mode 100644 newlib/libc/stdio/wbuf.c create mode 100644 newlib/libc/stdio/wsetup.c create mode 100644 newlib/libc/stdlib/Makefile.am create mode 100644 newlib/libc/stdlib/Makefile.in create mode 100644 newlib/libc/stdlib/__adjust.c create mode 100644 newlib/libc/stdlib/__exp10.c create mode 100644 newlib/libc/stdlib/__ten_mu.c create mode 100644 newlib/libc/stdlib/abort.c create mode 100644 newlib/libc/stdlib/abs.c create mode 100644 newlib/libc/stdlib/assert.c create mode 100644 newlib/libc/stdlib/atexit.c create mode 100644 newlib/libc/stdlib/atexit.h create mode 100644 newlib/libc/stdlib/atof.c create mode 100644 newlib/libc/stdlib/atoff.c create mode 100644 newlib/libc/stdlib/atoi.c create mode 100644 newlib/libc/stdlib/atol.c create mode 100644 newlib/libc/stdlib/bsearch.c create mode 100644 newlib/libc/stdlib/calloc.c create mode 100644 newlib/libc/stdlib/div.c create mode 100644 newlib/libc/stdlib/dtoa.c create mode 100644 newlib/libc/stdlib/dtoastub.c create mode 100644 newlib/libc/stdlib/ecvtbuf.c create mode 100644 newlib/libc/stdlib/efgcvt.c create mode 100644 newlib/libc/stdlib/environ.c create mode 100644 newlib/libc/stdlib/envlock.c create mode 100644 newlib/libc/stdlib/envlock.h create mode 100644 newlib/libc/stdlib/eprintf.c create mode 100644 newlib/libc/stdlib/exit.c create mode 100644 newlib/libc/stdlib/getenv.c create mode 100644 newlib/libc/stdlib/getenv_r.c create mode 100644 newlib/libc/stdlib/getopt.c create mode 100644 newlib/libc/stdlib/labs.c create mode 100644 newlib/libc/stdlib/ldiv.c create mode 100644 newlib/libc/stdlib/local.h create mode 100644 newlib/libc/stdlib/malign.c create mode 100644 newlib/libc/stdlib/malloc.c create mode 100644 newlib/libc/stdlib/mallocr.c create mode 100644 newlib/libc/stdlib/mbctype.h create mode 100644 newlib/libc/stdlib/mblen.c create mode 100644 newlib/libc/stdlib/mblen_r.c create mode 100644 newlib/libc/stdlib/mbstowcs.c create mode 100644 newlib/libc/stdlib/mbstowcs_r.c create mode 100644 newlib/libc/stdlib/mbtowc.c create mode 100644 newlib/libc/stdlib/mbtowc_r.c create mode 100644 newlib/libc/stdlib/mlock.c create mode 100644 newlib/libc/stdlib/mprec.c create mode 100644 newlib/libc/stdlib/mprec.h create mode 100644 newlib/libc/stdlib/msize.c create mode 100644 newlib/libc/stdlib/mstats.c create mode 100644 newlib/libc/stdlib/mtrim.c create mode 100644 newlib/libc/stdlib/putenv.c create mode 100644 newlib/libc/stdlib/putenv_r.c create mode 100644 newlib/libc/stdlib/qsort.c create mode 100644 newlib/libc/stdlib/rand.c create mode 100644 newlib/libc/stdlib/rand_r.c create mode 100644 newlib/libc/stdlib/realloc.c create mode 100644 newlib/libc/stdlib/setenv.c create mode 100644 newlib/libc/stdlib/setenv_r.c create mode 100644 newlib/libc/stdlib/std.h create mode 100644 newlib/libc/stdlib/stdlib.tex create mode 100644 newlib/libc/stdlib/strdup.c create mode 100644 newlib/libc/stdlib/strdup_r.c create mode 100644 newlib/libc/stdlib/strtod.c create mode 100644 newlib/libc/stdlib/strtol.c create mode 100644 newlib/libc/stdlib/strtoul.c create mode 100644 newlib/libc/stdlib/system.c create mode 100644 newlib/libc/stdlib/valloc.c create mode 100644 newlib/libc/stdlib/wcstombs.c create mode 100644 newlib/libc/stdlib/wcstombs_r.c create mode 100644 newlib/libc/stdlib/wctomb.c create mode 100644 newlib/libc/stdlib/wctomb_r.c create mode 100644 newlib/libc/string/Makefile.am create mode 100644 newlib/libc/string/Makefile.in create mode 100644 newlib/libc/string/bcmp.c create mode 100644 newlib/libc/string/bcopy.c create mode 100644 newlib/libc/string/bzero.c create mode 100644 newlib/libc/string/index.c create mode 100644 newlib/libc/string/memchr.c create mode 100644 newlib/libc/string/memcmp.c create mode 100644 newlib/libc/string/memcpy.c create mode 100644 newlib/libc/string/memmove.c create mode 100644 newlib/libc/string/memset.c create mode 100644 newlib/libc/string/rindex.c create mode 100644 newlib/libc/string/strcasecmp.c create mode 100644 newlib/libc/string/strcat.c create mode 100644 newlib/libc/string/strchr.c create mode 100644 newlib/libc/string/strcmp.c create mode 100644 newlib/libc/string/strcoll.c create mode 100644 newlib/libc/string/strcpy.c create mode 100644 newlib/libc/string/strcspn.c create mode 100644 newlib/libc/string/strerror.c create mode 100644 newlib/libc/string/strings.tex create mode 100644 newlib/libc/string/strlen.c create mode 100644 newlib/libc/string/strlwr.c create mode 100644 newlib/libc/string/strncasecmp.c create mode 100644 newlib/libc/string/strncat.c create mode 100644 newlib/libc/string/strncmp.c create mode 100644 newlib/libc/string/strncpy.c create mode 100644 newlib/libc/string/strpbrk.c create mode 100644 newlib/libc/string/strrchr.c create mode 100644 newlib/libc/string/strspn.c create mode 100644 newlib/libc/string/strstr.c create mode 100644 newlib/libc/string/strtok.c create mode 100644 newlib/libc/string/strtok_r.c create mode 100644 newlib/libc/string/strupr.c create mode 100644 newlib/libc/string/strxfrm.c create mode 100644 newlib/libc/string/u_strerr.c create mode 100644 newlib/libc/sys.tex create mode 100644 newlib/libc/sys/Makefile.am create mode 100644 newlib/libc/sys/Makefile.in create mode 100644 newlib/libc/sys/a29khif/Makefile.am create mode 100644 newlib/libc/sys/a29khif/Makefile.in create mode 100644 newlib/libc/sys/a29khif/_alloc.s create mode 100644 newlib/libc/sys/a29khif/_close.s create mode 100644 newlib/libc/sys/a29khif/_cycles.s create mode 100644 newlib/libc/sys/a29khif/_exit.s create mode 100644 newlib/libc/sys/a29khif/_fstat.s create mode 100644 newlib/libc/sys/a29khif/_getpsiz.s create mode 100644 newlib/libc/sys/a29khif/_gettz.s create mode 100644 newlib/libc/sys/a29khif/_ioctl.s create mode 100644 newlib/libc/sys/a29khif/_iostat.s create mode 100644 newlib/libc/sys/a29khif/_iowait.s create mode 100644 newlib/libc/sys/a29khif/_isatty.s create mode 100644 newlib/libc/sys/a29khif/_lseek.s create mode 100644 newlib/libc/sys/a29khif/_open.s create mode 100644 newlib/libc/sys/a29khif/_query.s create mode 100644 newlib/libc/sys/a29khif/_read.s create mode 100644 newlib/libc/sys/a29khif/_sbrk.s create mode 100644 newlib/libc/sys/a29khif/_setim.s create mode 100644 newlib/libc/sys/a29khif/_settrap.s create mode 100644 newlib/libc/sys/a29khif/_setvec.s create mode 100644 newlib/libc/sys/a29khif/_tmpnam.s create mode 100644 newlib/libc/sys/a29khif/_write.s create mode 100644 newlib/libc/sys/a29khif/aclocal.m4 create mode 100644 newlib/libc/sys/a29khif/alloc.s create mode 100644 newlib/libc/sys/a29khif/clock.s create mode 100755 newlib/libc/sys/a29khif/configure create mode 100644 newlib/libc/sys/a29khif/configure.in create mode 100644 newlib/libc/sys/a29khif/crt0.s create mode 100644 newlib/libc/sys/a29khif/getargs.s create mode 100644 newlib/libc/sys/a29khif/getenv.s create mode 100644 newlib/libc/sys/a29khif/getpid.c create mode 100644 newlib/libc/sys/a29khif/kill.c create mode 100644 newlib/libc/sys/a29khif/read.s create mode 100644 newlib/libc/sys/a29khif/remove.s create mode 100644 newlib/libc/sys/a29khif/rename.s create mode 100644 newlib/libc/sys/a29khif/signal.s create mode 100644 newlib/libc/sys/a29khif/stubs.s create mode 100644 newlib/libc/sys/a29khif/sys/cpudef.h create mode 100644 newlib/libc/sys/a29khif/sys/fpsymbol.h create mode 100644 newlib/libc/sys/a29khif/sys/intrinsi.h create mode 100644 newlib/libc/sys/a29khif/sys/macros.h create mode 100644 newlib/libc/sys/a29khif/sys/proreg.h create mode 100644 newlib/libc/sys/a29khif/sys/romdcl.h create mode 100644 newlib/libc/sys/a29khif/sys/smartmac.h create mode 100644 newlib/libc/sys/a29khif/sys/sysmac.h create mode 100644 newlib/libc/sys/a29khif/systime.s create mode 100644 newlib/libc/sys/a29khif/vec.s create mode 100644 newlib/libc/sys/aclocal.m4 create mode 100644 newlib/libc/sys/arm/Makefile.am create mode 100644 newlib/libc/sys/arm/Makefile.in create mode 100644 newlib/libc/sys/arm/aclocal.m4 create mode 100755 newlib/libc/sys/arm/configure create mode 100644 newlib/libc/sys/arm/configure.in create mode 100644 newlib/libc/sys/arm/crt0.S create mode 100644 newlib/libc/sys/arm/libcfunc.c create mode 100644 newlib/libc/sys/arm/setjmp.S create mode 100644 newlib/libc/sys/arm/swi.h create mode 100644 newlib/libc/sys/arm/sys/param.h create mode 100644 newlib/libc/sys/arm/syscalls.c create mode 100644 newlib/libc/sys/arm/trap.S create mode 100755 newlib/libc/sys/configure create mode 100644 newlib/libc/sys/configure.in create mode 100644 newlib/libc/sys/cygwin/Makefile.am create mode 100644 newlib/libc/sys/cygwin/Makefile.in create mode 100644 newlib/libc/sys/cygwin/aclocal.m4 create mode 100755 newlib/libc/sys/cygwin/configure create mode 100644 newlib/libc/sys/cygwin/configure.in create mode 100644 newlib/libc/sys/cygwin/crt0.c create mode 100644 newlib/libc/sys/cygwin/sys/dirent.h create mode 100644 newlib/libc/sys/cygwin/sys/param.h create mode 100644 newlib/libc/sys/cygwin/sys/utime.h create mode 100644 newlib/libc/sys/cygwin/sys/utmp.h create mode 100644 newlib/libc/sys/d10v/Makefile.am create mode 100644 newlib/libc/sys/d10v/Makefile.in create mode 100644 newlib/libc/sys/d10v/aclocal.m4 create mode 100755 newlib/libc/sys/d10v/configure create mode 100644 newlib/libc/sys/d10v/configure.in create mode 100644 newlib/libc/sys/d10v/creat.c create mode 100644 newlib/libc/sys/d10v/crt0.S create mode 100644 newlib/libc/sys/d10v/sys/syscall.h create mode 100644 newlib/libc/sys/d10v/syscalls.c create mode 100644 newlib/libc/sys/d10v/trap.S create mode 100644 newlib/libc/sys/decstation/Makefile.am create mode 100644 newlib/libc/sys/decstation/Makefile.in create mode 100644 newlib/libc/sys/decstation/_main.c create mode 100644 newlib/libc/sys/decstation/aclocal.m4 create mode 100755 newlib/libc/sys/decstation/configure create mode 100644 newlib/libc/sys/decstation/configure.in create mode 100644 newlib/libc/sys/decstation/sys/dirent.h create mode 100644 newlib/libc/sys/go32/Makefile.am create mode 100644 newlib/libc/sys/go32/Makefile.in create mode 100644 newlib/libc/sys/go32/_exit.s create mode 100644 newlib/libc/sys/go32/_main.c create mode 100644 newlib/libc/sys/go32/abort.c create mode 100644 newlib/libc/sys/go32/access.c create mode 100644 newlib/libc/sys/go32/aclocal.m4 create mode 100644 newlib/libc/sys/go32/bdos.c create mode 100644 newlib/libc/sys/go32/bdosptr.c create mode 100644 newlib/libc/sys/go32/brk.s create mode 100644 newlib/libc/sys/go32/chdir.s create mode 100644 newlib/libc/sys/go32/chmod.c create mode 100644 newlib/libc/sys/go32/chown.c create mode 100644 newlib/libc/sys/go32/clock.S create mode 100644 newlib/libc/sys/go32/close.s create mode 100755 newlib/libc/sys/go32/configure create mode 100644 newlib/libc/sys/go32/configure.in create mode 100644 newlib/libc/sys/go32/copying.dj create mode 100644 newlib/libc/sys/go32/creat.s create mode 100644 newlib/libc/sys/go32/crlf2nl.c create mode 100644 newlib/libc/sys/go32/crt0.S create mode 100644 newlib/libc/sys/go32/dir.c create mode 100644 newlib/libc/sys/go32/dir.h create mode 100644 newlib/libc/sys/go32/djtime.h create mode 100644 newlib/libc/sys/go32/dos.h create mode 100644 newlib/libc/sys/go32/dosmem.S create mode 100644 newlib/libc/sys/go32/dpmi.c create mode 100644 newlib/libc/sys/go32/dpmi.h create mode 100644 newlib/libc/sys/go32/dup.s create mode 100644 newlib/libc/sys/go32/dup2.s create mode 100644 newlib/libc/sys/go32/exec.c create mode 100644 newlib/libc/sys/go32/fchmod.c create mode 100644 newlib/libc/sys/go32/findfirs.s create mode 100644 newlib/libc/sys/go32/findnext.s create mode 100644 newlib/libc/sys/go32/fixpath.c create mode 100644 newlib/libc/sys/go32/fstat.s create mode 100644 newlib/libc/sys/go32/fsync.s create mode 100644 newlib/libc/sys/go32/ftruncat.c create mode 100644 newlib/libc/sys/go32/gerrno.s create mode 100644 newlib/libc/sys/go32/getcwd.c create mode 100644 newlib/libc/sys/go32/getdate.c create mode 100644 newlib/libc/sys/go32/getdtabl.c create mode 100644 newlib/libc/sys/go32/getgid.c create mode 100644 newlib/libc/sys/go32/getkey.s create mode 100644 newlib/libc/sys/go32/getpages.c create mode 100644 newlib/libc/sys/go32/getpid.c create mode 100644 newlib/libc/sys/go32/getrusag.c create mode 100644 newlib/libc/sys/go32/gettime.c create mode 100644 newlib/libc/sys/go32/gettimeo.c create mode 100644 newlib/libc/sys/go32/gettimeo.s create mode 100644 newlib/libc/sys/go32/getuid.c create mode 100644 newlib/libc/sys/go32/getwd.s create mode 100644 newlib/libc/sys/go32/go32.h create mode 100644 newlib/libc/sys/go32/go32func.c create mode 100644 newlib/libc/sys/go32/infoblk.c create mode 100644 newlib/libc/sys/go32/inportb.s create mode 100644 newlib/libc/sys/go32/inportl.s create mode 100644 newlib/libc/sys/go32/inportsb.s create mode 100644 newlib/libc/sys/go32/inportsl.s create mode 100644 newlib/libc/sys/go32/inportsw.s create mode 100644 newlib/libc/sys/go32/inportw.s create mode 100644 newlib/libc/sys/go32/int86x.s create mode 100644 newlib/libc/sys/go32/intdos.c create mode 100644 newlib/libc/sys/go32/intdosx.c create mode 100644 newlib/libc/sys/go32/isatty.s create mode 100644 newlib/libc/sys/go32/kbhit.s create mode 100644 newlib/libc/sys/go32/kill.c create mode 100644 newlib/libc/sys/go32/link.s create mode 100644 newlib/libc/sys/go32/longjmp.S create mode 100644 newlib/libc/sys/go32/lseek.s create mode 100644 newlib/libc/sys/go32/lstat.s create mode 100644 newlib/libc/sys/go32/mkdir.s create mode 100644 newlib/libc/sys/go32/open.s create mode 100644 newlib/libc/sys/go32/outportb.s create mode 100644 newlib/libc/sys/go32/outportl.s create mode 100644 newlib/libc/sys/go32/outportw.s create mode 100644 newlib/libc/sys/go32/outprtsb.s create mode 100644 newlib/libc/sys/go32/outprtsl.s create mode 100644 newlib/libc/sys/go32/outprtsw.s create mode 100644 newlib/libc/sys/go32/pc.h create mode 100644 newlib/libc/sys/go32/read.s create mode 100644 newlib/libc/sys/go32/readv.c create mode 100644 newlib/libc/sys/go32/rename.s create mode 100644 newlib/libc/sys/go32/rmdir.s create mode 100644 newlib/libc/sys/go32/sbrk.s create mode 100644 newlib/libc/sys/go32/screen.S create mode 100644 newlib/libc/sys/go32/setjmp.S create mode 100644 newlib/libc/sys/go32/setmode.s create mode 100644 newlib/libc/sys/go32/setstack.S create mode 100644 newlib/libc/sys/go32/settimeo.s create mode 100644 newlib/libc/sys/go32/sleep.c create mode 100644 newlib/libc/sys/go32/stat.c create mode 100644 newlib/libc/sys/go32/stat.s create mode 100644 newlib/libc/sys/go32/stat_ast.s create mode 100644 newlib/libc/sys/go32/sys/dir.h create mode 100644 newlib/libc/sys/go32/sys/dirent.h create mode 100644 newlib/libc/sys/go32/sys/dos.h create mode 100644 newlib/libc/sys/go32/sys/dpmi.h create mode 100644 newlib/libc/sys/go32/sys/errno.h create mode 100644 newlib/libc/sys/go32/sys/fcntl.h create mode 100644 newlib/libc/sys/go32/sys/file.h create mode 100644 newlib/libc/sys/go32/sys/go32.h create mode 100644 newlib/libc/sys/go32/sys/param.h create mode 100644 newlib/libc/sys/go32/sys/pc.h create mode 100644 newlib/libc/sys/go32/sys/register.h create mode 100644 newlib/libc/sys/go32/sys/resource.h create mode 100644 newlib/libc/sys/go32/sys/setjmp.h create mode 100644 newlib/libc/sys/go32/sys/stdc.h create mode 100644 newlib/libc/sys/go32/sys/uio.h create mode 100644 newlib/libc/sys/go32/syserr.c create mode 100644 newlib/libc/sys/go32/system.s create mode 100644 newlib/libc/sys/go32/tell.s create mode 100644 newlib/libc/sys/go32/time.c create mode 100644 newlib/libc/sys/go32/truncate.c create mode 100644 newlib/libc/sys/go32/turbo.s create mode 100644 newlib/libc/sys/go32/umask.c create mode 100644 newlib/libc/sys/go32/unlink.s create mode 100644 newlib/libc/sys/go32/utime.c create mode 100644 newlib/libc/sys/go32/utimes.c create mode 100644 newlib/libc/sys/go32/write.s create mode 100644 newlib/libc/sys/go32/writestub.c create mode 100644 newlib/libc/sys/go32/writev.c create mode 100644 newlib/libc/sys/h8300hms/Makefile.am create mode 100644 newlib/libc/sys/h8300hms/Makefile.in create mode 100644 newlib/libc/sys/h8300hms/_exit.c create mode 100644 newlib/libc/sys/h8300hms/aclocal.m4 create mode 100755 newlib/libc/sys/h8300hms/configure create mode 100644 newlib/libc/sys/h8300hms/configure.in create mode 100644 newlib/libc/sys/h8300hms/crt0.S create mode 100644 newlib/libc/sys/h8300hms/crt1.c create mode 100644 newlib/libc/sys/h8300hms/misc.c create mode 100644 newlib/libc/sys/h8300hms/sbrk.c create mode 100644 newlib/libc/sys/h8300hms/sys/file.h create mode 100644 newlib/libc/sys/h8300hms/syscalls.c create mode 100644 newlib/libc/sys/h8300hms/write.c create mode 100644 newlib/libc/sys/h8500hms/Makefile.am create mode 100644 newlib/libc/sys/h8500hms/Makefile.in create mode 100644 newlib/libc/sys/h8500hms/aclocal.m4 create mode 100755 newlib/libc/sys/h8500hms/configure create mode 100644 newlib/libc/sys/h8500hms/configure.in create mode 100644 newlib/libc/sys/h8500hms/crt0.c create mode 100644 newlib/libc/sys/h8500hms/misc.c create mode 100644 newlib/libc/sys/h8500hms/syscalls.c create mode 100644 newlib/libc/sys/m88kbug/Makefile.am create mode 100644 newlib/libc/sys/m88kbug/Makefile.in create mode 100644 newlib/libc/sys/m88kbug/aclocal.m4 create mode 100755 newlib/libc/sys/m88kbug/configure create mode 100644 newlib/libc/sys/m88kbug/configure.in create mode 100644 newlib/libc/sys/m88kbug/crt0.c create mode 100644 newlib/libc/sys/m88kbug/sys/systraps.h create mode 100644 newlib/libc/sys/m88kbug/syscalls.c create mode 100644 newlib/libc/sys/netware/Makefile.am create mode 100644 newlib/libc/sys/netware/Makefile.in create mode 100644 newlib/libc/sys/netware/aclocal.m4 create mode 100755 newlib/libc/sys/netware/configure create mode 100644 newlib/libc/sys/netware/configure.in create mode 100644 newlib/libc/sys/netware/crt0.c create mode 100644 newlib/libc/sys/netware/getpid.c create mode 100644 newlib/libc/sys/netware/link.c create mode 100644 newlib/libc/sys/rtems/Makefile.am create mode 100644 newlib/libc/sys/rtems/Makefile.in create mode 100644 newlib/libc/sys/rtems/aclocal.m4 create mode 100755 newlib/libc/sys/rtems/configure create mode 100644 newlib/libc/sys/rtems/configure.in create mode 100644 newlib/libc/sys/rtems/crt0.c create mode 100644 newlib/libc/sys/rtems/dummysys.c create mode 100644 newlib/libc/sys/rtems/include/limits.h create mode 100644 newlib/libc/sys/rtems/include/signal.h create mode 100644 newlib/libc/sys/rtems/include/time.h create mode 100644 newlib/libc/sys/rtems/sys/dirent.h create mode 100644 newlib/libc/sys/rtems/sys/features.h create mode 100644 newlib/libc/sys/rtems/sys/sched.h create mode 100644 newlib/libc/sys/rtems/sys/siginfo.h create mode 100644 newlib/libc/sys/rtems/sys/signal.h create mode 100644 newlib/libc/sys/rtems/sys/time.h create mode 100644 newlib/libc/sys/rtems/sys/times.h create mode 100644 newlib/libc/sys/rtems/sys/types.h create mode 100644 newlib/libc/sys/sh/Makefile.am create mode 100644 newlib/libc/sys/sh/Makefile.in create mode 100644 newlib/libc/sys/sh/aclocal.m4 create mode 100755 newlib/libc/sys/sh/configure create mode 100644 newlib/libc/sys/sh/configure.in create mode 100644 newlib/libc/sys/sh/creat.c create mode 100644 newlib/libc/sys/sh/crt0.S create mode 100644 newlib/libc/sys/sh/sys/syscall.h create mode 100644 newlib/libc/sys/sh/syscalls.c create mode 100644 newlib/libc/sys/sh/trap.S create mode 100644 newlib/libc/sys/sparc64/Makefile.am create mode 100644 newlib/libc/sys/sparc64/Makefile.in create mode 100644 newlib/libc/sys/sparc64/_exit.S create mode 100644 newlib/libc/sys/sparc64/_main.c create mode 100644 newlib/libc/sys/sparc64/aclocal.m4 create mode 100644 newlib/libc/sys/sparc64/cerror.S create mode 100644 newlib/libc/sys/sparc64/closedir.c create mode 100755 newlib/libc/sys/sparc64/configure create mode 100644 newlib/libc/sys/sparc64/configure.in create mode 100644 newlib/libc/sys/sparc64/creat.c create mode 100644 newlib/libc/sys/sparc64/crt0.S create mode 100644 newlib/libc/sys/sparc64/dup2.S create mode 100644 newlib/libc/sys/sparc64/execve.S create mode 100644 newlib/libc/sys/sparc64/ieee.c create mode 100644 newlib/libc/sys/sparc64/isatty.c create mode 100644 newlib/libc/sys/sparc64/lstat.S create mode 100644 newlib/libc/sys/sparc64/opendir.c create mode 100644 newlib/libc/sys/sparc64/readdir.c create mode 100644 newlib/libc/sys/sparc64/rewinddir.c create mode 100644 newlib/libc/sys/sparc64/sbrk.S create mode 100644 newlib/libc/sys/sparc64/scandir.c create mode 100644 newlib/libc/sys/sparc64/seekdir.c create mode 100644 newlib/libc/sys/sparc64/sigsetjmp.S create mode 100644 newlib/libc/sys/sparc64/stat.S create mode 100644 newlib/libc/sys/sparc64/sys/dirent.h create mode 100644 newlib/libc/sys/sparc64/sys/fcntl.h create mode 100644 newlib/libc/sys/sparc64/sys/file.h create mode 100644 newlib/libc/sys/sparc64/sys/stat.h create mode 100644 newlib/libc/sys/sparc64/sys/syscall.h create mode 100644 newlib/libc/sys/sparc64/sys/syscallasm.h create mode 100644 newlib/libc/sys/sparc64/sys/termios.h create mode 100644 newlib/libc/sys/sparc64/sys/time.h create mode 100644 newlib/libc/sys/sparc64/sys/utime.h create mode 100644 newlib/libc/sys/sparc64/sys/utmp.h create mode 100644 newlib/libc/sys/sparc64/sys/wait.h create mode 100644 newlib/libc/sys/sparc64/telldir.c create mode 100644 newlib/libc/sys/sparc64/template.S create mode 100644 newlib/libc/sys/sparc64/template_r.S create mode 100644 newlib/libc/sys/sparc64/utime.S create mode 100644 newlib/libc/sys/sparc64/utime2.c create mode 100644 newlib/libc/sys/sparc64/wait.S create mode 100644 newlib/libc/sys/sun4/Makefile.am create mode 100644 newlib/libc/sys/sun4/Makefile.in create mode 100644 newlib/libc/sys/sun4/_main.c create mode 100644 newlib/libc/sys/sun4/aclocal.m4 create mode 100755 newlib/libc/sys/sun4/configure create mode 100644 newlib/libc/sys/sun4/configure.in create mode 100644 newlib/libc/sys/sun4/ieee.c create mode 100644 newlib/libc/sys/sun4/sys/dirent.h create mode 100644 newlib/libc/sys/sun4/sys/file.h create mode 100644 newlib/libc/sys/sun4/sys/termios.h create mode 100644 newlib/libc/sys/sun4/sys/utime.h create mode 100644 newlib/libc/sys/sun4/sys/utmp.h create mode 100644 newlib/libc/sys/sun4/sys/wait.h create mode 100644 newlib/libc/sys/sysmec/Makefile.am create mode 100644 newlib/libc/sys/sysmec/Makefile.in create mode 100644 newlib/libc/sys/sysmec/_exit.c create mode 100644 newlib/libc/sys/sysmec/access.c create mode 100644 newlib/libc/sys/sysmec/aclocal.m4 create mode 100644 newlib/libc/sys/sysmec/chmod.c create mode 100644 newlib/libc/sys/sysmec/chown.c create mode 100644 newlib/libc/sys/sysmec/close.c create mode 100755 newlib/libc/sys/sysmec/configure create mode 100644 newlib/libc/sys/sysmec/configure.in create mode 100644 newlib/libc/sys/sysmec/creat.c create mode 100644 newlib/libc/sys/sysmec/crt0.S create mode 100644 newlib/libc/sys/sysmec/crt1.c create mode 100644 newlib/libc/sys/sysmec/execv.c create mode 100644 newlib/libc/sys/sysmec/execve.c create mode 100644 newlib/libc/sys/sysmec/fork.c create mode 100644 newlib/libc/sys/sysmec/fstat.c create mode 100644 newlib/libc/sys/sysmec/getpid.c create mode 100644 newlib/libc/sys/sysmec/gettime.c create mode 100644 newlib/libc/sys/sysmec/isatty.c create mode 100644 newlib/libc/sys/sysmec/kill.c create mode 100644 newlib/libc/sys/sysmec/lseek.c create mode 100644 newlib/libc/sys/sysmec/open.c create mode 100644 newlib/libc/sys/sysmec/pipe.c create mode 100644 newlib/libc/sys/sysmec/read.c create mode 100644 newlib/libc/sys/sysmec/sbrk.c create mode 100644 newlib/libc/sys/sysmec/stat.c create mode 100644 newlib/libc/sys/sysmec/sys/syscall.h create mode 100644 newlib/libc/sys/sysmec/time.c create mode 100644 newlib/libc/sys/sysmec/times.c create mode 100644 newlib/libc/sys/sysmec/trap.S create mode 100644 newlib/libc/sys/sysmec/unlink.c create mode 100644 newlib/libc/sys/sysmec/utime.c create mode 100644 newlib/libc/sys/sysmec/wait.c create mode 100644 newlib/libc/sys/sysmec/write.c create mode 100644 newlib/libc/sys/sysnec810/Makefile.am create mode 100644 newlib/libc/sys/sysnec810/Makefile.in create mode 100644 newlib/libc/sys/sysnec810/aclocal.m4 create mode 100755 newlib/libc/sys/sysnec810/configure create mode 100644 newlib/libc/sys/sysnec810/configure.in create mode 100644 newlib/libc/sys/sysnec810/crt0.s create mode 100644 newlib/libc/sys/sysnec810/io.s create mode 100644 newlib/libc/sys/sysnec810/misc.c create mode 100644 newlib/libc/sys/sysnec810/sbrk.c create mode 100644 newlib/libc/sys/sysnec810/write.c create mode 100644 newlib/libc/sys/sysnecv850/Makefile.am create mode 100644 newlib/libc/sys/sysnecv850/Makefile.in create mode 100644 newlib/libc/sys/sysnecv850/_exit.c create mode 100644 newlib/libc/sys/sysnecv850/access.c create mode 100644 newlib/libc/sys/sysnecv850/aclocal.m4 create mode 100644 newlib/libc/sys/sysnecv850/chmod.c create mode 100644 newlib/libc/sys/sysnecv850/chown.c create mode 100644 newlib/libc/sys/sysnecv850/close.c create mode 100755 newlib/libc/sys/sysnecv850/configure create mode 100644 newlib/libc/sys/sysnecv850/configure.in create mode 100644 newlib/libc/sys/sysnecv850/creat.c create mode 100644 newlib/libc/sys/sysnecv850/crt0.S create mode 100644 newlib/libc/sys/sysnecv850/crt1.c create mode 100644 newlib/libc/sys/sysnecv850/execv.c create mode 100644 newlib/libc/sys/sysnecv850/execve.c create mode 100644 newlib/libc/sys/sysnecv850/fork.c create mode 100644 newlib/libc/sys/sysnecv850/fstat.c create mode 100644 newlib/libc/sys/sysnecv850/getpid.c create mode 100644 newlib/libc/sys/sysnecv850/gettime.c create mode 100644 newlib/libc/sys/sysnecv850/isatty.c create mode 100644 newlib/libc/sys/sysnecv850/kill.c create mode 100644 newlib/libc/sys/sysnecv850/link.c create mode 100644 newlib/libc/sys/sysnecv850/lseek.c create mode 100644 newlib/libc/sys/sysnecv850/open.c create mode 100644 newlib/libc/sys/sysnecv850/pipe.c create mode 100644 newlib/libc/sys/sysnecv850/read.c create mode 100644 newlib/libc/sys/sysnecv850/sbrk.c create mode 100644 newlib/libc/sys/sysnecv850/stat.c create mode 100644 newlib/libc/sys/sysnecv850/sys/syscall.h create mode 100644 newlib/libc/sys/sysnecv850/time.c create mode 100644 newlib/libc/sys/sysnecv850/times.c create mode 100644 newlib/libc/sys/sysnecv850/trap.S create mode 100644 newlib/libc/sys/sysnecv850/unlink.c create mode 100644 newlib/libc/sys/sysnecv850/utime.c create mode 100644 newlib/libc/sys/sysnecv850/wait.c create mode 100644 newlib/libc/sys/sysnecv850/write.c create mode 100644 newlib/libc/sys/sysvi386/Makefile.am create mode 100644 newlib/libc/sys/sysvi386/Makefile.in create mode 100644 newlib/libc/sys/sysvi386/_exit.s create mode 100644 newlib/libc/sys/sysvi386/_longjmp.s create mode 100644 newlib/libc/sys/sysvi386/_setjmp.s create mode 100644 newlib/libc/sys/sysvi386/access.s create mode 100644 newlib/libc/sys/sysvi386/aclocal.m4 create mode 100644 newlib/libc/sys/sysvi386/alarm.s create mode 100644 newlib/libc/sys/sysvi386/brk.s create mode 100644 newlib/libc/sys/sysvi386/cerror.s create mode 100644 newlib/libc/sys/sysvi386/chdir.s create mode 100644 newlib/libc/sys/sysvi386/chmod.s create mode 100644 newlib/libc/sys/sysvi386/close.s create mode 100644 newlib/libc/sys/sysvi386/closedir.c create mode 100755 newlib/libc/sys/sysvi386/configure create mode 100644 newlib/libc/sys/sysvi386/configure.in create mode 100644 newlib/libc/sys/sysvi386/crt0.c create mode 100644 newlib/libc/sys/sysvi386/dup.c create mode 100644 newlib/libc/sys/sysvi386/dup2.c create mode 100644 newlib/libc/sys/sysvi386/exec.c create mode 100644 newlib/libc/sys/sysvi386/execve.s create mode 100644 newlib/libc/sys/sysvi386/fcntl.s create mode 100644 newlib/libc/sys/sysvi386/fork.s create mode 100644 newlib/libc/sys/sysvi386/fpathconf.s create mode 100644 newlib/libc/sys/sysvi386/fps.s create mode 100644 newlib/libc/sys/sysvi386/fpx.c create mode 100644 newlib/libc/sys/sysvi386/fstat.s create mode 100644 newlib/libc/sys/sysvi386/getdents.s create mode 100644 newlib/libc/sys/sysvi386/getegid.s create mode 100644 newlib/libc/sys/sysvi386/geteuid.s create mode 100644 newlib/libc/sys/sysvi386/getgid.s create mode 100644 newlib/libc/sys/sysvi386/getgroups.s create mode 100644 newlib/libc/sys/sysvi386/getpid.s create mode 100644 newlib/libc/sys/sysvi386/getuid.s create mode 100644 newlib/libc/sys/sysvi386/ioctl.s create mode 100644 newlib/libc/sys/sysvi386/isatty.c create mode 100644 newlib/libc/sys/sysvi386/kill.s create mode 100644 newlib/libc/sys/sysvi386/link.s create mode 100644 newlib/libc/sys/sysvi386/lseek.s create mode 100644 newlib/libc/sys/sysvi386/mkdir.s create mode 100644 newlib/libc/sys/sysvi386/open.s create mode 100644 newlib/libc/sys/sysvi386/opendir.c create mode 100644 newlib/libc/sys/sysvi386/pathconf.s create mode 100644 newlib/libc/sys/sysvi386/pause.s create mode 100644 newlib/libc/sys/sysvi386/pipe.s create mode 100644 newlib/libc/sys/sysvi386/read.s create mode 100644 newlib/libc/sys/sysvi386/readdir.c create mode 100644 newlib/libc/sys/sysvi386/rename.s create mode 100644 newlib/libc/sys/sysvi386/rewinddir.c create mode 100644 newlib/libc/sys/sysvi386/rmdir.s create mode 100644 newlib/libc/sys/sysvi386/sbrk.c create mode 100644 newlib/libc/sys/sysvi386/scandir.c create mode 100644 newlib/libc/sys/sysvi386/seekdir.c create mode 100644 newlib/libc/sys/sysvi386/setgid.s create mode 100644 newlib/libc/sys/sysvi386/setuid.s create mode 100644 newlib/libc/sys/sysvi386/sigaction.s create mode 100644 newlib/libc/sys/sysvi386/signal.s create mode 100644 newlib/libc/sys/sysvi386/sigprocmask.s create mode 100644 newlib/libc/sys/sysvi386/sleep.c create mode 100644 newlib/libc/sys/sysvi386/speed.c create mode 100644 newlib/libc/sys/sysvi386/stat.s create mode 100644 newlib/libc/sys/sysvi386/sys/dirent.h create mode 100644 newlib/libc/sys/sysvi386/sys/param.h create mode 100644 newlib/libc/sys/sysvi386/sys/setjmp.h create mode 100644 newlib/libc/sys/sysvi386/sys/termio.h create mode 100644 newlib/libc/sys/sysvi386/sys/termios.h create mode 100644 newlib/libc/sys/sysvi386/sys/utime.h create mode 100644 newlib/libc/sys/sysvi386/sys/utmp.h create mode 100644 newlib/libc/sys/sysvi386/sys/wait.h create mode 100644 newlib/libc/sys/sysvi386/sysconf.s create mode 100644 newlib/libc/sys/sysvi386/tcgetattr.c create mode 100644 newlib/libc/sys/sysvi386/tcline.c create mode 100644 newlib/libc/sys/sysvi386/tcsetattr.c create mode 100644 newlib/libc/sys/sysvi386/telldir.c create mode 100644 newlib/libc/sys/sysvi386/time.s create mode 100644 newlib/libc/sys/sysvi386/times.s create mode 100644 newlib/libc/sys/sysvi386/unlink.s create mode 100644 newlib/libc/sys/sysvi386/utime.s create mode 100644 newlib/libc/sys/sysvi386/wait.s create mode 100644 newlib/libc/sys/sysvi386/waitpid.s create mode 100644 newlib/libc/sys/sysvi386/write.s create mode 100644 newlib/libc/sys/sysvnecv70/Makefile.am create mode 100644 newlib/libc/sys/sysvnecv70/Makefile.in create mode 100644 newlib/libc/sys/sysvnecv70/aclocal.m4 create mode 100644 newlib/libc/sys/sysvnecv70/cerror.s create mode 100644 newlib/libc/sys/sysvnecv70/close.s create mode 100755 newlib/libc/sys/sysvnecv70/configure create mode 100644 newlib/libc/sys/sysvnecv70/configure.in create mode 100644 newlib/libc/sys/sysvnecv70/crt0.s create mode 100644 newlib/libc/sys/sysvnecv70/exit.s create mode 100644 newlib/libc/sys/sysvnecv70/fps.s create mode 100644 newlib/libc/sys/sysvnecv70/fpx.c create mode 100644 newlib/libc/sys/sysvnecv70/fstat.s create mode 100644 newlib/libc/sys/sysvnecv70/ioctl.s create mode 100644 newlib/libc/sys/sysvnecv70/isatty.s create mode 100644 newlib/libc/sys/sysvnecv70/lseek.s create mode 100644 newlib/libc/sys/sysvnecv70/open.s create mode 100644 newlib/libc/sys/sysvnecv70/read.s create mode 100644 newlib/libc/sys/sysvnecv70/sbrk.s create mode 100644 newlib/libc/sys/sysvnecv70/sysv60.s create mode 100644 newlib/libc/sys/sysvnecv70/sysvnecv70.tex create mode 100644 newlib/libc/sys/sysvnecv70/write.s create mode 100644 newlib/libc/sys/tic80/Makefile.am create mode 100644 newlib/libc/sys/tic80/Makefile.in create mode 100644 newlib/libc/sys/tic80/aclocal.m4 create mode 100755 newlib/libc/sys/tic80/configure create mode 100644 newlib/libc/sys/tic80/configure.in create mode 100644 newlib/libc/sys/tic80/crt0.c create mode 100644 newlib/libc/sys/w65/Makefile.am create mode 100644 newlib/libc/sys/w65/Makefile.in create mode 100644 newlib/libc/sys/w65/aclocal.m4 create mode 100755 newlib/libc/sys/w65/configure create mode 100644 newlib/libc/sys/w65/configure.in create mode 100644 newlib/libc/sys/w65/crt0.c create mode 100644 newlib/libc/sys/w65/sys/syscall.h create mode 100644 newlib/libc/sys/w65/syscalls.c create mode 100644 newlib/libc/sys/w65/trap.c create mode 100644 newlib/libc/sys/z8ksim/Makefile.am create mode 100644 newlib/libc/sys/z8ksim/Makefile.in create mode 100644 newlib/libc/sys/z8ksim/aclocal.m4 create mode 100755 newlib/libc/sys/z8ksim/configure create mode 100644 newlib/libc/sys/z8ksim/configure.in create mode 100644 newlib/libc/sys/z8ksim/crt0.c create mode 100644 newlib/libc/sys/z8ksim/glue.c create mode 100644 newlib/libc/sys/z8ksim/sys/syscall.h create mode 100644 newlib/libc/syscalls/Makefile.am create mode 100644 newlib/libc/syscalls/Makefile.in create mode 100644 newlib/libc/syscalls/sysclose.c create mode 100644 newlib/libc/syscalls/sysexecve.c create mode 100644 newlib/libc/syscalls/sysfcntl.c create mode 100644 newlib/libc/syscalls/sysfork.c create mode 100644 newlib/libc/syscalls/sysfstat.c create mode 100644 newlib/libc/syscalls/sysgetpid.c create mode 100644 newlib/libc/syscalls/sysgettod.c create mode 100644 newlib/libc/syscalls/syskill.c create mode 100644 newlib/libc/syscalls/syslink.c create mode 100644 newlib/libc/syscalls/syslseek.c create mode 100644 newlib/libc/syscalls/sysopen.c create mode 100644 newlib/libc/syscalls/sysread.c create mode 100644 newlib/libc/syscalls/syssbrk.c create mode 100644 newlib/libc/syscalls/sysstat.c create mode 100644 newlib/libc/syscalls/systimes.c create mode 100644 newlib/libc/syscalls/sysunlink.c create mode 100644 newlib/libc/syscalls/syswait.c create mode 100644 newlib/libc/syscalls/syswrite.c create mode 100644 newlib/libc/time/Makefile.am create mode 100644 newlib/libc/time/Makefile.in create mode 100644 newlib/libc/time/asctime.c create mode 100644 newlib/libc/time/asctime_r.c create mode 100644 newlib/libc/time/clock.c create mode 100644 newlib/libc/time/ctime.c create mode 100644 newlib/libc/time/ctime_r.c create mode 100644 newlib/libc/time/difftime.c create mode 100644 newlib/libc/time/gmtime.c create mode 100644 newlib/libc/time/gmtime_r.c create mode 100644 newlib/libc/time/lcltime.c create mode 100644 newlib/libc/time/lcltime_r.c create mode 100644 newlib/libc/time/mktime.c create mode 100644 newlib/libc/time/strftime.c create mode 100644 newlib/libc/time/time.c create mode 100644 newlib/libc/time/time.tex create mode 100644 newlib/libc/unix/Makefile.am create mode 100644 newlib/libc/unix/Makefile.in create mode 100644 newlib/libc/unix/getcwd.c create mode 100644 newlib/libc/unix/getlogin.c create mode 100644 newlib/libc/unix/getpass.c create mode 100644 newlib/libc/unix/getpwent.c create mode 100644 newlib/libc/unix/getut.c create mode 100644 newlib/libc/unix/sigset.c create mode 100644 newlib/libc/unix/ttyname.c create mode 100644 newlib/libm/Makefile.am create mode 100644 newlib/libm/Makefile.in create mode 100644 newlib/libm/aclocal.m4 create mode 100644 newlib/libm/common/Makefile.am create mode 100644 newlib/libm/common/Makefile.in create mode 100644 newlib/libm/common/common.tex create mode 100644 newlib/libm/common/fdlibm.h create mode 100644 newlib/libm/common/s_cbrt.c create mode 100644 newlib/libm/common/s_copysign.c create mode 100644 newlib/libm/common/s_expm1.c create mode 100644 newlib/libm/common/s_finite.c create mode 100644 newlib/libm/common/s_ilogb.c create mode 100644 newlib/libm/common/s_infinity.c create mode 100644 newlib/libm/common/s_lib_ver.c create mode 100644 newlib/libm/common/s_log1p.c create mode 100644 newlib/libm/common/s_logb.c create mode 100644 newlib/libm/common/s_matherr.c create mode 100644 newlib/libm/common/s_modf.c create mode 100644 newlib/libm/common/s_nan.c create mode 100644 newlib/libm/common/s_nextafter.c create mode 100644 newlib/libm/common/s_rint.c create mode 100644 newlib/libm/common/s_scalbn.c create mode 100644 newlib/libm/common/sf_cbrt.c create mode 100644 newlib/libm/common/sf_copysign.c create mode 100644 newlib/libm/common/sf_expm1.c create mode 100644 newlib/libm/common/sf_finite.c create mode 100644 newlib/libm/common/sf_ilogb.c create mode 100644 newlib/libm/common/sf_infinity.c create mode 100644 newlib/libm/common/sf_log1p.c create mode 100644 newlib/libm/common/sf_logb.c create mode 100644 newlib/libm/common/sf_modf.c create mode 100644 newlib/libm/common/sf_nan.c create mode 100644 newlib/libm/common/sf_nextafter.c create mode 100644 newlib/libm/common/sf_rint.c create mode 100644 newlib/libm/common/sf_scalbn.c create mode 100644 newlib/libm/config.h.in create mode 100755 newlib/libm/configure create mode 100644 newlib/libm/configure.in create mode 100644 newlib/libm/libm.texinfo create mode 100644 newlib/libm/math/Makefile.am create mode 100644 newlib/libm/math/Makefile.in create mode 100644 newlib/libm/math/e_acos.c create mode 100644 newlib/libm/math/e_acosh.c create mode 100644 newlib/libm/math/e_asin.c create mode 100644 newlib/libm/math/e_atan2.c create mode 100644 newlib/libm/math/e_atanh.c create mode 100644 newlib/libm/math/e_cosh.c create mode 100644 newlib/libm/math/e_exp.c create mode 100644 newlib/libm/math/e_fmod.c create mode 100644 newlib/libm/math/e_hypot.c create mode 100644 newlib/libm/math/e_j0.c create mode 100644 newlib/libm/math/e_j1.c create mode 100644 newlib/libm/math/e_jn.c create mode 100644 newlib/libm/math/e_log.c create mode 100644 newlib/libm/math/e_log10.c create mode 100644 newlib/libm/math/e_pow.c create mode 100644 newlib/libm/math/e_rem_pio2.c create mode 100644 newlib/libm/math/e_remainder.c create mode 100644 newlib/libm/math/e_scalb.c create mode 100644 newlib/libm/math/e_sinh.c create mode 100644 newlib/libm/math/e_sqrt.c create mode 100644 newlib/libm/math/ef_acos.c create mode 100644 newlib/libm/math/ef_acosh.c create mode 100644 newlib/libm/math/ef_asin.c create mode 100644 newlib/libm/math/ef_atan2.c create mode 100644 newlib/libm/math/ef_atanh.c create mode 100644 newlib/libm/math/ef_cosh.c create mode 100644 newlib/libm/math/ef_exp.c create mode 100644 newlib/libm/math/ef_fmod.c create mode 100644 newlib/libm/math/ef_hypot.c create mode 100644 newlib/libm/math/ef_j0.c create mode 100644 newlib/libm/math/ef_j1.c create mode 100644 newlib/libm/math/ef_jn.c create mode 100644 newlib/libm/math/ef_log.c create mode 100644 newlib/libm/math/ef_log10.c create mode 100644 newlib/libm/math/ef_pow.c create mode 100644 newlib/libm/math/ef_rem_pio2.c create mode 100644 newlib/libm/math/ef_remainder.c create mode 100644 newlib/libm/math/ef_scalb.c create mode 100644 newlib/libm/math/ef_sinh.c create mode 100644 newlib/libm/math/ef_sqrt.c create mode 100644 newlib/libm/math/er_gamma.c create mode 100644 newlib/libm/math/er_lgamma.c create mode 100644 newlib/libm/math/erf_gamma.c create mode 100644 newlib/libm/math/erf_lgamma.c create mode 100644 newlib/libm/math/k_cos.c create mode 100644 newlib/libm/math/k_rem_pio2.c create mode 100644 newlib/libm/math/k_sin.c create mode 100644 newlib/libm/math/k_standard.c create mode 100644 newlib/libm/math/k_tan.c create mode 100644 newlib/libm/math/kf_cos.c create mode 100644 newlib/libm/math/kf_rem_pio2.c create mode 100644 newlib/libm/math/kf_sin.c create mode 100644 newlib/libm/math/kf_tan.c create mode 100644 newlib/libm/math/math.tex create mode 100644 newlib/libm/math/s_asinh.c create mode 100644 newlib/libm/math/s_atan.c create mode 100644 newlib/libm/math/s_ceil.c create mode 100644 newlib/libm/math/s_cos.c create mode 100644 newlib/libm/math/s_erf.c create mode 100644 newlib/libm/math/s_fabs.c create mode 100644 newlib/libm/math/s_floor.c create mode 100644 newlib/libm/math/s_frexp.c create mode 100644 newlib/libm/math/s_infconst.c create mode 100644 newlib/libm/math/s_isinf.c create mode 100644 newlib/libm/math/s_isnan.c create mode 100644 newlib/libm/math/s_ldexp.c create mode 100644 newlib/libm/math/s_signif.c create mode 100644 newlib/libm/math/s_sin.c create mode 100644 newlib/libm/math/s_tan.c create mode 100644 newlib/libm/math/s_tanh.c create mode 100644 newlib/libm/math/sf_asinh.c create mode 100644 newlib/libm/math/sf_atan.c create mode 100644 newlib/libm/math/sf_ceil.c create mode 100644 newlib/libm/math/sf_cos.c create mode 100644 newlib/libm/math/sf_erf.c create mode 100644 newlib/libm/math/sf_fabs.c create mode 100644 newlib/libm/math/sf_floor.c create mode 100644 newlib/libm/math/sf_frexp.c create mode 100644 newlib/libm/math/sf_isinf.c create mode 100644 newlib/libm/math/sf_isnan.c create mode 100644 newlib/libm/math/sf_ldexp.c create mode 100644 newlib/libm/math/sf_signif.c create mode 100644 newlib/libm/math/sf_sin.c create mode 100644 newlib/libm/math/sf_tan.c create mode 100644 newlib/libm/math/sf_tanh.c create mode 100644 newlib/libm/math/w_acos.c create mode 100644 newlib/libm/math/w_acosh.c create mode 100644 newlib/libm/math/w_asin.c create mode 100644 newlib/libm/math/w_atan2.c create mode 100644 newlib/libm/math/w_atanh.c create mode 100644 newlib/libm/math/w_cabs.c create mode 100644 newlib/libm/math/w_cosh.c create mode 100644 newlib/libm/math/w_drem.c create mode 100644 newlib/libm/math/w_exp.c create mode 100644 newlib/libm/math/w_fmod.c create mode 100644 newlib/libm/math/w_gamma.c create mode 100644 newlib/libm/math/w_hypot.c create mode 100644 newlib/libm/math/w_j0.c create mode 100644 newlib/libm/math/w_j1.c create mode 100644 newlib/libm/math/w_jn.c create mode 100644 newlib/libm/math/w_lgamma.c create mode 100644 newlib/libm/math/w_log.c create mode 100644 newlib/libm/math/w_log10.c create mode 100644 newlib/libm/math/w_pow.c create mode 100644 newlib/libm/math/w_remainder.c create mode 100644 newlib/libm/math/w_scalb.c create mode 100644 newlib/libm/math/w_sinh.c create mode 100644 newlib/libm/math/w_sqrt.c create mode 100644 newlib/libm/math/wf_acos.c create mode 100644 newlib/libm/math/wf_acosh.c create mode 100644 newlib/libm/math/wf_asin.c create mode 100644 newlib/libm/math/wf_atan2.c create mode 100644 newlib/libm/math/wf_atanh.c create mode 100644 newlib/libm/math/wf_cabs.c create mode 100644 newlib/libm/math/wf_cosh.c create mode 100644 newlib/libm/math/wf_drem.c create mode 100644 newlib/libm/math/wf_exp.c create mode 100644 newlib/libm/math/wf_fmod.c create mode 100644 newlib/libm/math/wf_gamma.c create mode 100644 newlib/libm/math/wf_hypot.c create mode 100644 newlib/libm/math/wf_j0.c create mode 100644 newlib/libm/math/wf_j1.c create mode 100644 newlib/libm/math/wf_jn.c create mode 100644 newlib/libm/math/wf_lgamma.c create mode 100644 newlib/libm/math/wf_log.c create mode 100644 newlib/libm/math/wf_log10.c create mode 100644 newlib/libm/math/wf_pow.c create mode 100644 newlib/libm/math/wf_remainder.c create mode 100644 newlib/libm/math/wf_scalb.c create mode 100644 newlib/libm/math/wf_sinh.c create mode 100644 newlib/libm/math/wf_sqrt.c create mode 100644 newlib/libm/math/wr_gamma.c create mode 100644 newlib/libm/math/wr_lgamma.c create mode 100644 newlib/libm/math/wrf_gamma.c create mode 100644 newlib/libm/math/wrf_lgamma.c create mode 100644 newlib/libm/mathfp/Makefile.am create mode 100644 newlib/libm/mathfp/Makefile.in create mode 100644 newlib/libm/mathfp/e_acosh.c create mode 100644 newlib/libm/mathfp/e_atanh.c create mode 100644 newlib/libm/mathfp/e_hypot.c create mode 100644 newlib/libm/mathfp/e_j0.c create mode 100644 newlib/libm/mathfp/e_j1.c create mode 100644 newlib/libm/mathfp/e_remainder.c create mode 100644 newlib/libm/mathfp/e_scalb.c create mode 100644 newlib/libm/mathfp/ef_acosh.c create mode 100644 newlib/libm/mathfp/ef_atanh.c create mode 100644 newlib/libm/mathfp/ef_hypot.c create mode 100644 newlib/libm/mathfp/ef_j0.c create mode 100644 newlib/libm/mathfp/ef_j1.c create mode 100644 newlib/libm/mathfp/ef_remainder.c create mode 100644 newlib/libm/mathfp/ef_scalb.c create mode 100644 newlib/libm/mathfp/er_gamma.c create mode 100644 newlib/libm/mathfp/er_lgamma.c create mode 100644 newlib/libm/mathfp/erf_gamma.c create mode 100644 newlib/libm/mathfp/erf_lgamma.c create mode 100644 newlib/libm/mathfp/mathfp.tex create mode 100644 newlib/libm/mathfp/s_acos.c create mode 100644 newlib/libm/mathfp/s_asin.c create mode 100644 newlib/libm/mathfp/s_asine.c create mode 100644 newlib/libm/mathfp/s_asinh.c create mode 100644 newlib/libm/mathfp/s_atan.c create mode 100644 newlib/libm/mathfp/s_atan2.c create mode 100644 newlib/libm/mathfp/s_atangent.c create mode 100644 newlib/libm/mathfp/s_ceil.c create mode 100644 newlib/libm/mathfp/s_cos.c create mode 100644 newlib/libm/mathfp/s_cosh.c create mode 100644 newlib/libm/mathfp/s_erf.c create mode 100644 newlib/libm/mathfp/s_exp.c create mode 100644 newlib/libm/mathfp/s_fabs.c create mode 100644 newlib/libm/mathfp/s_floor.c create mode 100644 newlib/libm/mathfp/s_fmod.c create mode 100644 newlib/libm/mathfp/s_frexp.c create mode 100644 newlib/libm/mathfp/s_infconst.c create mode 100644 newlib/libm/mathfp/s_isinf.c create mode 100644 newlib/libm/mathfp/s_isnan.c create mode 100644 newlib/libm/mathfp/s_ispos.c create mode 100644 newlib/libm/mathfp/s_ldexp.c create mode 100644 newlib/libm/mathfp/s_log.c create mode 100644 newlib/libm/mathfp/s_log10.c create mode 100644 newlib/libm/mathfp/s_logarithm.c create mode 100644 newlib/libm/mathfp/s_mathcnst.c create mode 100644 newlib/libm/mathfp/s_numtest.c create mode 100644 newlib/libm/mathfp/s_pow.c create mode 100644 newlib/libm/mathfp/s_signif.c create mode 100644 newlib/libm/mathfp/s_sin.c create mode 100644 newlib/libm/mathfp/s_sine.c create mode 100644 newlib/libm/mathfp/s_sineh.c create mode 100644 newlib/libm/mathfp/s_sinf.c create mode 100644 newlib/libm/mathfp/s_sinh.c create mode 100644 newlib/libm/mathfp/s_sqrt.c create mode 100644 newlib/libm/mathfp/s_tan.c create mode 100644 newlib/libm/mathfp/s_tanh.c create mode 100644 newlib/libm/mathfp/sf_acos.c create mode 100644 newlib/libm/mathfp/sf_asin.c create mode 100644 newlib/libm/mathfp/sf_asine.c create mode 100644 newlib/libm/mathfp/sf_asinh.c create mode 100644 newlib/libm/mathfp/sf_atan.c create mode 100644 newlib/libm/mathfp/sf_atan2.c create mode 100644 newlib/libm/mathfp/sf_atangent.c create mode 100644 newlib/libm/mathfp/sf_ceil.c create mode 100644 newlib/libm/mathfp/sf_cos.c create mode 100644 newlib/libm/mathfp/sf_cosh.c create mode 100644 newlib/libm/mathfp/sf_erf.c create mode 100644 newlib/libm/mathfp/sf_exp.c create mode 100644 newlib/libm/mathfp/sf_fabs.c create mode 100644 newlib/libm/mathfp/sf_floor.c create mode 100644 newlib/libm/mathfp/sf_fmod.c create mode 100644 newlib/libm/mathfp/sf_frexp.c create mode 100644 newlib/libm/mathfp/sf_isinf.c create mode 100644 newlib/libm/mathfp/sf_isnan.c create mode 100644 newlib/libm/mathfp/sf_ispos.c create mode 100644 newlib/libm/mathfp/sf_ldexp.c create mode 100644 newlib/libm/mathfp/sf_log.c create mode 100644 newlib/libm/mathfp/sf_log10.c create mode 100644 newlib/libm/mathfp/sf_logarithm.c create mode 100644 newlib/libm/mathfp/sf_numtest.c create mode 100644 newlib/libm/mathfp/sf_pow.c create mode 100644 newlib/libm/mathfp/sf_signif.c create mode 100644 newlib/libm/mathfp/sf_sin.c create mode 100644 newlib/libm/mathfp/sf_sine.c create mode 100644 newlib/libm/mathfp/sf_sineh.c create mode 100644 newlib/libm/mathfp/sf_sinh.c create mode 100644 newlib/libm/mathfp/sf_sqrt.c create mode 100644 newlib/libm/mathfp/sf_tan.c create mode 100644 newlib/libm/mathfp/sf_tanh.c create mode 100644 newlib/libm/mathfp/w_cabs.c create mode 100644 newlib/libm/mathfp/w_drem.c create mode 100644 newlib/libm/mathfp/w_jn.c create mode 100644 newlib/libm/mathfp/wf_cabs.c create mode 100644 newlib/libm/mathfp/wf_drem.c create mode 100644 newlib/libm/mathfp/wf_jn.c create mode 100644 newlib/libm/mathfp/zmath.h create mode 100644 newlib/libm/test/Makefile.in create mode 100644 newlib/libm/test/acos_vec.c create mode 100644 newlib/libm/test/acosf_vec.c create mode 100644 newlib/libm/test/acosh_vec.c create mode 100644 newlib/libm/test/acoshf_vec.c create mode 100644 newlib/libm/test/asin_vec.c create mode 100644 newlib/libm/test/asinf_vec.c create mode 100644 newlib/libm/test/asinh_vec.c create mode 100644 newlib/libm/test/asinhf_vec.c create mode 100644 newlib/libm/test/atan2_vec.c create mode 100644 newlib/libm/test/atan2f_vec.c create mode 100644 newlib/libm/test/atan_vec.c create mode 100644 newlib/libm/test/atanf_vec.c create mode 100644 newlib/libm/test/atanh_vec.c create mode 100644 newlib/libm/test/atanhf_vec.c create mode 100644 newlib/libm/test/ceil_vec.c create mode 100644 newlib/libm/test/ceilf_vec.c create mode 100644 newlib/libm/test/conv_vec.c create mode 100644 newlib/libm/test/convert.c create mode 100644 newlib/libm/test/cos_vec.c create mode 100644 newlib/libm/test/cosf_vec.c create mode 100644 newlib/libm/test/cosh_vec.c create mode 100644 newlib/libm/test/coshf_vec.c create mode 100644 newlib/libm/test/dcvt.c create mode 100644 newlib/libm/test/dvec.c create mode 100644 newlib/libm/test/erf_vec.c create mode 100644 newlib/libm/test/erfc_vec.c create mode 100644 newlib/libm/test/erfcf_vec.c create mode 100644 newlib/libm/test/erff_vec.c create mode 100644 newlib/libm/test/exp_vec.c create mode 100644 newlib/libm/test/expf_vec.c create mode 100644 newlib/libm/test/fabs_vec.c create mode 100644 newlib/libm/test/fabsf_vec.c create mode 100644 newlib/libm/test/floor_vec.c create mode 100644 newlib/libm/test/floorf_vec.c create mode 100644 newlib/libm/test/fmod_vec.c create mode 100644 newlib/libm/test/fmodf_vec.c create mode 100644 newlib/libm/test/gamma_vec.c create mode 100644 newlib/libm/test/gammaf_vec.c create mode 100644 newlib/libm/test/hypot_vec.c create mode 100644 newlib/libm/test/hypotf_vec.c create mode 100644 newlib/libm/test/iconv_vec.c create mode 100644 newlib/libm/test/j0_vec.c create mode 100644 newlib/libm/test/j0f_vec.c create mode 100644 newlib/libm/test/j1_vec.c create mode 100644 newlib/libm/test/j1f_vec.c create mode 100644 newlib/libm/test/jn_vec.c create mode 100644 newlib/libm/test/jnf_vec.c create mode 100644 newlib/libm/test/log10_vec.c create mode 100644 newlib/libm/test/log10f_vec.c create mode 100644 newlib/libm/test/log1p_vec.c create mode 100644 newlib/libm/test/log1pf_vec.c create mode 100644 newlib/libm/test/log2_vec.c create mode 100644 newlib/libm/test/log2f_vec.c create mode 100644 newlib/libm/test/log_vec.c create mode 100644 newlib/libm/test/logf_vec.c create mode 100644 newlib/libm/test/math.c create mode 100644 newlib/libm/test/math2.c create mode 100644 newlib/libm/test/sin_vec.c create mode 100644 newlib/libm/test/sinf_vec.c create mode 100644 newlib/libm/test/sinh_vec.c create mode 100644 newlib/libm/test/sinhf_vec.c create mode 100644 newlib/libm/test/sprint_ivec.c create mode 100644 newlib/libm/test/sprint_vec.c create mode 100644 newlib/libm/test/sqrt_vec.c create mode 100644 newlib/libm/test/sqrtf_vec.c create mode 100644 newlib/libm/test/string.c create mode 100644 newlib/libm/test/tan_vec.c create mode 100644 newlib/libm/test/tanf_vec.c create mode 100644 newlib/libm/test/tanh_vec.c create mode 100644 newlib/libm/test/tanhf_vec.c create mode 100644 newlib/libm/test/test.c create mode 100644 newlib/libm/test/test.h create mode 100644 newlib/libm/test/test_ieee.c create mode 100644 newlib/libm/test/test_is.c create mode 100644 newlib/libm/test/y0_vec.c create mode 100644 newlib/libm/test/y0f_vec.c create mode 100644 newlib/libm/test/y1_vec.c create mode 100644 newlib/libm/test/y1f_vec.c create mode 100644 newlib/libm/test/yn_vec.c create mode 100644 newlib/libm/test/ynf_vec.c diff --git a/newlib/ChangeLog b/newlib/ChangeLog new file mode 100644 index 000000000..0dde36388 --- /dev/null +++ b/newlib/ChangeLog @@ -0,0 +1,6797 @@ +Thu Feb 17 01:42:50 2000 J"orn Rennecke + + * libc/stdio/vfscanf.c (limits.h): #include. + (MAX_LONG_LEN): #define. + (__svfscanf): Handle floating point numbers with arbitrary amounts + of leading zeroes. + +2000-02-15 Nick Clifton + + * libc/sys/arm/syscalls.c (_fstat): Initialise all fields to + zero. Set the blocksize to 1024/ + +Thu Jan 20 18:57:00 2000 Fernando Nasser + + * setvbuf.c (setvbuf): Set size to BUFSIZ when passed a zero size + with line buffering. + +Mon Jan 10 18:43:00 2000 Jeff Johnston + + * acinclude.m4: Changed include directory for winsup headers. + * aclocal.m4 configure libc/aclocal.m4 + libc/configure libc/ctype/Makefile.in libc/errno/Makefile.in + libc/locale/Makefile.in libc/machine/aclocal.m4 + libc/machine/configure libc/machine/a29k/aclocal.m4 + libc/machine/a29k/configure libc/machine/arm/aclocal.m4 + libc/machine/arm/configure libc/machine/d10v/aclocal.m4 + libc/machine/d10v/configure libc/machine/d30v/aclocal.m4 + libc/machine/d30v/configure libc/machine/fr30/aclocal.m4 + libc/machine/fr30/configure + libc/machine/h8300/aclocal.m4 + libc/machine/h8300/configure libc/machine/h8500/aclocal.m4 + libc/machine/h8500/configure libc/machine/hppa/aclocal.m4 + libc/machine/hppa/configure libc/machine/i386/aclocal.m4 + libc/machine/i386/configure libc/machine/i960/aclocal.m4 + libc/machine/i960/configure libc/machine/m32r/aclocal.m4 + libc/machine/m32r/configure libc/machine/m68k/aclocal.m4 + libc/machine/m68k/configure libc/machine/m88k/aclocal.m4 + libc/machine/m88k/configure libc/machine/mips/aclocal.m4 + libc/machine/mips/configure libc/machine/mn10200/aclocal.m4 + libc/machine/mn10200/configure libc/machine/mn10300/aclocal.m4 + libc/machine/mn10300/configure libc/machine/necv70/aclocal.m4 + libc/machine/necv70/configure libc/machine/powerpc/aclocal.m4 + libc/machine/powerpc/configure + libc/machine/sh/aclocal.m4 + libc/machine/sh/configure libc/machine/sparc/aclocal.m4 + libc/machine/sparc/configure + libc/machine/tic80/aclocal.m4 libc/machine/tic80/configure + libc/machine/v850/aclocal.m4 libc/machine/v850/configure + libc/machine/w65/aclocal.m4 libc/machine/w65/configure + libc/machine/z8k/aclocal.m4 libc/machine/z8k/configure + libc/misc/Makefile.in libc/posix/Makefile.in + libc/reent/Makefile.in + libc/signal/Makefile.in + libc/string/Makefile.in libc/sys/aclocal.m4 libc/sys/configure + libc/sys/a29khif/aclocal.m4 libc/sys/a29khif/configure + libc/sys/arm/Makefile.in libc/sys/arm/aclocal.m4 + libc/sys/arm/configure libc/sys/cygwin/aclocal.m4 + libc/sys/cygwin/configure libc/sys/d10v/Makefile.in + libc/sys/d10v/aclocal.m4 libc/sys/d10v/configure + libc/sys/decstation/aclocal.m4 libc/sys/decstation/configure + libc/sys/go32/aclocal.m4 libc/sys/go32/configure + libc/sys/h8300hms/aclocal.m4 libc/sys/h8300hms/configure + libc/sys/h8500hms/aclocal.m4 libc/sys/h8500hms/configure + libc/sys/m88kbug/aclocal.m4 libc/sys/m88kbug/configure + libc/sys/netware/aclocal.m4 libc/sys/netware/configure + libc/sys/rtems/aclocal.m4 libc/sys/rtems/configure + libc/sys/sh/Makefile.in libc/sys/sh/aclocal.m4 + libc/sys/sh/configure libc/sys/sparc64/aclocal.m4 + libc/sys/sparc64/configure libc/sys/sun4/aclocal.m4 + libc/sys/sun4/configure libc/sys/sysmec/aclocal.m4 + libc/sys/sysmec/configure libc/sys/sysnec810/aclocal.m4 + libc/sys/sysnec810/configure libc/sys/sysnecv850/aclocal.m4 + libc/sys/sysnecv850/configure libc/sys/sysvi386/aclocal.m4 + libc/sys/sysvi386/configure libc/sys/sysvnecv70/aclocal.m4 + libc/sys/sysvnecv70/configure libc/sys/tic80/aclocal.m4 + libc/sys/tic80/configure libc/sys/w65/aclocal.m4 + libc/sys/w65/configure libc/sys/z8ksim/aclocal.m4 + libc/sys/z8ksim/configure libc/syscalls/Makefile.in + libc/time/Makefile.in libc/unix/Makefile.in libm/aclocal.m4 + libm/configure: Regenerated. + +Mon Jan 10 18:43:46 2000 Jeff Johnston + + * libc/stdlib/putenv_r.c (_putenv_r): New file. + * libc/stdlib/strdup_r.c (_strdup_r): New file. + * libc/include/string.h: Added _strdup_r. + * libc/stdlib/putenv.c: Added call to reentrant version. + * libc/stdlib/strdup.c: Ditto. + * libc/stdlib/Makefile.am: Added _putenv_r and _unsetenv_r. + * libc/include/stdlib.h: Ditto. + * libc/stdlib/Makefile.in: Regenerated. + * libc/string/Makefile.in: Regenerated. + * libc/stdlib/setenv.c: Added reentrant version of unsetenv. + * libc/stdlib/setenv_r.c: Added unsetenv_r and changed memory + management calls to reentrant versions. + * libc/stdlib/wcstombs.c: Added #ifndef _REENT_ONLY wrapper. + * libc/stdlib/wctomb.c: Ditto. + * libc/stdlib/mblen.c: Ditto. + * libc/stdlib/mbstowcs.c: Ditto. + * libc/stdlib/mbtowc.c: Ditto. + * libc/stdlib/getenv.c: Ditto. + * libc/reent/reent.tex: Added references to _putenv_r, _setenv_r, + and _strdup_r. + +Thu Jan 6 15:33:46 2000 Christopher Faylor + + patch from Corinna Vinschen + * libc/sys/cygwin/sys/param.h: Define NGROUP_MAX as 16. + +Mon Jan 03 14:36:00 2000 Ranjith Kumaran + + * libm/mathfp/s_atangent.c: Fix exponent calculation. + * libm/mathfp/s_ldexp.c: Ditto. + * libm/mathfp/sf_atangent.c: Ditto. + * libm/mathfp/sf_ldexp.c: Ditto. + +Tue Dec 14 5:42:00 1999 Ranjith Kumaran + + * libc/machine/i960/setjmp.S: fix typo leaving .link_pix uncommented + * libc/include/locale.h: define NULL to be 0. + +Tue Dec 7 15:41:45 1999 Jim Wilson + + * libc/sys/sh/syscalls.c (stack_ptr): Move definition before first + function. + +Wed Dec 1 17:39:29 1999 Jeffrey A Law (law@cygnus.com) + + * libc/machine/mn10300/setjmp.S: Handle am33. + +1999-11-26 Nick Clifton + + * libc/sys/arm/syscalls.c: Add function prototypes. + (stack_ptr): Move declaration before function definitions. + +Sat Nov 20 17:13:00 1999 Ranjith Kumaran + + * NEWS: Updated version information. + * README: Ditto. + +Tue Nov 09 12:19:21 1999 Jeff Johnston + + * libc/machine/i386/strchr.S: Fixed alignment test. + +Thu Oct 28 05:30:46 1999 Andrew Cagney + + * libc/sys/d10v/crt0.S (_start): Construct a real stack frame. + +Thu Oct 28 15:29:11 1999 Andrew Cagney + + * libc/sys/d10v/crt0.S (_start): Initialize both SPI and SPU + ensuring that there is space between the two. + +Thu Oct 14 13:39:21 1999 Christopher Faylor + + * libc/stdio/flags.c: Conditionalize check for 't' for cygwin case + only. + +1999-10-08 Vadim Egorov + + * libc/include/stdlib.h: add ptsname, grantpt, unlockpt to cygwin + section + +Sat Oct 2 02:02:00 MEST 1999 Ralf Corsepius + + * libc/machine/sh/asm.h: Added __SH4_SINGLE__ to DELAYED_BRANCHES + * libc/machine/sh/memcpy.S: Fix line wrapping in SL macro + +Fri Oct 1 13:17:59 CDT 1999 + * libc/include/grp.h: Added getgrnam_r and getgrgid_r prototypes + per POSIX 1003.1b. + * libc/include/pwd.h: Added getpwnam_r and getpwuid_r prototypes + per POSIX 1003.1b. + +1999-09-13 DJ Delorie + + * libc/stdio/mktemp.c (_gettemp): on cygwin, check for EACCESS + also. + +Thu Sep 9 15:31:00 1999 Jeff Johnston + + * setvbuf.c (setvbuf): When mallocing a buffer of size BUFSIZ, + also note BUFSIZ as its size. + +Tue Sep 7 17:15:00 1999 Joel Sherrill + + * configure.host: Corrected feature defines for RTEMS. + * libc/include/sys/stat.h: Added protototype for RTEMS mknod. + * libc/include/sys/stat.h: mkfifo() should take const path arg. + * libc/include/sys/unistd.h: pathconf() should take const path arg. + Enabled usleep(), ftruncate(), and truncate() prototypes for RTEMS. + Added defines for _POSIX_JOB_CONTROL, _POSIX_SAVED_IDS, and + _POSIX_VERSION for RTEMS. Added defines for _PC_ASYNC_IO, + _PC_PRIO_IO, and _PC_SYNC_IO. + * libc/machine/m68k/Makefile.am: Added strcpy.c and strlen.c. + * libc/machine/m68k/Makefile.in: Regenerated. + * libc/machine/m68k/strcpy.c: New file. + * libc/machine/m68k/strlen.c: New file. + * libc/stdio/tmpnam.c: Always make the returned name usable. + * libc/sys/rtems/crt0.c: New version that passes all autoconf tests. + * libc/sys/rtems/sys/dirent.h: New file. + * libc/sys/rtems/sys/types.h: Added dev_t. + +Tue Sep 7 17:15:00 1999 Jay Kulpinski + + * libc/stdlib/mprec.c: Fixed unitialized variable problem. + +Fri Sep 3 12:35:20 1999 Jeff Johnston + + * libc/stdio/ftell.c (ftell): Backing off Joern's fix and + my patch. + +Thu Sep 2 22:05:20 1999 Christopher Faylor + + patch from Jeff Johnston + * libc/stdio/ftell.c (ftell): Avoid using buffer position when the + buffer is not in a useful state. + +1999-09-01 Nick Clifton + + * libc/sys/arm/syscalls.c (_link): Add stub. + +Fri Aug 27 23:09:09 1999 J"orn Rennecke + + * ftell.c (ftell): Use actual position within buffer for text mode. + * findfp.c (std): Initialize ptr->_bf._size. + +Wed Aug 18 18:48:02 1999 Christopher Faylor + + * libc/include/sys/unistd.h: Add nice() declaration. + +1999-08-09 Nick Clifton + + * libc/sys/arm/crt0.S (change_mode): Rename to __change_mode and + declare as a thumb function so that the disassembler will see the + mode change. + +Thu Aug 5 17:37:00 1999 Ranjith Kumaran + + * libc/reent/reent.tex: Updated list of reentrant functions. + +1999-07-09 Michael Meissner + + * libc/include/stdlib.h (_findenv{,_r}): Add prototypes. + +Tue Jul 6 10:46:24 1999 Jeff Johnston + + * libc/stdio/sprintf.c: Moved snprintf and _snprintf_r to + separate file. + * libc/stdio/snprintf.c: New file. + * libc/stdio/vsprintf.c: Moved vsnprintf and _vsnprintf_r to + separate file. + * libc/stdio/vsnprintf.c: New file. + * libc/stdio/Makefile.am: Added snprintf.c and vsnprintf.c. + * libc/stdio/Makefile.in: Regenerated. + +Mon Jul 5 14:43:24 1999 Christopher Faylor + + Patch submitted by Egor Duda : + * libc/include/stdio.h: Add declarations for *nprintf. + * libc/stdio/sprintf.c (snprintf): New function. + (_snprintf_r): New function. + * libc/stdio/vsprintf.c (vsnprintf): New function. + (_vnsprintf_r): New function. + +Wed Jun 30 16:36:27 1999 Jeff Johnston + + * libc/Makefile.am (stmp-targetdep): Remove extraneous blank. + * libm/Makefile.am (stmp-targetdep): Ditto. + * libc/Makefile.in: Regenerated. + * libm/Makefile.in: Ditto. + +Fri Jun 25 10:49:27 1999 Jeff Johnston + + * libc/Makefile.am (stmp-targetdep): Ignore "." in SUBDIRS. + * libm/Makefile.am (stmp-targetdep): Ditto. + * libc/Makefile.in: Regenerated. + * libm/Makefile.in: Ditto. + +Thu June 03 16:25:00 1999 Jeff Johnston + + * Makefile.am: Removed dependencies on all-recursive and added "." + to the SUBDIRS list to prevent infinite recursion from occurring. + Also removed any references to EXTRA_DATA. + * libc/Makefile.am: Ditto. + * libc/machine/Makefile.am: Ditto. + * libc/machine/i386/Makefile.am: Ditto. + * libm/Makefile.am: Ditto. + * libc/sys/Makefile.am: Ditto. + * Makefile.in: Regenerated. + * aclocal.m4: Ditto. + * configure: Ditto. + * doc/Makefile.in: Ditto. + * doc/aclocal.m4: Ditto. + * doc/configure: Ditto. + * libc/Makefile.in: Ditto. + * libc/aclocal.m4: Ditto. + * libc/configure: Ditto. + * libc/machine/Makefile.in: Ditto. + * libc/machine/aclocal.m4: Ditto. + * libc/machine/configure: Ditto. + * libc/machine/mn10300/Makefile.in: Ditto. + * libc/machine/mn10300/aclocal.m4: Ditto. + * libc/machine/mn10300/configure: Ditto. + * libc/sys/Makefile.in: Ditto. + * libc/sys/aclocal.m4: Ditto. + * libc/sys/configure: Ditto. + * libm/Makefile.in: Ditto. + * libm/aclocal.m4: Ditto. + * libm/configure: Ditto. + +Thu June 03 16:20:00 1999 Ranjith Kumaran + + * libc/include/stdlib/stdlib.tex: Add link to env_lock. + +Fri May 28 17:09:00 1999 Ranjith Kumaran + + * libc/include/stdlib.h: Add reentrant routines. + * libc/stdlib/Makefile.am: Add reentrant routines. + * libc/stdlib/Makefile.in: Ditto. + * libc/stdlib/envlock.c: New file. + * libc/stdlib/envlock.h: New file. + * libc/stdlib/getenv.c: Modify to call reentrant routine. + * libc/stdlib/getenv_r.c: New file. + * libc/stdlib/mblen.c: Modify to call reentrant routine. + * libc/stdlib/mblen_r.c: New file. + * libc/stdlib/setenv.c: Modify to call reentrant routine. + * libc/stdlib/setenv_r.c: New file. + * libc/stdlib/stdlib.tex: Add reentrant routines. + +Mon May 17 22:01:38 1999 Christopher Faylor + + * libc/include/sys/types.h: Define __MS_types__ whenever + cygwin or win32. + +Sun May 16 16:02:41 1999 Christopher Faylor + + * libc/include/machine/ieeefp.h: Always default to little + endian if Windows, regardless of architecture. + * libc/include/machine/sethmp.h: Define JBLEN if CYGWIN + regardless of architecture. + +Mon May 3 11:49:18 1999 Geoffrey Noer + + * libc/include/machine/setjmp.h: Accept CYGWIN define, even if + _WIN32 isn't defined. + +Mon May 3 11:41:51 1999 Jeff Johnston + + * libm/common/s_rint.c (rint): Add volatile qualifier for + intermediate value w. + * libm/common/sf_rint.c (rintf): Ditto. + +Thu Apr 29 20:34:27 1999 Jeff Johnston + + * libc/sys/arm/syscalls.c (remap_handle): Added check to + ensure that std streams are initialized before being referenced. + +1999-04-27 Jason Molenda (jsm@bugshack.cygnus.com) + + * README: Update reference to newlib@cygnus.com new + newlib@sourceware.cygnus.com address. + +Mon Apr 26 18:17:33 1999 Geoffrey Noer + + * libc/include/sys/types.h: Define MS_types if CYGWIN is defined. + * libc/include/sys/fcntl.h: Define _O_BINARY et al if CYGWIN is + defined, even if _WIN32 isn't defined. + +Sat Apr 24 19:59:55 1999 Christopher Faylor + + * libc/include/sys/fcntl.h: Correct _O_CREATE to _O_CREAT. + +Wed Apr 21 18:01:00 1999 Ranjith Kumaran + + * libc/include/sys/reent.h: Change Long and ULong to __Long and + __ULong. + * libc/stdlib/dtoa.c: Ditto. + * libc/stdlib/mprec.c: Ditto. + * libc/stdlib/mprec.h: Ditto. + * libc/stdlib/strtod.c: Ditto. + +1999-04-21 Nick Clifton + + * configure.host (mcore): Remove mcore machine directory. + +1999-04-18 Nick Clifton + + * libc/include/machine/ieeefp.h: Add support for mcore target. + * libc/include/machine/setjmp.h: Add support for mcore target. + * configure.host: Add support for mcore target. + +1999-04-13 Mark Salter + + * libc/sys/arm/libcfunc.c: Moved isatty to syscall.c + * libc/sys/arm/syscalls.c: Added isatty. + +Wed Apr 07 16:06:04 1999 Jeff Johnston + + * libc/stdlib/ecvtbuf.c (fcvtbuf): Fixed code to properly + insert zeroes after significant digits. + +Wed Mar 17 22:06:04 1999 Jeff Johnston + + * libc/stdio/vfprintf.c (cvt): Changed floating point + cvt routine to use union used by dtoa to properly determine + if the sign bit is on or not. + * libc/stdio/vfieeefp.h: New file + +Wed Mar 17 17:35:04 1999 Jeff Johnston + + * aclocal.m4: Regenerated. + * configure: Regenerated. + +Wed Mar 17 16:35:04 1999 Jeff Johnston + + * libc/machine/i386/Makefile.am (lib_a_SOURCES): Added missing + f_tanf reference. + * libc/machine/i386/Makefile.in: Regenerated. + +Tue Mar 16 14:56:36 1999 Jeff Johnston + + * acinclude.m4: Changed to work with new automake. + * configure: Regenerated. + * libc/machine/i386/aclocal.m4: Regenerated. + * libc/machine/i386/configure: Regenerated. + +Tue Mar 16 13:55:36 1999 Corinna Vinschen + + * libc/sys/cygwin/sys/dirent.h: Add additional prototypes + for telldir() and seekdir(). Rename unused structure element + for use with these two routines. + +Fri Mar 12 19:11:58 1999 Jeff Johnston + + * libc/time/mktime.c (validate_structure): Multiple fixes to + code to handle cases where input fields are outside valid ranges. + * libc/stdlib/div.c (div): Modified invalid rounding check. + * libc/stdlib/ldiv.c (ldiv): Ditto. + +Thu Mar 11 21:32:13 1999 Jeff Johnston + + * libc/machine/i386/memcpy.S: Performance rewrite. + * libc/machine/i386/memmove.S: Ditto. + * libc/machine/i386/i386mach.h: Added more register definitions. + * libc/include/math.h: Include if -ffast-math + option used. + * libc/include/machine/fastmath.h: Add definitions for x86 + fast-math routines. + +Wed Mar 10 17:56:00 1999 Ranjith Kumaran + + * libc/stdlib/strtod.c: Change from unsigned long to ULong. + +Tue Mar 9 14:31:58 1999 Geoffrey Noer + + Adjust newlib headers for new Cygwin Win32 API header files: + * libc/include/sys/time.h: Check _WINSOCK_H rather than + _GNU_H_WINDOWS32_SOCKETS. + * libc/include/sys/types.h: Ditto. + +Tue Mar 09 15:55:00 1999 Ranjith Kumaran + + *include/sys/reent.h: Add checks for size of Bigint element Long. + *libc/dtoa.c: Change routines to use generic Long type. + *libc/mprec.c: Change routines to use generic Long type. + *libc/mprec.h: Change routines to use generic Long type. + +Tue Mar 02 18:07:49 1999 Ranjith Kumaran + + * libc/Makefile.am: Add .def files. + * libc/Makefile.in: Regenerate. + * libc/e_acosh.c: Documentation update. + * libc/e_atanh.c: Documentation update. + * libc/e_hypot.c: Documentation update. + * libc/e_remainder.c: Documentation update. + * libc/er_lgamma.c: Documentation update. + * libc/mathfp.tex: Documentation update. + * libc/s_acos.c: Documentation update. + * libc/s_atan.c: Documentation update. + * libc/s_atan2.c: Documentation update. + * libc/s_cosh.c: Documentation update. + * libc/s_fmod.c: Documentation update. + * libc/s_isnan.c: Documentation update. + * libc/s_log10.c: Documentation update. + * libc/s_pow.c: Documentation update. + * libc/w_jn.c: Documentation update. + +Sun Feb 28 23:18:49 1999 Geoffrey Noer + + * aclocal.m4: Regenerate. + * configure: Regenerate. + +Tue Feb 23 13:57:26 1999 Jeff Johnston + + * libc/machine/mn10300/setjmp.S (_longjmp): Fixed longjmp + to return 1 if user specified return code is 0. + * libc/machine/mn10200/setjmp.S (_longjmp): Ditto. + +Thu Feb 18 11:13:28 1999 Jeff Johnston + + * libc/machine/mn10200/setjmp.S (_setjmp/_longjmp): Fixed setjmp + to save the return address. Fixed longjmp to return to the original + calling address of setjmp and to return the user specified return code + rather than default to 1. + * libc/machine/mn10300/setjmp.S (_setjmp/_longjmp): Ditto. + +Mon Feb 15 17:48:17 1999 Jeff Johnston + + * libc/stdlib/mprec.h (mult): Define mult to be _multiply instead of _mult. + +1999-02-10 Nick Clifton + + * libc/sys/arm/syscalls.c (initialise_monitor_handles): Make block + volatile so that its assignments will not be discarded. + +Wed Feb 10 17:19:40 1999 Jeff Johnston + + * libc/include/_ansi.h: Corrected _STRICT_ANSI reference to + be __STRICT_ANSI__ which is generated by compiler. + * libc/include/ctype.h: Ditto. + * libc/include/math.h: Ditto. + * libc/include/stdio.h: Ditto. + * libc/include/stdlib.h: Ditto. + * libc/include/string.h: Ditto. + * libc/include/sys/signal.h: Ditto. + +1999-02-08 Nick Clifton + + * configure.host: Add support for StrongARM target. + +Fri Feb 5 11:13:14 1999 Jeff Johnston + + * libc/string/strncpy.c (strncpy): Removed redundant code + that was copying bytes if data unaligned. + +1999-02-02 Brendan Kehoe + + * libc/stdlib/Makefile.{am,in} (CHEWOUT_FILES): Add mblen.def, + mbstowcs.def, and wcstombs.def. + +Sat Jan 30 02:36:33 1999 Christopher Faylor + + * libc/include/sys/errno.h: Add Cygwin errno. + * libc/stdio/flags.c: Don't default to O_TEXT if no other flag + is specified. + +1999-01-29 Nick Clifton + + * libc/sys/arm/syscalls.c: Move C library functions into seperate + file. + + * libc/sys/arm/libcfunc.c: New file containing C library functions + from syscalls.c + + * libc/sys/arm/Makefile.am (lib_a_SOURCES): Add libcfuncs.c + * libc/sys/arm/Makefile.in (lib_a_SOURCES): Regenerate. + + +1999-01-27 Michael Meissner + + * libc/include/machine/setjmp.h (D30V _JBLEN/_JBTYPE): Use double + type, and cut size in half so that the jmp_buf array is guaranteed + to be aligned on a 64-bit boundary. + +Mon Jan 25 12:05:38 1999 Jeff Johnston + + * libc/string/strings.tex: Added information about + strcasecmp and strncasecmp. + * libc/stdlib/stdlib.tex: Added missing information + about mblen, mbstowcs, and wcstombs. + * libc/string/strchr.c: Changed how mask is built to use + shift operators so register will be used instead of storage. + +1999-01-22 DJ Delorie + + * libc/include/stdlib.h: don't use dllimport if we're building + newlib, since it's inside cygwin.dll + +Fri Jan 22 14:57:18 1999 Christopher Faylor + + * libc/ctype/ctype_.c: Need to use __declspec(dllexport) for + _ctype_ under cygwin. + +Fri Jan 22 09:50:19 1999 Christopher Faylor + + * include/stdlib.h: Fix typo from previous checkin. + +Thu Jan 21 22:42:21 1999 Christopher Faylor + + * include/ctype.h: Use __declspec(dllimport) method for exporting + variable from cygwin DLL. + * include/time.h: Ditto. + * sys/errno.h: Ditto. + * include/stdlib.h: Export __mb_cur_max from cygwin DLL. + * libc/locale/locale.c: Use __declspec(dllexport) method for + exporting variable from cygwin DLL. + +Sat Jan 16 13:29:54 1999 Christopher Faylor + + * libc/stdio/setvbuf.c: Always clean up when _IONBF or possible + access of bogus pointer will result in SIGSEGV. + +1999-01-07 Nick Clifton + + * libc/sys/arm/setjmp.S: Use C macros to cope with the possibility + of an underscore prefix to function names. + +Fri Jan 8 19:00:07 1999 Jeff Johnston + + * libc/machine/i386/i386mach.h (__REG_PREFIX__): Create new + define __REG_PREFIX__ instead of using __REGISTER_PREFIX__. + +1998-12-31 Michael Meissner + + * libc/machine/i386/i386mach.h (__REGISTER_PREFIX__): Only define + to `%' if not already defined. + +1998-12-30 Michael Meissner + + * libc/stdio/tmpnam.c (_tempnam_r): Make directory and prefix + arguments const char *, not char *. + * libc/include/stdio.h (_tempnam_r): Ditto. + + * libc/include/sys/reent.h (struct _reent): The _sig_func type + points to a function taking an integer, not void. + +Tue Dec 29 14:35:53 1998 Christopher Faylor + + * configure.host: Add a define for Cygwin builds. + * libc/include/ctype.h: Don't use dll imported variables in newlib. + +Mon Dec 28 09:19:56 1998 Christopher Faylor + + * libc/include/ctype.h: Define _ctype_ as dll imported variable + for use with Cygwin. + * libc/include/sys/errno.h: Define _sys_errlist and _sys_nerr as + dll imported variables for use with Cygwin. + * libc/ctype/ctype_.c: Undefine _ctype_ in case it has been defined + as a dll imported variable for Cygwin. + +Sat Dec 26 00:13:53 1998 Christopher Faylor + + * libc/include/sys/unistd.h: Add proto for getpass. + +Fri Dec 18 19:28:19 1998 Geoffrey Noer + + * libc/sys/cygwin/sys/dirent.h: add protos for scandir and + alphasort. + +Fri Dec 18 16:33:25 1998 Geoffrey Noer + + * libc/posix/execvp.c (execvp): call cygwin_posix_path_list_p, + not posix_path_list_p. + +1998-12-15 Nick Clifton + + * libc/string/memchr.c: Treat 'c' argument as an unsigned byte not + a signed int. + +1998-12-13 Nick Clifton + + * libc/include/machine/setjmp.h (_JBLEN): Set to 10. + +1998-12-12 Nick Clifton + + * libc/machine/fr30/setjmp.S: New file, supplied by Mark Slater + + * libc/machine/fr30/Makefile.am: Add build of setjmp.S + * libc/machine/fr30/Makefile.in: Regenerated. + +1998-12-11 Nick Clifton + + * configure.host: Remove use of libc/sys for FR30 port. + * libc/sys/fr30: Remove directory (replaced by libgloss). + +1998-12-10 Ken Raeburn + + * libc/string/strcat.c (ALIGNED): Sense of result was reversed. + * libc/string/strncat.c (ALIGNED): Ditto. + +Wed Dec 9 14:37:57 1998 Geoffrey Noer + + * libc/include/sys/time.h: include sys/types.h + +Tue Dec 8 15:53:18 1998 Jeff Johnston + + * libc/machine/i386/memcmp.S (memcmp): Fix for unequal + comparison found when checking word at a time. + +1998-12-04 Nick Clifton + + * libc/sys/fr30/crt0.s (_start): Initialise frame pointer. + +1998-12-03 Nick Clifton + + * libc/sys/fr30/syscalls.c (_times): New function stub. + +Thu Dec 3 15:59:19 1998 Jeff Johnston + + * configure.host (mach_add_setjmp): Replaced mach_add_objs + with mach_add_setjmp flag which indicates if setjmp should + be added to the machine directory objects. + * acinclude.m4: Removed reference to mach_add_objs. + * aclocal.m4: Regenerated. + * Makefile.in: Regenerated. + * configure: Regenerated. + * libc/aclocal.m4: Regenerated. + * libc/Makefile.in: Regenerated. + * libc/configure: Regenerated. + * libc/machine/aclocal.m4: Regenerated. + * libc/machine/Makefile.in: Regenerated. + * libc/machine/configure: Regenerated. + * libc/machine/i386/aclocal.m4: Regenerated. + * libc/machine/i386/Makefile.am: Altered to selectively add + setjmp.S to the src files list. + * libc/machine/i386/Makefile.in: Regenerated. + * libc/machine/i386/configure.in: Altered to test mach_add_setjmp. + * libc/machine/i386/configure: Regenerated. + +1998-12-02 Nick Clifton + + * libc/sys/fr30/crt0.s (_start): Fix function names. + + * libc/machine/fr30: New directory + * libc/machine/fr30/Makefile.am: New file. + * libc/machine/fr30/Makefile.in: New generated file. + * libc/machine/fr30/configure.in: New file. + * libc/machine/fr30/configure: New generated file. + * libc/machine/fr30/aclocal.m4: New generated file. + * libc/sys/fr30/Makefile.am: New file. + * libc/sys/fr30/Makefile.in: New generated file. + * libc/sys/fr30/configure.in: New file. + * libc/sys/fr30/configure: New generated file. + * libc/sys/fr30/syscalls.c: New file. + +Tue Dec 1 16:28:56 1998 Geoffrey Noer + + * libc/sys/cygwin/sys/utmp.h: new file, moved from winsup/include. + +1998-12-01 Ken Raeburn + + * libc/time/strftime.c (strftime): Also handle %y for years before + 1900. + +Tue Dec 1 13:26:07 1998 Christopher Faylor + + * libc/string/strcasecmp.c (strcasecmp): Adhere to standard + UNIX convention. Perform tolower on characters before comparing + them rather than use toupper. + * libc/string/strncasecmp.c (strncasecmp): Ditto. + +Mon Nov 30 16:24:19 1998 Jeff Johnston + + * configure.host: Added using i386 machine directory + for all x86 cross-compiler and configuring + which added object files to use via new "mach_add_objs" variable. + * configure: Regenerated. + * libc/configure: Regenerated. + * libc/Makefile.in: Regenerated. + * libc/aclocal.m4: Regenerated. + * libc/ctype/Makefile.in: Regenerated. + * libc/errno/Makefile.in: Regenerated. + * libc/locale/Makefile.in: Regenerated. + * libc/machine/Makefile.in: Regenerated. + * libc/machine/aclocal.m4: Regenerated. + * libc/machine/configure: Regenerated. + * libc/posix/Makefile.in: Regenerated. + * libc/reent/Makefile.in: Regenerated. + * libc/signal/Makefile.in: Regenerated. + * libc/stdio/Makefile.in: Regenerated. + * libc/stdlib/Makefile.in: Regenerated. + * libc/string/Makefile.in: Regenerated. + * libc/string/memmove.c: Optimized code to use memcpy + logic when performing a non-destructive copy. + * libc/string/strncmp.c: Altered code to allow building + optimized for size or speed. + * libc/syscalls/Makefile.in: Regenerated. + * libc/time/Makefile.in: Regenerated. + * libc/unix/Makefile.in: Regenerated. + * libc/machine/i386/Makefile.am: Added new files and reference + to "mach_add_objs" to indicate optional object files. + * libc/machine/i386/Makefile.in: Regenerated. + * libc/machine/i386/aclocal.m4: Regenerated. + * libc/machine/i386/configure: Regenerated. + * libc/machine/i386/memchr.S: New file that implements + function in Intel assembler. + * libc/machine/i386/memcmp.S: ditto. + * libc/machine/i386/memcpy.S: ditto. + * libc/machine/i386/memmove.S: ditto. + * libc/machine/i386/memset.S: ditto. + * libc/machine/i386/strchr.S: ditto. + * libc/machine/i386/strlen.S: ditto. + * libc/machine/i386/f_atan2.S: New file that implements + fast version of math function to be used by compiler when + --ffast_math compile option is used. + * libc/machine/i386/f_atan2f.S: ditto. + * libc/machine/i386/f_exp.c: ditto. + * libc/machine/i386/f_expf.c: ditto. + * libc/machine/i386/f_frexp.S: ditto. + * libc/machine/i386/f_frexpf.S: ditto. + * libc/machine/i386/f_ldexp.S: ditto. + * libc/machine/i386/f_ldexpf.S: ditto. + * libc/machine/i386/f_log.S: ditto. + * libc/machine/i386/f_logf.S: ditto. + * libc/machine/i386/f_log10.S: ditto. + * libc/machine/i386/f_log10f.S: ditto. + * libc/machine/i386/f_math.h: New file. + * libc/machine/i386/f_pow.c: ditto. + * libc/machine/i386/f_powf.S: ditto. + * libc/machine/i386/f_tan.S: ditto. + * libc/machine/i386/f_tan.S: ditto. + * libc/machine/i386/i386mach.h: New file. + +Mon Nov 30 13:02:17 1998 Christopher Faylor + + patch from Mumit Khan + * libc/include/stdio.h (tempnam): Add prototype. + * libc/stdio/tmpnam.c (_tempnam_r): Handle NULL prefix. + (tempnam): Adhere to prototype. + +Thu Nov 26 00:21:32 1998 Christopher Faylor + + * Makefile.am: Add default for AR_FLAGS. + * Makefile.in: Regenerate. + +Tue Nov 24 18:48:56 1998 Geoffrey Noer + + * libc/include/time.h: move __cplusplus wrapper after includes + * libc/include/sys/time.h: ditto. If Cygwin, include + sys/select.h. + * libc/include/sys/types.h: lose "32" in comment about Cygwin. + +1998-11-23 Ken Raeburn + + * libc/time/strftime.c (strftime): Handle %y after year 2000. + +Wed Nov 18 12:22:41 1998 Nick Clifton + + * libc/sys/fr30/crt0.s (_start): Switch over to using int #9 as + abnormnal end-of-crt0 marker. + +Tue Nov 17 16:27:58 1998 Nick Clifton + + * libc/sys/fr30/crt0.s: New file/directory. + * libc/include/machine/setjmp.h: Add FR30 target. + * libc/include/machine/ieeefp.h: Add FR30 target. + * configure.host: Add FR30 target. + +Mon Nov 16 23:15:00 1998 Ranjith Kumaran + + * libm/math: Files that are duplicated in common directory removed. + * libm/math/fdlibm.h: Removed. + * libm/math/s_cbrt.c: Removed. + * libm/math/s_copysign.c: Removed. + * libm/math/s_expm1.c: Removed. + * libm/math/s_finite.c: Removed. + * libm/math/s_ilogb.c: Removed. + * libm/math/s_infinity.c: Removed. + * libm/math/s_lib_ver.c: Removed. + * libm/math/s_log1p.c: Removed. + * libm/math/s_logb.c: Removed. + * libm/math/s_matherr.c: Removed. + * libm/math/s_modf.c: Removed. + * libm/math/s_nan.c: Removed. + * libm/math/s_nextafter.c: Removed. + * libm/math/s_rint.c: Removed. + * libm/math/s_scalbn.c: Removed. + * libm/math/sf_cbrt.c: Removed. + * libm/math/sf_copysign.c: Removed. + * libm/math/sf_expm1.c: Removed. + * libm/math/sf_finite.c: Removed. + * libm/math/sf_ilogb.c: Removed. + * libm/math/sf_infinity.c: Removed. + * libm/math/sf_log1p.c: Removed. + * libm/math/sf_logb.c: Removed. + * libm/math/sf_modf.c: Removed. + * libm/math/sf_nan.c: Removed. + * libm/math/sf_nextafter.c: Removed. + * libm/math/sf_rint.c: Removed. + * libm/math/sf_scalbn.c: Removed. + * libm/math/Makefile.am: Removed references to deleted files (above). + * libm/math/Makefile.in: Regenerated. + * libm/Makefile.am: Added common directory to math. + * libm/Makefile.in: Regenerated. + +Mon Nov 2 23:12:00 1998 Ranjith Kumaran + + * libm/mathfp: Add non-ANSI functions. + * libm/mathfp/e_acosh.c acosh(): New file. + * libm/mathfp/e_atanh.c atanh(): New file. + * libm/mathfp/e_hypot.c hypot(): New file. + * libm/mathfp/e_j0.c j0(): New file. + * libm/mathfp/e_j1.c j1(): New file. + * libm/mathfp/e_remainder.c remainder(): New file. + * libm/mathfp/e_scalb.c scalb(): New file. + * libm/mathfp/ef_acosh.c acoshf(): New file. + * libm/mathfp/ef_atanh.c atanhf(): New file. + * libm/mathfp/ef_hypot.c hypotf(): New file. + * libm/mathfp/ef_j0.c j0f(): New file. + * libm/mathfp/ef_j1.c j1f(): New file. + * libm/mathfp/ef_remainder.c remainderf(): New file. + * libm/mathfp/ef_scalb.c scalbf(): New file. + * libm/mathfp/er_gamma.c gamma_r: New file. + * libm/mathfp/er_lgamma.c lgamma_r(): New file. + * libm/mathfp/erf_gamma.c gamma_rf(): New file. + * libm/mathfp/erf_lgamma.c lgamma_rf(): New file. + * libm/mathfp/w_cabs.c cabs(): New file. + * libm/mathfp/w_drem.c drem(): New file. + * libm/mathfp/w_jn.c jn(): New file. + * libm/mathfp/wf_cabs.c cabsf(): New file. + * libm/mathfp/wf_drem.c dremf(): New file. + * libm/mathfp/wf_jn.c jnf(): New file. + +Mon Nov 2 16:43:18 1998 Geoffrey Noer + + * libc/sys/cygwin32: remove directory and contents + * libc/sys/cygwin: and add back, losing the "32". + * configure.host: check for cygwin* instead of cygwin32. + * acinclude.m4: ditto. + * aclocal.m4: regenerate with aclocal + * configure: regenerate with autoconf + +Tue Oct 20 17:28:28 1998 Geoffrey Noer + + * libc/stdio/tmpnam.c (_tempnam_r): not enough memory allocated + for length + +Tue Oct 20 18:49:05 1998 Jeff Johnston + + * libc/include/sys/reent.h (struct _reent): Added variables _rand_next, _strtok_last, + _asctime_buf, _localtime_buf and _gamma_signgam to struct reent + to make rand/srand, strtok, asctime, localtime, w_gamma, + w_lgamma, wf_gamma, and wf_lgamma reentrant. Included + time.h to bring in struct tm definition. + * libc/stdlib/rand.c (rand, srand): Don't emit functions 'rand' and 'srand' if + '_REENT_ONLY' is set. Used variable '_rand_next' from struct reent. + * libc/stdlib/strtok.c (strtok): Used variable '_strtok_last' from struct reent + instead of static variable. + * libc/stdlib/asctime.c (asctime): Used variable '_asctime_buf' from + struct reent instead of static variable. + * libc/stdlib/lcltime.c (localtime): Used variable '_localtime_buf' from + struct reent instead of static variable. + * libm/math/Makefile.am: Removed s_signgam.o. + * libm/math/Makefile.in: Regenerated. + * libm/math/w_gamma.c (gamma): Used variable '_gamma_signgam' from + struct reent instead of global variable 'signgam'. + * libm/math/w_lgamma.c (lgamma): Likewise. + * libm/math/wf_gamma.c (gammaf): Likewise. + * libm/math/wf_lgamma.c (lgammaf): Likewise. + * libm/math/s_signgam.c: Removed. + * libc/include/unctrl.h: Defined arrays __unctrl and __unctrllen + to be const. + * libc/misc/unctrl.c: Defined arrays __unctrl and __unctrllen + to be const. + * libc/reent/Makefile.am: Added dependence for impure.o on impure.c and + libc/include/reent.h. + * libc/reent/Makefile.in: Regenerated. + * libc/stdio/vfprintf.c (_vfprintf_r): Defined arrays 'blanks' and 'zeroes' + to be const. + * libc/stdlib/mbtowc_r.c (_mbtowc_r): Defined arrays 'JIS_state_table' and + 'JIS_action_table' to be const. + * libm/math/s_lib_ver.c: define variable _LIB_VERSION to be const. + +Mon Oct 12 00:26:33 1998 Christopher Faylor + + * acinclude.m4: $with_target_subdir should default to '.' + or confusion results when configuring in same directory as sources. + * Regenerate all aclocal.m4 and configure files. + +Fri Oct 9 16:27:36 1998 Jeff Johnston + + * libc/stdlib/mallocr.c: Added 16 byte alignment support which + can be set by defining MALLOC_ALIGNMENT=16. Also added support + for platforms where sizeof(size_t) < sizeof(long) via + SIZE_T_SMALLER_THAN_LONG macro. + +Wed Oct 7 14:02:40 1998 Jeff Johnston + + * libc/include/time.h (CLOCKS_PER_SEC): Change CLOCKS_PER_SEC + to refer to _CLOCKS_PER_SEC_ and added including + which sets _CLOCKS_PER_SEC_ for selected machines. + * libc/include/machine/time.h: New file. + +Tue Oct 6 16:08:05 1998 Jeff Johnston + + * libc/syscalls/sysexecve.c: New file. + * libc/syscalls/sysgettod.c: New file. + * libc/syscalls/systimes.c: New file. + * libc/syscalls/Makefile.am: Added new objects. + * libc/syscalls/Makefile.in: Regenerated. + * libc/include/_syslist.h (_execve): Moved define in file. + * libc/include/reent.h: Added _execve_r declaration. + * libc/Makefile.in: Regenerated. + * libc/ctype/Makefile.in: Regenerated. + * libc/errno/Makefile.in: Regenerated. + * libc/locale/Makefile.in: Regenerated. + * libc/machine/Makefile.in: Regenerated. + * libc/misc/Makefile.in: Regenerated. + * libc/posix/Makefile.in: Regenerated. + * libc/reent/Makefile.in: Regenerated. + * libc/reent/execr.c (_execve_r): Added _execve_r function. + * libc/signal/Makefile.in: Regenerated. + * libc/stdio/Makefile.in: Regenerated. + * libc/time/Makefile.in: Regenerated. + * libc/unix/Makefile.in: Regenerated. + * libm/mathfp/Makefile.in: Regenerated. + +Tue Oct 6 14:14:05 1998 Jeff Johnston + + * libc/string/Makefile.in: Regenerated. + * libc/string/memchr.c (memchr): Moved code to reduce object size. + * libc/string/memcpy.c (memcpy): Ditto. + * libc/string/memcmp.c (memcmp): Ditto. + * libc/string/memset.c (memset): Ditto. + * libc/string/strchr.c (strchr): Ditto. + * libc/string/strcmp.c (strcmp): Ditto. + * libc/string/strcpy.c (strcpy): Ditto. + * libc/string/strlen.c (strlen): Ditto. + +Tue Oct 6 13:58:05 1998 Jeff Johnston + + * libm/acinclude.m4: Removed since newlib/acinclude.m4 can be used + to generate aclocal.m4. + * libm/Makefile.in: Regenerated. + * libm/aclocal.m4: Regenerated. + * libm/configure: Regenerated. + * libm/math/Makefile.in: Regenerated. + * libm/mathfp/Makefile.in: Regenerated. + +1998-09-25 Mark Salter + + * libc/include/machine/setjmp.h: Fixed test for mn10300 and mn10200 + by adding leading and trailing underscores to symbol names. + +Tue Sep 22 15:33:41 1998 Christopher Faylor + + * Makefile.in: Add default for AR_FLAGS. + +Tue Sep 22 15:02:49 1998 Christopher Faylor + + patch from ian@airs.com (Ian Taylor): + * acinclude.m4: Run AC_CANONICAL_BUILD explicitly before + NEWLIB_CONFIGURE so AC_CANONICAL_HOST will be run before it + is needed for detecting the build machine. Required for + cygwin native builds. + + * Regenerate all aclocal.m4 and configure files. + +Mon Sep 21 14:44:16 1998 Nick Clifton + + * libc/sys/arm/crt0.S: Prepend a period to all local labels that + used to start with LC. + +Thu Sep 17 18:18:11 1998 J"orn Rennecke + + * libc/machine/sh/setjmp.S (setjmp): Handle __SH4* like __SH3E__ . + (longjmp): Likewise. + +Thu Sep 17 16:25:33 1998 J"orn Rennecke + + * libc/machine/sh/memset.S (memset): Move copy from r4 to r4 before + the test for small number of bytes. + +Thu Sep 10 11:40:00 1998 Ranjith Kumaran + + * Makefile.am: Add --enable-newlib-hw-fp check. This builds the new + math library that uses floating point algorithms instead of the old + libm. + * Makefile.in: Regenerate with automake version 1.3b. + * configure: Rebuild. + * libm/Makefile.in: Regenerate with automake version 1.3b. + * libm/aclocal.m4: Regenerate. + * libm/configure: Rebuild. + * libm/configure.in: Add newlib_hw_fp definition and mathfp directory. + * libm/acinclude.m4: Define macros for configure.in. + * libm/config.h.in: Generate. + * libm/mathfp/Makefile.am: New file. + * libm/mathfp/Makefile.in: Generate. + * libm/mathfp/s_acos.c (acos): New file. + * libm/mathfp/s_asin.c (asin): New file. + * libm/mathfp/s_asine.c (asine): New file. + * libm/mathfp/s_atan.c (atan): New file. + * libm/mathfp/s_atan2.c (atan2): New file. + * libm/mathfp/s_atangent.c (atangent): New file. + * libm/mathfp/s_ceil.c (ceil): New file. + * libm/mathfp/s_copysign.c (copysign): New file. + * libm/mathfp/s_cos.c (cos): New file. + * libm/mathfp/s_cosh.c (cosh): New file. + * libm/mathfp/s_exp.c (exp): New file. + * libm/mathfp/s_fabs.c (fabs): New file. + * libm/mathfp/s_finite.c (finite): New file. + * libm/mathfp/s_floor.c (floor): New file. + * libm/mathfp/s_fmod.c (fmod): New file. + * libm/mathfp/s_frexp.c (frexp): New file. + * libm/mathfp/s_infconst.c: New file. + * libm/mathfp/s_isinf (isinf).c: New file. + * libm/mathfp/s_isnan.c (isnan): New file. + * libm/mathfp/s_ispos.c (ispos): New file. + * libm/mathfp/s_ldexp.c (ldexp): New file. + * libm/mathfp/s_log.c (log): New file. + * libm/mathfp/s_log10.c (log10): New file. + * libm/mathfp/s_logarithm.c (logarithm): New file. + * libm/mathfp/s_mathcnst.c: New file. + * libm/mathfp/s_modf (modf).c: New file. + * libm/mathfp/s_numtest.c (numtest): New file. + * libm/mathfp/s_pow.c (pow): New file. + * libm/mathfp/s_scalbn.c (scalbn): New file. + * libm/mathfp/s_sin (sin).c: New file. + * libm/mathfp/s_sine.c (sine): New file. + * libm/mathfp/s_sineh.c (sineh): New file. + * libm/mathfp/s_sinf.c (sinf): New file. + * libm/mathfp/s_sinh.c (sinh): New file. + * libm/mathfp/s_sqrt.c (sqrt): New file. + * libm/mathfp/s_tan.c (tan): New file. + * libm/mathfp/s_tanh.c (tanh): New file. + * libm/mathfp/sf_acos.c (acosf): New file. + * libm/mathfp/sf_asin.c (asinf): New file. + * libm/mathfp/sf_asine.c (asinef): New file. + * libm/mathfp/sf_atan.c (atanf): New file. + * libm/mathfp/sf_atan2.c (atan2f): New file. + * libm/mathfp/sf_atangent.c (atangent): New file. + * libm/mathfp/sf_ceil.c (ceilf): New file. + * libm/mathfp/sf_copysign.c (copysignf): New file. + * libm/mathfp/sf_cos.c (cosf): New file. + * libm/mathfp/sf_cosh.c (coshf): New file. + * libm/mathfp/sf_exp.c (expf): New file. + * libm/mathfp/sf_fabs.c (fabsf): New file. + * libm/mathfp/sf_finite.c (finitef): New file. + * libm/mathfp/sf_floor.c (floorf): New file. + * libm/mathfp/sf_fmod.c (fmodf): New file. + * libm/mathfp/sf_frexp.c (frexpf): New file. + * libm/mathfp/sf_isinf.c (isinff): New file. + * libm/mathfp/sf_isnan.c (isnanf): New file. + * libm/mathfp/sf_ispos.c (isposf): New file. + * libm/mathfp/sf_ldexp.c (ldexpf): New file. + * libm/mathfp/sf_log.c (logf): New file. + * libm/mathfp/sf_log10.c (log10f): New file. + * libm/mathfp/sf_logarithm.c (logarithmf): New file. + * libm/mathfp/sf_modf.c (modff): New file. + * libm/mathfp/sf_numtest.c (numtestf): New file. + * libm/mathfp/sf_pow.c (powf): New file. + * libm/mathfp/sf_scalbn.c (scalbnf): New file. + * libm/mathfp/sf_sin.c (sinf): New file. + * libm/mathfp/sf_sine.c (sinef): New file. + * libm/mathfp/sf_sineh.c (sinehf): New file. + * libm/mathfp/sf_sinh.c (sinhf): New file. + * libm/mathfp/sf_sqrt.c (sqrtf): New file. + * libm/mathfp/sf_tan.c (tanf): New file. + * libm/mathfp/sf_tanh.c (tanhf): New file. + * libm/mathfp/zmath.h: New file. + +Wed Sep 2 02:49:03 1998 J"orn Rennecke + + * libc/machine/sh/strcmp.S (L_char_loop): Re-load r0 at loop + exit if it has been overwritten by pre-fetching in delay slot. + +1998-09-01 Michael Meissner + + * Makefile.am (tooldir): Add in host_alias, so that multilib + libraries are installed in the directory the compiler looks in. + * Makefile.in: Regenerate. + + * libc/stdlib/Makefile.in: Regenerate with automake version 1.3b. + +Mon Aug 31 11:39:31 1998 Jeff Johnston + + * libc/machine/mn10300/memcpy.S (_memcpy): Move alignment test + ahead of test for number of bytes being moved. + +Thu Aug 27 14:07:53 1998 Christopher Faylor + + * libc/include/sys/unistd.h: Nothing special needed for + _exit under cygwin. + +Wed Aug 26 15:05:21 1998 Nick Clifton + + * libc/sys/arm/syscalls.c (_sbrk): Rename '_end' to 'end' to + conform to user label naming conventions. + +Mon Aug 24 14:46:19 1998 Geoffrey Noer + + * libc/sys/cygwin32/sys/utime.h: variable names in + protos should start with two leading underscores + * libc/include/string.h: ditto + * libc/include/sys/signal.h: ditto + * libc/include/sys/stat.h: ditto + * libc/include/sys/time.h: ditto + * libc/include/sys/unistd.h: ditto + * libc/include/ctype.h: ditto + * libc/include/stdlib.h: ditto + * libc/include/sys/reent.h: struct _atexit function ptr takes a + void, same with _sig_func. + +Fri Aug 21 14:44:14 1998 Jeff Johnston + + * libc/stdlib/mbtowc_r.c (_mbtowc_r): Added preprocessor checks + for MB_CAPABLE to reduce code size when newlib is not configured + with --enable-newlib-mb. + * libc/stdlib/Makefile.am: Specified -fshort-enums when building + mbtowc_r.o to minimize size. + * libc/stdlib/Makefile.in: Rebuild. + +Wed Aug 19 16:20:13 1998 Jim Wilson + + * libc/sys/sparc64/Makefile.am (.S_r.o, .c_r.o): Change -DREENTRANT + to -DREENT. + * libc/sys/sparc64/Makefile.in: Rebuild. + +Tue Aug 18 22:38:29 1998 Ian Lance Taylor + + * Makefile.am (MAKEOVERRIDES): Define. + * Makefile.in: Rebuild. + +Tue Aug 18 12:38:47 1998 Jim Wilson + + * libc/sys/sparc64/sys/stat.h (stat): Add const. + +Mon Aug 17 22:27:06 1998 Ian Lance Taylor + + * acinclude.m4 (NEWLIB_CONFIGURE): Use top_builddir in + newlib_cflags when looking for targ-include. + * */aclocal.m4, */configure: Rebuild. + +Fri Jul 31 10:57:42 1998 Catherine Moore + + * libc/sys/arm/syscalls.c (_sbrk): Change "__end__" + to "_end". + +Wed Jul 29 00:02:01 1998 Mark Alexander + + * libc/include/sys/config.h: Define __IEEE_LITTLE_ENDIAN + on SPARCs with little-endian data. + * libc/include/machine/ieeefp.h: Ditto. + +Wed Jul 22 18:00:10 1998 Ian Lance Taylor + + * acinclude.m4: Handle a relative srcdir correctly when setting + newlib_cflags. + * */aclocal.m4, */configure: Rebuild. + +Wed Jul 22 17:11:33 1998 Jeff Johnston + + * libm/math/wrf_lgamma.c (lgammaf_r): Initialize exc.err to 0 and + also set exc.arg1, exc.arg2 appropriately in case matherr is supplied. + * libm/math/wrf_gamma.c (gammaf_r): ditto + * libm/math/wr_lgamma.c (lgamma_r): ditto + * libm/math/wr_gamma.c (gamma_r): ditto + * libm/math/wf_sqrt.c (sqrtf): ditto + * libm/math/wf_sinh.c (sinhf): ditto + * libm/math/wf_scalb.c (scalbf): ditto + * libm/math/wf_remainder.c (remainderf): ditto + * libm/math/wf_pow.c (powf): ditto + * libm/math/wf_log10.c (log10f): ditto + * libm/math/wf_log.c (logf): ditto + * libm/math/wf_lgamma.c (lgammaf): ditto + * libm/math/wf_jn.c (jnf, ynf): ditto + * libm/math/wf_j1.c (j1f, y1f): ditto + * libm/math/wf_j0.c (j0f, y0f): ditto + * libm/math/wf_hypot.c (hypotf): ditto + * libm/math/wf_gamma.c (gammaf): ditto + * libm/math/wf_fmod.c (fmodf): ditto + * libm/math/wf_exp.c (expf): ditto + * libm/math/wf_cosh.c (coshf): ditto + * libm/math/wf_atanh.c (atanhf): ditto + * libm/math/wf_atan2f.c (atan2f): ditto + * libm/math/wf_asin.c (asinf): ditto + * libm/math/wf_acosh.c (acoshf): ditto + * libm/math/wf_acos.c (acosf): ditto + * libm/math/w_sqrt.c (sqrt): ditto + * libm/math/w_sinh.c (sinh): ditto + * libm/math/w_scalb.c (scalb): ditto + * libm/math/w_remainder.c (remainder): ditto + * libm/math/w_pow.c (pow): ditto + * libm/math/w_log10.c (log10): ditto + * libm/math/w_log.c (log): ditto + * libm/math/w_lgamma.c (lgamma): ditto + * libm/math/w_jn.c (jn, yn): ditto + * libm/math/w_j1.c (j1, y1): ditto + * libm/math/w_j0.c (j0, y0): ditto + * libm/math/w_hypot.c (hypot): ditto + * libm/math/w_gamma.c (gamma): ditto + * libm/math/w_fmod.c (fmod): ditto + * libm/math/w_exp.c (exp): ditto + * libm/math/w_cosh.c (cosh): ditto + * libm/math/w_atanh.c (atanh): ditto + * libm/math/w_atan2f.c (atan2): ditto + * libm/math/w_asin.c (asin): ditto + * libm/math/w_acosh.c (acosh): ditto + * libm/math/w_acos.c (acos): ditto + +Tue Jul 21 12:34:54 1998 Ian Lance Taylor + + * libm/math/Makefile.am (src): Add w_cabs.c and w_drem.c. + (fsrc): Add wf_cabs.c and wf_drem.c. + * libm/math/Makefile.in: Rebuild. + + * Makefile.am (AM_MAKEFLAGS): Add CFLAGS_FOR_BUILD. Remove some + unused directory variables. Remove duplicate CFLAGS. + * Makefile.in: Rebuild. + + * doc/Makefile.am ($(MKDOC)): Don't use $(CFLAGS) when building + with $(CC_FOR_BUILD). + (makedoc.o): Likewise. + * doc/Makefile.in: Rebuild. + + * libc/sys/cygwin32/Makefile.am (EXTRA_LIBRARIES): Define, to + force a definition of COMPILE. + (libfoo_a_SOURCES): Define. + * libc/sys/cygwin32/Makefile.in: Rebuild. + * libc/sys/tic80/Makefile.am (EXTRA_LIBRARIES): Define, to + force a definition of COMPILE. + (libfoo_a_SOURCES): Define. + * libc/sys/tic80/Makefile.in: Rebuild. + +Mon Jul 20 20:49:24 1998 Christopher Faylor + + * libc/include/sys/fcntl.h: Add O_NOINHERIT, Win32-specific + flag. + +Fri Jul 17 16:13:16 1998 Ian Lance Taylor + + * Build using autoconf and automake. Added many Makefile.am and + configure.in files, plus generated files. Old configure.in files + and all old Makefile.in files completely replaced. Removed + host/any. Added acinclude.m4 and configure.host. + +Sat Jul 11 18:14:49 1998 Felix Lee + + * libc/stdio/vfprintf.c: enable long long support, sometimes. + * configure.in (*-*-cygwin32): add -DWANT_PRINTF_LONG_LONG. + +Tue Jul 7 01:51:55 1998 J"orn Rennecke + + * libc/machine/sh/strcmp.S, libc/machine/sh/strcpy.S: New files. + * libc/machine/sh/Makefile.in: Add rules for new files. + +Tue Jul 7 01:40:55 1998 J"orn Rennecke + + * libc/machine/sh/asm.h (SL, DELAYED_BRANCHES): Define. + * libc/machine/sh/memset.S (memset): Remove uses of dt; shorten code. + * libc/machine/sh/memcpy.S (SL, DELAYED_BRANCHES): Don't define. + +Thu Jul 2 10:33:16 1998 Nick Clifton + + * libc/sys/arm/syscalls.c (_exit): Add comment, noting that exit + code is ignored. + +Wed Jun 24 13:56:54 1998 Jeff Johnston + + * libc/stdio/tmpnam.c (_tmpnam_r): Changed routine to use + internal static buffer when s is NULL, as prescribed by ANSI. + +1998-06-22 Vladimir N. Makarov + + * libc/sys/h8300hms/Makefile.in (OFILES): malloc.o has been + removed. + * libc/sys/h8300hms/malloc.c: has been removed. Now malloc.c from + libc/stdlib will be used for h8300hms. + +Thu Jun 18 16:56:05 1998 Jeff Johnston + + * libc/machine/mn10300/strlen.S (_strlen): New optimized assembler + version that can be built either for speed or size. + * libc/machine/mn10300/memset.S (_memset): ditto + * libc/machine/mn10300/memchr.S (_memchr): ditto + * libc/machine/mn10300/memcpy.S (_memcpy): ditto + * libc/machine/mn10300/memcmp.S (_memcmp): ditto + * libc/machine/mn10300/strchr.S (_strchr): ditto + * libc/machine/mn10300/strcmp.S (_strcmp): ditto + * libc/machine/mn10300/strcpy.S (_strcpy): ditto + * libc/machine/mn10300/Makefile.in: Added entries for + memchr.o, memcmp.o, memcpy.o, memset.o, strchr.o, + strcmp.o, strcpy.o, and strlen.o. + +Wed Jun 17 12:50:26 1998 Mark Alexander + + * configure.in: Don't use libc/sys/sysmec for MN10200; it's + been replaced with libgloss/mn10200. + +Fri Jun 12 14:34:39 1998 Michael Meissner + + * libc/string/strchr.c (strchr): Make s a constant pointer to + avoid warning. + +Tue Jun 9 16:29:30 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * configure.in (target == arm* or thumb*): Define ARM_RDI_MONITOR + instead of ARM_RDP_MONITOR (sys/libc/arm/crt0.S to assume Angel + board SWIs instead of Demon board SWIs). + +Thu Jun 4 12:16:46 1998 Michael Meissner + + * libc/string/strncat.c (strncat): Make -Os act the same as + PREFER_SIZE_OVER_SPEED being defined. + +Wed Jun 3 17:52:33 1998 Michael Meissner + + * libc/string/memchr.c (memchr): Make -Os act the same as + PREFER_SIZE_OVER_SPEED being defined. + * libc/string/memcmp.c (memcmp): Ditto. + * libc/string/memcpy.c (memcpy): Ditto. + * libc/string/memset.c (memset): Ditto. + * libc/string/strcat.c (strcat): Ditto. + * libc/string/strchr.c (strchr): Ditto. + * libc/string/strcmp.c (strcmp): Ditto. + * libc/string/strcpy.c (strcpy): Ditto. + * libc/string/strlen.c (strlen): Ditto. + * libc/string/strncat.c (strncat): Ditto. + * libc/string/strncmp.c (strncmp): Ditto. + * libc/string/strncpy.c (strncpy): Ditto. + +Mon Jun 1 15:25:07 1998 Geoffrey Noer + + * libc/include/sys/itimer.h: remove + * libc/include/sys/time.h: itimer stuff should be here + +Mon Jun 1 16:31:29 1998 Jeff Johnston + + * libc/stdio/vfprintf.c (cvt): Changed code to look at sign + bit instead of comparing to 0 so -0.0 can be printed correctly. + +Sat May 30 09:33:51 1998 J"orn Rennecke + + * libc/stdlib/mprec.c (b2d): Inilialize d in non-VAX case too. + +Fri May 29 22:25:10 1998 Geoffrey Noer + + * libc/include/sys/unistd.h: fix sync() proto + * libc/include/sys/fcntl.h: remove _close which is already + defined in unistd.h. + * libc/include/sys/time.h: add getitimer proto + +Fri May 29 16:10:28 1998 Geoffrey Noer + + * libc/string/strchr.c: convert arg to unsigned char + * libc/include/stdlib.h: add protos for random, srandom + * libc/include/sys/stat.h: add lstat proto + * libc/include/sys/time.h: add setitimer proto + * libc/include/sys/unistd.h: add readlink, symlink protos + * libc/include/process.h: instead of including windows.h and using + HANDLEs in sexec protos, just use void *s. Need to include + sys/types.h. + +Fri May 29 03:04:29 1998 Geoffrey Noer + + * libc/include/sys/fcntl.h: add _close proto for Cygwin32 + +Thu May 28 16:34:21 1998 Geoffrey Noer + + * libc/include/process.h: add secure exec protos + +Wed May 27 13:54:51 1998 Jeffrey A Law (law@cygnus.com) + + * libc/stdlib/dtoa.c (_dtoa_r): Use "double_union" for variables + which are accessed as both doubles and integers. + * libc/stdlib/mprec.c (ulp, b2d, ratio): Likewise. + * libc/stdlib/strtod.c (_strtod_r): Likewise. + * libc/stdlib/mprec.h: Add "union double_union" and change + word0/word1 macros to use it. + +Tue May 26 18:04:21 1998 Geoffrey Noer + + * libc/include/sys/signal.h: add __cplusplus wrapper + +Tue May 26 15:10:22 1998 Geoffrey Noer + + * libc/include/sys/utime.h: new generic file that gets replaced by + libc/sys/SYSDIR/sys/utime.h on systems that support the utime + function. + * sys/cygwin32/sys/utime.h: use _EXFUN in utime proto + * libc/include/time.h: remove duplicate utime proto + * libc/include/utime.h: add comment + +Sun May 24 23:56:20 1998 Christopher Faylor + + * libc/include/sys/time.h: Add missing include to + allow use of _EXFUN. Remove times function that is + already defined in times.h. + +Sun May 24 01:32:14 1998 Christopher Faylor + + * libc/include/time.h: Fix typo in tzset. + +Fri May 22 17:00:48 1998 Geoffrey Noer + + * libc/include/sys/time.h: add missing Cygwin32 function protos + * libc/include/sys/unistd.h: ditto + * libc/include/time.h: ditto + +Wed May 20 20:35:11 1998 Geoffrey Noer + + * libc/sys/cygwin32/sys/param.h: add protected NULL def, remove + FIXME. + * libc/include/sys/types.h: add a new __MS_types__ section + to define vm_offset_t, vm_size_t, int32_t et al, register_t, + __BIT_TYPES_DEFINED__. + +Wed May 20 18:49:21 1998 Geoffrey Noer + + * libc/sys/cygwin32/sys/param.h: move here from winsup/include/sys + since it overrides the one in libc/include/sys. Also, start + including types.h. + +Wed May 20 14:45:40 1998 Geoffrey Noer + + * libm/math/Makefile.in: add s_signgam.o to obj list + +Tue May 19 11:57:11 1998 Jeff Johnston + + * libc/include/sys/reent.h (_REENT_INIT): Initialize current locale to "C". + +Mon May 18 22:36:12 1998 Christopher Faylor + + * libc/include/sys/signal.h: cygwin32 exports sig{empty,add}set, + so don't use defines. + +Mon May 18 19:01:02 1998 Michael Meissner + + * libc/sys/d10v/crt0.S: Use correct stab for 16-bit ints. + +Sun May 17 18:40:32 1998 Frank Ch. Eigler + + * libc/stdlib/mbtowc_r.c (_mbtowc_r): Accept a NULL + _current_locale as default locale. + +Sat May 16 21:59:59 1998 Bob Manson + + * libc/stdlib/mallocr.c (mALLOc): Add explicit tests for + insufficient space in a chunk. + +Tue May 12 14:41:01 1998 Jeff Johnston + + * configure.in (links): Added check for --enable-newlib-mb configure + option which defines the MB_CAPABLE macro. + * libc/locale/locale.c (_setlocale_r): Added support for setting + LC_CTYPE to "C-JIS", "C-SJIS" or "C-EUCJP", when MB_CAPABLE is + defined. + * libc/stdlib/mbtowc_r.c (_mbtowc_r): New function _mbtowc_r that + implements mbtowc() with multibyte support for JIS, SJIS, and EUC-JP. + * libc/stdlib/wctomb_r.c (_wctomb_r): New function _wctomb_r that + implements wctomb() with multibyte support for JIS, SJIS, and EUC-JP. + * libc/stdlib/mbstowcs_r.c (_mbstowcs_r): New function _mbstowcs_r that + implements mbstowcs() with multibyte support for JIS, SJIS, and EUC-JP. + * libc/stdlib/wcstombs_r.c (_wcstombs_r): New function _wcstomb_r that implements + wcstombs() with multibyte support for JIS, SJIS, and EUC-JP. + * libc/stdlib/Makefile.in: Added new multibyte + routines: _mbtowc_r(), _wctomb_r(), _mbstowcs_r(), and _wcstombs_r(). + * libc/include/stdlib.h: Added declarations of _mbtowc_r(), _wctomb_r(), + _mbstowcs_r(), and _wcstombs_r(). + * libc/stdlib/mbctype.h: New internal header file that contains macros to test + for JIS, SJIS, and EUC-JP characters. + * libc/stdlib/mblen.c (mblen): Added code to call _mbtowc_r() if + MB_CAPABLE defined. + * libc/stdlib/mbtowc.c (mbtowc): Added code to call _mbtowc_r() if + MB_CAPABLE defined. + * libc/stdlib/wctomb.c (wctomb): Added code to call _wctomb_r() if + MB_CAPABLE defined. + * libc/stdlib/mbstowcs.c (mbstowcs): Added code to call _mbstowcs_r() + if MB_CAPABLE defined. + * libc/stdlib/wcstombs.c (wcstombs): Added code to call _wcstombs_r() + if MB_CAPABLE defined. + * libc/stdio/vfscanf.c (__svfscanf): Added multibyte tolerance + to the format string processing when MB_CAPABLE. + * libc/stdio/vfprintf.c (_VFPRINTF_R): Changed mbtowc() call to + call _mbtowc_r(). + +Tue May 5 16:07:23 1998 Nick Clifton + + The following modifications are courtesy of Anthony Thompson, + athompson@cambridge.arm.com: + * libc/sys/arm/syscalls.c: Initialise and track stdin/out/err for + boith RDI and RDP monitors. + * libc/sys/arm/crt0.S: Call initialise_monitor_handles() for both + RDI and RDP monitors. + +Wed Apr 29 15:22:15 1998 Jeff Johnston + + * configure.in (links): Added -DHAVE_GETTIMEOFDAY for arm and thumb. + * libc/sys/arm/syscalls.c (_gettimeofday _times): Added functions. + (_swiopen): Fixed open flags to treat write with append as just append. + (_swilseek): Fixed lseek support to properly handle offsets from SEEK_END. + * libc/sys/arm/sys/param.h: New file to override param.h for ARM. + +Fri Apr 24 18:00:09 1998 J"orn Rennecke + + * libc/machine/sh/memcpy.S (L_odddst, big endian version): + When needing to transfer an initial 2-byte-word, store as + two single bytes. + +Wed Apr 22 17:56:03 1998 J"orn Rennecke + + * libc/sys/sh/crt0.S (start): Handle __SH4_SINGLE_ONLY__ like + __SH3E__ . + * libc/machine/sh/memcpy.S (DELAYED_BRANCHES, SL): Likewise. + * libc/include/machine/ieeefp.h (_DOUBLE_IS_32BITS): Likewise. + +Wed Apr 22 12:28:03 1998 Michael Meissner + + * configure.in (target_cflags): If --enable-target-optspace, use + -Os to compile newlib rather than -O2. Default to using -Os for + d10v, d30v and m32r if --{enable,disable}-target-optspace is not + used. + +Tue Apr 21 23:13:34 1998 Geoffrey Noer + + * libc/include/machine/setjmp.h: change sigsetjmp and + siglongjmp definitions to use an array instead of a struct + for __CYGWIN32__ + +Tue Apr 14 11:47:47 1998 Doug Evans + + * libc/reent/impure.c (__ATTRIBUTE_IMPURE_DATA__): Fix spelling. + +Mon Apr 6 15:05:08 1998 Jonathan Larmour + + * libc/string/strxfrm.c: fix to get correct return value + +Wed Apr 1 16:09:05 1998 Nick Clifton + + * libc/sys/arm/crt0.S: Set top of RAM to be 0x800000 for PE + builds. Make mode change labels global so that they will be seen + by the debugger. + +Wed Mar 18 09:45:10 1998 Nick Clifton + + * configure.in (links): Do not use ARM debiugging protocols for PE + builds. + + * libc/sys/arm/syscalls.c (_sbrk): Add "_sbrk: " to error + message. + +Fri Mar 13 11:24:34 1998 Jeff Johnston + + * libc/stdio/findfp.c (__sinit): Made stdout default to + line buffered mode as defined by ANSI. + +Tue Mar 10 11:41:26 1997 Bob Manson + + * libc/include/sys/itimer.h: New file. + + * libc/signal/signal.c (__sigtramp_r,__sigtramp): New functions. + +Mon Mar 9 14:19:26 1998 J"orn Rennecke + + * libc/machine/sh/memcpy.S: (_memcpy): Fix for execute/memcpy-1.c + failure. + +Fri Feb 27 13:56:10 1998 Michael Meissner + + * libc/machine/d30v/setjmp.S (longjmp): Fix order of parallel + insns. + +Wed Feb 25 09:29:54 1998 Nick Clifton + + * libc/sys/arm/syscalls.c (_open): Add varags to conform to prototype. + +Tue Feb 24 18:00:13 1998 Michael Meissner + + * libc/machine/d30v/{setjmp.S,Makefile.in}: New files for D30V + support. + + * libc/include/machine/setjmp.h: Add D30V support. + + * configure.in (d30v-*): Add d30v machine directory. + +Mon Feb 23 09:32:58 1998 Mark Alexander + + * configure.in: Don't use libc/sys/sysmec for MN10300; it's + been replaced with libgloss/mn10300. + +Sat Feb 21 17:44:43 1998 Geoffrey Noer + + * libc/stdlib/mallocr.c: remove __malloc_copy routine now that + it is no longer needed. + +Thu Feb 19 16:15:10 1998 Geoffrey Noer + + * libc/include/sys/signal.h: add sigpause proto for Cygwin32 + +Wed Feb 18 23:51:08 1998 Geoffrey Noer + + * libc/stdio/fdopen.c (fdopen): Make all writes go to the end of + the file when O_APPEND is set, wherever the EOF happens to be at + that time. + +Wed Feb 18 23:25:02 1998 Geoffrey Noer + + patch from cgf@bbc.com (Christopher Faylor): + * libc/stdio/freopen.c (freopen): Conform to standard UNIX + convention of closing fp prior to attempting to open the file + argument. This allows correct operation when reopening + stdin/stdout/stderr. Replaces last freopen.c patch. + +Wed Feb 18 16:27:40 1998 Geoffrey Noer + + patch from cgf@bbc.com (Christopher Faylor): + * libc/stdio/freopen.c: freopen was not preserving the fd + of the stream being operated on. This confuses programs that + expect that the handles for stdout and stderr will be 1 and 2. + +Mon Feb 16 23:34:07 1998 Andrew Cagney + + * libc/sys/d10v/crt0.S (_start): Set PSW{SW} - select SPU. + +Thu Feb 12 15:09:20 1998 Ranjith Kumaran + + * libc/sys/go32/longjmp.S: Fix longjmp to not return 0. + +Wed Feb 11 17:50:45 1998 Jeff Johnston + + * libc/machine/powerpc/setjmp.S (setjmp, longjmp): Alignment code + altered to not use a branch. Also added hint that last + bclr in longjmp will likely result in branch. + + +Mon Feb 9 03:44:02 1998 Geoffrey Noer + + * libc/sys/cygwin32/crt0.c: add missing args to main() extern + +Fri Feb 6 16:32:32 1998 Nick Clifton + + * libc/sys/sysnecv850/crt0.S (_start): Initialise _ctbp even for + v850 builds. + + * configure.in: Add -msmall-sld to target_cflags for v850 builds. + +Wed Feb 4 16:56:20 1998 Jeff Johnston + + * libc/machine/powerpc/setjmp.S (longjmp): Fixed code + that loads FR14 to specify offset of 8 rather than 4 + so it loads from offset 96 (where setjmp stored it). + +Tue Feb 3 18:08:34 1998 Jeff Johnston + + * libc/machine/sh/memcpy.S: (_memcpy): Update to + latest version supplied by customer. + * libc/machine/sh/memset.S (_memset): Ditto. + +Mon Feb 2 16:20:39 1998 Nick Clifton + + * libc/sys/sysnecv850/Makefile.in (OFILES): Add link.o (for + PR14730). + +Mon Feb 2 15:13:26 1998 Geoffrey Noer + + * libc/include/string.h: remove redefinition of ffs + +Wed Jan 28 13:30:14 1998 Geoffrey Noer + + * libc/include/sys/signal.h: include _ansi.h so _EXFUN is + defined + +Wed Jan 28 10:38:34 1998 Jeff Johnston + + * libc/machine/tic80/setjmp.S: Adding _setjmp to allow + TI Libraries to link to libc.a + +Sat Jan 24 10:15:56 1998 Michael Meissner + + * libc/include/sys/fcntl.h (_open,_fcntl): Add prototypes. + * libc/include/sys/stat.h (_{,f}stat): Ditto. + * libc/include/sys/wait.h (_wait): Ditto. + * libc/include/sys/unistd.h (_close,_fork,_getpid): Ditto. + (_link,_lseek,_read,_sbrk,_unlink,_write): Ditto. + +Fri Jan 23 11:32:10 1998 Michael Meissner + + * libc/machine/d10v/setjmp.S: Change to new ABI. Add simple + minded stabs so function name shows up when running the simulator + with -t. + * libc/sys/d10v/{crt0,trap}.S: Ditto. + +Thu Jan 22 15:57:14 1998 Fred Fish + + * libc/sys/d10v/trap.S: Change syscalls to use trap 15. + * libc/sys/d10v/crt0.S: Use R6 where we used to use R2. + Use R5 where we used to use R3. + +Wed Jan 21 14:22:23 1998 Bill Moyer + + * libc/stdlib/getopt.c (getopt): replaced __progname + with nargv[0] to improve portability to imbedded systems. + +Thu Jan 15 12:32:38 1998 Nick Clifton + + * libc/sys/arm/syscalls.c (initialise_angel_handles): Applied + patch supplied by Tont.Thompson@arm.com to fix the creation of the + stdout file. + +Wed Jan 14 13:00:19 1998 Ian Lance Taylor + + * libc/stdio/tmpnam.c (worker): Generate a different file name + each time. + + * libc/posix/popen.c (popen): If __CYGWIN32__, and execing /bin/sh + fails, try an execlp for sh. + + * host/any (INCLUDES): If target_os is cygwin32, then add a -I + option for the winsup include directory. + +Wed Jan 7 17:02:58 1998 Nick Clifton + + * libc/sys/arm/syscalls.c: Applied patches for Angel based remote + debugging interface from Tony.Thompson@arm.com. + + * libc/sys/arm/crt0.S (_mainCRTStartup): ditto. + * libc/sys/arm/swi.h: ditto. + +Tue Jan 6 14:15:10 1998 Geoffrey Noer + + * libc/sys/cygwin32/sys/dirent.h: add __d_dirhash field to + DIR struct used for readdir hashes. + +Thu Jan 1 11:22:22 1998 Jeffrey A Law (law@cygnus.com) + + * libc/string/strchr.c: Use "unsigned chars" as necessary. + +Wed Dec 31 04:25:30 1997 Jeffrey A Law (law@cygnus.com) + + * libc/stdlib/mallocr.c (idx2binblock): Don't lose on 16bit + integer targets. + +Sat Dec 13 15:11:06 1997 Ian Lance Taylor + + * libc/stdlib/mallocr.c (__malloc_copy): New function, compiled if + INTERNAL_NEWLIB and __CYGWIN32__ and DEFINE_MALLOC. + * libc/include/malloc.h: Add extern "C" if __cplusplus. + (__malloc_copy): Declare. + +Wed Dec 10 12:15:54 1997 Ian Lance Taylor + + * libc/stdlib/mallocr.c: If INTERNAL_NEWLIB, include + . + (POINTER_UINT): Define. + (DEFAULT_TRIM_THRESHOLD): Mark constants as long. + (MALLOC_ALIGNMENT): Don't define if already defined. + (malloc_extend_top): Cast pointers to POINTER_UINT, not unsigned + long. + +Tue Dec 9 19:23:42 1997 Michael Meissner + + * libc/string/memset.c (memset): Fiddle with code so that the long + value being stored is not a stack value. Unroll storing longs 4 + times. + +Tue Dec 9 14:13:18 1997 Jeff Johnston + + * Reduce code size for libm modules. + * libm/math/w_sqrt.c (sqrt): Remove call to kernel_standard + and simply move code into sqrt. + * libm/math/wrf_lgamma.c (lgammaf_r): Likewise. + * libm/math/wr_lgamma.c (lgamma_r): Likewise. + * libm/math/wrf_gamma.c (gammaf_r): Likewise. + * libm/math/wr_gamma.c (gamma_r): Likewise. + * libm/math/wf_sinh.c (sinfh): Likewise. + * libm/math/w_sinh.c (sinh): Likewise. + * libm/math/wf_scalb.c (scalbf): Likewise. + * libm/math/w_scalb.c (scalb): Likewise. + * libm/math/wf_remainder.c (remainderf): Likewise. + * libm/math/w_remainder.c (remainder): Likewise. + * libm/math/wf_pow.c (powf): Likewise. + * libm/math/w_pow.c (pow): Likewise. + * libm/math/wf_log10.c (log10f): Likewise. + * libm/math/w_log10.c (log10): Likewise. + * libm/math/wf_log.c (logf): Likewise. + * libm/math/w_log.c (log): Likewise. + * libm/math/w_lgamma.c (lgamma): Likewise. + * libm/math/wf_lgamma.c (lgammaf): Likewise. + * libm/math/wf_jn.c (jnf): Likewise. + * libm/math/w_jn.c (jn): Likewise. + * libm/math/wf_j1.c (j1f): Likewise. + * libm/math/w_j1.c (j1): Likewise. + * libm/math/wf_j0.c (j0f): Likewise. + * libm/math/w_j0.c (j0): Likewise. + * libm/math/wf_hypot.c (hypotf): Likewise. + * libm/math/w_hypot.c (hypot): Likewise. + * libm/math/wf_gamma.c (gammaf): Likewise. + * libm/math/w_gamma.c (gamma): Likewise. + * libm/math/wf_fmod.c (fmodf): Likewise. + * libm/math/w_fmod.c (fmod): Likewise. + * libm/math/wf_exp.c (expf): Likewise. + * libm/math/w_exp.c (exp): Likewise. + * libm/math/wf_cosh.c (coshf): Likewise. + * libm/math/w_cosh.c (cosh): Likewise. + * libm/math/wf_atanh.c (atanhf): Likewise. + * libm/math/w_atanh.c (atanh): Likewise. + * libm/math/wf_atan2.c (atan2f): Likewise. + * libm/math/w_atan2.c (atan2): Likewise. + * libm/math/wf_asin.c (asinf): Likewise. + * libm/math/w_asin.c (asin): Likewise. + * libm/math/wf_acosh.c (acoshf): Likewise. + * libm/math/w_acosh.c (acosh): Likewise. + * libm/math/wf_acos.c (asocf): Likewise. + * libm/math/w_acos.c (acos): Likewise. + * libm/math/wf_sqrt.c (sqrtf): Likewise. + * libm/math/k_standard.c (_k_standard): Don't require SVID behavior + for embedded systems. + +Mon Dec 8 12:12:58 1997 Ian Lance Taylor + + * libc/stdlib/mallocr.c (malloc_extend_top): Add patch from Doug + Lea in case of a foreign sbrk. + +Fri Dec 5 23:27:28 1997 Ian Lance Taylor + + Incorporate Doug Lea's malloc: + * libc/stdlib/mallocr.c: Completely replaced. + * libc/stdlib/malloc.c: Document malloc_usable_size and memalign. + (realloc): Remove. + * libc/stdlib/calloc.c (calloc): Just call _calloc_r. + * libc/stdlib/mstats.c: Document mallinfo, malloc_stats, and + mallopt. + (mallinfo, malloc_stats, mallopt): New functions. + (_mstats_r): Just call _malloc_stats_r. + * libc/stdlib/malign.c: New file. + * libc/stdlib/mlock.c: New file. + * libc/stdlib/msize.c: New file. + * libc/stdlib/mtrim.c: New file. + * libc/stdlib/realloc.c: New file. + * libc/stdlib/valloc.c: New file. + * libc/stdlib/malloc.h: Remove. + * libc/stdlib/callocr.c: Remove. + * libc/stdlib/Makefile.in (OFILES): Add cfreer.o, freer.o, + malign.o, malignr.o, mallinfor.o, malloptr.o, mallstatsr.o, + mlock.o, msize.o, msizer.o, mtrim.o, pvallocr.o, realloc.o, + reallocr.o, valloc.o, vallocr.o. + (CHEWOUT_FILES): Add mlock.def, mstats.def. + (MALLOC_CFLAGS): New variable. + (mallocr.o): New target, build from mallocr.c. + (freer.o, reallocr.o, callocr.o, cfreer.o, malignr.o): Likewise. + (vallocr.o, pvallocr.o, mallinfor.o, mallstatsr.o): Likewise. + (msizer.o, malloptr.o): Likewise. + (malign.o, mlock.o, msize.o, mtrim.o, realloc.o): New targets. + (valloc.o): New target. + * libc/stdlib/stdlib.tex: Include mlock.def and mstats.def. + * libc/include/malloc.h: Declare struct mallinfo, and new + routines. + * libc/include/stdlib.h (cfree): Correct declaration. + +Tue Dec 2 10:12:16 1997 Nick Clifton + + * libc/include/machine/setjmp.h: Add support for Thumb target. + + * libc/include/machine/ieeefp.h: Add support for Thumb target. + + * configure.in (links): Add support for Thumb target. + +Wed Nov 26 09:56:17 1997 Nick Clifton + + * libc/sys/arm/setjmp.S: Updated with version from branch. + +Thu Nov 20 01:21:43 1997 Geoffrey Noer + + * libc/include/stdio.h: add POSIX-required define L_ctermid + for ctermid + +Wed Nov 19 16:11:40 1997 Michael Meissner + + * configure.in (d30v-*-*): Define ABORT_MESSAGE, SMALL_MEMORY, in + addition to MISSING_SYSCALL_NAMES. + +Mon Nov 17 20:05:05 1997 J"orn Rennecke + + * libc/include/sys/config.h: (UINT_MAX, for D10V): Make unsigned. + +Mon Nov 10 22:26:55 1997 Geoffrey Noer + + * libc/include/string.h: change strsignal proto to return + a char *. This eliminates compile problems in gdb resulting + from gdb's definition of strsignal in defs.h. + +Mon Nov 10 17:11:08 1997 Geoffrey Noer + + * libc/sys/cygwin32/sys/utime.h: new (moved here from + winsup/include) so as not to conflict with the one in + libc/include. + * libc/include/string.h: add protos for strsignal, strtosigno + +Mon Nov 10 13:49:54 1997 Michael Meissner + + * libc/include/sys/config.h: Define __IEEE_BIG_ENDIAN if d30v. + + * configure.in (d30v-*-*): Add configuration. + +Thu Oct 30 14:01:23 1997 Nick Clifton + + * configure.in (links): Add -DARM_RD[P|I]_MONITOR to target_cflags + to select which kind of debug monitor is in use for an ARM target. + + * libc/sys/arm/crt0.S: New version: Supports Thumb startups and + Angel and Demon debug monitors. Part of this code was supplied by + Tony Thompson at ARM: athompso@arm.com. + +Fri Oct 24 18:57:05 1997 Jeffrey A Law (law@cygnus.com) + + * strncat.c (strncat): Don't call strncpy; strncay has the wrong + semantics when the count is greater than the length of the second + source string. + +Thu Oct 23 01:37:41 1997 Geoffrey Noer + + * libc/include/sys/signal.h: reorder CYGWIN32 signal numbers + * libc/include/sys/unistd.h: add protos for usleep, truncate, + truncate and ftruncate take off_t, not size_t + +Tue Oct 21 18:42:00 1997 Jim Wilson + + * libc/string/strcat.c (strcat): Add missing comment end. + * libc/string/strncat.c (strncat): Likewise. + +Tue Oct 21 17:23:34 1997 Nick Clifton + + * configure.in (links): Define PREFER_SIZE_OVER_SPEED for v850 + targets. + * libc/string/{memchr.c, memcmp.c, memcpy.c}: Add space + optimised version which is selected if PREFER_SIZE_OVER_SPEED is + defined. + * libc/string/{memset.c, strcat.c, strchr.c}: Likewise. + * libc/string/{strcmp.c, strcpy.c, strlen.c}: Likewise. + * libc/string/{strncat.c, strncmp.c, strncpy.c}: Likewise. + +Mon Oct 13 15:12:35 1997 Ian Lance Taylor + + * libc/include/sys/param.h (BIG_ENDIAN): Define if __i386__. + (LITTLE_ENDIAN, BYTE_ORDER): Likewise. + +Thu Oct 9 13:54:44 1997 Doug Evans + + * libc/machine/i386/setjmp.S: New file. + * libc/machine/i386/Makefile.in: Delete COPYOFILES. + (OFILES): Add setjmp.o. + (setjmp.o): Add rule for. + * configure.in: Don't set machine_dir for *-*-{go32,sco*,cygwin32}. + +Tue Oct 7 14:01:29 1997 Bill Moyer (billm@cygnus.com) + Jeffrey A Law (law@cygnus.com) + + * libc/string/{memchr.c, memcmp.c, memcpy.c}: Reimplement to run faster. + * libc/string/{memset.c, strcat.c, strchr.c}: Likewise. + * libc/string/{strcmp.c, strcpy.c, strlen.c}: Likewise. + * libc/string/{strncat.c, strncmp.c, strncpy.c}: Likewise. + +Mon Oct 6 14:07:59 1997 Nick Clifton + + * libc/sys/sysnecv850/Makefile.in (crt0.o trap.o): Explicit + rules. + + * libc/include/sys/config.h: Use __v850 to select v850 + endianness. + + * libc/include/machine/setjmp.h: Use __v850 to select v850 jump + buffer size. + + * libc/include/machine/ieeefp.h: Use __v850 to select v850 + endianness. + +Thu Sep 25 14:11:37 1997 Geoffrey Noer + + * libc/stdlib/setenv.c: change unsetenv definition to match + style of setenv (with _DEFUN). The string should be a const. + * libc/include/stdlib.h: unsetenv proto should return void. + +Tue Sep 23 18:17:20 1997 Geoffrey Noer + + * libc/include/stdlib.h: define unsetenv proto for __CYGWIN32__ + +Thu Sep 18 12:50:15 1997 Angela Marie Thomas (angela@cygnus.com) + + * libc/stdio/glue.h: remove. + * libc/stdio/findfp.c, libc/stdio/fwalk.c: remove #include "glue.h" + * libc/stdio/Makefile.in: remove glue.h dependencies + +Wed Sep 17 17:42:27 1997 Nick Clifton + + * libc/sys/sysnecv850/crt0.S: Created V850e version. + +Tue Sep 9 10:40:57 1997 Doug Evans + + * configure.in (target_cpu): Add `arc'. + +Tue Sep 9 10:40:42 1997 Joel Sherrill + + * newlib/configure.in (*-*-rtems*): Add -DSIGNAL_PROVIDED and + -DREENTRANT_SYSCALLS_PROVIDED to the target_cflags. + * newlib/libc/include/sys/errno.h: Add ENOTSUP. + * newlib/libc/reent/reent.c: Add _wrapup_reent. + * newlib/libc/sys/rtems/sys/types.h: Avoid redefinitions for go32. + +Sun Sep 7 16:41:41 1997 Gavin Koch + + * libc/machine/mips/setjmp.S: Handle mips16 builds. + +Thu Aug 21 20:05:38 1997 Ian Lance Taylor + + * libc/include/stdio.h (siprintf): Declare. + +Mon Aug 18 11:19:13 1997 Nick Clifton + + * libc/sys/sysnecv850/Makefile.in (.c.o): Add rule that includes + TARGET_CFLAGS and NEWLIB_FLAGS. + +Mon Aug 18 11:15:43 1997 Nick Clifton + + * configure.in (links): Add support for v850ea target. + +Mon Aug 18 11:15:43 1997 Nick Clifton + + * configure.in (links): Add support for v850e target. + +Wed Aug 13 19:16:54 1997 Nick Clifton + + * libc/sys/sysnecv850/crt0.S: Remove initial setting of r0 to 0. + +Mon Aug 11 15:49:54 1997 Doug Evans + + * configure.in (arc-*-*): Add support for. + * libc/include/machine/ieeefp.h (__arc__): Add support for the ARC. + +Fri Jul 25 17:37:41 1997 J"orn Rennecke + + * libc/sys/sh/crt0.S (start): Add fpscr initialization for SH4. + +Thu Jul 24 18:32:17 1997 Geoffrey Noer + + * libc/stdlib/bsearch.c (bsearch): remove last unneeded + comparison which accesses invalid memory when the key is + larger than the last member of the array. + * libc/include/machine/setjmp.h: add sigsetjmp, siglongjmp + for CYGWIN32 + * libc/include/sys/unistd.h: add _POSIX defines for CYGWIN32 + +Tue Jul 22 16:03:06 1997 Ian Lance Taylor + + * libc/include/stdlib.h (realpath): Declare if __CYGWIN32__ and + not _STRICT_ANSI. + +Thu Jul 10 15:11:52 1997 Doug Evans + + * libm/math/k_standard.c (__kernel_standard): Call fflush(stdout) + ifndef _USE_WRITE, instead of ifdef _USE_WRITE. + +Thu Jul 10 16:00:09 1997 Mike Meissner + + * libc/machine/tic80/setjmp.S (setjmp,longjmp): Use ld.d and st.d + to load/store memory. + +Mon Jul 7 17:38:17 1997 Ian Lance Taylor + + * libc/include/sys/fcntl.h: Define _O_* symbols with leading + underscores if _WIN32. + +Wed Jul 2 10:07:20 1997 Doug Evans + + * libm/math/k_standard.c (__kernel_standard): Delete reentrancy + support ifdef _USE_WRITE missed in last change. + From Anders Blomdell . + +Wed Jun 25 10:18:49 1997 Doug Evans + + * libc/stdio/tmpnam.c (worker): Handle _open_r being stubbed out. + (_tmpnam_r, _tempnam_r): Update. + +Wed Jun 25 00:16:55 1997 Mark Alexander + + * libc/machine/sparc/setjmp.S: New file. + * libc/machine/sparc/Makefile.in: Add setjmp. + * libc/include/machine/setjmp.h: Increase jmpbuf size for sparc. + +Tue Jun 24 23:27:38 1997 Mark Alexander + + * libc/include/machine/setjmp.h: Use __TIC80__ instead of __tic80__. + +Tue Jun 24 14:53:40 1997 Doug Evans + + From Joel Sherrill . + * libc/stdlib/getenv.c (_findenv): Avoid dereferencing null `environ'. + + Add rtems support. From Joel Sherrill . + * configure.in: Recognize *-*-rtems*. + * libc/sys/rtems/{Makefile.in,crt0.c,dummysys.c}: New files. + * libc/sys/rtems/sys/{features.h,sched.h,siginfo.h,signal.h, + time.h,times.h,types.h}: New files. + * libc/sys/rtems/include/{limits.h,signal.h,time.h}. New files. + +Fri Jun 20 11:13:16 1997 Geoffrey Noer + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * include/sys/wait.h: correct operator precidence bug + in WIFSIGNALED + +Wed Jun 18 22:08:27 1997 Geoffrey Noer + + * libc/include/stdlib.h: remove unsetenv proto since it conflicts + with newlib's unsetenv function + * libc/sys/cygwin32/sys: new directory for includes + * libc/sys/cygwin32/sys/dirent.h: move cygwin32's dirent.h + here from winsup/include/sys + +Mon Jun 16 21:02:22 1997 Geoffrey Noer + + * libc/include/sys/unistd.h: _exit should only be + labelled noreturn when not __CYGWIN32__ + * libc/include/stdlib.h: for __CYGWIN32__, add proto for unsetenv + * libc/include/sys/signal.h: add SIGIO to _WIN32 list and + increment NSIG + +Thu Jun 12 18:52:41 1997 Ian Lance Taylor + + * libc/include/sys/time.h: Only define timeval and timezone if + _GNU_H_WINDOWS32_SOCKETS is not defined. + * libc/include/sys/stat.h: If _WIN32, define _S_IFMT, etc. + +Wed Jun 11 09:46:26 1997 Jeffrey A Law (law@cygnus.com) + + * libc/machine/mn10200/setjmp.S: Implement setjmp/longjmp + * libc/machine/mn10300/setjmp.S: Likewise. + + * libc/sys/sysmec/crt0.S: Use "call" instead of "calls" for + the mn10300 (more relaxing opportunities). + +Tue Jun 10 17:24:45 1997 Mike Meissner + + * configure.in (powerpc*-*-{eabi,elf,linux,rtems,sysv,solaris}): + Build libraries with -mstrict-align. + +Fri Jun 6 14:07:59 1997 Ian Lance Taylor + + * libc/string/strlwr.c: New file. + * libc/string/strupr.c: New file. + * libc/include/string.h: Declare strlwr and strupr. + * libc/string/Makefile.in (OFILES): Add strlwr.o and strupr.o. + (CHEWOUT_FILES): Add strlwr.def and strupr.def. + (strlwr.o, strupr.o): New targets. + * libc/string/strings.tex: Include strlwr and strupr docs. + + * libc/include/sys/types.h: Don't define u_char, et. al., if + _GNU_H_WINDOWS32_SOCKETS is defined. Likewise for fd_set, + et. al. Make FD_SETSIZE default 64 rather than 60. Define + _types_fd_set rather than fd_set, and define fd_set as a macro. + + * libc/include/malloc.h: New file. + + * libc/include/string.h: Define strcmpi, stricmp, strncmpi, and + strnicmp if they are not already defined. + + * libc/include/time.h: If __CYGWIN32__, declare tzset and define + _timezone, _daylight, and _tzname. + +Wed Jun 4 12:51:16 1997 Doug Evans + + * configure.in: Sort all configuration tables. + + From Joel Sherrill + * Makefile.in (stmp-targ-include): Copy $(sys_dir)/include/*.h. + +Tue Jun 3 14:47:46 1997 Ian Lance Taylor + + * libc/include/sys/signal.h: Don't include . Just + use int when declaring kill. + + * libc/include/sys/timeb.h: New file. + +Mon Jun 2 12:06:58 1997 Geoffrey Noer + + * libc/include/sys/time.h: add itimer support for Cygwin32 + +Mon May 19 11:56:46 1997 Mike Meissner + + * libc/stdlib/abort.c (abort): If ABORT_MESSAGE is defined, write + out a message that abort was called to stderr. + +Fri May 16 15:02:59 1997 Bob Manson + + * libc/sys/sysmec/fstat.c (_fstat): Set st_blksize to 4096 + so that libio doesn't freak. + + * libc/sys/sysmec/sbrk.c (_sbrk): The argument is a size_t, not + int. + + * libc/stdlib/mallocr.c (_morecore_r): Use size_t for + memory sizes, not int. + +Wed May 14 21:16:58 1997 Bob Manson + + * libm/math/ef_hypot.c: Use long constants where + appropriate. + * libm/math/ef_sqrt.c: Ditto. + + * libc/sys/sysmec/times.c(_times): Change to times. + + * libc/sys/sysmec/read.c(_read): The third argument is + size_t. + * libc/sys/sysmec/write.c (_write): Ditto. + + * libc/sys/sysmec/lseek.c: Include unistd.h for off_t. + (_lseek): It's off_t for the second argument. + +Wed May 14 15:23:36 1997 Mike Meissner + + * libc/include/sys/config.h (__IEEE_LITTLE_ENDIAN): Define here, + as well as machine/ieeefp.h. + +Thu May 8 15:47:25 1997 Geoffrey Noer + + * libc/include/sys/signal.h: add signal protos for winsup + functions (when __CYGWIN32__), include types.h + * libc/include/sys/types.h: Change __go32_types__ internal + define to __MS_types__ since it's used for more than just + GO32 configs. Define this if GO32, __MSDOS__, or _WIN32 are + defined. + * libc/include/sys/unistd.h: add ftruncate proto for + winsup functions (when __CYGWIN32__) + +Fri Apr 25 10:10:16 1997 Doug Evans + + * libc/sys/h8300hms/sbrk.c (stack_ptr): Add definition. + +Thu Apr 24 15:46:51 1997 Mike Stump + + * libc/include/machine/setjmp.h: Add tic80 support. + * libc/machine/tic80/setjmp.S: Likewise. + +Tue Apr 22 16:54:40 1997 Geoffrey Noer + + * libc/sys/cygwin32/crt0.c: Add reference to main() so we can + link programs from libraries only (such as in the X11 + distribution) + +Mon Apr 21 15:02:12 1997 Fred Fish + + * libc/sys/arm/syscalls.c (signal): Remove stub, signal() + supplied elsewhere in newlib. + +Mon Apr 14 16:25:55 1997 Ian Lance Taylor + + * Makefile.in (INSTALL): Change install.sh to install-sh. + +Fri Apr 11 17:04:02 1997 Jason Molenda (crash@godzilla.cygnus.co.jp) + + * README: update WWW address for on-line documentation. + +Wed Apr 9 00:38:13 1997 Geoffrey Noer + + * libc/include/sys/signal.h: for _WIN32, define SIGCONT and + increment NSIG + +Mon Apr 7 23:54:00 1997 Jeffrey A Law (law@cygnus.com) + + * libc/sys/sysmec/crt0.S: Update for new calling conventions on the + mn10300. + * libc/sys/sysmec/trap.S: Don't compare a register to itself. + +Tue Mar 25 08:47:43 1997 Jeffrey A Law (law@cygnus.com) + + * libc/sys/arm/syscalls.c: Fix/add stack/heap collision detection. + * libc/sys/d10v/syscalls.c: Likewise. + * libc/sys/h8300hms/sbrk.c: Likewise. + * libc/sys/h8500hms/syscalls.c: Likewise. + * libc/sys/m88kbug/syscalls.c: Likewise. + * libc/sys/sh/syscalls.c: Likewise. + * libc/sys/sysmec/sbrk.c: Likewise. + * libc/sys/sysnecv850/sbrk.c: Likewise. + * libc/sys/w65/syscalls.c: Likewise. + * libc/sys.tex: Update sbrk sample code to include stack/heap collision. + +Tue Mar 18 14:14:34 1997 Jeffrey A Law (law@cygnus.com) + + * libc/sys/sysmec/trap.S: Use "syscall" to trigger an + emulated syscall instead of "trap". + +Fri Mar 14 11:26:13 1997 Michael Meissner + + * libc/sys/d10v/trap.S (__trap0): Use trap 15 for system calls, + not trap 0. + +Sun Mar 9 23:27:04 1997 Doug Evans + + * configure.in (m32r-*-*): Add -msdata=sdata to target_cflags. + +Sat Mar 8 09:05:01 1997 Fred Fish + + * libc/machine/arm/Makefile.in: Fix comment, is for "arm" + not "sh". + * libc/machine/m32r/Makefile.in: Fix comment, is for "m32r" + not "d10v". + * libc/sys/tic80/crt0.c: New file for TIc80. + * libc/sys/tic80/Makefile.in: New file for TIc80. + * libc/machine/tic80/Makefile.in: New file for TIc80. + +Wed Mar 5 11:32:12 1997 J.T. Conklin + + * libc/machine/sh/memcpy.S: New file. + * libc/machine/sh/memset.S: New file. + * libc/machine/sh/Makefile.in (OFILES): Add memcpy.o and memset.o + +Thu Feb 27 16:27:55 1997 Fred Fish + + * libc/include/machine/ieeefp.h (_IEEE_LITTLE_ENDIAN): Define + for TIc80. + +Wed Feb 26 13:43:39 1997 Jeffrey A Law (law@cygnus.com) + + * libc/sys/sysmec/crt0.S: Handle new calling conventions for + the mn10200. + +Wed Feb 26 07:11:03 1997 Michael Meissner + + * libc/machine/powerpc/setjmp.S (longjmp): Correct return status + (patch from andrew@pogo.WV.TEK.COM). + +Fri Feb 14 11:49:28 1997 Doug Evans + + * libc/machine/m32r/setjmp.S (setjmp): Save r12. + (longjmp): Restore r12. Fix code that handles returning 1 if passed 0. + +Mon Feb 10 10:02:34 1997 Fred Fish + + * configure.in: Add cases for "tic80" to set machine_dir, + sys_dir, and syscall_dir. + +Sun Feb 2 17:57:15 1997 Geoffrey Noer + + * libc/sys/cygwin32/crt0.c: initialize floating pt registers + +Wed Jan 29 15:57:38 1997 Geoffrey Noer + + * libc/include/math.h: avoid conflicts with ANSI C++ + +Mon Jan 27 12:50:01 1997 Doug Evans + + * libc/machine/m32r/setjmp.S: Use proper comment delimiter. + Use proper constant prefix. + +Fri Jan 24 10:59:04 1997 Jeffrey A Law (law@cygnus.com) + + * libc/sys/sysmec/*.c: Don't cast args to syscall to integers, + that loses on the mn10200 where ints and pointers are different + sizes. + +Tue Jan 14 13:29:55 PST 1997 Jeremy Allison + + * configure.in: Added -DSIGNAL_PROVIDED to cygwin32 + target as signal is provided in winsup. + +Tue Jan 14 11:10:13 1997 Jeremy Allison + + * libc/include/sys/process.h: Corrected const definitions + in spawn functions. Added cwait. + +Thu Jan 2 12:22:41 1997 Jeffrey A Law (law@cygnus.com) + + * libc/include/machine/ieeefp.h: mn10200 uses 16bit ints and 32bit + doubles. + * libc/include/sys/config.h: Similarly. + +Tue Dec 31 18:36:14 1996 Michael Meissner + + * configure.in (sparc-sun-sunos*): Add -DSIGNAL_PROVIDED to the + target_cflags. + (i[3456]86-*-sco*): Ditto. + + * libc/signal/Makefile.in (OFILES): Add signal.o. + (CFILES): Add signal.c. + + * libc/signal/raise.c (_raise_r): Only compile code if + SIGNAL_PROVIDED is defined. + + * libc/signal/signal.c: Redo whole file so that it works with + current newlib. Use _kill_r if no signal handler provided. + + * libc/sys/{go32,sparc64,sysmec}/Makefile.in: Delete raise and + signal stubs. + * libc/sys/sysvnecv70/Makefile.in: Ditto. + * libc/sys/sysnecv850/Makefile.in: Ditto. + + * libc/sys/{go32,sparc64}/signal.c: Delete, stub no longer used. + * libc/sys/sysmec/{raise,signal}.c: Ditto. + * libc/sys/sysvnecv70/signal.s: Ditto. + * libc/sys/sysnecv850/raise.c: Ditto. + + * libc/sys/sysnecv850/kill.c (_kill): Encode signal # so that + simulator and debugger can tell the difference between a signal + being raised and an exit system call. + + * NEWS: Document software signals being provided. + +Mon Dec 23 11:54:19 1996 Michael Meissner + + * libc/reent/impure.c (_REENT_ATTR): Delete in favor of + __ATTRIBUTE_IMPURE_PTR__. Move PowerPC definition to + include/sys/config.h. + (impure_data): Use __ATTRIBUTE_IMPURE_DATA__ for attributes. + Change from 'inpure_data'. + (_impure_ptr): Use __ATTRIBUTE_IMPURE_PTR__ for attributes. Use + &impure_data, not &inpure_data. + + * libc/include/sys/config.h (__ATTRIBUTE_IMPURE_PTR__): If PowerPC + and and System V ABI, define so that _impure_ptr lives in the + .sdata section. + +Sun Dec 22 23:33:05 1996 Michael Meissner + + * libc/include/sys/reent.h (__ATTRIBUTE_IMPURE_PTR__): Define as + nothing if not defined. + (_impure_ptr): Use __ATTRIBUTRE_IMPURE_PTR__, so a machine can set + its attributes. + + * libc/include/sys/config.h (__ATTRIBUTE_IMPURE_PTR__): + +Wed Dec 18 10:12:04 1996 Jeffrey A Law (law@cygnus.com) + + * libc/sys/sysmec/crt0.S: Fix mn10200 stuff. + * libc/sys/sysmec/trap.s: Handle mn10200 too. + * libc/machine/mn10200/setjmp.S: Fix mn10200 stuff. + +Mon Dec 16 10:05:36 1996 Jeffrey A Law (law@cygnus.com) + + * libc/sys/sysmec/crt0.S: Handle mn10200 too. + +Fri Dec 13 11:05:20 1996 Jeremy Allison + + * libc/include/sys/errno.h: Added net errno's. + +Wed Dec 11 16:24:25 1996 Michael Meissner + + * libc/misc/ffs.c: New file to support ffs function for GCC test + gcc.c-torture/execute/960909-1.c. + + * libc/misc/Makefile.in ({O,CHEWOUT_}FILES): Add ffs. + +Sat Dec 7 10:12:37 1996 Jeffrey A Law (law@cygnus.com) + + * libc/sys/sysmec/crt0.S: Handle underscore prefix. + * libc/sys/sysmec/trap.S: Likewise. + +Fri Dec 6 15:08:49 1996 Jim Wilson + + * configure.in (mips*vr4300*-*-*): Delete use of sys/vr4300. + * libc/sys/vr4300/{Makefile.in,crt0.S,syscalls.c}: Delete. + +Wed Dec 4 16:25:27 1996 Jeffrey A Law (law@cygnus.com) + + * libc/sys/sysmec/signal.c: Dummy file. + * libc/sys/sysmec/Makefile.in: Build it. + +Wed Nov 27 13:10:18 1996 Ian Lance Taylor + + * libc/machine/mips/machine/regdef.h: Define pc as $pc for + mips16. + +Mon Nov 25 09:58:28 1996 Jeffrey A Law (law@cygnus.com) + + * libc/sys/sysmec/{crt0.S,trap0.S}: Actually try to implement + c-startup and simulator traps. + + + * libc/sys/sysmec/crt0.S: Remove bogus '_' symbol prefixing + * libc/sys/sysmec/trap0.S: Likewise. + +Sat Nov 23 09:01:03 1996 Michael Meissner + + * libc/stdlib/mallocr.c (ROUND_TO): If SMALL_MEMORY, set to 0x7 to + round to double word alignment. + (_morecore_r): Combine rounding up pointers to both ROUND_TO and 8 + byte alignment. + + * libc/include/sys/config.h (__IEEE_BIG_ENDIAN): Define if d10v. + + * libc/sys/d10v/syscalls.c (_sbrk): Add better checks for running + out of memory. + +Mon Nov 18 13:08:26 1996 Jeffrey A Law (law@cygnus.com) + + * configure.in: Handle mn10200 and mn10300. + * libc/include/machine/{ieeefp.h,setjmp.h}: Likewise. + * libc/include/sys/config.h: Likewise. + * libc/sys/sysmec: New directory for mec stuff. + * libc/machine/mn10300: New directory for mn10300 stuff. + * libc/machine/mn10200: Similarly for mn10200 stuff. + +Fri Nov 15 16:41:41 1996 Doug Evans + + * libc/sys/arm/crt0.S: Use .text, not .section .text. + * libc/sys/arm/syscalls.c: Rewrite to set errno properly. + + * libc/include/sys/types.h (_ST_INT32): New macro, local to file. + (nlink_t): Change type from unsigned int to unsigned short. + (mode_t): Ensure size is 32 bits even if int is 16. + * libc/include/sys/stat.h (st_nlink): Change type to nlink_t. + (st_spare[123]): Change type from int to long. + +Fri Nov 15 11:41:50 1996 Michael Meissner + + * libc/sys/d10v/syscalls.c (_sbrk): Align initial heap_end to 8 + byte boundary. + + * configure.in (d10v*): Define SMALL_MEMORY. + +Mon Nov 11 10:30:44 1996 Michael Meissner + + * configure.in (powerpc*-{eabi,elf,linux,rtem,sysv,solaris}*): Add + -mrelocatable-lib and -mno-eabi flags. + +Mon Nov 11 09:01:39 1996 Jeffrey A Law (law@cygnus.com) + + * libc/machine/h8300/memcpy.S: Fix comments to reflect reality. + Fix handling of mis-aligned source operand when both the + destination & length are properly aligned. + +Wed Oct 30 09:41:11 1996 Jeffrey A Law (law@cygnus.com) + + * libc/sys/sysnecv850/Makefile.in (OFILES): Add + times.o, time.o and gettime.o + * libc/sys/sysnecv850/{time.c, times.c, gettime.c}: New files. + * libc/sys/sysnecv850/sys/syscall.h: Add SYS_times and + SYS_gettimeofday. + +Tue Oct 29 13:40:09 1996 Jeffrey A Law (law@cygnus.com) + + * libc/sys/sysnecv850/Makefile.in (OFILES): Add access.o + * libc/sys/sysnecv850/access.c: New file. + +Mon Oct 21 19:47:02 1996 Ian Lance Taylor + + * libc/sys/vr4300/Makefile.in (clean): Remove $(OFILES). + + * libc/stdlib/mprec.h (word0, word1): Use __uint32_t, not unsigned + long. + +Mon Oct 21 14:43:07 1996 Jeffrey A Law (law@cygnus.com) + + * libc/sys/sysnecv850/crt0.S: Initialize ep and gp registers. + +Thu Oct 17 11:47:16 1996 Doug Evans + + * libc/include/machine/{ieeefp.h,setjmp.h}: Add m32r support. + * libc/include/sys/config.h: Add m32r support. + +Wed Oct 16 23:08:05 1996 Jeffrey A Law (law@cygnus.com) + + * libc/sys/sysnecv850/v850.ld: Remove. It doesn't belong + here. + +Wed Oct 16 21:18:07 1996 Mark Alexander + + * libc/include/machine/setjmp.h: Add D10v support. + +Tue Oct 15 22:28:26 1996 Jeffrey A Law (law@cygnus.com) + + * configure.in: Configure the "libc/syscalls" directory for + the v850. + + * libc/sys/sysnecv850/{close.c, execve.c, fork.c}: Add missing '_'. + * libc/sys/sysnecv850/{fstat.c, getpid.c, kill.c}: Likewise. + * libc/sys/sysnecv850/{lseek.c, open.c, read.c}: Likewise. + * libc/sys/sysnecv850/{sbrk.c, stat.c, unlink.c}: Likewise. + * libc/sys/sysnecv850/{wait.c, write.c}: Likewise. + +Tue Oct 15 16:24:39 1996 Stu Grossman (grossman@critters.cygnus.com) + + * libc/sys/sysnecv850/crt0.S (start): Allocate spill space on + stack for args for main and other routines. Zero out args for + main. + + * libc/sys/sysnecv850/v850.ld: New. Linker script to layout memory + correctly. + +Tue Oct 15 11:51:42 1996 Michael Meissner + + * libc/stdio/findfp.c (std): Remove extraneous ';' after + function. + + * libc/sys/d10v/sys/syscall.h (SYS_kill): Add. + + * libc/sys/d10v/{syscalls.c,trap.S} (_kill,_getpid): Make these + real system calls now. + + * libc/stdio/setvbuf (setvbuf): Cast pointers to _POINTER_INT + before casting them to int. + * libc/stdio/tmpnam.c (_tempnam_r): Ditto. + + * libc/stdlib/mallocr.c (_morecore_r): Use _POINTER_INT when + aligning pointer. + * libc/string/memset.c (memset): Ditto. + + * libc/stdio/vfscanf.c (__svfscanf): When converting to pointer, + first convert ints to _POINTER_INT to eliminate GCC warning. + + * libc/stdio/vfprintf.c (_vfprintf_r): Use _POINTER_INT when + processing %p. + + * libm/math/ef_scalb.c (__ieee754_scalbf): Cut down range to 32000 + from 65000 if ints are only 16 bits. + + * libm/math/sf_scalbn.c (scalbnf): Cut down overflow test to 30000 + from 50000 if ints are only 16 bits. + + * libc/include/sys/config.h (_POINTER_INT): New macro, to give an + int type that is the same size as a pointer. + + * libc/misc/dprintf.c (__dprintf): Use _POINTER_INT when + processing %p. + (get_number): Explicitly cast number to long before shifting by 16 + or 24, in case ints are short. + + * libc/include/sys/config.h (_POINTER_INT): Define as short. + +Wed Oct 9 16:54:32 1996 Jeremy Allison + + * libc/string.h: Added ffs, removed swab. + * libc/sys/errno.h: Added EOPNOTSUPP. + * libc/sys/unistd.h: Added swab. + +Thu Oct 3 17:08:50 1996 Jeremy Allison + + * libc/include/sys/stat.h: Added fchmod. + * libc/include/sys/unistd.h: Added fsync. + +Tue Oct 1 17:34:08 1996 Jeremy Allison + + * libc/include/sys/errno.h: Added defines for EPFNOSUPPORT (96) + and ECONNRESET (104) for cygwin32. + +Tue Oct 1 16:24:05 1996 Gavin Koch + + * libc/sys/sysnecv850/_exit.c: added _do_dtors to + do the static destructors. + +Mon Sep 30 15:59:05 1996 Stu Grossman (grossman@critters.cygnus.com) + + * libc/sys/sysnecv850/trap.S: Change I/O to use trap 31. + +Mon Sep 30 12:02:50 1996 Doug Evans + + * libc/machine/m32r/{Makefile.in,setjmp.S}: New files. + * configure.in: Recognize m32r-*-*. + +Mon Sep 30 00:34:41 1996 James G. Smith + + * libc/sys/arm/trap.S (__rt_stkovf_split_big, + __rt_stkovf_split_small): Added default software stack overflow + handlers, which just call SWI_Exit. + * libc/sys/arm/crt0.S (_mainCRTStartup): Simple software stack + limit initialisation. + +Fri Sep 27 13:08:03 1996 Mark Alexander + + * libc/sys/d10v/{trap.S,sys/syscall.h}: Add time() function. + +Fri Sep 27 12:32:00 1996 Jeremy Allison + + * libc/include/sys/types.h: Added ssize_t definition. + +Wed Sep 25 14:52:18 1996 Michael Meissner + + * libc/machine/d10v/setjmp.S: Use ';' for comments. + * libc/sys/d10v/{crt0.S,trap.S}: Ditto. + + * libc/machine/d10v/setjmp.S (longjmp): Use exef0t || instead of + branch around a single ldi instruction. + + * libc/sys/d10v/crt0.S (_start): Use auto-increment to zero bss. + Call exit, instead of just issuing a stop instruction. + +Sun Sep 22 17:26:55 1996 Michael Meissner + + * libc/sys/d10v/{trap.S,syscalls.c}: Add -mint32 support. + +Fri Sep 20 13:23:12 1996 Michael Meissner + + * libc/stdlib/mprec.h: Explicitly declare all large constants as + longs, and then cast them to __uint32_t. + + * libc/include/sys/config.h: Protect against multiple inclusions. + +Tue Sep 17 13:10:33 1996 Mark Alexander + + * configure.in (d10v*): Set syscall_dir. + +Sun Sep 15 10:41:59 1996 Mark Alexander + + * libc/sys/d10v/crt0.S: Set stack pointer. + +Thu Sep 12 13:02:38 1996 Mark Alexander + + * libc/sys/d10v/{trap.S, syscalls.c}: Rewrite most system calls + in assembly for efficiency. Change calling convention to allow + long ints to be returned. + +Wed Sep 11 10:28:18 1996 Michael Meissner + + * libc/machine/v850/Makefile.in (setjmp.o): Fix dependency. + +Thu Sep 5 19:23:06 1996 Doug Evans + + * libc/posix/execvp.c (execvp): Don't search PATH if file has '/'. + Handle empty entries in $PATH. + +Tue Sep 03 18:15:02 1996 Mark Alexander + + * libc/machine/d10v/setjmp.S: Make it really work. + +Tue Sep 3 12:16:26 1996 Ian Lance Taylor + + * libc/sys/sh/crt0.S: If __ELF__, use ELF section attributes for + the .stack section. + +Tue Sep 3 10:08:45 1996 Jeffrey A Law (law@cygnus.com) + + * sys/sysnecv850/sys/file.h: Remove. + * sys/sysnecv850/sys/syscall.h: New file. + * sys/sysnecv850/{misc.c,syscalls.c,malloc.c}: Deleted. + * sys/sysnecv850/{chmod.c, chown.c, close.c, creat.c} New files. + * sys/sysnecv850/{execv.c, execve.c, fork.c, fstat.c} New files. + * sys/sysnecv850/{getpid.c, isatty.c, kill.c, lseek.c} New files. + * sys/sysnecv850/{open.c, pipe.c, raise.c, read.c} New files. + * sys/sysnecv850/{stat.c, unlink.c, utime.c, wait.c} New files. + * sys/sysnec850/trap.S: New file. + * sys/sysnecv850/{_exit.c, write.c}: Use new TRAP0 mechanism for + syscalls. + * sys/sysnecv850/crt0.S: Use cmp/bl, not tst/bz. + * sys/sysnec850/sbrk.c: New version. + +Sun Sep 1 20:08:27 1996 Jeffrey A Law (law@cygnus.com) + + * sys/sysnecv850/crt0.S: Fix order of comparison args. Loop + as long as r6 is less than r7. + +Sun Sep 1 13:54:19 1996 Ian Lance Taylor + + * Makefile.in (mostlyclean): Separate from clean target. Don't + remove *.a or targ-include. + * libc/machine/sparc/Makefile.in (mostlyclean): New target. + +Sun Sep 1 11:35:26 1996 Michael Meissner + + * libc/include/machine/ieeefp.h (_DOUBLE_IS_32BITS): Define for + d10v. + (__SMALL_BITFIELDS): Ditto. + + * libc/include/sys/config.h (_DOUBLE_IS_32BITS): Define for d10v. + +Sat Aug 31 16:42:36 1996 Jeffrey A Law (law@cygnus.com) + + * libc/sys/sysnecv850/misc.c (raise, getpid, kill): Remove '_' + prefix. + + * libc/sys/sysnecv850/sbrk.c (sbrk): Remove '_' prefix. + * libc/sys/sysnecv850/syscalls.c (read, lseek, close): Likewise. + * libc/sys/sysnecv850/syscalls.c (fstat, open, close): Likewise. + * libc/sys/sysnecv850/write.c (write): Likewise. + + * libc/sys/sysnecv850/crt0.S: Don't try to zero out an empty + .bss. + +Fri Aug 30 11:18:45 1996 Michael Meissner + + * libc/include/sys/config.h: Define INT_MAX, UINT_MAX + appropriately for D10V, depending on -mint16/-mint32. + +Thu Aug 29 16:09:37 1996 Mark Alexander + + * configure.in: Add cases for D10V. + +Thu Aug 29 17:03:23 1996 Michael Meissner + + * configure.in (i[345]86-*-*): Recognize i686 for pentium pro. + +Wed Aug 28 21:05:52 1996 Jeffrey A Law (law@cygnus.com) + + * libc/include/machine/ieeefp.h: Fix typo. + +Wed Aug 28 19:47:55 1996 Mark Alexander + + * libc/sys/d10v: New directory for D10V stuff. + * libc/include/machine/ieeefp.h: Add D10V defines. + +Mon Aug 26 13:34:58 1996 Doug Evans + + * libc/include/sys/errno.h: Add winsup/include/sys/errno.h values: + ELOOP, ENOBUFS, EAFNOSUPPORT, EPROTOTYPE, ENOTSOCK, ENOPROTOOPT, + ESHUTDOWN, ECONNREFUSED, EADDRINUSE, ECONNABORTED, EWOULDBLOCK. + * libc/string/strerror.c (strerror): Add them. + +Thu Aug 22 16:38:19 1996 Jeffrey A Law (law@cygnus.com) + + * libc/sys/sysnecv850: New directory for v850 stuff. + + * libc/machine/v850: New directory for v850 stuff. + * libc/machine/v850/setjmp.S: setjmp/longjmp support. + + * configure.in: Add support for the v850. + + * libc/include/machine/ieeefp.h: Add v850 defines. + * libc/include/machine/setjmp.h: Likewise. + * libc/include/sys/config.h: Add v850 defines. + +Sat Aug 17 04:06:36 1996 Geoffrey Noer + + * libc/include/machine/ieeefp.h + * libc/include/machine/setjmp.h + * libc/include/sys/fcntl.h + * libc/include/sys/signal.h + * libc/include/sys/types.h + * libc/stdlib/system.c: + Fix preprocessor defines to match new scheme (_WIN32 for WIN32 + API availability, __CYGWIN32__ for cygwin32 environment specific). + +Thu Aug 15 17:09:21 1996 Geoffrey Noer + + * libc/include/stdlib.h: add multibyte character functions. Add + __eprintf for assert. + +Thu Aug 15 11:15:40 1996 Michael Meissner + + * libc/stdlib/malloc.h (MALLOC_ALIGNMENT): Use either pointer + arithmetic or __alignof__ to properly get the alignment, instead + of hardwiring it to 4. + +Wed Aug 14 23:43:28 1996 Geoffrey Noer + + * libc/stdio/fseek.c: add fflush call to adjust seek offset + on append stream (fix from NetBSD sources), adjust curoff offset + for ungetc's benefit. + * libc/stdio/ftell.c: adjust curoff offset for ungetc's benefit. + * libc/stdio/rewind.c: replace code with up to date NetBSD + code to undo hacks made to work around above problem of not + having fflush call mentioned above + +Fri Aug 2 18:28:07 1996 J.T. Conklin + + * libc/reent/{closer.c, execr.c, fstatr.c, linkr.c, lseekr.c, + openr.c, readr.c, sbrkr.c, signalr.c, statr.c, timer.c, writer.c}: + Partially revert last changes. The thread specific errno is set + iff if the underlying syscall fails and the global errno is not + zero. + +Fri Jul 19 11:41:52 1996 J.T. Conklin + + * libc/reent/filer.c: Removed files, all functions have split out + into their own files. + * libc/reent/{closer.c, lseekr.c, openr.c, readr.c, writer.c}: + New files containing functions formally in filer.c + * libc/reent/Makefile.in: Updated for above change. + + * libc/reent/execr.c (_fork_r, _wait_r): Set errno if underlying + syscall fails, not if errno is changed. + * libc/reent/filer.c (_open_r, _close_r, _lseek_r, _read_r, + _write_r): Likewise. + * libc/reent/fstatr.c (_fstat_r): Likewise. + * libc/reent/linkr.c (_link_r, _unlink_r): Likewise. + * libc/reent/sbrkr.c (_sbrk_r): Likewise. + * libc/reent/signalr.c (_kill_r): Likewise. + * libc/reent/statr.c (_stat_r): Likewise. + * libc/reent/timer.c (_gettimeofday_r): Likewise. + + * libc/reent/{execr.c, filer.c, fstatr.c, linkr.c, sbrkr.c, + signalr.c, statr.c, timer.c} (errno): declare extern rather + than as a common. + + * libc/stdio/vfprintf.c (__sbprintf): Use the VFPRINTF macro + instead of calling vfprintf so that i*printf will not require + floating point support code. + +Mon Jul 15 16:50:59 1996 Doug Evans + + * libc/posix/execvp.c (execvp): Use posix_path_list_p to determine + path delimiter. + * libc/include/sys/unistd.h (_SC_PATH_RULES): Delete. + (_PATH_RULES_{UNKNOWN,WIN32,POSIX}): Delete. + +Thu Jul 11 14:34:14 1996 Geoffrey Noer + + * libc/include/signal.h: _sig_func_ptr function takes an int + * libc/include/sys/signal.h: sa_handler function takes an int + +Tue Jul 9 21:22:32 1996 Jeffrey A Law (law@cygnus.com) + + * libc/include/machine/ieeefp.h: Simplify H8/S support. + * libc/include/sys/config.h: Add missing H8/S conditional. + +Sun Jun 30 12:05:46 1996 Doug Evans + + * libc/include/sys/unistd.h (MAXPATHLEN): Add cygwin32 value. + +Wed Jun 26 09:57:54 1996 Jeffrey A Law (law@cygnus.com) + + * libc/include/machine/setjmp.h: Handle H8/S. + * libc/include/machine/ieeefp.h: Likewise. + * libc/include/sys/config.h: Likewise. + * libc/machine/h8300/{defines.h, memcpy.S, memset.S}: Likewise. + * libc/machine/h8300/{reg_memcpy.S, reg_memset.S}: Likewise. + * libc/machine/h8300/{strcmp.S, setjmp.S}: Likewise. + * libc/sys/h8300hms/crt0.S: Likewise. + +Tue Jun 25 23:15:45 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) + + * Makefile.in (datadir): Set to $(prefix)/share. + (oldincludedir, docdir): Removed. + * doc/Makefile.in (datadir): Set to $(prefix)/share. + (oldincludedir, docdir): Removed. + * libc/Makefile.in (datadir): Set to $(prefix)/share. + (oldincludedir, docdir): Removed. + * libm/Makefile.in (datadir): Set to $(prefix)/share. + (oldincludedir, docdir): Removed. + +Fri Jun 21 19:24:41 1996 Ian Lance Taylor + + * libc/include/sys/reent.h (_REENT_INIT): Update for change to + _reent struct. + +Wed Jun 19 14:00:09 1996 Doug Evans + + * libc/posix/execvp.c: Delete _WIN32 support. For __CYGWIN32__ + fetch current path rules with sysconf and handler posix/win32 + appropriately. + + * libc/include/sys/unistd.h (_PATH_RULES{,_POSIX,_WIN32}): Define. + + * libc/include/process.h: Prepend '_' to P_{WAIT,NOWAIT,OVERLAY}. + (WAIT_CHILD): Always define. + +Sat Jun 15 17:50:42 1996 Ian Lance Taylor + + * libc/stdlib/eprintf.c: New file. + * libc/stdlib/Makefile.in (OFILES): Add eprintf.o. + (eprintf.o): New target. + +Thu Jun 13 16:44:32 1996 Doug Evans + + * libc/sys/cygwin32/crt0.c (__cygwin_crt0_bp): New global. + (mainCRTStartup): Do int3 if __cygwin_crt0_bp non-zero. + +Thu Jun 13 17:45:17 1996 Mike Meissner + + * libc/include/machine/ieeefp.h: Add support for AIX and Windows + NT in PowerPC endianess cases. + +Tue Jun 11 12:26:28 1996 Michael Meissner + + * libc/include/machine/ieeefp.h: Clean up PowerPC endianess. + +Thu Jun 6 11:34:20 1996 Michael Meissner + + * libc/string/strtok.c: Fix doc typo. + +Mon Jun 3 11:30:00 1996 J.T. Conklin + + * libc/include/sys/reent.h (struct _reent): Removed _asctime, + _next, _scanpoint, _signgam fields. + + * libc/include/stdlib.h (rand_r): Added new declaration. + (_rand_r, _srand_r): Removed declarations. + * libc/stdlib/rand.c (_rand_r, _srand_r): Removed, these functions + have been made obsolete by rand_r. + * libc/stdlib/rand_r.c: New file, rand_r function as specified + by POSIX.1c. + + * libc/string/strtok.c: Update documentation to describe + strtok_r(). + +Sat Jun 1 23:50:39 1996 Michael Meissner + + * libc/include/sys/stat.h (stat structure): Use the expanded stat + structure on Solaris, and PowerPC systems even though __svr4__ is + defined. + +Tue May 28 13:02:42 1996 Doug Evans + + * libc/sys/go32/sys/errno.h (ENOSYS,ESPIPE): Keep values <= 255. + +Fri May 17 10:34:44 1996 Ian Lance Taylor + + * host/any: Use ../.. rather than .. to get to the main build + directory. This matches the current layout of the build + directory. + +Wed May 15 15:52:27 1996 Jeffrey A Law (law@cygnus.com) + + * libc/machine/h8300/__main.S: Delete. No longer needed. + * libc/machine/h8300/Makefile.in: Corresponding changes. + * libc/sys/h8300hms/crt1.c: New file. + * libc/sys/h8300hms/Makefile.in: Corresponding changes. + * libc/sys/h8300hms/crt0.s: Call __main. + + * libc/sys/h8300hms/crt0.S: Use temporary label names + for branch targets. + +Mon May 13 14:26:30 1996 Doug Evans + + * libc/stdio/fopen.c (_fopen_r): Fix arguments to fseek. + +Fri May 3 16:38:23 1996 Michael Meissner + + * libc/reent/impure.c (_impure_ptr): Force the impure pointer into + .sdata on the PowerPC so that we can link newlib with code + compiled with -msdata. + +Mon Apr 29 21:38:02 1996 Doug Evans + + * libc/sys/arm/syscalls.c (_sbrk): Rename end to __end__. + +Thu Apr 25 06:38:59 1996 Michael Meissner + + * libc/sys/cygwin32/crt0.c (mainCRTStartup): On PowerPC, set the + exception handler to __cygwin_exception_handler. + +Tue Apr 23 15:14:20 1996 Ian Lance Taylor + + * libc/include/machine/setjmp.h: Check _AM29K, not ___AM29K__. + +Sun Apr 21 12:11:51 1996 Doug Evans + + * libm/math/Makefile.in ({w,wf}_cabs.o,{w,wf}_drem.o): Add rule for + SunOS VPATH. + * libc/stdlib/Makefile.in (atoff.o,atol.o,mblen.o,mbstowcs.o, + wcstombs.o): Likewise. + +Thu Apr 18 12:37:01 1996 Doug Evans + + * libc/stdlib/environ.c (initial_env): New static local. + (environ): Point to `initial_env'. + + * libc/include/machine/setjmp.h: Clean up. + (__H8300H__,__PPC__): Define _JBTYPE. + (__arm__): Provide entry for. + (sigjmp_buf): Delete. + (jmp_buf): Use _JBTYPE if defined, otherwise int. + +Thu Apr 18 12:10:52 1996 Jeffrey A Law (law@cygnus.com) + + * libc/machine/h8300/strcmp.S: Sign extend the result to + 32bits so we don't lose with -mint32. + +Sun Apr 14 19:59:52 1996 Doug Evans + + * libc/sys/go32/sys/errno.h: New file. + * libc/sys/go32/Makefile.in (stat.o): Depend on stat.c. + * libc/sys/go32/gerrno.s (syscall_error): Call __errno to get + errno's address (make compatible with rest of newlib). + * libc/sys/go32/stat.c (fixinode): Set errno upon failure. + * libc/string/strerror.c (strerror): Surround each case with #ifdef. + +Thu Mar 28 13:44:42 1996 Doug Evans + + * libc/machine/sparc/{scan.c,shuffle.c}: New files. + * libc/machine/sparc/Makefile.in: Build them. + * libc/machine/sparc/machine/sparclet.h: New file. + +Mon Mar 25 15:29:14 1996 J.T. Conklin + + * libc/machine/sh/asm.h: New file. + * libc/machine/sh/setjmp.S: Only save clobbered registers. Added + support for SH3e's FP registers. Use asm.h. + +Mon Mar 25 11:59:23 1996 Jeffrey A Law (law@cygnus.com) + + * libc/stdio/vfprintf.c (cvt): Accept a reent structure + as first argument. Call _dtoa_r and pass the reent structure + instead of calling __dtoa. + +Fri Mar 22 13:59:37 1996 Jeffrey A Law (law@cygnus.com) + + * libc/include/sys/config.h: Define DOUBLE_IS_32BITS for + the h8300, h8500, and others. Add comments for some rather + dubious code. + +Thu Mar 14 18:04:43 1996 Ian Lance Taylor + + * Makefile.in (check): Check that testsuite exists before cd. + +Tue Mar 12 11:46:47 1996 Michael Meissner + + * libc/include/string.h (strsep): Correct prototype. + +Mon Mar 11 09:55:19 1996 Doug Evans + + * libc/sys/h8300/_exit.c (_exit,__exit): Set r0 to 0 before `sleep'. + * libc/sys/h8300/misc.c (_kill): Set r0 to indicate abort and `sleep'. + * libc/sys/h8300/crt0.S (_start): Call exit instead of `sleep'. + +Wed Mar 6 11:51:55 1996 Doug Evans + + * libc/posix/{creat.c,isatty.c}: New files. + * libc/posix/Makefile.in (OFILES): Add creat.o, isatty.o. + + * libc/sys/sparc64/crt0.S (environ): Delete. + (.LHaveBias): Renamed from HaveBias. + +Thu Feb 15 10:48:37 1996 Doug Evans + + * libc/stdlib/mallocr.c (etext): Move decl inside ifdef WARN_VLIMIT. + (_morecore_r): Delete SBRK_IS_ALLOC support. + +Tue Feb 13 09:44:09 1996 Michael Meissner + + * libc/sys/cygwin32/Makefile.in (lib.a): Make lib.a with a dummy + module rather than touch, so we don't get warning messages when + all of the libraries are combined into libc.a. + +Tue Feb 13 06:32:07 1996 Doug Evans + + * libc/sys/sparclite/{Makefile.in,crt0.s}: Deleted. + crt0.s replaced by version in libgloss. + +Mon Feb 5 15:17:51 1996 J.T. Conklin + + * libc/reent/Makefile.in (OFILES): Add impure.o. + * libc/reent/impure.o: New file, define initial reentrancy struct. + * libc/reent/reent.c: Remove above definition. + + * libm/math/sf_asinh.c: Fix typo. + + * Makefile.in (MATHOBJS_IN_LIBC): Removed sr_ldexp.o and + srf_ldexp.o. + + * libm/libm.texinfo: Change documentation to reflect changes + in reentrancy model. + * libm/math/w_gamma.c: Likewise. + +Wed Jan 31 18:49:45 1996 Steve Chamberlain + + * configure.in (*-*-cygwin32): New. + (*-*-win32): Deleted. + * libc/sys/win32 renamed libc/sys/cygwin32. + +Tue Jan 30 22:09:03 1996 Michael Meissner + + * libc/include/sys/file.h: New include file. + +Fri Jan 26 15:52:54 1996 Steve Chamberlain + + * libc/include/machine/setjmp.h: Increase size of PPC jmp_buf. + +Tue Jan 23 17:49:16 1996 Steve Chamberlain + + * libc/include/sys/wait.h (WIFSIGNALED): Fix. + +Tue Jan 16 09:28:10 1996 Michael Meissner + + * doc/makedoc.c (realloc): Declare at file scope. + (catchar): Not here. + +Wed Dec 27 15:45:23 1995 Doug Evans + + * Makefile.in (VERSION): Update to 1.7.0. + * {libc,libm}/Makefile.in (VERSION): Likewise. + * configure.in: Minor clean up of multilib stuff. + + From David Johnson + * {libc,libm}/Makefile.in (lib[cm].a): Delete library first. + + * libc/stdlib/environ.c: New file. + * libc/stdlib/Makefile.in (OFILES): Build it. + * libc/sys/h8500hms/crt0.c (environ): Deleted. + * libc/sys/m88kbug/crt0.c (environ): Deleted. + * libc/sys/z8ksim/crt0.c (environ): Deleted. + * libc/sys/netware/environ.c: Deleted. + +Tue Dec 19 15:24:46 1995 Kim Knuttila + + * configure.in (links): set sys_dir, posix_dir, syscall_dir + +Wed Dec 13 04:16:25 1995 Michael Meissner + + * doc/makedoc.c (init_string_with_size,nextword): Move malloc + declaration out to external scope and declare it PTR, not char *. + +Mon Dec 11 17:35:12 1995 steve chamberlain + + * libc/include/sys/unistd.h (getpagesize): New declaration. + (_SC_PAGESIZE): New definition. + * libc/include/time.h (CLK_TCK): Defined as CLOCKS_PER_SEC. + * libc/configure.in (i[345]86-*-win32): Remove -DNO_FORK. + +Fri Dec 1 16:48:46 1995 James G. Smith + + * libc/sys/vr4300/syscalls.c (sbrk): Fixed memory + addressing. System call returns size, not (last address + 1). + +Thu Nov 30 15:05:26 1995 J.T. Conklin + + * libm/math/*.c: Removed _foo_r() reentrancy API. + * libc/include/math.h: Removed _foo_r prototypes and macros. + + * libm/math/*.c: On systems with IEEE single precision "doubles" + move foo() -> foof() wrapper code from the files that implement + the standard IEEE double precision functions to the files that + implement IEEE single precision functions. (ie. On those systems + sin is moved from s_sin.c to sf_sin.c). There should eventually + be use of a C extension (like gcc's alias attribute) so that the + wrappers are not needed at all. + + * libc/sys/sysnec810/sbrk.c: Cast &end to char * to get around + strict NEC V810 compiler. + * libc/misc/dprintf.c (getnumber): Cast char * to unsigned char * + for same reason. + +Wed Nov 29 14:25:05 1995 J.T. Conklin + + * libc/stdlib/strtol.c (_strtol_r): Replaced with implementation + from NetBSD C library. + * libc/stdlib/strtoul.c (_strtoul_r): Likewise. + + * libc/stdlib/assert.c (__assert): Renamed from __assertfail + and adapted from implementation I wrote for NetBSD C library. + The difference is __assert doesn't take a format argument, + so that there won't be multiple copies of the same string + constant in the executable if assertions are enabled in + more than one source module. + * libc/include/assert.h (assert): Changed to call __assert. + +Tue Nov 28 16:54:26 1995 J.T. Conklin + + * libc/stdlib/strtod.c (_strtod_r): Changed to not assign to + word1 on systems with 32 bit doubles. + * libc/stdlib/qsort.c (qsort): Cast some void *'s to char *'s + so that we can do arithmetic on them. + * libc/misc/dprintf.c: Changed to support stdarg.h for ANSI + compilers. + +Tue Nov 28 16:03:32 1995 Doug Evans + + * libc/sys/arm/crt0.S: Zero bss. + +Fri Nov 24 16:09:23 1995 Doug Evans + + * libc/include/unctrl.h: New file. + * libc/misc/{Makefile.in,dprintf.c,unctrl.c,misc.tex}: New files. + * configure.in (subdirs): Add libc/misc. + * libc/Makefile.in (SUBDIRS): Add misc. + (SUBLIBS): Add misc/lib.a. + + * libc/include/sys/reent.h (struct _reent): Make __sf last member. + +Wed Nov 22 19:49:47 1995 Doug Evans + + * libc/stdio/vfprintf.c (__sbprintf): Init fake._data. + (_vfprintf_r): Call CHECK_INIT. + +Tue Nov 14 02:52:12 1995 Doug Evans + + * Makefile.in (MULTITOP): Delete. + (MULTISRCTOP, MULTIBUILDTOP): Add. + * configure.in: Delete call to cfg-ml-com.in. Call config-ml.in + instead of cfg-ml-pos.in. + +Wed Nov 8 01:24:08 1995 James G. Smith + + * libc/sys/vr4300/syscalls.c: Added clean version of sbrk(). + * libc/sys/vr4300/crt0.S: Cleaned up. Added check for FPU + presence. + +Thu Nov 2 22:25:06 1995 Michael Meissner + + * libc/string/strtok.c: Include string.h to pick up strtok_r + prototype. + +Wed Nov 1 18:54:11 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/string/strtok.c: include <_ansi.h>. + * libc/time/asctime_r.c: `reresult' -> `result'. + +Wed Nov 1 14:35:52 1995 J.T. Conklin + + * libc/time/{ctime.c, gmtime.c, lcltime.c}: Wrap functions + in #ifndef _REENT_ONLY ... #endif conditional. + + * libc/include/string.h (_strtok_r): Remove declaration. + * libc/include/time.h (_asctime_r): Remove declaration. + * libc/string/strtok.c (_strtok_r): Removed. + * libc/time/asctime.c (_asctime_r): Removed. + + * libc/string/Makefile.in (OFILES): Add new object. + * libc/string/strtok_r.c: New file. strtok_r function as + specified by POSIX.1c, adapted from strtok implementation + from NetBSD C library. + * libc/string/strtok.c (strtok): Reimplemented in terms of + strtok_r. + + * libc/time/Makefile.in (OFILES): Add new objects. + * libc/time/{asctime_r.c, ctime_r.c, gmtime_r.c, lcltime_r.c}: + New files, reentrant time functions specified by POSIX.1c. + * libc/time/{asctime.c, ctime.c, gmtime.c, lcltime.c}: Non- + reentrant time functions re-written in terms of reentrant + functions. + * libc/time/lcltime.c: Renamed from localtime.c + + * libc/include/time.h: Add prototypes for asctime_r, ctime_r, + gmtime_r, and localtime_r. + +Sat Oct 28 14:34:31 1995 steve chamberlain + + * libc/sys/win32/crt0.c (mainCRTStartup): Call cygwin_crt0. + * libc/include/sys/unistd.h (getlogin): Revert change of + Oct 19. + * libc/include/sys/signal.h (sigprocmask): Change prototype + so it compiles with c++. + +Wed Oct 25 15:43:18 1995 Michael Meissner + + * libc/include/machine/setjmp.h (PowerPC _JBLEN): Consider it a + PowerPC if __PPC__ is defined. Bump jump_buf length to 62 ints, + to give some room in case we need to align the jmp_buf. + + * libc/machine/powerpc/setjmp.S (setjmp, longjmp): Rewrite to use + the new ppc-asm.h include file the compiler provides to specify + function prologue/epilogue. Eliminate saves of the xer and ctr + registers, which are volatile. Before starting to save registers, + align to 8 byte boundary. + +Mon Oct 23 11:20:51 1995 James G. Smith + + * libc/sys/vr4300/syscalls.c: Added empty kill() function, + referenced by standard libraries. + +Thu Oct 19 21:39:47 1995 Fred Fish + + * libc/unix/Makefile.in, libc/string/Makefile.in, + libc/stdio/Makefile.in, libc/reent/Makefile.in, + libc/posix/Makefile.in: + Remove tabs from otherwise empty line. Confuses some + older non-GNU versions of "make". + +Thu Oct 19 16:32:17 1995 steve chamberlain + + * libc/sys/unistd.h (getlogin): Returns const char *. + +Wed Oct 18 12:57:50 1995 steve chamberlain + + * libc/include/fcntl.h (O_BINARY, O_TEXT): New. + * libc/include/errno.h: Moved into and include... + * libc/include/sys/errno.h: New file. + * libc/include/sys/wait.h: New file. + * libc/stdio/rename.c (_rename_r): Use _rename system call if available. + * libc/sys/win32/*: Moved out. + * libc/sys/win32/crt0.c: Rewritten to cope with shared library. + * configure.in (i[345]86-*-win32): HAVE_RENAME + +Wed Oct 18 09:58:27 1995 Brendan Kehoe + + * libc/unix/sigset.c (sigemptyset, sigaddset): Prefix #undef to + avoid macro expansion for these two names. + +Tue Oct 17 08:45:33 1995 Doug Evans + + * libc/machine/h8500/psi.S: r6 renamed to fp. + +Sun Oct 15 12:58:10 1995 Michael Meissner + + * configure.in (powerpc*): No longer need to define + NO_LONGLONG_POINTERS to supress warnings. + +Sat Oct 14 12:55:08 1995 Jim Wilson + + * libc/reent/reent.c (_reclaim_reent): Call cleanup indirectly + through PTR instead of directly. + + * libc/sys/sh/crt0.S: Clean up formatting. Delete unused + non-standard constructor support. + +Thu Oct 12 11:39:42 1995 J.T. Conklin + + * libc/stdlib/dtoa.c (_dtoa_r): Set result pointer to the + address of the Bigint instead of the address of its _x field, + as the size the result buffer was calculated accordingly. + Fix from Jim Wilson . + + * libc/stdlib/{div.c, ldiv.c}: Replaced with implementation + from NetBSD C library. No longer special cases division by + zero (which needs to be done by the application anyway), but + it doesn't need to call abs() (or labs()) four times either. + + * libc/stdlib/qsort.c: Replaced with implementation from + NetBSD C library. + +Tue Oct 10 14:01:10 1995 J.T. Conklin + + * libc/stdio/vfprintf.c: Replaced with implementation from + NetBSD C library (which is derived from the 4.4BSD C library). + * libc/stdio/cvt.c: Removed. + * libc/stdio/Makefile: Updated. + +Tue Oct 10 12:15:23 1995 steve chamberlain + + * libc/sys/win32/syscalls.c (rename): New. + * libc/sys/win32/include/winkernel.h (MoveFileExA): New. + +Fri Oct 6 12:18:43 1995 Jim Wilson + + * libc/machine/sh/Makefile.in (setjmp.o): Depend on setjmp.S. + * libc/machine/sh/setjmp.S: Rename from setjmp.s. + + * libc/sys/sh/Makefile.in (OFILES, all): Delete setjmp.o. + (setjmp.o): Delete rule to build setjmp.o. + * libc/sys/sh/setjmp.S: Delete file. + +Fri Oct 6 11:19:05 1995 J.T. Conklin + + * libc/stdlib/mprec.c (d2b): Added support for _DOUBLE_IS_32BITS. + * libc/stdlib/mprec.h: Fixed constants used for IEEE single float + format. Added #defines to map d2b, i2b, low0bits, lshift, mult, + pow5mult and s2b to identifiers with leading underscores. + * libc/stdlib/Makefile.in: Add mprec.h as a dependency to dtoa.o, + ecvtbuf.o, mprec.o and strtod.o. Sort dependencies. + +Thu Oct 5 17:27:30 1995 steve chamberlain + + * libc/sys/posix/popen.c (sys/types.h): Include. + +Thu Oct 5 16:33:01 1995 Doug Evans + + * libc/sys/win32/syscalls.h (fhandler): New struct. + (__lookup_fhandler, __lookup_fhandler_hook): Declare. + (__fhandler_normal): Declare. + (hinfo): New member op_handlers. + * libc/sys/win32/syscalls.c (__read): Don't validate fd. + (__write): Likewise. + (_read, _write, _open, _close, _lseek): Validate fd here. + Move file type specific stuff to foo_normal. + (read_normal, write_normal, open_normal, close_normal, lseek_normal): + New functions. + (__lookup_fhandler): New function. + (__lookup_fhandler_hook, __fhandler_normal): New variables. + + From anders.blomdell@control.lth.se (Anders Blomdell) + * libc/sys/win32/crt0.c (vfork_init): Unset __FD_TABLE__. + Don't touch standard handles. + * libc/sys/win32/spawn.c (_spawn): Use STARTF_USESTDHANDLES. + (_execve): Only create __FD_TABLE__ if necessary. + * libc/sys/win32/include/winkernel.h (STARTF_*): Define. + +Thu Oct 5 14:25:14 1995 steve chamberlain + + * libc/sys/win32/sys/termios.h (FLUSHO): New. + * libc/sys/win32/include/win*.h: Moved a load of prototypes around. + * libc/sys/win32/pipe.c (_fctnl): Ignore F_SETFL without errors. + * libc/sys/win32/exception.c (ehandler3): set strace when a signal + without a handler is received. + * libc/sys/win32/Makefile.in: Remove --nodelete. + * libc/sys/win32/resouce.c (gettimeofday): New. + * libc/sys/win32/syscalls.c (path_to_real_path): New. + * libc/sys/win32/syscalls.h (include/wincon.h): Don't include. + +Wed Oct 4 13:10:35 1995 Doug Evans + + * libc/sys/win32/dirsearch.c (opendir): stat real path name. + Don't append "/*" to search pattern if trailing '/' already there, + append "*". + * libc/sys/win32/spawn.c (_spawn): CreateProcess doesn't seem to + like /'s, convert them to \'s. Handle /// path names. + Add space for quoted \'s in arg string. Print translated prog name + and original prog name. + (_execve): Handle parent doing exec a teensy bit better. + * libc/sys/win32/syscalls.h (__path_to_real_path): Update prototype. + * libc/sys/win32/syscalls.c (__path_to_real_path): Don't assume + path needs conversion, handle both cases. Delete `const' from result. + (hash_path_name): New function. + (_open): Call it. + (_stat): Likewise. Fill in more fields for directories. + * libc/sys/win32/wait.c (_wait): Explicitly pass -1 to waitpid. + (wait_for_any): Fix trace message. + (waitpid): Explicitly test for intpid == 0. + + From anders.blomdell@control.lth.se (Anders Blomdell) + * libc/sys/win32/spawn.c (__vfork_get_empty_entry): zero fill result + so `next' is valid. + +Sat Sep 30 15:00:15 1995 Jason Molenda (crash@phyeaux.cygnus.com) + + * libc/sys/win32/spawn.c (_spawn): Make quoting rules more + complicated. + +Sat Sep 30 10:25:57 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/include/_ansi.h: set _HAVE_STDC if __STDC__ is defined + at all, not just == 1. + * libm/math/wf_acos.c (acosf): check for _HAVE_STDC, not __STDC__. + +Sat Sep 30 04:30:09 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/sys/win32/include/winbase.h: include and + * libc/sys/win32/include/wintypes.h: include + * libc/sys/win32/include/winnt.h: avoid multiple inclusion of this + file. + +Fri Sep 29 01:49:17 1995 steve chamberlain + + * libc/sys/syscalls.c (getcwd): Fix off by one error. + + * libc/sys/signal.c (sleep): Fill it in. + * libc/sys/termios.c (tcflush): Use PurgeComm + (tcsetattr): Set some more of the bits. + * libc/sys/include/winkernel.h: Add PurgeComm and Sleep. + +Fri Sep 29 04:33:53 1995 Doug Evans + + * libc/sys/arm/crt0.S (fp): Initialize to 0. + Conditionally include .idata$3 stuff ifdef __pe__. + +Fri Sep 29 01:49:17 1995 steve chamberlain + + * libc/sys/win32/crt0.c (hmap_init): Call __init_hinfo. + * libc/sys/win32/pipe.c (pipe): Ditto. + * libc/sys/win32/syscalls.c (__read): Use new vtime and vmin fields. + * libc/sys/win32/syscalls.h (hinfo): vtime, vmin are new. + * libc/sys/win32/termios.c (tcsetattr): Init new fields. + (tcgetattr): Contents are new. + * libc/sys/win32/include/winkernel.h (DCB): New. + (GetCommState, SetCommState): New. + +Thu Sep 28 16:29:09 1995 Doug Evans + + * libc/sys/arm/crt0.S (_start): Define. + +Thu Sep 28 12:26:45 1995 steve chamberlain + + * libc/sys/arm/crt0.S: Move stack to top of RAM on PIE board. + * libc/sys/arm/syscalls.c (_read, _write): Use the SWI properly. + + * libc/sys/win32/sysconf.c: New + * libc/sys/win32/sys/winadvapi.h: New + * libc/sys/win32/syscalls.h (hinfo): Added timeout_len, w_binary, r_binary. + * libc/sys/win32/crt0.c (hmap_init): Initialize new fields. + * libc/sys/win32/pipe.c (pipe): Ditto. + * libc/sys/win32/signal.c (_raise): New. + (_kill): Moved from spawn.c + * libc/sys/win32/spawn.c (kill): Moved to signal.c + * libc/sys/win32/syscalls.c (__read): Use new fields. + (_open): Ditto. + * libc/sys/win32/termios.c (tcflush, tcsetattr, tcgetattr): Fill in. + * libc/sys/win32/exceptions.c (__stack_trace): Keep going for longer. + * libc/include/sys/unistd.h (rmdir): Takes const path. + * libc/include/sys/stat.h (mkdir): Takes const path. + * libc/include/sys/signal.h (SIGTTOU, SIGTTIN): New for win32. + +Thu Sep 28 10:11:27 1995 Doug Evans + + * libc/sys/win32/spawn.c (_spawn): Fix quoting. + + Add support for specifying paths as ///foo/bar. + * libc/sys/win32/syscalls.h (__path_needs_conversion_p): Declare. + (__path_to_real_path): Declare. + (PATH_TO_REAL_PATH): New macro. + * libc/sys/win32/syscalls.c (__win32_pid_to_posix_pid): Minor cleanup. + (__path_needs_conversion_p, __path_to_real_path): New functions. + (_open): Fix test for error return from CreateFileA. + Handle new path syntax. + (_link, mkdir, rmdir, getcwd, chdir, stat): Handle new path syntax. + * libc/sys/win32/dirsearch.c (opendir): Likewise. + +Wed Sep 27 16:36:46 1995 steve chamberlain + + * libc/sys/win32/include/*.h: Reorganized + * libc/sys/win32/include/WINREADME: New. + * libc/sys/win32/Makefile.in (DLLS): Build version.a. + * libc/sys/win32/*.c: Fix for new include scheme. + * libc/sys/win32/crt0.c (__this_uinfo_buf, __this_uinfo): New. + * libc/sys/win32/getlogin.c (getlogin): Use uinfo. + * libc/sys/win32/passwd.c (*): Fix. + * libc/sys/win32/syscalls.c (get[e|][g|u]id): Use passwd info. + (_stat): Get directory owner and permissions right. + * libc/sys/win32/syscalls.h (uinfo): New. + * libc/sys/win32/version.def: Remove leading underscores. + +Tue Sep 26 18:18:47 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/sys/win32/key.c: include "include/wincon.h". + +Tue Sep 26 07:21:48 1995 steve chamberlain + + * libc/sys/win32/{key, stubs}.c: New. + * libc/sys/win32/Makefile: Adjust to cope. + * libc/sys/win32/crt0.c (vfork_init_first): Cope with -ve pids. + (environ_init): Change env names to upper case. + * libc/sys/win32/dirsearch.c (readdir): Don't fill in inode number. + * libc/sys/win32/passwd.c (*): Fill in the functions. + * libc/sys/win32/pipe.c (_fcntl): F_GETFL returns O_RDWR. + * libc/sys/win32/spawn.c (_spawn): Cope with -ve pids. + * libc/sys/win32/syscalls.c (__win32_pid_to_posix_pid): New function. + (_open): Initialze hmap->execable_p too. + * libc/sys/win32/syscalls.c (getuid, getgid, geteuid, getegid): Return from macros. + (_fstat): Fill in permissions. + * libc/sys/win32/syscalls.h (hinfo): Add execable_p. + +Fri Sep 22 13:47:27 1995 Doug Evans + + * configure.in (cfg-ml-com.in invocation): Use ${with_multilib_top} + if defined. + (cfg-ml-pos.in invocation): Likewise. + +Fri Sep 22 11:43:44 1995 J.T. Conklin + + * Makefile.in (MATHOBJS_IN_LIBC): Added s_isinf.o, sf_isinf.o, + s_isnan.o and sf_isnan.o. + +Wed Sep 20 14:50:19 1995 Ian Lance Taylor + + * All Makefile.in files: added maintainer-clean target as a + synonym for realclean. + +Wed Sep 20 11:02:50 1995 Jeff Law (law@snake.cs.utah.edu) + + * libc/include/machine/setjmp.h: Add hppa support. + * libc/machine/hppa/setjmp.S: New file with setjmp/longjmp + support. + * libc/machine/hppa/Makefile.in: Related changes. + +Tue Sep 19 12:09:01 1995 J.T. Conklin + + * configure.in (machine_dir): Don't set for v810-*-*. + +Fri Sep 15 20:22:08 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/sys/win32/crt0.c (passover): Change to handle MKS quoting + conventions correctly. + +Thu Sep 14 13:37:22 1995 J.T. Conklin + + * libc/stdio/puts.c: Update documentation of return value to match + ANSI standard. + +Thu Sep 14 01:52:37 1995 Doug Evans + + Fix file descriptor inheritance. + * libc/sys/win32/syscalls.h (CHILD_P): Define again. + (NOT_OPEN_FD): Fix. + * libc/sys/win32/spawn.c (vfork0): Only create inheritable handle if + close-on-exec flag not set. Initialize child's entire fd table. + * libc/sys/win32/syscalls.c (_open): Only create inheritable handle if + CHILD_P. + * libc/sys/win32/pipe.c (pipe): Only create new handle as inheritable + if CHILD_P. Initialize entire hmap entry. + (dup): Only create new handle as inheritable if CHILD_P. + (dup2): Likewise. Properly initialize hmap entry. + + * libc/sys/win32/spawn.c (_execve): Don't pass _P_SEARCH_PATH to + _spawn. + (_exit): Use CHILD_P. + * libc/sys/win32/syscalls.c (_fstat): Fix call to memset. + (_stat): Likewise. + +Mon Sep 11 23:09:39 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/sys/win32/crt0.c (passover): fix up the state table. + * libc/posix/popen.c: Added. + * libc/posix/Makefile.in: compile popen.c. + +Mon Sep 11 11:43:38 1995 J.T. Conklin + + * libc/include/machine/ieeefp.h: On the h8/300, h8/300h and + h8/500 define _DOUBLE_IS_32BITS. + +Sat Sep 9 17:55:54 1995 Doug Evans + + Get vfork/exec/spawn/cwait/wait working again. + * libc/sys/win32/syscalls.h (VFORK_NEWBORN_PSEUDO_PID): Define. + (procinfo): New member vfork_level. + * libc/sys/win32/crt0.c (__vfork_next_pid): Delete. + (vfork_init_first): Use GetCurrentProcessId to get pid. + Initialize vfork_level. + (vfork_init): Delete __PID__. + (environ_init): New function. Undo patch of Aug 19, Posix says + environment variables are case sensitive. + (mainCRTStartup): Call it. + * libc/sys/win32/spawn.c (__vfork_next_pid): Delete. + (my_longjump: Make static. + (_spawn): New argument `h'. Delete setting of __PID__. + Delete local `idx'. Look for chars that need quotes, rather than + ones that don't. Set handle of created process in `h'. + Result is process id if created task. + (allocate_spawn_entry): New function. + (spawnvp, spawnv): Call it. Store handle and pid in procinfo entry. + (_execve): Set __FD_TABLE__ before spawning child. + Scan our fd table when passing fds, not our parent's. + Store handle and pid in procinfo entry. + (vfork0): Ensure strace message always printed. + Set child pid to VFORK_NEWBORN_PSEUDO_PID. + (vfork): Don't clobber result of vfork0. + * libc/sys/win32/wait.c (cwait): Fix non-error result (is pid). + (wait_for_any): Ignore processes in state FORK_STATE_VFORK_0. + + * libc/sys/win32/syscalls.h (procinfo): New members `handle_valid_p' + and `exit_code'. + * libc/sys/win32/spawn.c (allocate_spawn_entry): Initialize them. + (vfork0): Likewise. Distinguish children, grandchildren, etc. by + adding vfork level to pseudo-pid. + (vfork1): If not root, set state back to FORK_STATE_VFORK_0. + (spawnvp, spawnv, _execve): Set handle_valid_p if success. + (_exit): If child, set exit code. + (__vfork_record_death): Only close process handle if valid. + * libc/sys/win32/wait.c (wait_for_single): Watch for children that + didn't exec. + (wait_for_any): Likewise. Start scan after root entry. + +Fri Sep 8 18:48:02 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/include/sys/types.h (off_t): off_t back to 32 bits. + * libc/include/sys/_types.h (_off_t): _off_t back to 32 bits. + * libc/sys/win32/syscalls.c (_fstat): st_size is lower 32-bits + of actual file length. + + * libc/sys/win32/sys/wait.h: include . + * libc/include/paths.h: _PATH_BSHELL added. + * libc/include/sys/unistd.h: define STDIN_FILENO, STDOUT_FILENO, + and STDERR_FILENO. + +Thu Sep 7 21:02:22 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/include/ar.h: Added. + * libc/include/sys/types.h: ino_t goes back to 32-bits. + * libc/sys/win32/syscalls.h (hinfo): added .namehash field. + * libc/sys/win32/syscalls.c (_open): compute .namehash based + on filename. + (_fstat): use .namehash for inode number of the fd. + +Thu Sep 7 12:57:19 1995 steve chamberlain + + * libc/sys/win32/{console,ioctl,pipe,spawn,syscalls,wait}.? (*): + Change hinfo to __this_procinfo. + * libc/sys/win32/crt0.c: Remove procinfo_list. + +Wed Sep 6 18:38:26 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/include/sys/types.h (ino_t): Define ino_t correctly for + win32 environment. + +Wed Sep 6 18:09:29 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/sys/win32/include/grp.h: Removed. + * libc/sys/include/grp.h: Added. + * libc/sys/win32/grp.c: Include . + +Wed Sep 6 16:52:48 1995 steve chamberlain + + * libc/include/sys/signal.h (__need_MAX_SIGNALS): Removed. + (sigset_t, sigaction, SIG_SETMASK, SIG_BLOCK, SIG_UNBLOCK): + Defined for all but strict ANSI. + * libc/include/sys/reent.h (__need_MAX_SIGNALS): Removed. + * libc/include/machine/setjmp.h: Get win32 _JBLEN right. + * libc/signal/signal.c (_signal_r): Changed from using + _MAX_SIGNALS to NSIG. + * libc/sys/win32/crt0.c (__current_pid, __parent_hmap, __child_hmap, + __hmap): Deleted. + (__strace, __vfork_next_pid): New. + (__exe_suffix): Default to 1. + (passover, table): Understand quoted arguments. + (vfork_init_first): New. + (vfork_init): Initialize new process structure. + (mainCRTStartup): Pass environ to main. + * exceptions.c (__sig_mask): New + (ehandler3): Ignore signals in mask. + (really_exit): Remove CHILD_P test. + * pipe.c (pipe, dup, dup2): Use new process and file structure. + * resource.c (getrusage): Ditto. + * signal.c (sigprocmask): New. + * spawn.c (*): Rewritten. + * syscalls.c (*): Use new process and file structure. + (find_unused_handle): New. + * syscalls.h (MAX_HANDLES): Deleted. + (hinfo): Removed child_created_p. + (MAX_CHILDREN): Deleted. + (vfork_jmp_info, procinfo): New. + * wait.c (*): Mostly new. + * sys/strace.h (_STRACE_PARANOID): New. + * sys/param.h: New file. + +Wed Sep 6 17:03:53 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/include/sys/stat.h: add S_BLKSIZE. + * libc/include/sys/_types.h: _off_t is a 64-bit type under win32. + * libc/include/sys/types.h: define off_t and ino_t to be 64 bit + types under win32. + (mode_t): add a #else to avoid multiple definitons. + + * libc/sys/win32/Makefile.in: add grp.c. + * libc/sys/win32/grp.c: include grp.h correctly. + * libc/sys/win32/syscalls.c (_fstat): set almost all of the fields + of the st structure with real information. + * libc/sys/win32 (dirent): d_ino is of type ino_t. + +Wed Sep 6 10:41:34 1995 Doug Evans + + * libc/include/sys/types.h (mode_t): Correct for svr4 sparc's + and (maybe) sparc64. + (nlink_t): Provide typedef. + +Tue Sep 5 18:46:05 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/sys/win32/grp.c: New file. + * libc/sys/win32/include/grp.h: New file. + +Tue Sep 5 13:47:27 1995 J.T. Conklin + + * libc/include/machine/ieeefp.h: Added whitespace to make this + file easier to maintain. + On the sh, define either __IEEE_BIG_ENDIAN or __IEEE_LITTLE_ENDIAN + depending on the value of __LITTLE_ENDIAN__. + On the sh3e, define _DOUBLE_IS_32BITS. + +Fri Sep 1 15:35:18 1995 James G. Smith + + * libc/sys/vr4300/syscalls.c: Added missing support + routines. _raise() and getpid(). + +Fri Sep 1 14:12:48 1995 James G. Smith + + * configure.in (mips*vr4300*-*-elf): Fixed silly mistake + +Fri Sep 1 08:42:11 1995 James G. Smith + + * configure.in (mips*vr4300*-idt-*) Add support for RISQ monitor + and VR4300 processor. + * libc/sys/vr4300: Add directory. + * libc/sys/vr4300/{Makefile.in, crt0.S, syscalls.c}: Add SIM + monitor run-time support. + +Thu Aug 31 09:16:52 1995 J.T. Conklin + + * libc/stdlib/Makefile.in (CHEWOUT_FILES): Removed atol.def. + * libc/stdlib/stdlib.tex: Don't include atol.def. + +Wed Aug 30 20:38:28 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/sys/win32/uname.c (uname): hardcode processor as `i386'. + +Wed Aug 30 10:48:08 1995 steve chamberlain + + * libc/ctype/Makefile.in: Fill in _to* dependencies. + +Tue Aug 29 17:14:29 1995 steve chamberlain + + * libc/sys/win32/{dirsearch.c,sys/dirent.h}: Fix namespace problems. + * libc/sys/win32/sys/dirent.h (struct dirent): Added d_ino. + * libc/sys/win32/strace.c (__sys_printf): Increase size of buffer. + * libc/sys/win32/smallprint.c (__small_vsprintf): Remove debug. + * libc/sys/win32/dirsearch.c (readdir): Set d_ino. + +Tue Aug 29 19:00:09 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/stdlib/atol.c (atol): DEFUN -> _DEFUN. + +Tue Aug 29 16:08:09 1995 J.T. Conklin + + * libc/stdlib/Makefile.in (OFILES): Added atoff.o and atol.o. + * libc/stdlib/atoff.c: New file. + * libc/stdlib/atof.c (atoff): Moved to atoff.c. + * libc/stdlib/atoi.c (atol): Removed. + * libc/stdlib/atol.c: Removed duplicate documentation. + + * libc/include/ctype.h (_tolower, _toupper): Moved inside + #ifndef _STRICT_ANSI conditional. + * libc/ctype/Makefile.in (OFILES): Added _tolower.o and _toupper.o + * libc/ctype/_tolower.c: New file. + * libc/ctype/_toupper.c: New file. + * libc/ctype/tolower.c (_tolower): Moved to _tolower.c. + * libc/ctype/toupper.c (_toupper): Moved to _toupper.c. + * libc/ctype/toascii.c (_toascii): Removed. + +Tue Aug 29 12:17:32 1995 Doug Evans + + * libc/sys/sparc64/sys/types.h: Deleted. + +Mon Aug 28 22:06:08 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/sys/win32/uname.c (uname): change `Windows/NT' to `Windows_NT' + and recognize Windows_95 systems. + +Mon Aug 28 19:50:54 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/sys/win32/crt0.c (vfork_init, hmap_init): standard I/O fds + and passed fds should be opened in text mode. + +Mon Aug 28 18:51:22 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * libc/sys/win32/crt0.c (vfork_init): mark passed fds as used + in __hmap, set to binary mode by default. + +Tue Aug 22 14:12:37 1995 J.T. Conklin + + * libc/sys/sh/syscalls.c: Updated all functions to call __trap34. + * libc/sys/sh/trap.S (__trap34): Renamed from __trap3. Use trap + vector 34. + +Sat Aug 19 18:25:37 1995 steve chamberlain + + * Makefile.in (install): Install all libraries found in the + top level. If there's a sys//include directory, + install those headers into include. + + * libc/sys/win32/kernel.def351: Delete + * libc/sys/win32/{comctl32.def, comdlg32.def, ctl3d32.def, + glaux.def, glu32.def, largeint.def, libc.def, libcmt.def, + lz32.def, mgmtapi.def, mpr.def, msacm32.def, msvcrt.def, + nddeapi.def, netapi32.def, odbc32.def, odbccp32.def, oldnames.def, + ole32.def, oleaut32.def, opengl32.def, rasapi32.def, rpcndr.def, + rpcns4.def, rpcrt4.def, scrnsave.def, shell32.def, snmp.def, + uuid.def, vdmdbg.def, version.def, vfw32.def, win32spl.def, + winmm.def, winspool.def, winstrm.def, wsock32.def}: New. + + * libc/sys/win32/Makefile.in: Update for new files and new dlltool options. + * libc/sys/win32/crt0.c: Force all env names to upper case. + * libc/sys/win32/sys/win*.h -> libc/sys/win32/include + * libc/sys/win32/*.c: Headers have moved. + * libs/sys/win32/*.[ch]: Test for open_p rather than BAD_HANDLE, + __vfork_child_idx is now __vfork_child_ptr. + + * posix/execvp (execvp): Don't crash if no PATH envname. + +Fri Aug 18 12:22:59 1995 J.T. Conklin + + * libc/include/sys/reent.h (_Bigint): Removed _reclaim field. + * libc/reent/reent.c (_reclaim_reent): Free Bigint's by going + through the _freelist instead of through the _reclaim list. + * libc/stdlib/mprec.c (_Balloc): Don't put new node on _reclaim list. + * libc/stdlib/mprec.c (_Bcopy): Make like version in master dtoa.c + sources. + +Thu Aug 17 11:03:27 1995 J.T. Conklin + + * libc/machine/h8500/setjmp.S: New file. + * libc/include/machine/setjmp.h: Updated for H8/500. + +Wed Aug 16 16:19:11 1995 steve chamberlain + + * libc/sys/win32/syscalls.c (_open): More stracing. + (_stat): Open the file in O_BINARY. + +Wed Aug 16 15:49:01 1995 J.T. Conklin + + * libc/machine/h8300/setjmp.S: New file. + * libc/include/machine/setjmp.h: Updated for H8/300 and H8/300H. + +Tue Aug 15 10:31:09 1995 Doug Evans + + * libc/sys/win32/crt0.c (__exe_suffix): New global. + (mainCRTStartup): Set __exe_suffix from LIBC_EXE_SUFFIX. + * libc/sys/win32/spawn.c (_spawn): Add .exe suffix based on + __exe_suffix. Free fd_tab after setting env variable. + (spawnv,_execve): Update. + * libc/sys/win32/syscalls.h (__exe_suffix): Declare. + * libc/sys/win32/smallprint.c (puts,putn): New (static) functions. + (__small_vfprintf): New function. + * libc/sys/win32/strace.c (__sys_printf): Call __small_vfprintf. + * libc/sys/win32/wait.c (cwait): Validate argument. + + * libc/sys/win32/syscalls.c (queue_file_deletion): Add trace message. + (process_deletion_queue): Likewise. + + * libc/sys/win32/Makefile.in (lib.a): Don't call $(RANLIB). + +Mon Aug 14 10:14:10 1995 steve chamberlain + + * libc/sys/win32: Copyrights and gratuitous indenting. + +Mon Aug 14 01:32:58 1995 Doug Evans + + * libc/sys/win32/syscalls.c (queue_file_deletion): Finish. + (process_deletion_queue): Likewise. + (__close_all_files): New function. + (_close): Only queue file deletion if really a file. + * libc/sys/win32/spawn.c (_spawn): Only ensure .exe suffix if + _P_APPEND_EXE. + (_exit): Call __close_all_files. + + * libc/stdlib/system.c: #include . + (_system_r): Fix results in -DNO_EXEC case. + + * libc/sys/win32/sys/dirent.h (DIR): New member __d_dirname. + Reorganize structure. + * libc/sys/win32/dirsearch.c (opendir): Use stat to determine + if argument is valid. Save directory name in DIR. malloc space + for dirent struct separately. + * libc/sys/win32/syscalls.c (stat): Fix test for directory. + + * libc/include/errno.h (ENAMETOOLONG): Define. + * libc/string/strerror.c (strerror): Reword ENFILE. + Add ENOSYS, ENMFILE, ENOTEMPTY, ENAMETOOLONG. + +Sun Aug 13 22:42:25 1995 Doug Evans + + * libc/sys/win32/crt0.c (__progname): New global. + (mainCRTStartup): Support strace=bitmask,filename. + * libc/sys/win32/dirsearch.c (all fns): Add trace messages. + * libc/sys/win32/syscalls.c (_write): Print parent trace message + if error. + (getcwd): Handle len too small. Convert '\\' to '/'. + * libc/sys/win32/sys/fcntl.h (O_RDWR): = O_RDONLY|O_WRONLY. + Add prototypes for open, creat, fcntl. + (O_APPEND): Change value to conform to Microsoft's value. + * libc/sys/win32/sys/strace.h (_STRACE): Protect in do/while. + + * libc/stdlib/getopt.c: New file. + * libc/stdlib/Makefile.in: Build it. + +Sat Aug 12 12:17:14 1995 Doug Evans + + * libc/posix/execvp.c (execvp): Watch for DOS drives ifdef _WIN32. + Fix scanning of $PATH. + * libc/posix/exec*.c: Call _execve, not execve. + * libc/posix/execve.c: New file. + * libc/posix/Makefile.in (OFILES): Add execve.o. + + * libc/sys/win32/sys/strace.h (_STRACE_ALL, _STRACE_UHOH, + _STRACE_STARTUP, _STRACE_SYSCALL): More bit masks of things to trace. + (_STRACE): If level==0, always print. Handle new bit mask scheme. + * libc/sys/win32/crt0.c: Update _STRACE calls. + * libc/sys/win32/{pipe.c,resource.c,spawn.c,syscalls.c,wait.c}: Ditto. + + * libc/sys/win32/smallprint.c (rn): Fix digit list. + + * libc/sys/win32/syscalls.c (__really_exit): Move from here, + * libc/sys/win32/exceptions.c (really_exit): to here. Avoid recursion. + * libc/sys/win32/spawn.c (spawnvp): Pass `prog' as image name. + Print __seterrno trace message first. + (_execve): Renamed from execve. + (vfork): Update __strace usage. + (__vfork_child_pid): Deleted. + (__vfork_children, __vfork_child_idx): New globals. + (_spawnvp): New function. + (spawnvp, spawnv, _execve): Call _spawnvp. + (init_child): Record child in __vfork_children. + (__vfork_get_entry, __vfork_record_death): New functions. + * libc/sys/win32/crt0.c (mainCRTStartup): Initialize __vfork_children. + * libc/sys/win32/kernel32.def (WaitForMultipleObjects): Define. + * libc/sys/win32/syscalls.h (CHILD_P): New macro. All files updated. + (MAX_CHILDREN, CHILD_INTERIM_PID): Define. + (children): New typedef. + (__vfork_children,__vfork_child_idx): Declare. + (__vfork_get_entry,__vfork_record_death): Declare. + * libc/sys/win32/wait.c (wait_for_single,wait_for_any): New functions. + (waitpid): Handle pid == -1. + * libc/sys/win32/sys/wintypes.h (WaitForMultipleObjects): Declare. + * configure.in (i386-win32): Add -DNO_FORK. + * libc/syscalls/sysfork.c (fork): Don't define for NO_FORK. + * libc/reent/execr.c (_fork_r): Likewise. + * libc/stdlib/system.c (do_system): New function. + If WIN32, try to get shell path from $SH_PATH, use vfork. + (_system_r): Return 1 for (s == NULL) if WIN32 or unix, + otherwise return 0. + +Sat Aug 12 11:08:00 1995 steve chamberlain + + * libc/stdlib/{mallocr.c, mstats.c}: Move mstats from mallocr to mstats.c. + * libc/sys/win32/fcntl.h: Don't include self. + * libc/sys/win32/sys/strace.h (_STRACE_WM, _strace_wm): New. + * libc/sys/win32/sys/winbase.h: (GetUserName) New. + * libc/sys/win32/sys/wincon.h (HANDLER_ROUTINE): Define correctly. + * libc/sys/win32/sys/wintypes.h (GetFileType, GetCurrentProcess, CloseHandle, + SetFilePointer, CreateFileA, GetFileInformationByHandle, GetStdHandle): + Correct prototypes. + * libc/sys/win32/strace.c: New file. + * libc/sys/win32/smallprint.c: New file. + * libc/sys/win32/crt0.c (func): Delete. + (mainCRTStartup): Fix alloca usage. Set handles explictly. + * libc/sys/win32/dirsearch.c: Clean up handle usage, fix calls to __seterrno. + * libc/sys/win32/exceptions.c: Lint. + * libc/sys/win32/{ioctl.c, pipe.c, resource.c, spawn.c, cwait.c, syscalls.c}: + Clean up handle usage. + * libc/sys/win32/syscalls.c (__sys_printf): Moved into strace.c + (open.c): Default file type is text. + * libc/sys/win32/uname.c (uname): Use __small_sprintf. + * libc/sys/win32/advapi32.def: New + +Fri Aug 11 17:11:52 1995 Doug Evans + + * configure.in (posix_dir, libc_posix_lib): New variables. + Define LIBC_POSIX_LIB in makefile to be $libc_posix_lib. + (i[345]86-*-win32): Define posix_dir. + Delete -DNO_EXEC. Define -DHAVE_OPENDIR. + (if unix_dir): Fix typo. + * libc/posix/{Makefile.in,closedir,opendir,readdir,rewinddir, + scandir,seekdir,telldir}: New files. + * libc/posix/{execl.c,execle.c,execlp.c,execv.c,execvp.c}: Move here + from libc/unix. + * libc/Makefile.in (LIBC_POSIX_LIB): Define. + (SUBDIRS): Add posix. + (SUBLIBS): Add $(LIBC_POSIX_LIB). + + * libc/include/sys/signal.h (SIGCHLD): Add for _WIN32. + (NSIG): Increase to 21. + * libc/include/sys/unistd.h (pid_t): Move from here, + * libc/include/sys/types.h (pid_t): to here. + + * libc/sys/win32/syscalls.h: #include "sys/strace.h". + (__ptrace): Delete. + (hinfo): New members close_exec_p, child_created_p. + (struct exception_list): Define. + (__hmap): Redefine as pointer to table. + (__parent_hmap, __child_hmap): New globals. + (__set_errno, __really_exit): Declare. + (__vfork_child_pid): Declare. + * libc/sys/win32/crt0.c (__strace, __trace_file): New global. + (__orig_stdin, __orig_stdout, __orig_stderr): New globals. + (__parent_hmap, __child_hmap): New globals. + (__hmap): Redefine as pointer to active map. + (__get_console): New function. + (mainCRTStartup): Change leading '=' in environ vars to '!'. + (env __FD_TABLE__): Watch for this and initialize our fd/handle + mapping table from it if defined. + (argv, envp): Dump if __strace >= 4. + (main): Call here. + * libc/sys/win32/exceptions.c (myp): Redefine. + (__syscalls_b): Delete. + (__stack_trace): New function. + (ehandler3): Update to use _STRACE. Print stack trace. + Call __really_exit instead of exit. + (init_exceptions): Delete args argc,argv. New arg mine. + * libc/sys/win32/kernel32.def (CreatePipe, DuplicateHandle, FindClose, + FindFirstFileA, FindNextFileA, GetComputerNameA, + GetEnvironmentVariableA, ReadFile, SetEnvironmentVariableA): Define. + * libc/sys/win32/signal.c (signal): Validate arg. + (alarm, sleep): Define as stubs for now. + * libc/sys/win32/syscalls.c (all fns): Update to use _STRACE. + (__syscalls_b, errno): Delete. + (__vfork_child_pid, __vfork_jmp_buf): New globals. + (__seterrno): Handle more errors. + (__sys_printf): Renamed from _ptrace. + (__really_exit): New function. + (queue_file_deletion, process_deletion_queue): New functions. + (__resume_parent): New function. + (_unlink): Handle trying to delete open file. + (__totime_t): Renamed from totime_t. + (setsid, __read, __write): New functions. + (cwait, spawnvp, R, D, getrusage, _execve, _fork, _wait): Delete. + * libc/sys/win32/{dirsearch.c,getlogin.c,misc.c,resource.c,passwd.c, + times.c,spawn.c,pipe.c,wait.c,termios.c,ioctl.c,uname.c}: New files. + * libc/sys/win32/console.c: Update to new definition of __hmap. + * libc/sys/win32/Makefile.in: Build new files. + * libc/sys/win32/sys/{dirent.h,winerror.h,wait.h,termios.h}: New files. + * libc/sys/win32/sys/{ioctl.h,utsname.h}: New files. + * libc/sys/win32/sys/strace.h: Renamed from ptrace.h. + * libc/sys/win32/sys/wintypes.h (GetCurrentDirectoryA): Fix prototype. + +Thu Aug 10 16:32:52 1995 Doug Evans + + * libc/sys/h8500hms/misc.c (kill): Handle SIGABRT. + +Thu Aug 10 12:07:38 1995 J.T. Conklin + + * libc/stdlib/{dtoa.c, strtod.c}: Merged assorted changes that + have been made to the master dtoa.c sources (from netlib.att.com) + since they were integrated into newlib in early 1992. Fixes + problems with storage leaks and handling of numbers with very + negative exponents. + +Wed Aug 9 14:18:39 1995 J.T. Conklin + + * Makefile.in (all): set rootpre and srcrootpre before calling + sub-makes. + +Tue Aug 8 17:20:45 1995 steve chamberlain + + * libc/sys/win32/crt0.c: Change __hmap usage. + * libc/sys/win32/exceptions.c: Use _ptrace call. + * libc/sys/win32/syscalls.c: Use _ptrace call. + (read, write): Cope with DOS style CRLF when in TEXT mode. + * libc/sys/win32/syscalls.h: Declare hinfo struct. + * libc/sys/win32/user32.def: Get DefWindowProc arg list right. + * libc/sys/win32/sys/fcntl.h, ptrace.h: New. + * libc/sys/win32/sys/windows.h: Fill in rest of messages. + * libc/sys/win32/sys/wintypes.h: Fix attribute syntax. + +Mon Aug 7 13:04:54 1995 J.T. Conklin + + * libc/include/math.h (cabs, cabsf, drem, dremf): New declarations. + + * libm/math/{w_cabs.c, wf_cabs.c, w_drem.c, wf_drem.c}: New files, + wrappers for hypot() and remainder() for BSD libm compatibility. + These are public domain implementations written by me for the + NetBSD libm some time ago. Note cabs() is required by ucbtest. + * libm/math/Makefile.in (obj): Added w_cabs.o and w_drem.o. + (fobj): Added wf_cabs.o and wf_drem.o. + +Thu Aug 3 08:13:05 1995 J.T. Conklin + + * libc/sys/h8500hms/misc.c: New file. + * libc/sys/h8500hms/Makefile.in (OFILES): Add misc.o. + +Wed Aug 2 16:46:27 1995 J.T. Conklin + + * libc/time/localtime.c (localtime): Fix problem with leap year + handling. Stole algorithm from Arthur David Olson's tz code. + +Mon Jul 31 10:21:54 1995 steve chamberlain + + * configure.in: (z8k-*sim): Renamed z8k-*-coff. + + * libc/sys/z8ksim/glue.c (_getpid, _kill): New + (_exit): Use argument. + +Fri Jul 28 15:17:04 1995 Doug Evans + + * libc/sys/win32/sys/winbase.h (_WINBASE_H): Define. + +Wed Jul 26 16:24:19 1995 steve chamberlain + + * libc/sys/sh/trap.S (perrno): Align correctly. (pr 7532) + +Mon Jul 24 13:42:52 1995 J.T. Conklin + + * configure.in (sparc*): Add -DMALLOC_ALIGNMENT=8 to + target_cflags. + +Mon Jul 24 11:42:07 1995 steve chamberlain + + * libc/sys/win32/crt0.c (mainCRTStartup): Look for + ptrace with case insensitivity + * libc/sys/win32/{user32.def, gdi32.def, exceptions.c, screen.c, + sys/winbase.h, sys/windows.h, sys/wintypes.h, sys/winuser.h}: + New files. + +Fri Jul 21 11:22:26 1995 Doug Evans + + * Makefile.in: Multilib support moved to ../cfg-ml-{com,pos}.in. + (MULTITOP, MULTIDIRS, MULTISUBDIR, MULTIDO, MULTICLEAN): New variables. + (all, install, *clean): Use new multilib support. + * configure.in: Multilib support moved to ../cfg-ml-{com,pos}.in. + +Fri Jul 21 07:11:42 1995 steve chamberlain + + * libc/include/sys/signal.h (__WIN32__): New. + + * configure.in (i386-*-win32): Remobe SBRK_IS_ALLOC. + + * libc/stdlib/mprec.c (Balloc): Fix trampling problem. + (ulp, b2d): Handle 32 bit doubles. + * libc/stdlib/mprec.h: Handle 32 bit doubles. + * libc/stdlib/strtod.c (_strtod_r): Ditto. + +Fri Jul 14 08:24:58 1995 steve chamberlain + + from medp@primag.co.uk: + * libc/stdio/setvbuf.c (setvbuf): Fix line buffering on + dynamically allocated buffers. + +Thu Jul 20 10:11:03 1995 Fred Fish + + * libc/include/sys/unistd.h (_exit): Add _ATTRIBUTE ((noreturn)). + * libc/stdlib/exit.c (unistd.h): Include to pick up _exit() declaration. + +Thu Jul 20 10:16:25 1995 Michael Meissner + + * configure.in (powerpc): Fix previous fix. + +Wed Jul 19 14:08:55 1995 Michael Meissner + + * configure.in (powerpc-*eabiaix*): Update PowerPC multilib + directories for this target. + +Wed Jul 19 00:34:30 1995 Jeffrey A. Law + + * configure.in (hppa): Add machine_dir definition. + * libc/machine/hppa: New directory with PA specific implementations + of the basic memory/string functions. + +Tue Jul 18 21:16:00 1995 Michael Meissner + + * configure.in: Update current PowerPC multilib directories. + Split big and little endian configurations. + +Tue Jul 18 11:55:33 1995 Ian Lance Taylor + + * configure.in: Add --enable-single-float option to configure to + control use of MIPS single-float directories. Default to yes. + + * Makefile.in (all): Don't recurse into multilib directory if it + does not exist. + +Mon Jul 17 15:51:30 1995 J.T. Conklin + + * libc/sys/sh/syscalls.c: Fix typo. + +Mon Jul 3 14:38:52 1995 Steve Chamberlain + + * Makefile.in, libc/Makefile.in, libc/sys/Makefile.in: + Pass down DLLTOOL. + * libc/include/process.h: Define WAIT_CHILD. + * libc/include/types.h: Get sizes right for win32. + * configure.in (i386-*-pe): Becomes i386-win32. + * libc/sys/win32/{crt0.c, kernel32.def, longjmp.c, setjmp.c, syscalls.c + wintypes.h,sys/file.h,sys/resource.h}: Second pass. + * libc/stdlib/mallocr.c: Don't round up memory block if SBRK_IS_ALLOC + is defined. + +Wed Jun 28 18:34:54 1995 Steve Chamberlain + + * configure.in (i[345]86-*-pe): New target (NT). + * host/any: DLLTOOL new. + * libc/sys/win32/{crt0.c, kernel32.def, longjmp.c, setjmp.c, syscalls.c + wintypes.h,sys/file.h,sys/resource.h}: Preliminary support for + WIN32 (just enough to cross host the comp-tools). + +Thu Jun 22 11:45:18 1995 Doug Evans + + * libc/machine/h8300/{cmpsi.S,ucmpsi.S,divhi3.S,mulhi3.S,mulsi3.S}: + Deleted. These files live in gcc/config/h8300/lib1funcs.asm now. + +Mon Jun 19 11:40:40 1995 Doug Evans + + * libc/include/machine/ieeefp.h (arm): Change to always be + __IEEE_BIG_ENDIAN (even on little endian ARM's). + +Thu Jun 8 14:22:28 1995 Steve Chamberlain + + * libc/sys/crt0.S: Initialze sp, and call exit after main. + * libc/sys/syscalls.c (abort): New. + * configure.in (arm): Define ABORT_PROVIDED. + +Wed Jun 7 14:04:35 1995 J.T. Conklin + + * configure.in (powerpc): Define multidirs. + +Mon Jun 5 16:10:13 1995 Doug Evans + + * libc/sys/arm/crt0.S: Add __USER_LABEL_PREFIX__ support. + +Thu Jun 1 10:51:47 1995 Sean Eric Fagan + + * configure.in (sparclite): Delete target_cflags. Define multidirs. + +Wed May 24 14:23:25 1995 Steve Chamberlain + + * configure.in, libc/include/machine/ieeefp.h: Modified + for arm: + libc/machine/arm/*, libc/sys/arm/*: New + +Tue May 23 13:53:07 1995 J.T. Conklin + + * libc/include/machine/ieeefp.h: Use __PPC__ instead of + __powerpc__ when determining endianness. + +Wed May 10 07:55:56 1995 J.T. Conklin + + * configure.in (m68*): Add multidir for the m68332. + + * host/any (CC): Fix typo in last change. + +Fri Apr 14 22:20:31 1995 Ken Raeburn + + * libc/include/sys/config.h: Test __m68k__ instead of __m68000__ + when determining endianness. + * libc/include/machine/ieeefp.h: Ditto. + * libc/machine/m68k/setjmp.S: Use '&' instead of '#' for immediate + operands. + +Fri Apr 14 14:14:29 1995 Doug Evans + + * libc/include/errno.h (ENOTEMPTY): Define. + +Thu Apr 6 12:21:20 1995 J.T. Conklin + + * configure.in (sparc-sun-sunos*): Add -DMALLOC_ALIGNMENT=8 to + target_cflags. + + * libc/sys/sun4/Makefile.in (COPYOFILES): Added rem.o, multiply.o, + and umultiply.o. + + * libc/stdio/tmpnam.c (worker): Unconditionally increment count + instead of only when open succeeds. ANSI requires that multiple + calls to tmpnam() result in different files. + + * libc/sys/sun4/Makefile.in (COPYRENAMEOFILES): New macro, list of + objects pulled in from /lib/libc.a that must be renamed before + being pulled into newlib. /lib/libc.a's div.o conflicted with + newlib's file with the same name. + + * libc/stdlib/ldiv.c (ldiv): Call labs() instead of abs(). + + * host/any (CC, AS, AR, RANLIB): Changed so that executables in + the build tree will only be used if the executables are present + (instead of just the Makefiles). + + * libc/include/stdlib.h (mblen, mbtowc, wctomb, mbstowcs, + wcstombs): Define. + * libc/stdlib/{mblen.c, mbstowcs.c, wcstombs.c}: New files, null + versions of these functions that I orignally wrote for the + NetBSD C library. + * libc/stdlib/{mbtowc.c, wctomb.c}: Replaced functions with + versions I wrote for NetBSD. + +Wed Mar 29 12:42:42 1995 Kung Hsu + + * libc/sys/sparclite/Makefile.in: add crt0.s and make info. + * libc/sys/sparclite/crt0.s: ditto. + +Tue Mar 28 20:28:03 1995 Rob Savoye + + * configure.in: Add soft-float for proelf. + +Mon Mar 27 12:07:56 1995 Steve Chamberlain + + * libc/stdlib/mprec.h (Bcopy): Copy the right number + of bytes. + +Mon Mar 27 11:24:22 1995 Doug Evans + + * Makefile.in (all): Depend on `force'. + * configure.in (syscall_dir): Renamed from fake_sys_dir. + (libc_syscall_lib): Renamed from libc_fake_sys_lib. + (LIBC_SYSCALL_LIB): Renamed from LIBC_FAKE_SYS_LIB. + * libc/Makefile.in: Likewise. + * libc/include/reent.h: Update syscall references. + (_fcntl_r): Add prototype. + * libc/syscalls/*.c #include . + (*) Call reentrant version if REENTRANT_SYSCALLS_PROVIDED. + +Mon Mar 20 16:57:39 1995 Doug Evans + + * libc/include/sys/stat-dj.h (S_ISBLK): Define. + (S_ISCHR, S_ISDIR, S_ISFIFO, S_ISREG): Define. + * libc/include/sys/stat.h (stat-dj.h): Include ifdef MSDOS. + (time.h, sys/types.h): Always include (even if MSDOS). + (stat): Fix prototype. + +Fri Mar 10 11:30:38 1995 Ian Lance Taylor + + * configure.in (i[345]86-*-go32): Compile with -DNO_EXEC. + +Mon Feb 27 18:00:39 1995 Jim Wilson + + * libc/machine/h8500/psi.S (EXTPSIHI_RN_SN): Ifdef out. + +Mon Feb 13 16:10:03 1995 Ian Lance Taylor + + * libc/include/regdef.h: New file. + * libc/machine/mips/machine/regdef.h: New file. + +Mon Feb 6 15:24:29 1995 Doug Evans + + * libc/sys/sparc64/sys/fcntl.h (open): Add ellipsis. + +Fri Jan 27 13:52:10 1995 Steve Chamberlain + + * libc/sys/sh/crt0.S: Pass main's return to exit. + * libc/sys/sh/trap.S: Put errno in the right place. + +Tue Jan 24 18:57:56 1995 Ian Lance Taylor + + * libm/math/e_rem_pio2.c (__ieee754_rem_pio2): Integrate change + from fdlibm 5.2: handle |x| < 3pi/4 more efficiently. + * libm/math/ef_rem_pio2.c: Likewise. + * libm/math/e_log10.c: Remove unused static one. + * libm/math/ef_log10.c: Likewise. + * libm/math/s_frexp.c: Likewise. + * libm/math/sf_frexp.c: Likewise. + +Sun Jan 22 21:26:14 1995 Steve Chamberlain + + * libc/sys/go32/Makefile.in, clock.S, dir.c, setjmp.S, stat.c, + longjmp.S: Upgraded. + * libc/sys/go32/sys/setjmp.h: Upgraded. + * libc/sys/go32/sys/go32.h, dpmi.h: New files. + +Fri Jan 20 18:33:18 1995 Ian Lance Taylor + + * configure.in: Add many entries to multidirs for mips targets. + +Wed Jan 18 10:19:25 1995 J.T. Conklin + + * libm/math/e_jn.c (__ieee754_yn): Integrate change from fdlibm + 5.2 which fixes bug where jn(-1,x) is three times larger than + the actual answer. + * libm/math/ef_jn.c (__ieee754_ynf): Likewise. + +Sun Jan 15 21:48:58 1995 Steve Chamberlain + + * libc/sys/w65/sys/syscalls.h: New file + * libc/include/machine/ieeefp.h: W65 support. + * libc/include/sys/config.h: Ditto. + * libc/machine/w65/Makefile.in, cmpsi, divsi3, lshrhi.s, mulsi3.c, + sdivhi3.s, smulhi3.s, udivhi3.s, umodhi3.s: New files. + * libc/sys/w65/Makefile.in, crt0.c, syscalls.c, trap.c: New files. + +Wed Jan 11 15:59:01 1995 Ian Lance Taylor + + * libc/sys/Makefile.in (lib.a, crt0.o): Depend upon subs. + +Tue Jan 3 15:57:03 1995 Rob Savoye + + * Makefile.in, configure.in: Remove any references to the old + "stub" dir. + +Thu Dec 22 10:42:08 1994 Ian Lance Taylor + + * libc/syscalls/sysopen.c: Write _HAVE_STDC version of open, which + uses ... in prototype. + + +Wed Nov 30 08:39:42 1994 Ian Lance Taylor + + * libc/sys/a29khif/sys/libconfig.h: Remove. + * libc/sys/go32/sys/libconfig.h: Remove. + * libc/sys/sun4/sys/libconfig.h: Remove. + * libc/sys/sysvi386/sys/libconfig.h: Remove. + * libc/sys/sysvnecv70/sys/libconfig.h: Remove. + * libc/sys/sparc64/sys/libconfig.h: Remove. + + * libc/include/_ansi.h (_FLOAT_ARG, _FLOAT_RET): Don't define. + * libc/include/sys/config.h (_FLOAT_ARG, _FLOAT_RET): Likewise. + * libc/include/math.h: Change all uses of _FLOAT_RET and + _FLOAT_ARG to float. + * libm/test/math.c: Likewise. + * testsuite/libm.sac/math.c: Likewise. + * testsuite/libm.sac/working/math.c: Likewise. + +Wed Nov 23 22:39:28 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * libc/sys/sh/trap.s,crt0.s,setjmp.s: Renamed with .S so that + gcc calls gas with endian option. + * configure.in (sh): Build little endian version too. + +Wed Nov 16 18:21:45 1994 Ian Lance Taylor + + * configure.in: Configure big and little endian versions for MIPS + targets. + +Sat Nov 12 21:12:51 1994 Doug Evans + + * libc/include/limits.h: Deleted. + * libc/include/machine/limits.h: Deleted. + +Thu Nov 10 15:32:44 1994 Rob Savoye + + * ChangeLog: Remove stub directory. This has all been rewritten + and moved to devo/libgloss. + +Thu Sep 29 18:31:04 1994 Ian Lance Taylor + + * Makefile.in (dvi): Add to info target, use $@ in sub make. + (docs): Merge into info target. + * libm/Makefile.in (dvi): Add $(srcdir). + * libm/math/Makefile.in (chobjs): Remove underscores from file + names. Texinfo doesn't like them. + (wacos.def, ...): Add explicit targets for all .def files. + * libm/math/math.tex: Remove underscores from @include file names. + * doc/Makefile.in (dvi): Add dummy target. + * testsuite/Makefile.in (dvi): Add dummy target. + +Mon Sep 26 21:17:46 1994 Doug Evans (dje@canuck.cygnus.com) + + * Makefile.in (VERSION): Define. For net newlib releases. + +Thu Sep 22 19:01:26 1994 Doug Evans (dje@canuck.cygnus.com) + + * README: New file. + +Mon Sep 19 16:35:23 1994 Jim Wilson (wilson@sphagnum.cygnus.com) + + * libc/stdlib/ecvtbuf.c (_gcvt): Undo last change. + +Mon Sep 19 11:44:23 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * libc/stdlib/setenv.c (_findenv): Declare. + + * libc/include/sys/fcntl.h: Fix declarations of open, creat, and + fcntl to not use _EXFUN, and change string parameters to open and + creat to be ``const char *''. + * libc/sys/sparc64/sys/fcntl.h: Likewise. + * libc/sys/sparc64/creat.c (creat): Make PATH const. + * libc/syscalls/sysopen.c: Include . + (open) Make _FILE const. + * libc/sys/z8ksim/glue.c (_open): Make BUF const. + (_creat): Make PATH const. + * libc/sys/h8300hms/syscalls.c (_open): Make PATH const. + * libc/sys/h8500hms/syscalls.c (_open): Likewise. + * libc/sys/m88kbug/syscalls.c (open): Likewise. + * libc/sys/sh/syscalls.c (_open): Likewise. + * stub/shared/glue.c (open): Make BUF const. + * stub/ex93x/syscalls.c (open): Make FILENAME const. + +Thu Sep 8 16:39:12 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * libc/include/errno.h: Add ENMFILE + * libc/include/sys/config.h: Support Z8000. + * libc/include/sys/signal.h: New signals for go32. + * libc/machine/h8500/psi.S (__addpsir0r0): New function + * libc/machine/h8500/cmpsi.S (__ucmppsi2): New function + * libc/machine/sh/sdivsi3.s (__sdivsi3): Rewritten. + * libc/stdlib/mallocr.c (_morecore_r): Minimum chunk + size is variable, depending upon CHUNK_POWER. + * libc/sys/go32/*.c: Upgrade to new go32 stuff. + +Sun Sep 4 17:42:43 1994 Jim Wilson (wilson@sphagnum.cygnus.com) + + * libc/stdlib/ecvtbuf.c (_gcvt): Output '-' for negative numbers. + +Fri Sep 2 10:56:01 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * libc/include/_ansi.h (_PARAMS): Don't define if already defined. + +Wed Aug 24 11:11:03 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * configure.in: Change i[34]86 to i[345]86. + + * libc/include/math.h: Don't define HUGE_VAL if it is already + defined. + +Wed Aug 17 15:18:02 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * testsuite/libm.sac/test_erfc.c: Correct some result values. + * testsuite/libm.sac/test_gammaf.c: Likewise. + * testsuite/libm.sac/test_sin.c: Likewise. + * testsuite/libm.sac/test_tanh.c: Likewise. + +Tue Aug 16 16:12:53 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * libc/include/machine/ieeefp.h: Don't try set endianness if it is + already set. Define typedefs __int32_t and __uint32_t. + * libc/include/math.h: Include . + (union __dmath): Use __uint32_t. + * libm/math/fdlibm.h, libm/math/*.c: Use __int32_t and __uint32_t + instead of int and unsigned int. + +Thu Aug 11 15:16:09 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + Replace the math library with the SunPRO fdlibm package. + * libm/math: Completely changed all files. + * libm/ieeefp: Remove contents and directory. + * libm/Makefile.in (LIBM_FP_LIB): Remove. + (SUBDIRS): Just set to math/lib.a. + * libm/libm.texinfo: Updated for new library. + * libc/include/math.h: Extensive changes for new math library. + * libc/include/ieeefp.h (isnanf, isinff, finitef): Change argument + from _FLOAT_ARG to float. + (maxpowtwo, maxpowtwof): Don't declare. + * configure.in (fp_dir): Removed; was always ieeefp anyhow. + (libm_fp_lib): Removed. + * Makefile.in (MATHOBJS_IN_LIBC): Updated with new file names. + * testsuite/libm.paranoia/Makefile.in (check): Correct --srcdir + argument to ${RUNTEST}. + * testsuite/libm.sac/Makefile.in (LOCAL_CFLAGS): Define. + (.c.o): New rule. + (RUNTESTFLAGS): Set CC and CFLAGS. + (TESTS): Remove test_log2 and test_log2f. + (${TESTS}): Pass ${LOCAL_CFLAGS}, not ${CFLAGS}. + * testsuite/libm.sac/math.c (run_vector_1): Use float, not + _FLOAT_ARG, for single precision argument type. + * testsuite/libm.sac/sac.exp: Treat an error in bit 63 as an + expected failure. Close the input pipe. + * testsuite/libm.sac/test.c (test_sok, test_iok, test_scok): + Correct misspelling of inaccurate. + (test_mok): Use ``inaccurate'', not ``wrong''. + * testsuite/libm.sac/{test_acos.c, test_acosh.c, test_asin.c, + test_asinh.c, test_atan.c, test_atanh.c, test_ceil.c, + test_ceilf.c, test_cos.c, test_cosh.c, test_erf.c, test_erf.c, + test_fabs.c, test_floor.c, test_floorf.c, test_fmod.c, + test_fmodf.c, test_gamma.c, test_log1p.c, test_log1pf.c, + test_yn.c): Correct many result values. Many are still wrong. + + * libc/stdlib/ecvtbuf.c (print_e): If _dtoa_r sets decpt to 9999, + just copy the string. + (_gcvt): Always return the buffer. + +Tue Aug 9 13:43:23 1994 J.T. Conklin (jtc@phishhead.cygnus.com) + + * bcopy.c: fixed documentation, bcopy was not specified by ANSI. + +Wed Aug 3 05:39:41 1994 D. V. Henkel-Wallace (gumby@cygnus.com) + + * libc/include/sys/reent.h: (struct _Bigint): add _reclaim + structure. + (struct _reent): add _p5s, _cvtlen, _cvtbuf. + (_reclaim_reent): declare new entry point. + * libc/reent/reent.c (cleanup_glue, _reclaim_reent): new + functions. + + * libc/stdlib/mprec.c (Balloc): Keep track of every struct bigint + ever allocated, so that we can later reclaim them all. + (pow5mult): make reentrant. + + * libc/stdlib/ecvtbuf.c (fcvtbuf, ecvtbuf): extend these functions + so that when given NULL as a buffer, return a pointer to static + space in the rent structure. This is not documented behaviour; + it's only to support ecvt and fcvt, which aren't ANSI anyway. + * libc/stdlib/efgcvt.c (fcvt, ecvt) Use new functionality (and + therefore become reentrant). + + * libc/stdlib/dtoastub.c: remove spurious inclusion of mprec.h. + +Mon Aug 1 16:52:24 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * libc/include/machine/ieeefp.h: Check _AM29K, not ___AM29K__. + +Thu Jul 28 15:40:21 1994 J.T. Conklin (jtc@phishhead.cygnus.com) + + * Makefile.in: Make link to libg.a after libc.a; this is needed + for the testsuites to build executables when everything comes + from the tree. + +Mon Jun 27 17:14:29 1994 Bill Cox (bill@rtl.cygnus.com) + + * libc/Makefile.in: Add a VERSION variable so we can keep track. + * libm/Makefile.in: Add a VERSION variable so we can keep track. + +Wed Jun 22 10:26:00 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * libc/include/stdio.h: Use __VALIST, not va_list. + +Tue May 17 15:43:28 1994 Bill Cox (bill@rtl.cygnus.com) + + * testsuite/config/unix-libm.exp, testsuite/lib/libm.exp, + testsuite/libm.sac/execute.exp: + Replace error proc calls with perror calls. + +Wed May 11 09:25:28 1994 Doug Evans (dje@canuck.cygnus.com) + + * libc/include/*.h: #include "_ansi.h" instead of <_ansi.h>. + * libc/include/time.h: #define NULL as 0L. + +Mon May 9 18:41:20 1994 Doug Evans (dje@canuck.cygnus.com) + + * host/any (INCLUDES): Delete -I of gcc/include, gcc -B takes + care of it. + +Mon May 9 18:39:39 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libc/include/sys/signal.h: Check for __GO32__, not __i386__ and + not __unix__. + +Sat May 7 17:07:36 1994 Steve Chamberlain (sac@cygnus.com) + + * configure.in (TARGET_CFLAGS): Set -O2 as default. + (z8k-*-*): Use syscalls fake sys dir. + * libc/sys/z8k/glue.c: Rename syscalls. + * libc/sys/go32/Makefile.in: Use new routines. + * libc/machine/Makefile.in: Fix typo in ln stuff. + +Thu May 5 13:47:48 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * Makefile.in (libm.a, crt0.o): Use cp if ln fails. + * libc/Makefile.in (crt0.o): Likewise. + * libc/machine/Makefile.in (lib.a): Likewise. + * libc/sys/Makefile.in (lib.a, crt0.o): Likewise. + + All Makefile.in files: Added mostlyclean, realclean and distclean + targets. + + * Makefile.in: Don't bother to unexport XTRAFLAGS or + XTRAFLAGS_FOR_TARGET, since they are no longer passed down from + the top level Makefile. + +Tue Apr 26 15:10:34 1994 Doug Evans (dje@canuck.cygnus.com) + + * libc/sys/sparc64/sys/stat.h: New file. + * libc/sys/sparc64/sys/time.h: New file. + * libc/sys/sparc64/sys/types.h: New file. + +Fri Apr 22 12:58:24 1994 Stan Shebs (shebs@andros.cygnus.com) + + * stub/ex93x/crt0.s (start): Add code to clear bss. + +Wed Apr 13 10:34:58 1994 Doug Evans (dje@canuck.cygnus.com) + + * libc/include/sys/types.h (time_t): Properly protect inside + #ifndef __time_t_defined. + + * libc/stdio/fileno.c: New file. + * libc/stdio/Makefile.in (OFILES, CHEWOUT_FILES): Add fileno. + (fileno.o): Add dependency. + * libc/include/stdio.h (__sgetc): Rename never to _never. + (fileno macro): Disable, needs to do CHECK_INIT first. + +Mon Apr 11 17:37:09 1994 Bill Cox (bill@rtl.cygnus.com) + + * testsuite/Makefile.in (EXPECT, RUNTEST): Set these for the check + goal. + + * testsuite/Makefile.in (check): Set TCL_LIBRARY for runtest. + * testsuite/libm.paranoia/Makefile.in (check): Set TCL_LIBRARY for + runtest. + * testsuite/libm.sac/Makefile.in (check): Set TCL_LIBRARY for + runtest. + +Sat Apr 9 16:18:09 1994 Doug Evans (dje@cygnus.com) + + * libc/sys/sparc64/sys/fcntl.h: New file, define solaris versions + of the various constants. + +Thu Apr 7 21:19:07 1994 Mark Eichin (eichin@cygnus.com) + + * libc/include/math.h: #ifndef __math_68881 around things which + conflict with the (gcc-provided) inline functions in + gcc/ginclude/math-68881.h. + +Thu Apr 7 02:50:43 1994 Doug Evans (dje@cygnus.com) + + * libc/include/_syslist.h (_gettimeofday): Define. + (_times): Ditto. + * libc/include/reent.h: #include to get _CLOCK_T_. + (struct tms, timeval, timezone): Declare. + (_gettimeofday_r, _times_r): Declare. + * libc/include/time.h (_CLOCK_T_): Don't #undef. Remove + #ifdef _CLOCK_T_ surrounding definition of clock_t. + (time_t): Add multiple definition protection, __time_t_defined. + * libc/include/sys/time.h: Don't #include . + Always define struct timezone (remove #ifndef _TIME_H_). + * libc/include/sys/times.h (_CLOCK_T_): Don't #undef. Remove + #ifdef _CLOCK_T_ surrounding definition of clock_t. + * libc/reent/Makefile.in (OFILES): Add timer.o. + (CHEWOUT_FILES): Add timer.def. Add timer.o/timer.c dependence. + * libc/reent/timer.c: New file. + * libc/time/clock.c: #include . + (clock): Call _times_r instead of times. + * libc/time/time.c (HAVE_GETTIMEOFDAY): Renamed from + HAVE_GET_TIME_OF_DAY. + Add comment regarding supporting OS routine(s) required (for docs). + #include . + (time): Call _gettimeofday_r instead of gettimeofday. + * libc/time/asctime.c: Fix comment regarding supporting OS routines. + * libc/time/ctime.c: Ditto. + * libc/time/strftime.c: Ditto. + * libc/sys/sparc64/Makefile.in (TEMPLATE_SFILES): Remove gettimeofday. + (TEMPLATE_SFILES_R): Define here. Also define times. + Add times_r.o/times.S dependence. + (time2.c, junk.c): Deleted. + * libc/sys/sparc64/time2.c: Deleted. + * configure.in (sparc64-*-*): Define HAVE_GETTIMEOFDAY. + + * libc/stdio/mktemp.c (_getpid_r): Renamed from _getpid. + * libc/stdio/tmpnam.c (_getpid_r): Ditto. + * libc/sys/sparc64/junk.c: Deleted. + +Mon Mar 21 16:51:03 1994 Doug Evans (dje@canuck.cygnus.com) + + * libc/sys/sparc64/Makefile.in: Add times syscall. + * libc/sys/sparc64/crt0.S: Handle stack bias at run time so we can + be used with and without it. Add comment clarifying Medium/Anywhere + model requirements. + * libc/sys/sparc64/sigsetjmp.S (setjmp, longjmp): Add svr4 support. + * libc/sys/sparc64/sys/syscall.h (SYS_times): Define for sunos4 + even if obsolete. + +Sun Mar 20 15:51:47 1994 Doug Evans (dje@cygnus.com) + + * configure.in (target_cflags): Move init. + (sparc64-*-*): Define HAVE_BLKSIZE. + +Wed Mar 9 10:44:52 1994 Doug Evans (dje@canuck.cygnus.com) + + * libc/include/sys/_types.h: New file. + * libc/include/reent.h: #include it. + Add comment describing REENTRANT_SYSCALLS_PROVIDED and + MISSING_SYSCALL_NAMES. + Sort syscalls. + * libc/include/_syslist.h: Remove _raise. + * libc/reent/signalr.c: New file. + * libc/reent/Makefile.in: Compile it. + * libc/signal/signal.c: Only use ifdef SIMULATED_SIGNALS. + Add doc for raise and _raise_r. + * libc/signal/raise.c: Only use ifndef SIMULATED_SIGNALS. + (raise): Call _raise_r. + (_raise_r): Call _getpid_r and _kill_r. + * libc/stdlib/abort.c: Remove inclusion of stdio.h and _syslist.h. + (abort): Loop forever calling raise and _exit. + +Mon Mar 7 14:40:08 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure.in: Remove extraneous echo. + +Thu Mar 3 12:14:22 1994 Doug Evans (dje@canuck.cygnus.com) + + * libc/sys/sparc64/sys/dirent.h (MAXNAMLEN): #undef to avoid + collision with unistd.h, and fix for svr4. + +Wed Mar 2 13:55:25 1994 Doug Evans (dje@canuck.cygnus.com) + + * libc/stdio/local.h (_llicvt): Declare. + (CVT_BUF_SIZE): Define (and buffer size from 512 to 128). + * libc/stdio/cvt.c: Include "local.h" to get CVT_BUF_SIZE. + (_llicvt): Define. + (_sicvt): Fix function header (`value' is short). + * libc/stdio/vfprintf.c (_vfprintf_r): Use CVT_BUF_SIZE. + Add printing of long long's support. + Add printing of 8 byte pointer support. + +Fri Feb 11 21:52:11 1994 Steve Chamberlain (sac@sphagnum.cygnus.com) + + * libc/sys/sh/syscalls.c (pipe, execv, wait, fork, utime, chown, + stat, chmod): New hooks. + (sbrk): Abort if stack and heap collide. + * libc/machine/sh/udivsi3, libc/machine/sh/sdivsi3 Modified to + shortcut when given small args. + * libc/machine/sh/setjmp.s: Rewritten. + * libc/machine/sh/strcmp.s (strcmp): New function takes advantage + of cmp/str instruction. + +Wed Feb 9 15:12:35 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure.in: Accept powerpc* as a CPU type, using fp_dir ieeefp + and machine_dir powerpc. + * libc/include/machine/setjmp.h, libc/include/machine/ieeefp.h: + Add cases for __powerpc__. + * libc/machine/powerpc/Makefile.in, libc/machine/powerpc/setjmp.S: + New files. + + * libc/include/stdio.h (_iprintf_r): Declare correctly. + +Thu Jan 27 10:36:27 1994 Steve Chamberlain (sac@cygnus.com) + + * libc/stdlib/callocr.c: New file with _calloc_r in it. + * libc/stdlib/calloc.c (calloc_r): Now in callocr.c + +Thu Jan 20 15:14:37 1994 Doug Evans (dje@canuck.cygnus.com) + + * libc/stdlib/ecvtbuf.c (print_f): Remove local "done". + (print_e): More comments to describe args, etc. + "type" arg may now be 'g' or 'G' for %g/G format --> remove + trailing blanks. + (_gcvt): Remove locals decpt, sign, end, p, done. + More comments for print_e invocation. + Pass "type" to print_e as is (g/G). + +Wed Jan 19 16:34:18 1994 Rob Savoye (rob@darkstar.cygnus.com) + + * stub/shared/m68k-crt0.S: Changed so it compiles (and runs) on a + stock m68000. + +Mon Jan 17 15:41:53 1994 Doug Evans (dje@canuck.cygnus.com) + + * libc/stdlib/mallocr.c (_morecore_r): Fix aligning of pointer so it + works with any sized pointer, including ones bigger than ints and + longs. + +Thu Jan 6 14:53:21 1994 Doug Evans (dje@canuck.cygnus.com) + + * libc/sys/sparc64/{time2.c,utime.S,utime2.c}: New files. + +Sat Dec 11 16:17:20 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * libc/include/stdlib.h (_calloc_r): Add prototype. + * libc/machine/h8500/negsi2.c: New file. + * libc/machine/h8500/divsi3.c: Prevent overflow when dividing v + large unsigned numbers. + * libc/machine/h8500/cmpsi.c: Add cmppsi. + * libc/stdlib/mallocr.c (morecore_r): Fix aligning pointers so it + works when sizeof(size_t) != sizeof(char *). + * libc/stdlib/mprec.c (Balloc): Call calloc rather than malloc to + get play area + * libc/stdlib/mprec.h: Define Just_16 if generating for z8000. + +Mon Dec 6 15:59:53 1993 Doug Evans (dje@rtl.cygnus.com) + + * libc/include/assert.h (assert): Handle -traditional. + +Tue Nov 16 15:49:24 1993 Mark Eichin (eichin@cygnus.com) + + * Makefile.in: added ; after every "fi" and "done" that wasn't at + the end of a line (ie. anything before a backslash continuation) + so that bash handles them. + +Tue Nov 16 12:31:57 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * libc/sys/go32/lstat.s: new file, copied from stat.s and renamed + stat to lstat + +Mon Nov 15 15:50:43 1993 Steve Chamberlain (sac@jonny.cygnus.com) + + * libc/sys/sh/crt0.s, libc/sys/sh/trap.s, + libc/machine/sh/sdivsi3.s, libc/machine/sh/setjmp.s, + libc/machine/sh/udivsi3.s: Use new calling convention. + +Mon Nov 15 15:25:38 1993 Mark Eichin (eichin@cygnus.com) + + * libc/include/sys/unistd.h, libc/include/sys/stat.h: ANSI-fy + chmod, access, chdir, chown by making _path const. Also fix _amode + param of access. + +Fri Nov 12 20:25:28 1993 Mark Eichin (eichin@cygnus.com) + + * libc/sys/a29khif/_tmpnam.s (_tmpnam): renamed function to + _khif_tmpnam, because it doesn't comply with ANSI but may be + useful anyway. Real tmpnam was already in libc/stdio, and was + colliding with this one (pr 2176.) + * libc/sys/a29khif/stubs.s (tmpnam): removed tmpnam. This file is + the wrong idea anyhow. + +Mon Nov 8 07:50:16 1993 Doug Evans (dje@canuck.cygnus.com) + + * configure.in: Remove h8300h, we have multilib now. + +Fri Nov 5 12:37:27 1993 Mark Eichin (eichin@cygnus.com) + + * libc/string/strcasecmp.c, libc/string/strncasecmp.c: new + functions, to get preference over the ones in libiberty (since we + provide correct declarations in . + * libc/string/Makefile.in: add support for strncasecmp, + strcasecmp. + +Fri Nov 5 09:05:45 1993 D. V. Henkel-Wallace (gumby@blues.cygnus.com) + + * Change netware config not to look for cpu explicitly. + +Thu Nov 4 14:21:25 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/sys/sparc64/{creat.c,junk.c}: New files. + * libc/sys/sparc64/Makefile.in: Add dependencies. + +Wed Nov 3 10:42:49 1993 Doug Evans (dje@canuck.cygnus.com) + + * configure.in: Clean up v9 a bit, new "os" aoutv8. + +Tue Nov 2 10:00:44 1993 D. V. Henkel-Wallace (gumby@cygnus.com) + + * libc/include/sys/reent.h: make structure smaller by allocating + some stuff when needed. + * libc/signal/signal.c: allocate as needed + * libc/stdio/findfp.c,stdio/local.h: ditto + * libc/stdlib/mprec.c: ditto + + * libc/time/localtime.c: don't return a dangling stack ptr. + +Wed Sep 29 20:42:34 1993 Rob Savoye (rob@darkstar.cygnus.com) + + * stub/mvme135/crt0.S, stub/mvme135/glue.c: Moved to stub/generic. + +Wed Sep 29 16:27:49 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + * libc/include/stdio.h (__sputc): comment out static inline which + confuses coff toolchains. + +Thu Sep 2 16:31:36 1993 Mark Eichin (eichin@cygnus.com) + + * libc/sys/a29khif/{_close.s, _fstat.s, _lseek.s, _sbrk.s, + _write.s, getpid.c, kill.c, read.s}: + * libc/sys/a29khif/stubs.s: eliminated stubs that already go + through the syscalls directory. + +Fri Oct 29 13:59:58 1993 Jeffrey Wheat (cassidy@cygnus.com) + + * configure.in: fixed double quote gotcha. + +Wed Oct 27 15:27:09 1993 Rob Savoye (rob@darkstar.cygnus.com) + + * stub/ex931: stub library for sparclite board. + * stub/idp: Renamed from mc68ec. Added contructor table + stuff to linker script. + * stub/mvme135: Renamed from m68kmvme. Added contructor table + stuff to linker script. + +Tue Oct 26 17:01:23 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + * configure.in: Configure testsuites only if they exist. + +Tue Oct 26 12:37:11 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure.in: Don't set machine_dir for i386 until there is + something in libc/machine/i386 to compile. For i[34]86-*-netware* + use sys/netware, don't use signal, define NO_EXEC, ABORT_PROVIDED, + CLOCK_PROVIDED and MALLOC_PROVIDED. + + * libc/sys/netware: New directory. Contains simplistic and + probably incorrect stubs for NetWare. Should be enough to load + the library. + * libc/sys/netware/crt0.c, libc/sys/netware/environ.c, + libc/sys/netware/getpid.c, libc/sys/netware/link.c: New NetWare + stub files. + + * libc/reent/execr.c: Don't use if NO_EXEC is defined. + * libc/reent/sbrkr.c: Don't use if MALLOC_PROVIDED is defined. + * libc/stdlib/abort.c: Don't use if ABORT_PROVIDED is defined. + * libc/time/clock.c: Don't use if CLOCK_PROVIDED is defined. + +Mon Oct 25 16:48:08 1993 Roland H. Pesch (pesch@cygnus.com) + + * testsuite/Makefile.in: add "docs" dummy target for consistency + with rest of newlib; turn "info" and "install-info" into dummy + targets, since they wouldn't have worked. (Depended on + nonexistent "doc" subdir.) + +Fri Oct 22 20:37:32 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * configure.in: handle mips* instead of mips + +Thu Oct 21 08:57:24 1993 Ian Lance Taylor (ian@cygnus.com) + + * libc/include/sys/dirent.h: New file. If it is not overridden by + a version of libc/sys/*/sys/dirent.h, it includes the next + file in case there is one lurking somewhere. + +Fri Oct 15 14:17:40 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * libc/stdlib/strtoul.c (_strtoul_r): Several changes for ANSI + compliance, namely: Accept a minus sign. Consider a single 0 with + a radix of 0 as being a conversion. Determine overflow correctly. + If an overflow occurs, set *ptr to the end of the number, not the + middle. + * lib/stdlib/strtol.c (_strtol_r): Determine overflow correctly. + +Thu Oct 14 21:49:52 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/machine/h8300/divsi3.S (divmodsi4): Fix h8300h case. + +Fri Oct 1 17:17:34 1993 Doug Evans (dje@canuck.cygnus.com) + + * Makefile.in (INSTALL): Use $srcrootpre. + (crt0.o): Replace $< with $(CRT0_DIR)/$(CRT0), Sun make + can't handle it. + * libc/Makefile.in (crt0.o): Spell out $<, Sun make can't handle + it. + * libc/sys/Makefile.in (crt0.o, lib.a): Ditto. + * stub/Makefile.in (crt0.o, TARGETLIB): Ditto. + * libc/sys/sparc64/Makefile.in (isatty.o): Sun VPATH lossage. + * libm/math/Makefile.in (matherr.o): Ditto. + +Thu Sep 30 11:09:17 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * configure.in: Build multidirs for z8k. + * libc/include/stdlib.h (_strtoul_r): add prototype. + * libc/include/machine/limits.h: Get INT_MIN right for all the z8k family. + * libc/include/machine/setjmp.h: Add for z8k. + * libc/machine/z8k/{mulsi.o, udivsi3.o, umodsi3.o, modsi3.o} obsolete. + * libc/sys/z8ksim/glue.c: tidy up. + +Mon Sep 20 14:04:46 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/unix/{execl.c execle.c execlp.c execv.c execvp.c}: + New files. Requires execve system call. + * libc/unix/Makefile.in: Use them. + * libc/sys/sparc64/{execl.c execle.c execlp.c execv.c execvp.c}: + Deleted, moved to libc/unix. + * libc/sys/sparc64/Makefile.in: Remove them. + +Mon Sep 20 10:38:32 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/sys/sparc64/{template.S template_r.S}: New files. + * libc/sys/sparc64/Makefile.in: Build source for trivial syscalls + from templates. + * libc/sys/sparc64/{chdir.S chmod.S close.S dup.S fcntl.S + fork.S fstat.S lseek.S link.S mkdir.S open.S pipe.S read.S rmdir.S + umask.S unlink.S wait4.S write.S}: Removed, now built from + templates. + +Sun Sep 19 14:52:57 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/time/time.c: #include <_ansi.h>. + +Sun Sep 19 13:43:25 1993 Doug Evans (dje@canuck.cygnus.com) + + * configure.in (sparc64-*-*): Remove -D__SIZE_TYPE__. + +Mon Sep 13 13:52:16 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + * configure.in: match m8* rather than m88k so that m88110 is + recognized as well. + +Tue Sep 7 12:19:32 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/sys/h8300hms/{Makefile.in, _exit.c, misc.c}: + Renamed exit.c to _exit.c to avoid collision with stdlib/exit.c. + misc.c: New file. + + * configure.in: Add multilib support to h8300. + +Mon Sep 6 14:07:06 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/stdlib/abort.c (abort): Remove _VOLATILE from return type. + * libc/include/_ansi.h (_ATTRIBUTE): New macro for __attribute__. + * libc/include/stdlib.h (exit, abort): Add noreturn attribute. + +Mon Sep 6 14:24:18 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure.in: Corrected multidirs for sparc target. + +Mon Aug 30 15:56:44 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Support for building newlib multiple times with different + compilation flags. + * configure.in: Only configure doc at top level. Set multidirs + when appropriate for target, unless not at top level. If + multidirs is set, independently configure each subdirectory. + Adjust TOP, MULTIDIRS and MULTISUBDIR appropriately in Makefile. + * Makefile.in (MULTIDIRS, MULTISUBDIR): New variables, + automagically set by configure.in. + (all): If MULTIDIRS is set, build multiple copies of libraries. + (install): If MULTIDIRS is set, install multiple copies of + libraries. Install in $(tooldir)/lib/$(MULTISUBDIR). If + MULTISUBDIR is set, don't bother to install header files. + * host/any (INCLUDES, CHEW): Use $(SRCTOP) rather than $(TOP) from + ${srcrootpre}. + * stub/configure.in: Set MULTISUBDIR appropriately. + * stub/Makefile.in (install): Install in + $(tooldir)/lib/$(MULTISUBDIR). + * All Makefile.in files: Define SRCTOP as well as TOP. + +Mon Aug 30 10:34:24 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/machine/h8300/{mulhi3.S, divhi3.S}: Comment out if h8300h. + * libc/machine/h8300/{mulsi3.S, divsi3.S}: Add h8300h support. + +Thu Aug 26 19:38:12 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/sys/h8300hms/exit.c (_exit): New function. + +Wed Aug 25 16:31:48 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + * configure.in: recognize m88110. + +Fri Aug 20 16:46:23 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + * libc/sys/m88kbug/crt0.c: pretty up, remove extraneous comments, + prototype main and call with args. + +Fri Jul 30 16:52:47 1993 K. Richard Pixley (rich@cygnus.com) + + First real try at system traps for m88k-bug. + * libc/sys/m88kbug/syscalls.c: many changes. Convert from stubs + to real trap calls. + * libc/sys/m88kbug/sys/systraps.h: new file. + +Tue Jul 27 16:31:16 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + Patches to fix info building when target does not use sys + directory. + * libc/Makefile.in (targetdep.tex): add sys.tex separately. + * libc/sys.tex, libc/sys/sys.tex: moved from libc/sys/sys.tex to + libc/sys.tex. + * libc/sys/Makefile.in (doc): do nothing. + +Mon Jul 26 17:08:11 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + * libc/Makefile.in (CRT0): new macro. + (all): depend on $(CRT0) rather than crt0.o. + + * configure.in: fix libc_sys_dir -> libc_sys_lib thinko. + do not default crt0, instead, set crt0 and crt0_dir based on + sys_dir and stub_dir. + + * Makefile.in (CRT0_DIR): new macro. + (all): depend on $(CRT0) rather than crt0.o which may not exist. + (crt0.o): depend on $(CRT0_DIR)/$(CRT0) rather than simply + $(CRT0). + ($(CRT0)): recur by cd'ing into $(CRT0_DIR). + +Sun Jul 25 17:51:51 MDT 1993 Jeffrey Wheat (cassidy@cygnus.com) + + * testsuite/lib/libm.exp: + added code to support compiling and linking of tests for + libm.sac (paranoia to be added next) and processing the + pass or failure of the tests. + + * testsuite/config/unix-libm.exp: + platform specific proc's for dealing with compiler, linker + and the way we execute and process the test results. + + * testsuite/libm.sac/execute.exp: + generic framework for the sac tests. the config and lib + expect code for specific platforms tie it all together. + + * testsuite/libm.sac/test_is.c: + changed the output of the test to be consistant with the + other tests. parsing of pass nad fail messages is now fixed. + +Fri Jul 23 19:20:07 1993 Per Bothner (bothner@kalessin) + + * libc/include/{assert.h, ctype.h, dirent.h, errno.h, fastmath.h, + locale.h, math.h, pwd.h, reent.h, setjmp.h, signal.h, stdio.h, + stdlib.h, string.h, termios.h, time.h, utime.h, utmp.h}: For C++: + #ifdef __cplusplus, surround by extern ""C { ... }. + * libc/include/assert.h: Do *not* protect assert.h against + multiple inclusion! Also, #undef it before #define, to allow + redefinition. + * libc/include/stdio.h (getlogin, cuserid): Removed. These + should be only in unistd.h. + + * libc/include/sys/{fcntl.h, reent.h, stat.h, time.h, times.h, + unistd.h}: For C++: #ifdef __cplusplus, surround by extern ""C { + ... }. + +Fri Jul 23 10:15:33 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/machine/sparc/Makefile.in: Must create a library, even + if empty. + +Wed Jul 21 16:00:37 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + * configure.in: set machine_dir for m88k. edit crt0 definition + into makefiles. + + * Makefile.in, libc/Makefile.in (crt0): pull up from lower directories. + + * libc/Makefile.in (all): also build crt0.o. + + * libc/machine/i386/Makefile.in, libc/machine/sparc/Makefile.in, + libc/machine/z8k/Makefile.in, libm/Makefile.in (clean): no need + to remove CRT0. + + * libc/machine/m88k/Makefile.in (TOP, TARGETLIB): removed. + (all): reworked to build in place. + (clean): remove lib.a + (Makefile): remove redundant ./, call $(SHELL) rather than sh. + + * libc/sys/m88kbug/crt0.c (start): renamed to _start. + (_start): key off edata rather than _start_bss. + +Wed Jul 21 14:29:47 1993 david d `zoo' zuhn (zoo@cygnus.com) + + * libc/include/sys/unistd.h, libc/include/reent.h, + libc/reent/sbrkr.c: change sbrk to return void* instead of char*. + +Tue Jul 20 13:19:18 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + * libm/Makefile.in, libc/Makefile.in ($(SUBDIRS)): dollar escape a dollar sign. + + * Makefile.in (libc.a): break into two rules, one for libc.a and + one for libc/libc.a. Force subdirs current before rebuilding + library. + (libm.a): break into two rules, one for libm.a and one for + libm/libm.a. Force subdirs current before rebuilding library. + + * libc/Makefile.in (SUBLIBS): fix typo. + + * libc/sys/Makefile.in (all): force descent into subdirs, then + rebuild library iff out of of date. + +Fri Jul 16 17:47:57 1993 K. Richard Pixley (rich@sendai.cygnus.com) + + Rework so that library is built and then finished rather than + being built on each invocation of make. + + * host/any (machine_dir, sys_dir, signal_dir): these are not + shared and have been moved to their associated Makefile.in's. + (AR_FLAGS): switch to qc which is faster. + * configure.in: no longer assign machine_dir for m88k. set + stub_dir, stub_lib, & crt0 for m68k*-unknown-{aout,coff}. If + stub_dir set, then add to configdirs. add comment about silly + configuration. + (configdirs): drop stub. It will be added only + when needed. + (libm_fp_lib, libc_unix_lib, libc_signal_lib, libc_machine_lib, + libc_sys_dir, fake_sys_dir, libc_fake_sys_lib, stub_dir, + stub_lib, crt0): new variables for tailoring lower level + makefiles. Assign accordingly and edit into makefiles. + * libm/Makefile.in: updated copyright. + (TARGETLIB): removed. + (FLAGS_TO_PASS): removed TARGETLIB, machine_dir, sys_dir. + (SUBDIRS): removed TARGETDEP_DIRS. + (LIBM_FP_LIB, SUBLIBS): new macros. + (all): reworked. + (force): new target to force rebuilds. + (Makefile): call $(SHELL) rather than sh. drop redundant ./ + * libc/sys/a29khif/Makefile.in, libc/sys/decstation/Makefile.in, + libc/sys/go32/Makefile.in, libc/sys/h8300hms/Makefile.in, + libc/sys/h8500hms/Makefile.in, libc/sys/m88kbug/Makefile.in, + libc/sys/sh/Makefile.in, libc/sys/sparc64/Makefile.in, + libc/sys/sun4/Makefile.in, libc/sys/sysvi386/Makefile.in, + libc/sys/sysvnecv70/Makefile.in, libc/sys/z8ksim/Makefile.in, + stub/m68kmvme/Makefile.in: updated copyright. + (TARGETLIB, TARGETCRT0, CRT0): macros removed. + (all): reworked. made this the default rule. + (clean): also remove lib.a. + (Makefile): call $(SHELL) rather than sh. drop redundant ./ + * stub/Makefile.in: updated copyright. + (TARGETLIB, TARGETCRT0, CRT0, TOP): removed. + (stub_lib): new macro. + (FLAGS_TO_PASS): removed TARGETLIB, stub_dir, TARGETCRT0. Added + RANLIB. + (all): reworked. + (clean, install): assume stub_dir exists. + (Makefile): depend on configure.in. call $(SHELL) rather than + sh. drop redundant ./ + * stub/configure.in (stublib): new macro, assign it, edit it into + makefiles. + * Makefile, libc/Makefile.in, doc/Makefile.in, libc/sys/Makefile.in: + updated copyright. + (all): reworked. + (Makefile): call $(SHELL) rather than sh. drop redundant ./ + * libc/Makefile.in (TARGETCRT0): removed. + (FLAGS_TO_PASS): dropped TARGETLIB, machine_dir, sys_dir, + TARGETCRT0. + (SUBDIRS): drop TARGETDEP_DIRS. + (LIBC_SIGNAL_LIB, LIBC_SYS_LIB, LIBC_MACHINE_LIB, LIBC_UNIX_LIB, + LIBC_FAKE_SYS_LIB, SUBLIBS): new macros for configuration. + (force): new target to force rebuilds. + * libc/sys/Makefile.in (TARGETCRT0, sys_dir): removed. + (FLAGS_TO_PASS): TARGETLIB, machine_dir, sys_dir, TARGETCRT0 + removed. + (clean): assume sys_dir always exists. + * libm/test/Makefile.in (Makefile): call $(SHELL) rather than sh. + drop redundant ./ + * libc/ctype/Makefile.in, libc/errno/Makefile.in, + libc/locale/Makefile.in, libc/machine/Makefile.in, + libc/machine/a29k/Makefile.in, libc/machine/h8300/Makefile.in, + libc/machine/h8500/Makefile.in, libc/machine/i386/Makefile.in, + libc/machine/i960/Makefile.in, libc/machine/m68k/Makefile.in, + libc/machine/mips/Makefile.in, libc/machine/necv70/Makefile.in, + libc/machine/sh/Makefile.in, libc/machine/sparc/Makefile.in, + libc/machine/z8k/Makefile.in, libc/reent/Makefile.in, + libc/signal/Makefile.in, libc/stdio/Makefile.in, + libc/stdlib/Makefile.in, libc/string/Makefile.in, + libc/sys/Makefile.in, libc/syscalls/Makefile.in, + libc/time/Makefile.in, libc/unix/Makefile.in, + libm/ieeefp/Makefile.in, libm/math/Makefile.in: updated copyright. + (TARGETLIB): removed. + (all): reworked. + (clean): also remove lib.a. + (Makefile): call $(SHELL) rather than sh. drop redundant ./ + * Makefile.in: (machine_dir, sys_dir, stub_dir, stub_lib, CRT0): + new macros. + (SUBDIRS): moved to follow frag inclusion, change stub to + stub_dir. + (FLAGS_TO_PASS): removed machine_dir, sys_dir, signal_dir which + are now set in the libc Makefile. + * libc/machine/Makefile.in (TARGETCRT0, machine_dir): removed. + (FLAGS_TO_PASS): removed TARGETLIB, machine_dir, sys_dir, + TARGETCRT0. + (force): new target to force rebuilds. + * stub/configure.in: determine and set stub_lib for for Makefile. + +Thu Jul 15 12:01:27 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/sys/h8300hms/Makefile.in: Make `all' the default target. + crt0.s renamed to crt0.S. + * libc/sys/h8300hms/crt0.S: Add h8/300h support. + + * libc/machine/h8300/Makefile.in: Make `all' the default target. + * libc/machine/h8300/{cmpsi.S,ucmpsi.S}: #ifdef out entire file if + h8300h. + * libc/machine/h8300/defines.h: Add macros to handle pointers for + h8300 (16 bits) and h8300h (32 bits). + * libc/machine/h8300/{divsi3.S,mulsi3.S,memcpy.S,memset.S, + reg_memcpy.S,reg_memset.S,strcmp.S}: Add h8300h support. + +Thu Jul 15 10:13:29 1993 Ian Lance Taylor (ian@cygnus.com) + + * libc/machine/m88k/setjmp.S, Makefile.in: New files; a simple + implementation of setjmp and longjmp for the m88k. + * libc/include/machine/setjmp.h: Added __m88000__ case. + +Wed Jul 14 10:10:30 1993 Doug Evans (dje@canuck.cygnus.com) + + * configure.in: Recognize h8300h as variant of h8300. + +Tue Jul 13 12:24:11 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * libc/include/sys/unistd.h (read, write): get prototypes right. + (sbrk): New prototype. + * libc/reent/sbrkr.c (sbrkr): Use correct sbrk prototype. + * libc/stdio/local.h: Include unistd.h. + * libc/machine/h8300/syscalls.c: Names have changed. + +Mon Jul 12 18:08:42 1993 K. Richard Pixley (rich@cygnus.com) + + * configure.in: add sys_dir assignment for m88k-bug. + +Thu Jul 8 09:16:21 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/sys/sparc64/sys/syscallasm.h: New macros to handle either + a.out or elf. + * libc/sys/sparc64: all *.S files: Use new macros. + * libc/sys/sparc64/isatty.c: New file. + * libc/sys/sparc64/Makefile.in: Stop using /lib/libc.a for + functions beyond what newlib provides. + +Thu Jul 8 09:11:28 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/include/sys/stat.h: Move st_atime so not doubly defined for + svr4. + +Thu Jul 8 09:09:16 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/include/machine/ieeefp.h: Add support for h8/300h. + +Fri Jul 2 10:11:20 1993 K. Richard Pixley (rich@cygnus.com) + + * configure.in: add m88k. + * libc/include/machine/ieeefp.h: add case for m88k. Also add + sanity check so no one else need ever chase what I did to find + this. + + * libm/math/Makefile.in (FAKEC): added atanf.c log1pf.c scalbnf.c. + +Fri Jul 2 09:15:21 1993 Ian Lance Taylor (ian@cygnus.com) + + * doc/makedoc.c: Include . + +Wed Jun 30 09:35:06 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/Makefile.in (FLAGS_TO_PASS): Add TARGET_ASFLAGS. + * libc/sys/Makefile.in (FLAGS_TO_PASS): Add TARGET_ASFLAGS. + * libc/machine/Makefile.in (FLAGS_TO_PASS): Add TARGET_ASFLAGS. + + * libm/test/Makefile.in (all): Link with ../../lib[cm].a. + +Sun Jun 27 17:05:20 1993 Doug Evans (dje@sphagnum.cygnus.com) + + * libc/include/errno.h (ENOSYS): Added. + + * libc/unix/getpwd.c (getcwd): Fix typo (_up -> up). + +Mon Jun 21 09:03:32 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) + + * libc/stdio/fflush.c (fflush): Check for reent struct + initialization. + * libc/stdio/fdopen.c (fdopen): Avoid namespace conflict. + +Fri Jun 18 16:06:05 1993 Mark Eichin (eichin@rtl.cygnus.com) + + * libc/stdlib/dtoastub.c: new file -- move user callable "dtoa" + out of dtoa.c so it doesn't pollute the namespace. + * libc/include/_syslist.h: new file -- mappings from _function to + function, for systems where we can't win (by default, all of them, + until we start updating system calls.) + * libc/syscalls: new directory -- stubs for exporting _function + names as unmodified function names. + * libc/configure.in: add MISSING_SYSCALL_NAMES to enable + _syslist.h on all platforms by default, but put hooks in for + fake_sys_dir so we can include it when we've renamed the system + calls. + * libc/reent/execr.c libc/reent/filer.c libc/reent/fstatr.c + libc/reent/linkr.c libc/reent/sbrkr.c libc/reent/statr.c + libc/signal/raise.c libc/signal/signal.c libc/stdio/fdopen.c + libc/stdio/mktemp.c libc/stdio/tmpnam.c libc/stdlib/abort.c + libc/stdlib/system.c libc/unix/getcwd.c libc/unix/getlogin.c + libc/unix/getpass.c libc/unix/getut.c libc/unix/ttyname.c: change + non ANSI functions to call _function. + +Wed Jun 9 09:48:26 1993 Ian Lance Taylor (ian@cygnus.com) + + * libc/stdlib/strtoul.c (_strtoul_r): Handle leading 0 correctly + when base 16 is specified. Don't accept non-digits if radix > 10. + +Thu Jun 3 10:01:15 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/include/math.h: Rename xxx_r fns to _xxx_r. + +Wed Jun 2 16:54:16 1993 Jim Wilson (wilson@sphagnum.cygnus.com) + + * libc/include/sys/stat.h: Surround text after #endif with + comments. + +Wed Jun 2 12:47:32 1993 Ian Lance Taylor (ian@cygnus.com) + + * libc/stdlib/mallocr.c: If MALLOC_PROVIDED is defined, just make + _malloc_r, _realloc_r, and free_r call the corresponding + non-reentrant functions. + + * libm/math/modf.c (modf): We now take the address of ipart, so + don't make it a register variable. + +Tue Jun 1 18:25:54 1993 Doug Evans (dje@canuck.cygnus.com) + + * libm/math/*: Rename all xxx_r fns to _xxx_r. + +Wed May 26 22:06:35 1993 Roland H. Pesch (pesch@cygnus.com) + + * libc/libc.texinfo and embedded docn throughout: formatting + improvements, minor rephrasing for clarity, and improved + reentrancy docn. + +Sun May 23 17:29:49 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * libm/ieeefp/infinity.c (maxpowtwof): Fix initialzation bug. + + * libc/stdio/cvt.c (_licvt): Print the right value on machines + where sizeof(int) != sizeof(long). + +Fri May 21 22:09:32 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) + + * libc/reent/execr.c, libc/reent/filer.c, libc/reent/linkr.c, + libc/reent/sbrkr.c, libc/reent/statr.c, libc/stdio/tmpnam.c, + libc/stdlib/atol.c, libc/stdlib/rand.c, libc/string/strpbrk.c, + libc/string/strspn.c, libm/ieeefp/isnan.c, libm/math/bessel.c, + libm/math/matherr.c: changes for better docn formatting (info). + + * libc/libc.texinfo, libc/ctype/ctype.tex, libc/locale/locale/tex, + libc/reent/reent.tex, libc/signal/signal.tex, + libc/stdio/stdio.tex, libc/stdlib/stdlib.tex, + libc/string/strings.tex, libc/sys/sys.tex, libc/time/time.tex, + libm/libm.texinfo, libm/ieeefp/ieeefp.tex, libm/math/math.tex: use + makeinfo node defaulting to get better Info file node structure. + (Requires recent sac change to doc/makedoc.c and doc/doc.str.) + Also include a few formerly missing sections (subroutines). + + * doc/doc.str: delete fossil expansion for "func" + + * default.menu, no-signal.menu: delete. + + * Makefile.in, libc/Makefile.in, configure.in, host/any: simplify + method used to adjust doc for missing "signals" chapter when + signal_dir is empty. + +Thu May 20 21:38:37 MDT 1993 Jeffrey Wheat (cassidy@cygnus.com) + + * configure.in: added testsuite/libm.sac + +Wed May 19 14:52:34 1993 Doug Evans (dje@thepub.cygnus.com) + + * libc/sys/sparc64/crt0.S: Set %g4 to 0 (to test Medium/Anywhere + code model). + +Tue May 18 13:17:21 1993 Ian Lance Taylor (ian@cygnus.com) + + * libm/Makefile.in: Use $(MAKE) rather than make, and define + MAKEOVERRIDES to be empty. + +Mon May 17 08:42:44 1993 Ian Lance Taylor (ian@cygnus.com) + + * configure.in: Don't build mips-*-* with -msoft-float, since that + makes it incompatible with hard floating point. + +Mon May 17 00:03:35 MDT 1993 Jeffrey Wheat (cassidy@cygnus.com) + + * Makefile.in: added recursive 'make check' + +Thu May 13 16:24:18 MDT 1993 Jeffrey Wheat (cassidy@cygnus.com) + + * configure.in: added ./testsuite ./testsuite/libm.paranoia + * ./testsuite/Makefile.in: created + * ./testsuite/libm.paranoia: paranoia tests added + +Thu May 13 10:30:24 1993 Ian Lance Taylor (ian@cygnus.com) + + * configure.in: For mips-*-* set machine_dir to mips. + + * libc/machine/mips: New directory. + * libc/machine/mips/Makefile.in: New file. + * libc/machine/mips/setjmp.S: New file; simplistic MIPS version of + setjmp and longjmp. + * libc/include/machine/setjmp.h: Added __mips__ case. + + * libc/machine/lmips: Removed unused and useless directory. + +Mon May 3 10:22:31 1993 Ian Lance Taylor (ian@cygnus.com) + + * configure.in: Accept i486-*-sco* as well as i386-*-sco*. + +Thu Apr 15 15:16:44 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/sys/sparc64/crt0.S: Add comment (%g1 contains atexit arg at + start up). + +Fri Apr 9 13:32:26 1993 Ian Lance Taylor (ian@cygnus.com) + + * libc/include/machine/setjmp-dj.h: Use _SETJMP_DJ_H rather than + SETJMP_H. + +Thu Apr 8 10:07:18 1993 Doug Evans (dje@canuck.cygnus.com) + + * libm/test/convert.c: structure member errno -> errno_val. + Must include to use errno, it's a macro now. + * libm/test/math.c: Ditto. + * libm/test/math2.c: Include errno.h. + * libm/test/string.c: Ditto. + * libm/test/test.h: structure member errno -> errno_val. + Remove extern int errno decl. + +Thu Apr 8 07:56:33 1993 Ian Lance Taylor (ian@cygnus.com) + + * libc/stdio/Makefile.in: Added dependencies on local header + files. + * libc/stdio/std.h, libc/stdio/vfprintf.h: Removed unused header + files. + +Wed Apr 7 16:19:32 1993 Ian Lance Taylor (ian@cygnus.com) + + * libc/include/machine/ieeefp.h: Added __MIPSEB__ case. + +Wed Apr 7 10:55:21 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/stdio/siprintf.c libc/stdio/sscanf.c libc/stdio/vsprintf.c: + Initialize _data. + + * libc/stdio/vfprintf.c: No need to declare _icvt, _licvt, _sicvt. + * libc/stdio/local.h: Add prototype for _licvt. + + * libc/stdio/ungetc.c (__submore): Use _malloc_r,_realloc_r + instead of malloc,reealloc. + + * libc/stdlib/local.h: New file. + * libc/stdlib/efgcvt.c: #include local.h. + (gcvt): Fix call to _gcvt. + * libc/stdlib/ecvtbuf.c: #include local.h. + + * libc/stdlib/Makefile.in: new files mallocr.c mstats.c. + * libc/stdlib/mallocr.c mstats.c malloc.h: New files. + * libc/stdlib/malloc.c: main routines moved to mallocr.c. + + * libc/stdlib/atexit.c: moved global data to struct _reent. + * libc/stdlib/exit.c: use struct _atexit in struct _reent. + + * libc/reent/reent.c (inpure_data): _REENT_INIT macro modified. + +Wed Apr 7 09:41:50 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/include/sys/reent.h: Stuff required by ANSI headers moved + here from ../reent.h. + +Tue Apr 6 12:56:01 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (MATHOBJS_IN_LIBC): List of object files which + should be provided in both libc.a and libm.a. + (libc.a): Depend on targ-include and libm.a. Copy + $(MATHOBJS_IN_LIBC) from libm.a to libc.a. + (libm.a): Depend on targ-include. + * configure.in (subdirs): Removed libc/math. + +Mon Apr 5 10:18:16 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * libm/ieeefp/infinity.c (maxpowtwo): Fix initialization bug. + +Sat Apr 3 11:06:07 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/include/{errno.h, math.h, stdio.h, stdlib.h}: Use + sys/reent.h instead of reent.h. + * libc/include/reent.h: Split into two parts: stuff needed by ANSI + headers moved to sys/reent.h. + * libc/include/signal.h: _MAX_SIGNALS moved to sys/signal.h. + * libc/include/sys/signal.h: Define _MAX_SIGNALS if + __need__MAX_SIGNALS defined. + * libc/include/stdio.h: struct __sFILE moved to sys/reent.h. + std{in,out,err} refer to new _std{in,out,err} members. + +Fri Apr 2 11:27:12 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/include/sys/signal.h: #define _SYS_SIGNAL_H for general + case. + +Fri Apr 2 09:41:10 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/sys/sparc64/execve.S (execve): Insert nop in delay slot, + rather than whatever macro seterrno() has. + +Thu Apr 1 16:47:08 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/locale/locale.c: Reentrant routines _r_xxx renamed to + _xxx_r. struct reent_struct renamed to struct _reent for ANSI. + + * libc/include/machine/fastmath.h: Use _HAVE_STDC instead of + __STDC__. + + * libc/reent/{execr.c, filer.c, fstatr.c, linkr.c, reent.c, + reent.tex, sbrkr.c, statr.c}: _r_xxx reentrant routines renamed to + _xxx_r. struct reent_struct renamed to struct _reent for ANSI. + + * libc/signal/signal.c: Reentrant routines _r_xxx renamed to + _xxx_r. struct reent_struct renamed to struct _reent for ANSI. + + * libc/stdio/{fclose.c, fdopen.c, findfp.c, fiprintf.c, flags.c, + fopen.c, fprintf.c, freopen.c, fscanf.c, fseek.c, ftell.c, + fwalk.c, getchar.c, gets.c, iprintf.c, local.h, makebuf.c, + mktemp.c, perror.c, printf.c, putchar.c, puts.c, refill.c, + remove.c, rename.c, scanf.c, setvbuf.c, siprintf.c, sprintf.c, + sscanf.c, stdio.c, tmpfile.c, tmpnam.c, vfprintf.c, vfprintf.h, + vfscanf.c, vprintf.c, vsprintf.c}: Reentrant routines _r_xxx + renamed to _xxx_r. struct reent_struct renamed to struct _reent + for ANSI. structure members given leading "_" for ANSI. Use + _HAVE_STDC instead of __STDC__ and _HAVE_STDARG. + + * libc/stdlib/{__adjust.c, calloc.c, dtoa.c, ecvtbuf.c, malloc.c, + mprec.c, mprec.h, rand.c, std.h, strtod.c, strtol.c, strtoul.c, + system.c}: Reentrant routines _r_xxx renamed to _xxx_r. struct + reent_struct renamed to struct _reent for ANSI. + Structure members given leading "_" for ANSI. + _CONST --> const in prototypes. + Use _HAVE_STDC instead of __STDC__. + + * libc/string/strtok.c: Reentrant routines _r_xxx renamed to + _xxx_r. + struct reent_struct renamed to struct _reent for ANSI. + Structure members given leading "_" for ANSI. + + * libc/time/asctime.c: Reentrant routines _r_xxx renamed to + _xxx_r. + struct reent_struct renamed to struct _reent for ANSI. + + * libm/math/{acos.h, acosh.h, asin.c, asinh.h, atanh.h, bessel.h, + cbrt.h, cosh.h, erf.c, erf.h, error.c, exp.c, fmod.c, frexp.h, + gamma.h, hypot.h, ldexp.c, log.h, log10.c, log1p.c log2.c, + mathimpl.h, pow.c, remainder.c, sincos.c, sinh.h, sqrt.h, tan.c, + tanh.h}: struct reent_struct renamed to struct _reent for ANSI. + + * libc/include/{_ansi.h, ctype.h, math.h, reent.h, locale.h, + signal.h, stdio.h, stdlib.h, string.h, time.h}: + Use _HAVE_STDC instead of __STDC__ and _HAVE_STDARG. + #ifndef _STRICT_ANSI non-ANSI routines. + Reentrant routines renamed from _r_xxx to _xxx_r. + No need to use _STRICT_ANSI on _xxx_r reentrant routines. + Use _STRICT_ANSI instead of __STRICT_ANSI, _ANSI_SOURCE, etc. + Clean up namespace (structure members have leading "_"). + struct reent_struct renamed to struct _reent for ANSI compliance. + _CONST --> const in function prototypes. + + * libc/include/string.h: Add NULL and size_t. + + * libc/sys/sparc64/Makefile.in: New syscall routines for link, + unlink, wait, wait4. Reentrant syscall routines close, fork, + fstat, link, lseek, open, read, sbrk, stat, unlink, wait, wait4, + write. + * libc/sys/sparc64/cerror.S (cerror_r): New routine. + * libc/sys/sparc64/{close.S, fork.S, fstat.S, link.S, lseek.S, + open.S, read.S, sbrk.S, stat.S, unlink.S, wait.S, wait4.S, + write.S}: Define reentrant versions. + * libc/sys/sparc64/sys/syscallasm.h (defsyscall_r): New macro for + reentrant syscalls. + + * libc/sys/sparc64/crt0.S (start): Fix initialization of environ. + + * libc/include/stdlib.h (RAND_MAX): Fix value. + +Thu Apr 1 12:28:30 1993 Ian Lance Taylor (ian@cygnus.com) + + * libc/sys/a29khif/_main.c: Removed unnecessary file. + * libc/sys/a29khif/Makefile.in (OFILES): Removed _main.c, moved + VPATH support targets after all: target. + + * stub/mvme135/mvme.S: Renamed exceptionhandler to + exceptionHandler, which is what mvme135-stub.c expects. + +Wed Mar 31 17:42:03 1993 Doug Evans (dje@cygnus.com) + + * libc/stdio/tmpnam.c (worker): Fix test for _r_open() failure. + + * libc/unix/getpass.c (getpass): Use stdin,stderr instead of + def_stdin/def_stderr (latter removed from stdio.h to make it ANSI + compliant). + +Tue Mar 30 09:58:21 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/reent/execr.c (_r_wait): Re-order args to make reent_struct + first. + libc/reent/filer.c (_r_open, _r_close, _r_lseek, _r_read, + _r_write): Ditto. + libc/reent/fstatr.c (_r_fstat): Ditto. + libc/reent/linkr.c (_r_link, _r_unlink): Ditto. + libc/reent/sbrkr.c (_r_sbrk): Ditto. + libc/reent/statr.c (_r_stat): Ditto. + + * libc/stdio/fopen.c (_r_fopen): Re-order args to _r_open. + * libc/stdio/freopen.c (freopen): Ditto for _r_open, _r_free. + * libc/stdio/fseek.c (fseek): Ditto for _r_fseek. + * libc/stdio/makebuf.c (__smakebuf): Ditto for _r_fstat. + * libc/stdio/mktemp.c (_gettemp): Ditto for _r_stat, _r_open. + * libc/stdio/remove.c (_r_remove): Ditto for _r_unlink. + * libc/stdio/rename.c (_r_rename): Ditto for _r_link, _r_unlink. + * libc/stdio/stdio.c (__sread): Ditto for _r_read. + (__swrite): Ditto for _r_lseek, _r_write. + (__sseek): Ditto for _r_lseek. + (__close): Ditto for _r_close. + * libc/stdio/tmpnam.c (worker): Ditto for _r_open, _r_close. + + * libc/stdlib/malloc.c (_r_morecore): Re-order args to _r_sbrk. + * libc/stdlib/system.c (_r_system): Ditto for _r_wait. + + * libc/include/reent.h: Re-order arguments to _r_xxx syscall fns + to make reent_struct the first argument (and thus consistent with + the rest of newlib). + + * stub/mvme135/mvme135-stub.c (initializeRemcomErrorFrame): Remove + reference to __STDC__. + +Mon Mar 29 12:34:32 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/stdlib/exit.c (exit): Use _REENT->__cleanup instead of + global __cleanup. + +Wed Mar 24 11:54:35 1993 Doug Evans (dje@canuck.cygnus.com) + + * libc/stdio/freopen.c (freopen): Ensure stdio is initialized + first. + libc/stdio/fclose.c (fclose): Ditto. + +Tue Mar 23 01:26:52 1993 Doug Evans (dje@rtl.cygnus.com) + + * Run through indent and rename reentrant routines for ANSI. + libc/stdio/{clearerr.c cvt.c fclose.c fdopen.c feof.c ferror.c + fflush.c fgetc.c fgetpos.c fgets.c findfp.c fiprintf.c flags.c + fopen.c fprintf.c fputc.c fputs.c fread.c freopen.c fscanf.c + fseek.c fsetpos.c ftell.c fvwrite.c fwalk.c fwrite.c getc.c + getchar.c gets.c iprintf.c makebuf.c mktemp.c perror.c printf.c + putc.c putchar.c puts.c refill.c remove.c rename.c rewind.c rget.c + scanf.c setbuf.c setvbuf.c siprintf.c sprintf.c sscanf.c stdio.c + tmpfile.c tmpnam.c ungetc.c vfprintf.c vfscanf.c vprintf.c + vsprintf.c wbuf.c wsetup.c local.h} + + * libc/locale/locale.c: Reformat and rename for ANSI, GNU style. + + * Run through indent and rename xxx_r fns to _r_xxx for ANSI. + libc/stdlib/{__adjust.c __exp10.c __ten_mu.c abort.c abs.c + assert.c atexit.c atof.c atoi.c atol.c bsearch.c calloc.c div.c + dtoa.c ecvtbuf.c efgcvt.c exit.c getenv.c labs.c ldiv.c malloc.c + mbtowc.c mprec.c putenv.c qsort.c rand.c setenv.c strdup.c + strtod.c strtol.c strtoul.c system.c wctomb.c mprec.h} + + * Run through indent. + libc/string/{bcmp.c bcopy.c bzero.c index.c memchr.c memcmp.c + memcpy.c memmove.c memset.c rindex.c strcat.c strchr.c strcmp.c + strcoll.c strcpy.c strcspn.c strerror.c strlen.c strncat.c + strncmp.c strncpy.c strpbrk.c strrchr.c strspn.c strstr.c strtok.c + strxfrm.c} + + * libc/time/{asctime.c clock.c ctime.c difftime.c gmtime.c + localtime.c mktime.c strftime.c time.c}: + Run through indent and rename xxx_r (reentrant) fns to _r_xxx for ANSI. + + * Reformatting + renaming (for ANSI, GNU style, consistency). + libc/include/{_ansi.h, assert.h, ctype.h, errno.h, fastmath.h, + ieeefp.h, locale.h, math.h, paths.h, pwd.h, reent.h, setjmp.h, + signal.h, stdio.h, stdlib.h, string.h, time.h, unistd.h} + +Fri Mar 19 11:28:01 1993 Doug Evans (dje@cygnus.com) + + * libc/include/stdio.h (stdin_r): Fix. + +Fri Mar 19 09:43:48 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: Unexport some variables to keep GNU make from + putting them in the environment and using up needed ARG_MAX space + (a hack is used to let this work with older makes as well). + +Tue Mar 16 15:11:08 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: Use $(MAKE) rather than make. + (MAKEOVERRIDES): Define to be empty. + (FLAGS_TO_PASS): Don't pass down LD (it's not used). + (libc.a, libm.a): Depend on targ-include. + * host/any (LD): Don't define. + (INCLUDES): Use targ-include. + * stub/Makefile.in (MAKEOVERRIDES): Define to be empty. + (FLAGS_TO_PASS): Don't pass down LD (it's not used). + * libc/Makefile.in: Use $(MAKE) rather than make. + (MAKEOVERRIDES): Define to be empty. + (FLAGS_TO_PASS): Don't pass LD (it's not used). + (all): Rewrote to be slightly smaller. + * libc/machine/Makefile.in, libc/sys/Makefile.in (MAKEOVERRIDES): + Define to be empty. + (FLAGS_TO_PASS): Don't pass LD (it's not used). + * libm/Makefile.in (FLAGS_TO_PASS): Don't pass LD (it's not used). + +Mon Mar 15 08:45:41 1993 Ian Lance Taylor (ian@cygnus.com) + + * libc/sys/go32/gerrno.s: Renamed from errno.s to avoid conflict + with errno/errno.c. + +Fri Mar 12 09:46:54 1993 Ian Lance Taylor (ian@cygnus.com) + + * Changes for reentrancy. + libc/stdio/fdopen.c, libc/stdio/freopen.c, libc/stdio/perror.c: + Use ptr->_errno, not errno. + libc/stdio/mktemp.c (mkstemp_r, mktemp_r): New functions. + libc/stdio/remove.c (remove_r): New function. + libc/stdio/rename.c (rename_r): New function. + libc/stdio/fopen.c, libc/stdio/freopen.c, libc/stdio/fseek.c, + libc/stdio/makebuf.c, libc/stdio/mktemp.c, libc/stdio/remove.c, + libc/stdio/rename.c, libc/stdio/stdio.c, libc/stdio/tmpnam.c: Use + reentrant versions of system calls. + libc/stdio/gets.c: Call getchar_f, not nonexistent getchar_r. + libc/stdio/scanf.c: Use stdin_r, not nonexistent stdin_n. + libc/stdio/tmpfile.c: Use tmpnam_f, not nonexistent tmpnam_r. + libc/stdio/findfp.c: Include . + libc/stdio/fread.c, libc/stdio/rget.c, libc/stdio/scanf.c: Include + "local.h". + libc/stdio/wbuf.c: Include "fvwrite.h" + + * libc/stdlib/{dtoa.c, ecvtbuf.c, mprec.c, strtod.c}: Include + . + libc/stdlib/malloc.c: Call sbrk_r rather than sbrk. + (NULL): Don't define if already defined. + libc/stdlib/system.c: Call reentrant versions of system calls. + (system_r): New function. + + * Changes for reentrancy. + libc/include/_ansi.h (_PARAMS): New macro. + libc/include/errno.h: Define errno as a macro that calls __errno. + (__errno_r): New macro for reentrant code. + libc/include/math.h: Include reent.h. Declare many reentrant + functions. + (signgam): Now a macro, not a variable. + (struct exception): Added err field. + libc/include/reent.h: Don't declare __sglue. Added function + declarations. + (struct reent_struct): Moved errno to beginning. Added _signgam. + libc/include/stdio.h, libc/include/stdlib.h: Added function + declarations. + + * More reentrancy hacking. + libc/errno/errno.c (__errno): New function. + libc/reent/execr.c, libc/reent/filer.c, libc/reent/fstatr.c, + libc/reent/linkr.c, libc/reent/sbrkr.c, libc/reent/statr.c: New + files. + + * Added many new reentrant functions to libm/math/*. + libm/math/error.c (__matherror): Added reent_struct pointer + argument. Changed all callers. + libm/math/gamma.c (signgam): Removed. Set ptr->_signgam, instead. + libm/math/exp.h, libm/math/pow.h, libm/math/sincos.h, + libm/math/tan.h: Removed obsolete unused header files. + + * libc/sys/a29khif/stubs.s: Use register lr0, not v0. + + * libc/sys/sun/Makefile.in (COPYOFILES): Don't pull in errno.o. + +Mon Mar 8 16:43:43 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * libc/sys/a29khif/stubs.s: clobber safe register, and fill all + delay slots. + +Tue Mar 2 14:47:00 1993 Jeffrey Osier (jeffrey@fowanton.cygnus.com) + + * libc/libc.texinfo: comment out reentrancy chapter (duh) + +Tue Mar 2 14:34:16 1993 Jeffrey Osier (jeffrey@fowanton.cygnus.com) + + * libc/reent/reent.tex: New file. (text from + newlib/libc/libc.texinfo) + * libc/stdio/tmpnam.c: fixed doc typo + * libc/stdlib/rand.c: fixed doc typo + +Tue Mar 2 14:34:16 1993 Jeffrey Osier (jeffrey@fowanton.cygnus.com) + + * libc/reent/reent.tex: New file. (text from + newlib/libc/libc.texinfo) + +Fri Feb 26 12:20:54 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + support for reentrancy + * libc/reent/reent.c, libc/reent/Makefile.in, libc/reent/reent.c: + new files + * libc/errno/errno.c, libc/include/ieeefp.h, + libc/include/locale.h, libc/include/reent.h, + libc/include/signal.h, libc/include/stdio.h, + libc/include/stdlib.h, libc/include/string.h, libc/include/time.h, + libc/signal/signal.c libc/stdio/cvt.c, libc/stdio/fclose.c, + libc/stdio/fdopen.c, libc/stdio/fflush.c, libc/stdio/fgets.c, + libc/stdio/findfp.c, libc/stdio/flags.c, libc/stdio/fopen.c, + libc/stdio/fputc.c, libc/stdio/freopen.c, libc/stdio/fseek.c, + libc/stdio/ftell.c, libc/stdio/fwalk.c, libc/stdio/getchar.c, + libc/stdio/gets.c, libc/stdio/glue.h, libc/stdio/iprintf.c, + libc/stdio/local.h, libc/stdio/makebuf.c, libc/stdio/perror.c, + libc/stdio/printf.c, libc/stdio/putchar.c, libc/stdio/puts.c, + libc/stdio/refill.c, libc/stdio/scanf.c, libc/stdio/setvbuf.c, + libc/stdio/sprintf.c, libc/stdio/tmpfile.c, libc/stdio/tmpnam.c, + libc/stdio/ungetc.c, libc/stdio/vfprintf.c, libc/stdio/vfprintf.h, + libc/stdio/vfscanf.c, libc/stdio/vprintf.c, libc/stdio/wsetup.c, + libc/stdlib/__adjust.c, libc/stdlib/__exp10.c, + libc/stdlib/assert.c, libc/stdlib/atexit.c, libc/stdlib/atol.c, + libc/stdlib/dtoa.c, libc/stdlib/ecvtbuf.c, libc/stdlib/malloc.c, + libc/stdlib/mprec.c, libc/stdlib/mprec.h, libc/stdlib/rand.c, + libc/stdlib/setenv.c, libc/stdlib/std.h, libc/stdlib/strtod.c, + libc/stdlib/strtol.c, libc/stdlib/strtoul.c, libc/string/strtok.c, + libc/time/asctime.c, libc/time/localtime.c, libc/time/mktime.c, + libc/time/strftime.c: modify to provide reentracy. + + new routines: + strtok_r, asctime_r, fdopen_r, _cleanup_r, fopen_r, iprintf_r, + perror_r, printf_r, putchar_r, puts_r, scanf_r, sprintf_r, + tmpfile_r, vfiprintf_r, vfprintf_r, strtod_r, dtoa_r, rand_r, + srand_r, strtoul_r,strtol_r, free_r, malloc_r, morecore_r, + mstats_r, realloc_r, localeconv_r, setlocale_r + +Wed Feb 17 20:17:15 1993 Mark Eichin (eichin@cygnus.com) + + * libc/include/machine/ieeefp.h, libc/include/machine/setjmp.h, + libc/include/sys/config.h, libc/include/sys/signal.h, + libc/include/sys/stat.h, libc/include/sys/types.h: For compiler + provided macros (such as m68000), use the ansi version + (__m68000__) so that the library can be used with code compiled + -ansi. In particular, m68000, mc68000, _AM29K, i386, MIPSEL, unix, + and sparc. + +Wed Feb 17 13:01:34 1993 Jim Wilson (wilson@sphagnum.cygnus.com) + + * configure.in (sparc*): Don't set -fsoft-float for sparc + configurations. Do set -fsoft-float for sparclite configurations. + +Fri Feb 12 16:25:52 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) + + * default.menu, no-signal.menu: alternate forms of libc main menu + (in newlib rather than newlib/libc due to configuration restrictions) + + * configure.in: select one of the two menus above, link to + libc.menu + + * libc/libc.texinfo: include menu from separate file + +Fri Feb 12 12:50:06 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (FLAGS_TO_PASS): Put INSTALL back in. + (info): Split long shell command in half. + * libc/Makefile.in (info, targetdep.tex): Don't pass everything to + sub-makes, just CHEW and TARGETDOC. + (targetdep.tex): Removed now special handling of sys and machine + subdirectories, made obsolete some time ago. + * libc/machine/Makefile.in (doc): Don't pass everything to + sub-make, just CHEW and TARGETDOC. + (Makefile): New target. + * libc/sys/Makefile.in (Makefile): New target. + +Thu Feb 11 15:25:15 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (here and most subdirectories): Only pass down CHEW + and TARGETDOC when making info, not for other targets. + + * Makefile.in (here and most subdirectories), host/any: Use $(AR) + $(AR_FLAGS) rather than $(ARUPDATE). + +Wed Feb 10 11:57:52 1993 Ian Lance Taylor (ian@cygnus.com) + + * Try to reduce command line length: + * Makefile.in (FLAGS_TO_PASS): don't pass down exec_prefix, + CC_FOR_BUILD, CFLAGS_FOR_BUILD, INSTALL or CHEW. + (info, docs): pass CC_FOR_BUILD and CFLAGS_FOR_BUILD to doc. + (info): Pass CHEW to other subdirs. + +Tue Feb 9 14:01:42 1993 Mark Eichin (eichin@cygnus.com) + + * configure.in: add signal_dir, like unix_dir, but by default it + is set to "signal" so that a29khif can turn it off (since a29khif + has raise() as part of machine-specific signal.s.) + +Fri Jan 15 12:09:50 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * libc/sys/config.h, libc/machine/ieeefp.h: add Z8000 support + * libc/stdio/Makefile.in: pass CFLAGS so vfiprintf.c gets built + correctly. + * libc/stdio/fdopen.c, libc/stdio/fgets.c, libc/stdio/fscanf.c, + libc/stdio/vfprintf: type lint. + * libc/sys/z8ksim/crt0.c (start): Z8001/Z8002 independent + initialzation code. + * libc/sys/z8ksim/glue.c: Z8001/Z8002 clean system calls. + +Tue Dec 29 10:15:33 1992 Ian Lance Taylor (ian@cygnus.com) + + * stub/mvme135/mvme135-asm.S: new file. + stub/mvme135mvme135-stub.c: moved all assembler routines into + mvme135-asm.S. + stub/mvme135/Makefile.in: build mvme135-stub.o. + +Mon Dec 28 12:40:43 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: don't pass down $(CPP); use $(CC) -E in + sub-Makefiles instead, to try to avoid line length limitations. + +Mon Dec 21 18:36:13 1992 Per Bothner (bothner@rtl.cygnus.com) + + * libc/include/unistd.h (read, write): Use void* instead of + char*. + +Thu Dec 17 13:49:46 1992 Mark Eichin (eichin@cygnus.com) + + * stub/go32/resetpc: sample script to send a reset packet to the + stub + + * stub/go32/I386STUB.C: new file, gdb/i386stub.c modified for the + DOS environment, which compiles with Turbo C. + + * stub/go32/DSER32.LNK: new file, linker commands for serial + remote stub. + + * stub/go32/CONTROL.C: turn off debug_mode, add CYGNUS tag line to + start up message to identify version; call set_debug_traps. + + * stub/go32/DEBUG.C: turn off debug_mode (so stub doesn't need any + keyboard interaction); call handle_exception() in go_til_stop, + rather than return, so that the remote stub gets control. + + * stub/go32/MAKEFILE: fixed to actually use DOS commands (del and + rename, rather than mv), set flags that work with current Turbo C, + including using the /3 flag; also, add commands to build dser32. + + * stub/go32/DEBUG32.LNK, stub/go32/GO32.LNK: fix paths to match + default Turbo C installation (\tc rather than \usr) + + * stub/go32/MONO.C (printf): current Turbo C uses "..." instead of + "&..." + +Mon Dec 14 09:37:33 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * libc/include/math.h: added _DOUBLE_IS_32BITS checks + +Thu Nov 12 22:31:04 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * libc/stdio/cvt.c (licvt): new function to convert ints when + sizeof(int) != sizeof(long). + + * libc/include/stdio.h: added prototype for iprintf. + * libc/include/machine/limits.h machine/ieeefp.h: z8k stuff + +Tue Nov 10 12:18:12 1992 Ian Lance Taylor (ian@cygnus.com) + + * libc/machine/m68k/setjmp.S: use __USER_LABEL_PREFIX__ and + __REGISTER_PREFIX__. + +Mon Nov 2 13:50:14 1992 Ian Lance Taylor (ian@cygnus.com) + + * libc/sys/m68kbare: moved into stub directory. + +Mon Nov 2 13:40:42 1992 Ian Lance Taylor (ian@cygnus.com) + + * configure.in, Makefile.in: created new directory stub, to hold + sample code for specific targets. + +Wed Oct 28 02:19:55 1992 Mark Eichin (eichin@cygnus.com) + + * restored libc/sys/go32/sys/fcntl.h, to override incorrect values + in the unified libc/include/sys/fcntl.h. + +Wed Oct 21 13:55:58 1992 Doug Evans (dje@rtl.cygnus.com) + + * libc/stdlib/ecvtbuf.c: (print_f,_gcvt): printf("%f", 0.01) + printed .01, not 0.01. + +Mon Oct 19 11:05:55 1992 Ian Lance Taylor (ian@cygnus.com) + + * configure.in: compile with -m68000 for m68* targets. + +Sun Oct 18 05:29:05 1992 Mark Eichin (eichin@cygnus.com) + + * libm/math/remainder.c (remainder): document the svr4 and sunos + references used to construct the function. + +Sat Oct 17 21:46:16 1992 Mark Eichin (eichin@cygnus.com) + + * libm/math/remainder.c (rint, remainder): fix old typos. + * libm/math/Makefile.in: actually build remainder.c (functions + rint and remainder, from SysVr4 Programmer's Guide floor(3m) man + page.) + +Thu Oct 15 07:48:05 1992 Ian Lance Taylor (ian@cygnus.com) + + * libc/string/bcopy.c: BSD version works on overlapping strings, + so ours should too. + + * libc/stdlib/system.c: always invoke /bin/sh, not getenv + ("SHELL"). + +Wed Oct 14 11:07:11 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (docs): new target. + +Wed Oct 14 07:44:25 1992 Ian Lance Taylor (ian@cygnus.com) + + * libc/include/sys/times.h: define clock_t as required by POSIX. + libc/include/time.h: protect clock_t from multiple definitions. + +Wed Oct 7 11:02:21 1992 Mark Eichin (eichin at tweedledumber.cygnus.com) + + * libm/math/sqrt.h (sqrt): actually, the final version of fp-bit + does not need more than the original three iterations to get + within 1 ulp. (Paranoia tests for rounding to better than that, + but further iterations *don't* help, only more subtle changes + can.) + +Tue Oct 6 09:22:12 1992 Ian Lance Taylor (ian@cygnus.com) + + * libc/sys/vxworks68, libc/sys/vxworks960: removed, since they + were doing nothing useful. + +Tue Oct 6 08:48:13 1992 Ian Lance Taylor (ian@cygnus.com) + + * configure.in: define MALLOC_PROVIDED for vxworks targets; + removed sys_dir settings of vxworks68 and vxworks960. + host/any: don't pass -nostdinc to gcc, since newlib no longer + provides all required header files. + + * libc/stdlib/malloc.c: only compile this file if MALLOC_PROVIDED + is not defined; this provides a hook for VxWorks. + +Mon Oct 5 03:44:57 1992 Mark Eichin (eichin at tweedledumber.cygnus.com) + + * libc/stdio/setvbuf.c (setvbuf): while ANSI does say to malloc a + buffer if buf is NULL, don't do it here -- it is already being + done by makebuf elsewhere in stdio. + +Fri Oct 2 13:12:07 1992 Ian Lance Taylor (ian@cygnus.com) + + * libc/sys/a29khif/Makefile.in: assemble Steve's list of stubs so + that C programs can call functions without using initial + underscores. + +Thu Oct 1 09:37:47 1992 Ian Lance Taylor (ian@cygnus.com) + + * libc/stdlib/abort.c (abort): call exit, in case kill returns. + +Wed Sep 30 08:22:18 1992 Ian Lance Taylor (ian@cygnus.com) + + * configure.in: set TARGET_CFLAGS for certain CPU types to + -msoft-float. + +Tue Sep 29 21:09:32 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * libc/sys/m68kbare/glue.c: use <_ansi.h> instead of + +Mon Sep 28 14:58:44 1992 Ian Lance Taylor (ian@cygnus.com) + + * configure.in: added sys_dir m68kbare for m68k*-unknown-aout and + m68k*-unknown-coff. + +Fri Sep 25 08:33:21 1992 Ian Lance Taylor (ian@cygnus.com) + + * libc/include/stdio.h: define __need___va_list before including + , to avoid defining va_arg, et. al. + +Tue Sep 22 13:47:00 1992 Ian Lance Taylor (ian@cygnus.com) + + * libc/sys/Makefile.in: handle the case of an empty $(sys_dir) + (don't cd to the user's home directory). + + * libc/Makefile.in: replaced all instances of $(MAKE) with make. + In general this is the wrong thing to do, but I can't get around + GNU make's insistence on passing command line arguments any other + way. + +Tue Sep 22 10:12:44 1992 Ian Lance Taylor (ian@cygnus.com) + + * configure.in: always configure the libc/sys directory, since it + now provides a required documentation file. + + * Makefile.in: replaced all instances of $(MAKE) with make. In + general this is the wrong thing to do, but I can't get around GNU + make's insistence on passing command line arguments any other way. + +Mon Sep 21 22:42:26 1992 Ian Lance Taylor (ian@tweedledumbest.cygnus.com) + + * libc/stdlib/ecvtbuf.c (_gcvt): string for 0 was not null + terminated. + + * libc/stdio/local.h: include to define va_list. + libc/stdio/vsprintf.c: include rather than . + + * libc/include/float.h, libc/include/stdarg.h, + libc/include/stddef.h, libc/include/varargs.h: removed; use gcc + versions instead. + libc/include/stdio.h: get size_t from , and va_list from + , not from . Protect definition of + NULL. + libc/include/time.h: get size_t from stddef.h. Protect definition + of NULL. + libc/include/machine/limits.h: override gcc by defining + _LIMITS_H___. Don't define CLK_TCK. Copied in gcc to + get correct INT_MIN and LONG_LONG values. + libc/include/machine/types.h: don't define ptrdiff_t, wchar_t, + size_t or va_list at all; they're now gotten from stddef.h + instead. + libc/include/machine/varargs.h: removed; use gcc version instead. + libc/include/sys/types.h: explicitly include . + + * libm/math/sqrt.h: using the fp-bit routines appears to require + more iterations. + + * Makefile.in, host/any: let system include files override machine + include files. + +Sat Sep 19 21:10:06 1992 Mark Eichin (eichin at tweedledumber.cygnus.com) + + * libc/include/machine/types.h: allow __*_TYPE__ from cpp to + override _*_T_ definitions defaulted here. + +Tue Sep 15 11:14:46 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (install): install the include files in + $(tooldir)/include, not $(exec_prefix)/include. + +Fri Sep 11 15:48:43 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (install): fixed typo, and changed install to not + force rebuild of libc.a and libm.a. + +Thu Sep 10 10:46:09 1992 Ian Lance Taylor (ian@cygnus.com) + + * libc/sys/a29khif/*: Changed all .include's to include + sys/sysmac.h, not plain sysmac.h. The header files live in sys so + that they will be installed for the user. + + * Makefile.in (all): create targ-include, a directory holding the + machine and system specific header files during the build. + (install): fixed installation of machine and system specific + header files. + + * Makefile.in: fixed comment. + host/any: change .s.o rule to use $(AS) rather than $(CC), so that + we can pass $(INCLUDES) to it. + +Thu Sep 10 10:13:13 1992 Ian Lance Taylor (ian@cygnus.com) + + * libc/include/sys/param.h: new generic file, which may be + overridden for specific systems. + + * libc/include/sys/signal.h: define all ANSI signal names, and + NSIG (which is not ANSI) for a29k. + +Tue Sep 8 09:04:30 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: don't pass down arguments the lower level makes + will not need. + * libc/Makefile.in: recurse directly, rather than using subdir_do, + in hopes of avoiding argument length limits. + * libm/Makefile.in: recurse directly, rather using subdir_do, in + hopes of avoiding argument length limits. + +Tue Sep 8 08:27:22 1992 Ian Lance Taylor (ian@cygnus.com) + + * libc/include/sys/fcntl.h: include to ensure that + mode_t is defined. + +Mon Sep 7 14:02:07 1992 Ian Lance Taylor (ian@cygnus.com) + + * Fixed make info and make install-info for newlib, changing most + Makefile.in and several *.tex files. Moved doc directory from + libc to top level. + + * libc/time/mktime.c (_DAYS_IN_MONTH): actually, not const. + Should be rewritten. + + * libc/string/strings.tex: renamed node index to node index + function, so that it does not conflict with the top level index + node. + + * libc/include/sys/config.h: define __IEEE_BIG_ENDIAN for h8300. + +Fri Sep 4 02:34:06 1992 Ian Lance Taylor (ian@cygnus.com) + + * Overhauled general configuration for newlib. Eliminated all + target dependent Makefile fragments. Create libraries in newlib + rather than newlib/libc and newlib/libm. Use CC, et. al., rather + than CROSS_CC, et. al. Broke make docs; will fix later. + + * libc/time/localtime.c (_DAYS_IN_MONTH): actually, not const. + Should be rewritten. + +Tue Sep 1 15:21:14 1992 Ian Lance Taylor (ian@cygnus.com) + + * libc/configure.in: cleaned up somewhat; switch on ${target} + rather than ${target_alias}. + * libm/configure.in: cleaned up somewhat; switch on ${target} + rather than ${target_alias}. + + * libc/ctype/ctype_.c: marked _ctype_ array _CONST. + * libc/include/ctype.h: marked _ctype_ as _CONST. + + * libc/locale/locale.c (lconv, localeconv): marked static lconv as + _CONST. + + * libc/stdio/cvt.c, libc/stdio/findfp.c (__sfmoreglue), + libc/stdio/vfscanf.c (__svfscanf): made static variables const. + libc/stdio/gets.c (gets): removed non-ANSI warning message. + libc/stdio/tmpnam.c (tmpnam): removed unneeded filename variable. + + * libc/stdlib/mprec.h, libc/stdlib/mprec.c (pow5mult, tens, + bigtens, tinytens): marked arrays _CONST. + libc/stdlib/qsort.c (swap): if __GNUC__, use _builtin_alloca + rather than a static variable. + + * libc/time/asctime.c (asctime), libc/time/localtime.c + (_DAYS_IN_MONTH), libc/time/mktime.c (_DAYS_IN_MONTH, + _DAYS_BEFORE_MONTH), libc/time/strftime.c (dname_len, dname, + mname_len, mname): Marked static arrays _CONST. + + * libm/math/gamma.h: made local variables non-static. + + * libm/math/acos.h, libm/math/bessel.c, libm/math/erf.c, + libm/math/exp.c, libm/math/gamma.h: marked static arrays as + _CONST. + + * libm/math/constants.c: removed file, because the constants it + defined were never referenced. + libm/math/Makefile.in: removed references to constants.c. + libm/math/mathimpl.h: removed declarations of constants. + +Wed Aug 26 21:09:06 1992 Ian Lance Taylor (ian@cygnus.com) + + * libc/include/machine/varargs.h: only call __builtin_saveregs if + it is sensibly defined in libgcc2. Checks preprocessor defines, + which is not a good solution. + + * libm/sqrt.c: sqrt(Infinity) should not be a domain error. + + * libm/frexp.c: handle denormalized numbers as arguments. + + * libm/math/Makefile.in: added some dependencies for .c files + which include local .h files. + +Mon Aug 24 12:57:58 1992 Ian Lance Taylor (ian@cygnus.com) + + * libc/configure.in: set target_alias for OSE*. Replace + target_makefile_frag if it is blank. + + * libc/Makefile.in: make sure everything is passed to subsidiary + makes; create all directories when installing. + + * libm/ieeefp/Makefile.in, libm/math/Makefile.in: use + CROSS_ARUPDATE instead of AR. + + * libm/configure.in: set target_alias for OSE*. Replace + target_makefile_frag if it is blank. + + * libm/Makefile.in: make sure everything is passed to subsidiary + makes; create all directories when installing. + +Thu Aug 20 15:11:51 1992 Mark Eichin (eichin@cygnus.com) + + * add following change from libc copy. + +Wed Aug 19 18:54:49 1992 Roland H. Pesch (pesch@fowanton.cygnus.com) + + * libc/libc.texinfo: make copyright disclaimers appear on back of + title page; make format of same slightly less ugly; avoid using + underbars in section headings (avoids nasty texinfo bug in table + of contents). + + * libc/ctype/tolower.c, libc/ctype/toupper.c: (doc changes in + comments only) avoid using underbars in section headings + + * libc/ieeefp/ieeefp.tex: include doc from fpsticky, infinity, + isnan ieeefp/fpmask.c, ieeefp/fpround.c, ieeefp/fpsticky.c (doc + changes in comments only): shorten headings ieeefp/infinity.c, + ieeefp/isnan.c: (doc, comments only) more informative headings + + * libc/math/bessel.c: (doc, comments only) shorten heading + + * libc/stdlib/efgcvt.c, libc/stdlib/mbtowc.c, libc/stdlib/wctomb.c + (doc, comments only) shorten headings + + * libc/time/localtime.c (doc, comments only): shorten headings + + * libm/ieeefp/ieeefp.tex: include doc from fpsticky, infinity, + isnan + libm/ieeefp/fpmask.c, libm/ieeefp/fpround.c, + libm/ieeefp/fpsticky.c (doc changes in comments only): shorten + headings + libm/ieeefp/infinity.c, libm/ieeefp/isnan.c: (doc, comments + only) more informative headings + * libm/math/bessel.c: (doc, comments only) shorten heading + +Wed Aug 19 07:06:37 1992 Mark Eichin (eichin at tweedledumber.cygnus.com) + + * .../Makefile.in: use CROSS_ARUPDATE consistently. + * config/*.mt: define CROSS_AR as well as CROSS_ARUPDATE + * config/*.mt: define CROSS_CPP based on CROSS_CC, not /lib/cpp. + * .../Makefile.in: get rid of .c.o rule - if TOP is correctly + defined, the one from the .mt file will be correct. + * libc/include/machine, libc/include/sys: created, and populated + with common files from machine/*/machine. ifdefs were used for + most, typically by handling exceptions first and then filling in + defaults. Files with D.J. Delorie copyright #included rather than + copied. Most files in include/sys really were the same in the + original. + * libc/include/...: cleaned up use of _EXFUN. + * libc/stdlib/mprec.c: mprec.h doesn't get installed, so include + it with double quotes, not angles. + +Mon Aug 10 11:43:20 1992 Ian Lance Taylor (ian@dumbest.cygnus.com) + + * libc/Makefile.in: always create installation directories. + +Sun Aug 9 22:45:48 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * libc/configure.in: handle host properly (using canonical + triples), better error message for the case of target not found + +Thu May 28 01:56:37 1992 Michael Tiemann (tiemann@rtl.cygnus.com) + + * libc/Makefile.in (insincdir): Ensure this directory exists + before attempting installation. + +Fri May 1 18:16:42 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * libc/stdlib/assert.c: now calls abort like it should + * libc/sys/a29khif: many many patches for 29khif work + * libc/machine/i386: gnulib2 expanded there. + +Tue Apr 28 19:08:37 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + Added accurate fp conversion routines to stdlib, moved dcvt from + stdio to stdlib and called it ecvtbuf: + * libc/stdlib/mprec.c, mprec.h: new files for multiprec arithmetic + * libc/stdlib/Makefile.in, efgcvt.c, strtod.c: modified to use new + routines + * libc/libc.texinfo: Modifed to include the copyright info from + the mprec files + * libc/stdlib/efgcvt.c: now xref to ecvtbuf in stdlib. + * libc/test/ : many vector which tested for the implementation + defined returns of strange conversion requests have been updated + to relflect the new implementation + +Mon Apr 27 13:41:33 1992 Roland H. Pesch (pesch@fowanton.cygnus.com) + + * libc/libc.texinfo: new chapter on variable arg lists + (stdarg.h/varargs.h) + * libc/libc.texinfo: new title + * libc/time/gmtime.c, libc/time/localtime./c, libc/time/mktime.c: + (doc only) shorter headings for better formatting. + +Fri Apr 24 11:26:48 1992 Roland H. Pesch (pesch@fowanton.cygnus.com) + + * libc/libc.texinfo: three more info menu entries + * libc/locale/locale.tex: new chapter + * libc/locale/locale.c: new doc for setlocale, localeconv + * libc/locale/Makefile.in: use new locale doc + * libc/signal/signal.tex: new chapter + * libc/signal/raise.c, libc/signal/signal.c: new doc + * libc/signal/Makefile.in: use new doc + * libc/time/time.tex: new chapter + * libc/time/asctime.c libc/time/clock.c libc/time/ctime.c + libc/time/difftime.c libc/time/gmtime.c libc/time/localtime.c + libc/time/mktime.c libc/time/strftime.c libc/time/time.c: new doc + * libc/time/Makefile.in: use new doc + +Tue Apr 21 14:48:50 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * libm/math/log1p.c: split to use the new function way of float + function definition. math/log1p.h deleted + * libm/math/scalb.c: obsolete and deleted + * libm/math/scalbn.c: created from part log1p.c + * libm/math/Makefile.in: know about log1p and scalbn + +Tue Apr 21 12:32:21 1992 Roland H. Pesch (pesch@fowanton.cygnus.com) + + * libc/ctype/isupper.c: revise doc; + libc/ctype/ctype.tex: use doc from isupper.c + + * libc/string/bzero.c: new doc + +Mon Apr 20 14:19:42 1992 Roland H. Pesch (pesch@fowanton.cygnus.com) + + * libc/stdlib/system.c, libc/stdlib/exit.c, libc/stdlib/abort.c: + new doc + * libc/stdlib/Makefile.in: extract new doc + * libc/stdlib/stdlib.tex: use new doc + + * libc/string/strerror.c: expanded doc. + + * libc/stdio/Makefile.in: extract doc from more files + * libc/stdio/fopen.c, libc/stdio/perror.c, libc/stdio/remove.c, + libc/stdio/rename.c, libc/stdio/rewind.c, libc/stdio/setbuf.c, + libc/stdio/setvbuf.c, libc/stdio/sprintf.c, libc/stdio/tmpfile.c, + libc/stdio/tmpnam.c, libc/stdio/vfprintf.c, libc/stdio/vprintf.c, + libc/stdio/vsprintf.c: new doc + * libc/stdio/stdio.tex: use new doc + +Mon Apr 20 09:38:17 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * libc/config/ebmon29k: added CROSS_CPP rule and other fixes + * libc/include/ieeefp.h: fixed ansi conflict with isnanf, isinff, + finitef functions. + * libc/sys/a29khif/sys/*.h: ansidecl.h was renamed to _ansi.h some + time ago. + + * libc/stdio/stdio.h: added P_tmpdir for /tmp (SVID thing) + * libc/stdio/setbuf.c: added ansi style definition. + * libc/stdio/setvbuf.c: added ansi definition, now mallocs own + buffer if none provided. + * libc/stdio/tmpfile.c: lint + * libc/stdio/tmpnam.c (worker): created. (tmpnam): mallocs buffer + rather than using static, also make sure file isn't already + present. Uses P_tmpdir. (tempnam): rewritten to use new + subroutine, and uses P_tmpdir. + * libc/stdio/siprintf.c: created + +Mon Apr 13 09:12:58 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + Release 1.03 for NEC, major mods. Main differences from release + 1.02:: + + More tests in test/: + * jn_vec.c, jnf_vec.c, yn_vec.c, ynf_vec.c, log2_vec.c, + log2f_vec.c, atan2_vec.c, atan2f_vec.c: new test vectors. + * test_ieee.c: tests for ieee flags & masks - get/set rounding, + get/set mask, get/set sticky and get/set roundtoi. Tests + that setting the bits changes the way arithmetic is done. + * string.c: added test to make sure memcmp does it with unsigned + chars. + * test.c: cleaned up and removed lint. + * sprint_vec, sprint_ivec.c, convert.c, conv_vec.c, iconf_vec.c, + dvec.c: tests for string to value conversions, sprintf, scanf, + atof, atoff, strtod, strtodf, atoi, atol, strtol, ecvtbuf, ecvt, + ecvtf, fcvtbuf, fcvt, fcvtf, gcvt, gcvtf. Some attention paid to + rounding in sprintf too. + * test_is.c: tests for isalnum, isalpha, isascii, iscntrl, + isdigit, isgraph, islower, isprint, ispunct, isspace, isupper, + isxdigit, toascii, tolower, toupper, _tolower, _toupper in macro + and function form. + * math2.c: test for frexp, frexpf, ldexp, ldexpf, modf modff, pow, + powf + + In the library: + * libc/stdlib/div.c, libc/stdlib/ldiv.c, libc/stdlib/strtod.c, + libc/stdlib/strtol.c, libc/stdlib/stroul.c, libc/stdlib/abs.c, + libc/stdlib/bsearch.c, libc/stdlib/calloc.c, libc/stdlib/getenv.c, + libc/stdlib/labs.c, libc/stdlib/malloc.c: new documentation + * libc/stdlib/efgcvt.c: rewritten to use new _dcvt routines rather + than sprintf. + * libc/stdio/dcvt.c: rewritten to make more useful elsewhere. + * Method of producting float versions of double functions has + changed, functions will be modified gradually. So far: + libm/math/exp.c, libm/math/pow.c, libm/math/modf.c, + libm/math/sincos.c, libm/math/fmod.c, libm/math/tan.c have been + altered + * libc/string/memcmp.c: now uses unsigned chars + * libc/string/bcmp.c, libc/string/strcpy.c, + libc/stsring/strxfrm.c: fixed doc + * libc/sys/sysvnecv70.tex: fix example of sbrk code + +Local Variables: +version-control: never +End: diff --git a/newlib/Makefile.am b/newlib/Makefile.am new file mode 100644 index 000000000..38e1d138e --- /dev/null +++ b/newlib/Makefile.am @@ -0,0 +1,191 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +# Multilib support variables. +MULTISRCTOP = +MULTIBUILDTOP = +MULTIDIRS = +MULTISUBDIR = +MULTIDO = true +MULTICLEAN = true + +# Work around what appears to be a GNU make bug handling MAKEFLAGS +# values defined in terms of make variables, as is the case for CC and +# friends when we are called from the top level Makefile. +AM_MAKEFLAGS = \ + "AR_FLAGS=$(AR_FLAGS)" \ + "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ + "CFLAGS=$(CFLAGS)" \ + "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ + "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ + "INSTALL=$(INSTALL)" \ + "INSTALL_DATA=$(INSTALL_DATA)" \ + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ + "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ + "LDFLAGS=$(LDFLAGS)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ + "MAKE=$(MAKE)" \ + "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ + "PICFLAG=$(PICFLAG)" \ + "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \ + "SHELL=$(SHELL)" \ + "EXPECT=$(EXPECT)" \ + "RUNTEST=$(RUNTEST)" \ + "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ + "exec_prefix=$(exec_prefix)" \ + "infodir=$(infodir)" \ + "libdir=$(libdir)" \ + "prefix=$(prefix)" \ + "tooldir=$(tooldir)" \ + "AR=$(AR)" \ + "AS=$(AS)" \ + "CC=$(CC)" \ + "LD=$(LD)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "NM=$(NM)" \ + "PICFLAG=$(PICFLAG)" \ + "RANLIB=$(RANLIB)" \ + "DESTDIR=$(DESTDIR)" + +if HAVE_DOC +DOCDIR = doc +endif + +SUBDIRS = libc libm $(DOCDIR) . + +tooldir = $(exec_prefix)/$(host_alias) +toollibdir = $(tooldir)/lib$(MULTISUBDIR) + +AR_FLAGS = rc + +toollib_LIBRARIES = libm.a libc.a +toollib_DATA = $(CRT0) +noinst_DATA = stmp-targ-include + +# The functions ldexp, frexp and modf are traditionally supplied in +# both libc.a and libm.a. We build them in libm.a and copy them over, +# along with some required supporting routines. +MATHOBJS_IN_LIBC = \ + s_isinf.o sf_isinf.o \ + s_isnan.o sf_isnan.o \ + s_ldexp.o sf_ldexp.o \ + s_frexp.o sf_frexp.o s_modf.o sf_modf.o \ + s_scalbn.o sf_scalbn.o s_finite.o sf_finite.o \ + s_copysign.o sf_copysign.o s_infconst.o + +libc.a: libc/libc.a libm.a + rm -rf libc.a libg.a tmp + mkdir tmp + cd tmp; \ + $(AR) x ../libm.a $(MATHOBJS_IN_LIBC) ; \ + $(AR) x ../libc/libc.a ; \ + $(AR) $(AR_FLAGS) ../$@ *.o + $(RANLIB) libc.a + ln libc.a libg.a + rm -rf tmp + +libc/libc.a: ; @true + +libm.a: libm/libm.a + rm -f $@ + ln libm/libm.a $@ >/dev/null 2>/dev/null || cp libm/libm.a $@ + +libm/libm.a: ; @true + +crt0.o: $(CRT0_DIR)/$(CRT0) + rm -f $@ + ln $(CRT0_DIR)/$(CRT0) $@ >/dev/null 2>/dev/null \ + || cp $(CRT0_DIR)/$(CRT0) $@ + +$(CRT0_DIR)/$(CRT0): ; @true + +all-recursive: stmp-targ-include + +# The targ-include directory just holds the includes files for the +# particular system and machine we have been configured for. It is +# used while building. +stmp-targ-include: config.status + -rm -rf targ-include stmp-targ-include + mkdir targ-include targ-include/sys targ-include/machine + -for i in $(srcdir)/libc/machine/$(machine_dir)/machine/*.h; do \ + if [ -f $$i ]; then \ + cp $$i targ-include/machine/`basename $$i`; \ + else true; fi ; \ + done + -for i in $(srcdir)/libc/sys/$(sys_dir)/include/*.h; do \ + if [ -f $$i ]; then \ + cp $$i targ-include/`basename $$i`; \ + else true; fi ; \ + done + -for i in $(srcdir)/libc/sys/$(sys_dir)/sys/*.h; do \ + if [ -f $$i ]; then \ + cp $$i targ-include/sys/`basename $$i`; \ + else true; fi ; \ + done + touch $@ + +CLEANFILES = targ-include stmp-targ-include + +install-data-local: install-toollibLIBRARIES + rm -f $(toollibdir)/libg.a + ln $(toollibdir)/libc.a $(toollibdir)/libg.a + $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do + -if [ -z "$(MULTISUBDIR)" ]; then \ + for i in $(srcdir)/libc/include/*.h; do \ + $(INSTALL_DATA) $$i $(tooldir)/include/`basename $$i`; \ + done; \ + for i in $(srcdir)/libc/include/machine/*.h; do \ + $(INSTALL_DATA) $$i $(tooldir)/include/machine/`basename $$i`; \ + done; \ + for i in $(srcdir)/libc/machine/$(machine_dir)/machine/*.h; do \ + if [ -f $$i ]; then \ + $(INSTALL_DATA) $$i $(tooldir)/include/machine/`basename $$i`; \ + else true; fi ; \ + done; \ + for i in $(srcdir)/libc/include/sys/*.h; do \ + $(INSTALL_DATA) $$i $(tooldir)/include/sys/`basename $$i`; \ + done; \ + for i in $(srcdir)/libc/sys/$(sys_dir)/sys/*.h; do \ + if [ -f $$i ]; then \ + $(INSTALL_DATA) $$i $(tooldir)/include/sys/`basename $$i`; \ + else true; fi ; \ + done ; \ + for i in $(srcdir)/libc/sys/$(sys_dir)/include/*.h; do \ + if [ -f $$i ]; then \ + $(INSTALL_DATA) $$i $(tooldir)/include/`basename $$i`; \ + else true; fi ; \ + done ; \ + else true; fi + +# Force makedoc to be built before building info files. +info-recursive: doc/makedoc +dvi-recursive: doc/makedoc +doc/makedoc: + cd doc && $(MAKE) all + +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host + +# Multilib support. +.PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \ + maintainer-clean-multi + +all-recursive: all-multi +mostlyclean-recursive: mostlyclean-multi +clean-recursive: clean-multi +distclean-recursive: distclean-multi +maintainer-clean-recursive: maintainer-clean-multi + +all-multi: + $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do +mostlyclean-multi: + $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean +clean-multi: + $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean +distclean-multi: + $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean +maintainer-clean-multi: + $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean + +MAKEOVERRIDES= diff --git a/newlib/Makefile.in b/newlib/Makefile.in new file mode 100644 index 000000000..da4fed1f8 --- /dev/null +++ b/newlib/Makefile.in @@ -0,0 +1,625 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +CRT0 = @CRT0@ +CRT0_DIR = @CRT0_DIR@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +# Multilib support variables. +MULTISRCTOP = +MULTIBUILDTOP = +MULTIDIRS = +MULTISUBDIR = +MULTIDO = true +MULTICLEAN = true + +# Work around what appears to be a GNU make bug handling MAKEFLAGS +# values defined in terms of make variables, as is the case for CC and +# friends when we are called from the top level Makefile. +AM_MAKEFLAGS = \ + "AR_FLAGS=$(AR_FLAGS)" \ + "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ + "CFLAGS=$(CFLAGS)" \ + "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ + "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ + "INSTALL=$(INSTALL)" \ + "INSTALL_DATA=$(INSTALL_DATA)" \ + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ + "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ + "LDFLAGS=$(LDFLAGS)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ + "MAKE=$(MAKE)" \ + "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ + "PICFLAG=$(PICFLAG)" \ + "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \ + "SHELL=$(SHELL)" \ + "EXPECT=$(EXPECT)" \ + "RUNTEST=$(RUNTEST)" \ + "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ + "exec_prefix=$(exec_prefix)" \ + "infodir=$(infodir)" \ + "libdir=$(libdir)" \ + "prefix=$(prefix)" \ + "tooldir=$(tooldir)" \ + "AR=$(AR)" \ + "AS=$(AS)" \ + "CC=$(CC)" \ + "LD=$(LD)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "NM=$(NM)" \ + "PICFLAG=$(PICFLAG)" \ + "RANLIB=$(RANLIB)" \ + "DESTDIR=$(DESTDIR)" + + +@HAVE_DOC_TRUE@DOCDIR = \ +@HAVE_DOC_TRUE@doc + +SUBDIRS = libc libm $(DOCDIR) . + +tooldir = $(exec_prefix)/$(host_alias) +toollibdir = $(tooldir)/lib$(MULTISUBDIR) + +AR_FLAGS = rc + +toollib_LIBRARIES = libm.a libc.a +toollib_DATA = $(CRT0) +noinst_DATA = stmp-targ-include + +# The functions ldexp, frexp and modf are traditionally supplied in +# both libc.a and libm.a. We build them in libm.a and copy them over, +# along with some required supporting routines. +MATHOBJS_IN_LIBC = \ + s_isinf.o sf_isinf.o \ + s_isnan.o sf_isnan.o \ + s_ldexp.o sf_ldexp.o \ + s_frexp.o sf_frexp.o s_modf.o sf_modf.o \ + s_scalbn.o sf_scalbn.o s_finite.o sf_finite.o \ + s_copysign.o sf_copysign.o s_infconst.o + + +CLEANFILES = targ-include stmp-targ-include + +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host + +MAKEOVERRIDES = +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(toollib_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +libm_a_LIBADD = +libm_a_SOURCES = libm.a.c +libm_a_OBJECTS = libm.a.o +libc_a_LIBADD = +libc_a_SOURCES = libc.a.c +libc_a_OBJECTS = libc.a.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DATA = $(noinst_DATA) $(toollib_DATA) + +DIST_COMMON = README ChangeLog Makefile.am Makefile.in NEWS \ +acinclude.m4 aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +DIST_SUBDIRS = libc libm doc . +SOURCES = libm.a.c libc.a.c +OBJECTS = libm.a.o libc.a.o + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 + cd $(srcdir) && $(ACLOCAL) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-toollibLIBRARIES: + +clean-toollibLIBRARIES: + -test -z "$(toollib_LIBRARIES)" || rm -f $(toollib_LIBRARIES) + +distclean-toollibLIBRARIES: + +maintainer-clean-toollibLIBRARIES: + +install-toollibLIBRARIES: $(toollib_LIBRARIES) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(toollibdir) + @list='$(toollib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(toollibdir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(toollibdir)/$$p; \ + else :; fi; \ + done + @$(POST_INSTALL) + @list='$(toollib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(RANLIB) $(DESTDIR)$(toollibdir)/$$p"; \ + $(RANLIB) $(DESTDIR)$(toollibdir)/$$p; \ + else :; fi; \ + done + +uninstall-toollibLIBRARIES: + @$(NORMAL_UNINSTALL) + list='$(toollib_LIBRARIES)'; for p in $$list; do \ + rm -f $(DESTDIR)$(toollibdir)/$$p; \ + done + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +install-toollibDATA: $(toollib_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(toollibdir) + @list='$(toollib_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(toollibdir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(toollibdir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(toollibdir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(toollibdir)/$$p; \ + fi; fi; \ + done + +uninstall-toollibDATA: + @$(NORMAL_UNINSTALL) + list='$(toollib_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(toollibdir)/$$p; \ + done + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive install-info-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(DIST_SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +install-info-am: +install-info: install-info-recursive +install-exec-am: +install-exec: install-exec-recursive + +install-data-am: install-toollibLIBRARIES install-toollibDATA \ + install-data-local +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: uninstall-toollibLIBRARIES uninstall-toollibDATA +uninstall: uninstall-recursive +all-am: Makefile $(LIBRARIES) $(DATA) +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(toollibdir) $(DESTDIR)$(toollibdir) + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-toollibLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-toollibLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-toollibLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-recursive + -rm -f config.status + +maintainer-clean-am: maintainer-clean-toollibLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + -rm -f config.status + +.PHONY: mostlyclean-toollibLIBRARIES distclean-toollibLIBRARIES \ +clean-toollibLIBRARIES maintainer-clean-toollibLIBRARIES \ +uninstall-toollibLIBRARIES install-toollibLIBRARIES mostlyclean-compile \ +distclean-compile clean-compile maintainer-clean-compile \ +uninstall-toollibDATA install-toollibDATA install-data-recursive \ +uninstall-data-recursive install-exec-recursive \ +uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ +all-recursive check-recursive installcheck-recursive info-recursive \ +dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-info-am \ +install-info install-exec-am install-exec install-data-local \ +install-data-am install-data install-am install uninstall-am uninstall \ +all-redirect all-am all installdirs-am installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean + + +libc.a: libc/libc.a libm.a + rm -rf libc.a libg.a tmp + mkdir tmp + cd tmp; \ + $(AR) x ../libm.a $(MATHOBJS_IN_LIBC) ; \ + $(AR) x ../libc/libc.a ; \ + $(AR) $(AR_FLAGS) ../$@ *.o + $(RANLIB) libc.a + ln libc.a libg.a + rm -rf tmp + +libc/libc.a: ; @true + +libm.a: libm/libm.a + rm -f $@ + ln libm/libm.a $@ >/dev/null 2>/dev/null || cp libm/libm.a $@ + +libm/libm.a: ; @true + +crt0.o: $(CRT0_DIR)/$(CRT0) + rm -f $@ + ln $(CRT0_DIR)/$(CRT0) $@ >/dev/null 2>/dev/null \ + || cp $(CRT0_DIR)/$(CRT0) $@ + +$(CRT0_DIR)/$(CRT0): ; @true + +all-recursive: stmp-targ-include + +# The targ-include directory just holds the includes files for the +# particular system and machine we have been configured for. It is +# used while building. +stmp-targ-include: config.status + -rm -rf targ-include stmp-targ-include + mkdir targ-include targ-include/sys targ-include/machine + -for i in $(srcdir)/libc/machine/$(machine_dir)/machine/*.h; do \ + if [ -f $$i ]; then \ + cp $$i targ-include/machine/`basename $$i`; \ + else true; fi ; \ + done + -for i in $(srcdir)/libc/sys/$(sys_dir)/include/*.h; do \ + if [ -f $$i ]; then \ + cp $$i targ-include/`basename $$i`; \ + else true; fi ; \ + done + -for i in $(srcdir)/libc/sys/$(sys_dir)/sys/*.h; do \ + if [ -f $$i ]; then \ + cp $$i targ-include/sys/`basename $$i`; \ + else true; fi ; \ + done + touch $@ + +install-data-local: install-toollibLIBRARIES + rm -f $(toollibdir)/libg.a + ln $(toollibdir)/libc.a $(toollibdir)/libg.a + $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do + -if [ -z "$(MULTISUBDIR)" ]; then \ + for i in $(srcdir)/libc/include/*.h; do \ + $(INSTALL_DATA) $$i $(tooldir)/include/`basename $$i`; \ + done; \ + for i in $(srcdir)/libc/include/machine/*.h; do \ + $(INSTALL_DATA) $$i $(tooldir)/include/machine/`basename $$i`; \ + done; \ + for i in $(srcdir)/libc/machine/$(machine_dir)/machine/*.h; do \ + if [ -f $$i ]; then \ + $(INSTALL_DATA) $$i $(tooldir)/include/machine/`basename $$i`; \ + else true; fi ; \ + done; \ + for i in $(srcdir)/libc/include/sys/*.h; do \ + $(INSTALL_DATA) $$i $(tooldir)/include/sys/`basename $$i`; \ + done; \ + for i in $(srcdir)/libc/sys/$(sys_dir)/sys/*.h; do \ + if [ -f $$i ]; then \ + $(INSTALL_DATA) $$i $(tooldir)/include/sys/`basename $$i`; \ + else true; fi ; \ + done ; \ + for i in $(srcdir)/libc/sys/$(sys_dir)/include/*.h; do \ + if [ -f $$i ]; then \ + $(INSTALL_DATA) $$i $(tooldir)/include/`basename $$i`; \ + else true; fi ; \ + done ; \ + else true; fi + +# Force makedoc to be built before building info files. +info-recursive: doc/makedoc +dvi-recursive: doc/makedoc +doc/makedoc: + cd doc && $(MAKE) all + +# Multilib support. +.PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \ + maintainer-clean-multi + +all-recursive: all-multi +mostlyclean-recursive: mostlyclean-multi +clean-recursive: clean-multi +distclean-recursive: distclean-multi +maintainer-clean-recursive: maintainer-clean-multi + +all-multi: + $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do +mostlyclean-multi: + $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean +clean-multi: + $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean +distclean-multi: + $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean +maintainer-clean-multi: + $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/NEWS b/newlib/NEWS new file mode 100644 index 000000000..733185d89 --- /dev/null +++ b/newlib/NEWS @@ -0,0 +1,79 @@ +*** Major changes in newlib version 1.8.2: + +* RTEMS features and fixes from Joel Sherrill. + +* More work on reentrant routines. + +* Floating point math library check, --enable-newlib-hw-fp. + +*** Major changes in newlib version 1.8.1: + +* Added check for --enable-newlib-mb configure option which defines the + MB_CAPABLE macro. Multibyte support for JIS, SJIS, and EUC-JP implemented. + +* Reduced code size for libm modules. + +* Replaced the BSD malloc with Doug Lea's malloc. + +*** Major changes in newlib version 1.8.0: + +* Added simulated signal handling functions _raise_r, _signal_r, raise, and + signal except for sparc-sun-sunos*, i[3456]86-*-sco*, and a29k-*-* systems, + which already provide access to signal. The signal functionality provided + does not interact with hardware generated signals. + +* Added reentrant function rand_r from POSIX.1c. + +* Removed _asctime, _next, _scanpoint, and _signgam fields from struct + _reent. These are no longer necessary since there are now functions + that explictly support multiple threads (asctime_r, ctime_r, gamma_r, + gmtime_r, lgamma_r, localtime_r, rand_r, & strtok_r). + + +*** Major changes in newlib version 1.7.0: + +* Cross compiler target libraries are now built in a subdir of the top level + build directory. + + Old way: build + /newlib + /m68020 + /m68881 + New way: + build + /m68k-coff + /m68020 + /m68881 + + where m68020 and m68881 are multilib subdirectories + +* m68k targets support --disable options to avoid building unwanted versions + of the libraries. + + --disable-softfloat - don't build libc, libg++, etc. for -msoft-float + --disable-m68881 - don't build libc, libg++, etc. for -m68881 + --disable-m68000 - don't build libc, libg++, etc. for -m68000 + --disable-m68020 - don't build libc, libg++, etc. for -m68020 + + These options have *no* effect on the default libraries, so if the default + is -m68020, --disable-m68020 is nilpotent. + +* Reentrancy support in libm removed. + +* strtok, strtol, strtoul, assert, div, ldiv, qsort, vfprintf + replaced with NetBSD versions. + +* Support for systems with 32 bit "doubles" added. + +* unctrl added. + +* dtoa.c updated from master dtoa.c soruces (netlib.att.com) + +* Various bug fixes. + +*** Major changes in newlib version 1.6.1: + +* Added reentrant functions (asctime_r, ctime_r, gmtime_r, localtime_r, +and strtok_r) from POSIX.1c. + +* Removed _asctime_r and _strtok_r functions. diff --git a/newlib/README b/newlib/README new file mode 100644 index 000000000..fdda052d3 --- /dev/null +++ b/newlib/README @@ -0,0 +1,231 @@ + README for newlib-1.8.2 release + (mostly cribbed from the README in the gdb-4.13 release) + +This is `newlib', a simple ANSI C library, math library, and collection +of board support packages. + +The newlib and libgloss subdirectories are a collection of software from +several sources, each with their own copyright. See the file COPYING.NEWLIB +for details. The rest of the release tree is under either the GNU GPL or +LPGL copyright. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + + +Unpacking and Installation -- quick overview +========================== + +When you unpack the newlib-1.8.2.tar.gz file, you'll find a directory +called `newlib-1.8.2', which contains: + +COPYING config/ install-sh* mpw-configure +COPYING.LIB config-ml.in libgloss/ mpw-install +COPYING.NEWLIB config.guess* mkinstalldirs* newlib/ +CYGNUS config.sub* move-if-change* symlink-tree* +ChangeLog configure* mpw-README texinfo/ +Makefile.in configure.in mpw-build.in +README etc/ mpw-config.in + +To build NEWLIB, you can just do: + + cd newlib-1.8.2 + ./configure --target= + make all install + +This will configure and build all the libraries and crt0 (if one exists). +If `configure' can't determine your host system type, specify one as its +argument, e.g., sun4 or sun4sol2. NEWLIB is most often used in cross +environments. + +NOTE THAT YOU MUST HAVE ALREADY BUILT AND INSTALLED GCC and BINUTILS. + + +More Documentation +================== + + Newlib documentation is available on the net via: + http://www.cygnus.com/pubs/gnupro + + All the documentation for NEWLIB comes as part of the machine-readable +distribution. The documentation is written in Texinfo format, which is +a documentation system that uses a single source file to produce both +on-line information and a printed manual. You can use one of the Info +formatting commands to create the on-line version of the documentation +and TeX (or `texi2roff') to typeset the printed version. + + If you want to format these Info files yourself, you need one of the +Info formatting programs, such as `texinfo-format-buffer' or `makeinfo'. + + If you want to typeset and print copies of this manual, you need TeX, +a program to print its DVI output files, and `texinfo.tex', the Texinfo +definitions file. + + TeX is a typesetting program; it does not print files directly, but +produces output files called DVI files. To print a typeset document, +you need a program to print DVI files. If your system has TeX +installed, chances are it has such a program. The precise command to +use depends on your system; `lpr -d' is common; another (for PostScript +devices) is `dvips'. The DVI print command may require a file name +without any extension or a `.dvi' extension. + + TeX also requires a macro definitions file called `texinfo.tex'. +This file tells TeX how to typeset a document written in Texinfo +format. On its own, TeX cannot read, much less typeset a Texinfo file. +`texinfo.tex' is distributed with NEWLIB and is located in the +`newlib-VERSION-NUMBER/texinfo' directory. + + + +Compiling NEWLIB in another directory +===================================== + + If you want to run NEWLIB versions for several host or target machines, +you need a different `newlib' compiled for each combination of host and +target. `configure' is designed to make this easy by allowing you to +generate each configuration in a separate subdirectory, rather than in +the source directory. If your `make' program handles the `VPATH' +feature correctly (like GNU `make') running `make' in each of these +directories builds the `newlib' libraries specified there. + + To build `newlib' in a separate directory, run `configure' with the +`--srcdir' option to specify where to find the source. (You also need +to specify a path to find `configure' itself from your working +directory. If the path to `configure' would be the same as the +argument to `--srcdir', you can leave out the `--srcdir' option; it +will be assumed.) + + For example, with version 1.8.2, you can build NEWLIB in a separate +directory for a Sun 4 cross m68k-aout environment like this: + + cd newlib-1.8.2 + mkdir ../newlib-m68k-aout + cd ../newlib-m68k-aout + ../newlib-1.8.2/configure --host=sun4 --target=m68k-aout + make + + When `configure' builds a configuration using a remote source +directory, it creates a tree for the binaries with the same structure +(and using the same names) as the tree under the source directory. In +the example, you'd find the Sun 4 library `libiberty.a' in the +directory `newlib-m68k-aout/libiberty', and NEWLIB itself in +`newlib-m68k-aout/newlib'. + + When you run `make' to build a program or library, you must run it +in a configured directory--whatever directory you were in when you +called `configure' (or one of its subdirectories). + + The `Makefile' that `configure' generates in each source directory +also runs recursively. If you type `make' in a source directory such +as `newlib-1.8.2' (or in a separate configured directory configured with +`--srcdir=PATH/newlib-1.8.2'), you will build all the required libraries. + + When you have multiple hosts or targets configured in separate +directories, you can run `make' on them in parallel (for example, if +they are NFS-mounted on each of the hosts); they will not interfere +with each other. + + +Specifying names for hosts and targets +====================================== + + The specifications used for hosts and targets in the `configure' +script are based on a three-part naming scheme, but some short +predefined aliases are also supported. The full naming scheme encodes +three pieces of information in the following pattern: + + ARCHITECTURE-VENDOR-OS + + For example, you can use the alias `sun4' as a HOST argument or in a +`--target=TARGET' option. The equivalent full name is +`sparc-sun-sunos4'. + + The `configure' script accompanying NEWLIB does not provide any query +facility to list all supported host and target names or aliases. +`configure' calls the Bourne shell script `config.sub' to map +abbreviations to full names; you can read the script, if you wish, or +you can use it to test your guesses on abbreviations--for example: + + % sh config.sub sun4 + sparc-sun-sunos4.1.1 + % sh config.sub sun3 + m68k-sun-sunos4.1.1 + % sh config.sub decstation + mips-dec-ultrix4.2 + % sh config.sub hp300bsd + m68k-hp-bsd + % sh config.sub i386v + i386-pc-sysv + % sh config.sub i786v + Invalid configuration `i786v': machine `i786v' not recognized + + +`configure' options +=================== + + Here is a summary of the `configure' options and arguments that are +most often useful for building NEWLIB. `configure' also has several other +options not listed here. + + configure [--help] + [--prefix=DIR] + [--srcdir=PATH] + [--target=TARGET] HOST + +You may introduce options with a single `-' rather than `--' if you +prefer; but you may abbreviate option names if you use `--'. + +`--help' + Display a quick summary of how to invoke `configure'. + +`--prefix=DIR' + Configure the source to install programs and files in directory + `DIR'. + +`--exec-prefix=DIR' + Configure the source to install host-dependent files in directory + `DIR'. + +`--srcdir=PATH' + *Warning: using this option requires GNU `make', or another `make' + that compatibly implements the `VPATH' feature. + Use this option to make configurations in directories separate + from the NEWLIB source directories. Among other things, you can use + this to build (or maintain) several configurations simultaneously, + in separate directories. `configure' writes configuration + specific files in the current directory, but arranges for them to + use the source in the directory PATH. `configure' will create + directories under the working directory in parallel to the source + directories below PATH. + +`--norecursion' + Configure only the directory level where `configure' is executed; + do not propagate configuration to subdirectories. + +`--target=TARGET' + Configure NEWLIB for running on the specified TARGET. + + There is no convenient way to generate a list of all available + targets. + +`HOST ...' + Configure NEWLIB to be built using a cross compiler running on + the specified HOST. + + There is no convenient way to generate a list of all available + hosts. + + +Reporting Bugs +============== + +The correct address for reporting bugs found in NEWLIB is +"newlib@sourceware.cygnus.com". Please email all bug reports to that +address. Please include the NEWLIB version number (e.g., newlib-1.8.2), +and how you configured it (e.g., "sun4 host and m68k-aout target"). +Since NEWLIB supports many different configurations, it is important +that you be precise about this. + +Archives of the newlib mailing list are on-line, see + http://sourceware.cygnus.com/ml/newlib/ diff --git a/newlib/acinclude.m4 b/newlib/acinclude.m4 new file mode 100644 index 000000000..d21f67c18 --- /dev/null +++ b/newlib/acinclude.m4 @@ -0,0 +1,144 @@ +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) diff --git a/newlib/aclocal.m4 b/newlib/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/configure b/newlib/configure new file mode 100755 index 000000000..d9da9417f --- /dev/null +++ b/newlib/configure @@ -0,0 +1,1865 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" +ac_help="$ac_help + --enable-newlib-hw-fp Turn on hardware floating point math" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=libc + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in .. $srcdir/..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in .. $srcdir/.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:580: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:633: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:690: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:723: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:756: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../." + else + newlib_basedir="${srcdir}/${with_multisrctop}." + fi +else + newlib_basedir="${srcdir}/." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:842: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:883: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:896: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:909: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:922: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:935: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:960: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:990: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1039: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1063: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1096: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1117: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1149: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1181: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1213: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1258: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1312: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1346: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/./targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +configdirs="libc libm" + +# Check whether --enable-newlib_hw_fp or --disable-newlib_hw_fp was given. +if test "${enable_newlib_hw_fp+set}" = set; then + enableval="$enable_newlib_hw_fp" + case "${enableval}" in + yes) newlib_hw_fp=true ;; + no) newlib_hw_fp=false ;; + *) { echo "configure: error: bad value ${enableval} for --enable-newlib-hw-fp" 1>&2; exit 1; } ;; + esac +else + newlib_hw_fp=false +fi + + + +if test x$newlib_hw_fp = xtrue; then + NEWLIB_HW_FP_TRUE= + NEWLIB_HW_FP_FALSE='#' +else + NEWLIB_HW_FP_TRUE='#' + NEWLIB_HW_FP_FALSE= +fi + +if test -z "${with_multisubdir}"; then + configdirs="${configdirs} doc" + have_doc=yes +else + have_doc= +fi + + +if test x$have_doc = xyes; then + HAVE_DOC_TRUE= + HAVE_DOC_FALSE='#' +else + HAVE_DOC_TRUE='#' + HAVE_DOC_FALSE= +fi + +subdirs="${configdirs}" + + +CRT0= +CRT0_DIR= +if test -n "${sys_dir}"; then + CRT0=crt0.o + CRT0_DIR=libc +fi + + + + + + +if test "${multilib}" = "yes"; then + multilib_arg="--enable-multilib" +else + multilib_arg= +fi + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g +s%@NEWLIB_HW_FP_TRUE@%$NEWLIB_HW_FP_TRUE%g +s%@NEWLIB_HW_FP_FALSE@%$NEWLIB_HW_FP_FALSE%g +s%@HAVE_DOC_TRUE@%$HAVE_DOC_TRUE%g +s%@HAVE_DOC_FALSE@%$HAVE_DOC_FALSE%g +s%@subdirs@%$subdirs%g +s%@CRT0@%$CRT0%g +s%@CRT0_DIR@%$CRT0_DIR%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +if test -n "$CONFIG_FILES"; then + . ${newlib_basedir}/../config-ml.in +fi +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + +if test "$no_recursion" != yes; then + + # Remove --cache-file and --srcdir arguments so they do not pile up. + ac_sub_configure_args= + ac_prev= + for ac_arg in $ac_configure_args; do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case "$ac_arg" in + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; + esac + done + + for ac_config_dir in ${configdirs}; do + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + if test ! -d $srcdir/$ac_config_dir; then + continue + fi + + echo configuring in $ac_config_dir + + case "$srcdir" in + .) ;; + *) + if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :; + else + { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; } + fi + ;; + esac + + ac_popdir=`pwd` + cd $ac_config_dir + + # A "../" for each directory in /$ac_config_dir. + ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` + + case "$srcdir" in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + /*) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_config_dir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure; then + ac_sub_configure=$ac_sub_srcdir/configure + elif test -f $ac_sub_srcdir/configure.in; then + ac_sub_configure=$ac_configure + else + echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2 + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + + # Make the cache file name correct relative to the subdirectory. + case "$cache_file" in + /*) ac_sub_cache_file=$cache_file ;; + *) # Relative path. + ac_sub_cache_file="$ac_dots$cache_file" ;; + esac + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir" + # The eval makes quoting arguments work. + if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir + then : + else + { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; } + fi + fi + + cd $ac_popdir + done +fi + diff --git a/newlib/configure.host b/newlib/configure.host new file mode 100644 index 000000000..fcfaa5c9a --- /dev/null +++ b/newlib/configure.host @@ -0,0 +1,457 @@ +# configure.host + +# This shell script handles all host based configuration for newlib. +# It sets various shell variables based on the the host and the +# configuration options. You can modify this shell script without +# needing to rerun autoconf. + +# This shell script should be invoked as +# . configure.host +# If it encounters an error, it will exit with a message. + +# FIXME: This script is too complicated. It does things in too many +# different ways. This was taken from the old Cygnus configure script +# with only minor changes. It should be cleaned up. + +# FIXME: The general approach of picking and choosing which +# directories to configure, other than machine_dir and sys_dir, is +# potentially confusing. + +# It uses the following shell variables: +# host The configuration host +# host_cpu The configuration host CPU +# newlib_mb --enable-newlib-mb ("yes", "no") +# target_optspace --enable-target-optspace ("yes", "no", "") + +# It sets the following shell variables: +# newlib_cflags Special CFLAGS to use when building +# machine_dir Subdirectory of libc/machine to configure +# sys_dir Subdirectory of libc/sys to configure +# posix_dir "posix" to build libc/posix, "" otherwise +# signal_dir "signal" to build libc/signal, "" otherwise +# syscall_dir "syscalls" to build libc/syscalls, "" otherwise +# unix_dir "unix" to build libc/unix, "" otherwise + +newlib_cflags= +machine_dir= +sys_dir= +posix_dir= +signal_dir=signal +syscall_dir= +unix_dir= +mach_add_setjmp= + +case "${target_optspace}:${host}" in + yes:*) + newlib_cflags="${newlib_cflags} -Os" + ;; + :m32r-* | :d10v-* | :d30v-*) + newlib_cflags="${newlib_cflags} -Os" + ;; + no:* | :*) + newlib_cflags="${newlib_cflags} -O2" + ;; +esac + +# Get the source directories to use for the CPU type. +# machine_dir should supply CPU dependent routines, such as setjmp. +# newlib_cflags is passed to gcc when compiling. +# THIS TABLE IS ALPHA SORTED. KEEP IT THAT WAY. + +case "${host_cpu}" in + a29k) + machine_dir=a29k + ;; + arc) + machine_dir= + ;; + arm) + machine_dir=arm + ;; + d10v*) + machine_dir=d10v + ;; + d30v*) + machine_dir=d30v + ;; + fr30) + machine_dir=fr30 + ;; + h8300) + machine_dir=h8300 + ;; + h8500) + machine_dir=h8500 + ;; + hppa*) + machine_dir=hppa + ;; + i960) + machine_dir=i960 + ;; + i[3456]86) + # Don't use for these since they provide their own setjmp. + case ${host} in + *-*-go32 | *-*-sco* | *-*-cygwin*) + machine_dir=i386 + ;; + *) + machine_dir=i386 + mach_add_setjmp=true + ;; + esac + ;; + m32r*) + machine_dir=m32r + ;; + m68*) + machine_dir=m68k + ;; + m88k) + machine_dir=m88k + newlib_cflags="${newlib_cflags} -m88000" + ;; + m88110) + machine_dir=m88k + newlib_cflags="${newlib_cflags} -m88110" + ;; + mcore) + ;; + mips*) + machine_dir=mips + ;; + mn10200) + machine_dir=mn10200 + ;; + mn10300) + machine_dir=mn10300 + ;; + powerpc*) + machine_dir=powerpc + ;; + sh) + machine_dir=sh + ;; + sparc*) + machine_dir=sparc + # FIXME: Might wish to make MALLOC_ALIGNMENT more generic. + newlib_cflags="${newlib_cflags} -DMALLOC_ALIGNMENT=8" + ;; + strongarm) + machine_dir=arm + ;; + thumb) + machine_dir=arm + ;; + tic80*) + machine_dir=tic80 + ;; + v70) + ;; + v810) + ;; + v850) + machine_dir=v850 + newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mv850 -mno-app-regs -msmall-sld" + ;; + v850e) + machine_dir=v850 + newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mv850 -mno-app-regs -msmall-sld" + ;; + v850ea) + machine_dir=v850 + newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mv850 -mno-app-regs -msmall-sld" + ;; + w65*) + machine_dir=w65 + ;; + z8k) + machine_dir=z8k + ;; + *) + echo '***' "Newlib does not support CPU ${host_cpu}" 1>&2 + exit 1 + ;; +esac + +# Enable multibyte support if requested. + +if [ "${newlib_mb}" = "yes" ] ; then + newlib_cflags="${newlib_cflags} -DMB_CAPABLE" +fi + +# Get the source directories to use for the host. unix_dir is set +# to unix to get some standard Unix routines. posix_dir is set to get some +# standard Posix routines. sys_dir should supply system dependent routines +# including crt0. +# THIS TABLE IS ALPHA SORTED. KEEP IT THAT WAY. + +case "${host}" in + *-*-cygwin*) + sys_dir=cygwin + posix_dir=posix + ;; + *-*-netware*) + signal_dir= + sys_dir=netware + ;; + *-*-rtems*) # generic RTEMS support + sys_dir=rtems + # RTEMS POSIX support is all inside RTEMS + ;; + a29k-*-*) + sys_dir=a29khif + signal_dir= + ;; + arc-*-*) + sys_dir=arc + ;; + arm-*-*) + sys_dir=arm + ;; + d10v*) + sys_dir=d10v + ;; + d30v*) + sys_dir= + ;; + h8300-*-hms*) + sys_dir=h8300hms + ;; + h8300-*-xray*) + sys_dir=h8300xray + ;; + h8500-*-hms*) + sys_dir=h8500hms + ;; + i[3456]86-*-go32) + sys_dir=go32 + ;; + i[3456]86-*-sco*) + sys_dir=sysvi386 + unix_dir=unix + ;; + m68k-sun-sunos*) + unix_dir=unix + ;; + m8*-bug-*) + sys_dir=m88kbug + ;; + mips*-dec-*) + sys_dir=decstation + ;; + powerpcle-*-pe) + sys_dir=cygwin + posix_dir=posix + ;; + sh*-*) + sys_dir=sh + ;; + sparc-sun-sunos*) + sys_dir=sun4 + unix_dir=unix + ;; + sparc64*) + sys_dir=sparc64 + unix_dir=unix + ;; + strongarm-*-*) + sys_dir=arm + ;; + thumb-*-*) + sys_dir=arm + ;; + tic80*) + sys_dir=tic80 + ;; + v70-nec-*) + sys_dir=sysvnecv70 + ;; + v810-*-*) + sys_dir=sysnec810 + ;; + v850-*-*) + sys_dir=sysnecv850 + ;; + v850e-*-*) + sys_dir=sysnecv850 + ;; + v850ea-*-*) + sys_dir=sysnecv850 + ;; + w65-*-*) + sys_dir=w65 + ;; + z8k-*-coff) + sys_dir=z8ksim + ;; +esac + +# Host specific flag settings -- usually for features that are not +# general enough or broad enough to be handled above. +# THIS TABLE IS ALPHA SORTED. KEEP IT THAT WAY. + +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DSIGNAL_PROVIDED -DWANT_PRINTF_LONG_LONG -D_COMPILING_NEWLIB" + syscall_dir=syscalls + ;; +# RTEMS supplies its own versions of some routines: +# malloc() (reentrant version) +# exit() RTEMS has a "global" reent to flush +# signal()/raise() RTEMS has its own including pthread signals +# _XYZ_r() RTEMS has its own reentrant routines +# +# NOTE: When newlib malloc uses a semaphore, RTEMS will switch to that. + *-*-rtems*) + newlib_cflags="${newlib_cflags} -DHAVE_GETTIMEOFDAY -DMALLOC_PROVIDED -DEXIT_PROVIDED -DMISSING_SYSCALL_NAMES -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_OPENDIR" + ;; +# VxWorks supplies its own version of malloc, and the newlib one +# doesn't work because VxWorks does not have sbrk. + *-wrs-vxworks*) + newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DMISSING_SYSCALL_NAMES" + ;; +# UDI doesn't have exec, so system() should fail the right way + a29k-amd-udi) + newlib_cflags="${newlib_cflags} -DNO_EXEC" + syscall_dir=syscalls + ;; + arc-*-*) + syscall_dir=syscalls + ;; + arm-*-pe) + syscall_dir=syscalls + newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY" +# Don't use the debugging protocols just yet. + ;; + arm-*-*) + syscall_dir=syscalls + newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY" +# Select which debug protocol is being used. +# ARM_RDP_MONITOR selects the Demon monitor. +# ARM_RDI_MONITOR selects the Angel monitor. +# If neither are defined, then hard coded defaults will be used +# to create the program's environment. +# See also thumb below. +# newlib_cflags="${newlib_cflags} -DARM_RDP_MONITOR" + newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR" + ;; + d10v*) + newlib_cflags="${newlib_cflags} -DSMALL_MEMORY" + syscall_dir=syscalls + ;; + d30v*) + newlib_cflags="${newlib_cflags} -DABORT_MESSAGE -DSMALL_MEMORY -DMISSING_SYSCALL_NAMES" + syscall_dir= + ;; + fr30-*-*) + newlib_cflags="${newlib_cflags}" + syscall_dir=syscalls + ;; + h8300*-*-*) + syscall_dir=syscalls + newlib_cflags="${newlib_cflags} -DSMALL_DTOA -DSMALL_MEMORY" + ;; + h8500-*-*) + syscall_dir=syscalls + newlib_cflags="${newlib_cflags} -DSMALL_DTOA -DSMALL_MEMORY" + ;; + i[3456]86-*-sco*) + newlib_cflags="${newlib_cflags} -DSIGNAL_PROVIDED" + ;; + i[3456]86-*-netware*) + newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES -DNO_EXEC -DABORT_PROVIDED -DCLOCK_PROVIDED -DMALLOC_PROVIDED" + ;; + i[3456]86-*-go32) + newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES -DNO_EXEC" + ;; + m32r-*-*) + # Pass -msdata=sdata so _impure_ptr goes in .sdata. + # We don't generate sda relocs however for upward compatibility. + # FIXME: This is necessary because the default multilib doesn't + # use --print-multi-lib. + newlib_cflags="${newlib_cflags} -msdata=sdata" + syscall_dir=syscalls + ;; + mcore-*-*) + newlib_cflags="${newlib_cflags}" + syscall_dir=syscalls + ;; + mn10?00-*-*) + syscall_dir=syscalls + ;; + powerpc*-*-eabi* | \ + powerpc*-*-elf* | \ + powerpc*-*-linux* | \ + powerpc*-*-rtem* | \ + powerpc*-*-sysv* | \ + powerpc*-*-solaris*) + newlib_cflags="${newlib_cflags} -mrelocatable-lib -mno-eabi -mstrict-align -DMISSING_SYSCALL_NAMES" + ;; + powerpcle-*-pe) + newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME" + syscall_dir=syscalls + ;; + sh*-*-*) + syscall_dir=syscalls + ;; + sparc-sun-sunos*) + newlib_cflags="${newlib_cflags} -DSIGNAL_PROVIDED" + ;; + sparc64-*-*) + newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_BLKSIZE -DHAVE_GETTIMEOFDAY" + # This either belongs elsewhere or nowhere. But I need *something*, + # so for now it's here ... + case "${host_os}" in + aoutv8 | *32p) + newlib_cflags="${newlib_cflags} -DTARGET_PTR_SIZE=32" ;; + *) + newlib_cflags="${newlib_cflags} -DTARGET_PTR_SIZE=64" ;; + esac + ;; + strongarm-*-*) + syscall_dir=syscalls + newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY" + newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR" + ;; + thumb-*-pe) + syscall_dir=syscalls + newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY" +# Don't use the debugging protocols just yet. + ;; + thumb-*-*) + syscall_dir=syscalls + newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY" +# Select which debug protocol is being used. +# ARM_RDP_MONITOR selects the Demon monitor. +# ARM_RDI_MONITOR selects the Angel monitor. +# If neither are defined, then hard coded defaults will be used +# to create the program's environment. +# See also arm and strongarm above. +# newlib_cflags="${newlib_cflags} -DARM_RDP_MONITOR" + newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR" + ;; + tic80*) + syscall_dir=syscalls + ;; + v850-*-*) + syscall_dir=syscalls + ;; + v850e-*-*) + syscall_dir=syscalls + ;; + v850ea-*-*) + syscall_dir=syscalls + ;; + w65-*-*) + syscall_dir=syscalls + newlib_cflags="${newlib_cflags} -DSMALL_DTOA -DSMALL_MEMORY" + ;; + z8k-*-*) + syscall_dir=syscalls + ;; + *) + newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES" + syscall_dir= + ;; +esac diff --git a/newlib/configure.in b/newlib/configure.in new file mode 100644 index 000000000..218e69e45 --- /dev/null +++ b/newlib/configure.in @@ -0,0 +1,64 @@ +dnl This is the newlib configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(libc) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(..) + +NEWLIB_CONFIGURE(.) + +configdirs="libc libm" + +AC_ARG_ENABLE(newlib_hw_fp, +[ --enable-newlib-hw-fp Turn on hardware floating point math], +[case "${enableval}" in + yes) newlib_hw_fp=true ;; + no) newlib_hw_fp=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-newlib-hw-fp) ;; + esac],[newlib_hw_fp=false]) +AM_CONDITIONAL(NEWLIB_HW_FP, test x$newlib_hw_fp = xtrue) + +if test -z "${with_multisubdir}"; then + configdirs="${configdirs} doc" + have_doc=yes +else + have_doc= +fi +AM_CONDITIONAL(HAVE_DOC, test x$have_doc = xyes) + +AC_CONFIG_SUBDIRS(${configdirs}) + +CRT0= +CRT0_DIR= +if test -n "${sys_dir}"; then + CRT0=crt0.o + CRT0_DIR=libc +fi +AC_SUBST(CRT0) +AC_SUBST(CRT0_DIR) + + + + +if test "${multilib}" = "yes"; then + multilib_arg="--enable-multilib" +else + multilib_arg= +fi + + +AC_OUTPUT(Makefile, +[if test -n "$CONFIG_FILES"; then + . ${newlib_basedir}/../config-ml.in +fi], +srcdir=${srcdir} +host=${host} +target=${target} +with_multisubdir=${with_multisubdir} +ac_configure_args="${multilib_arg} ${ac_configure_args}" +CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} +newlib_basedir=${newlib_basedir} +CC="${CC}" +) diff --git a/newlib/doc/Makefile.am b/newlib/doc/Makefile.am new file mode 100644 index 000000000..de802d61e --- /dev/null +++ b/newlib/doc/Makefile.am @@ -0,0 +1,21 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +# We can't use noinst_PROGRAMS, because automake will add $(EXEEXT). +noinst_DATA = makedoc + +MKDOC = makedoc$(EXEEXT_FOR_BUILD) + +# We don't use CFLAGS with CC_FOR_BUILD because here CFLAGS will +# actually be CFLAGS_FOR_TARGET, and in some cases that will include +# -Os, which CC_FOR_BUILD may not recognize. + +$(MKDOC): makedoc.o + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS) -o $(MKDOC) makedoc.o + +makedoc.o: makedoc.c + $(CC_FOR_BUILD) -g $(CFLAGS_FOR_BUILD) -c $(srcdir)/makedoc.c + +ACLOCAL_AMFLAGS = -I .. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/doc/Makefile.in b/newlib/doc/Makefile.in new file mode 100644 index 000000000..f93c1fe85 --- /dev/null +++ b/newlib/doc/Makefile.in @@ -0,0 +1,246 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +# We can't use noinst_PROGRAMS, because automake will add $(EXEEXT). +noinst_DATA = makedoc + +MKDOC = makedoc$(EXEEXT_FOR_BUILD) + +ACLOCAL_AMFLAGS = -I .. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_CLEAN_FILES = +DATA = $(noinst_DATA) + +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in ../acinclude.m4 \ + ../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) +tags: TAGS +TAGS: + + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(DATA) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am + +distclean: distclean-am + -rm -f config.status + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + -rm -f config.status + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-info-am install-info \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# We don't use CFLAGS with CC_FOR_BUILD because here CFLAGS will +# actually be CFLAGS_FOR_TARGET, and in some cases that will include +# -Os, which CC_FOR_BUILD may not recognize. + +$(MKDOC): makedoc.o + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS) -o $(MKDOC) makedoc.o + +makedoc.o: makedoc.c + $(CC_FOR_BUILD) -g $(CFLAGS_FOR_BUILD) -c $(srcdir)/makedoc.c + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/doc/aclocal.m4 b/newlib/doc/aclocal.m4 new file mode 100644 index 000000000..6f1442ecb --- /dev/null +++ b/newlib/doc/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/doc/ansidecl.h b/newlib/doc/ansidecl.h new file mode 100644 index 000000000..1c7708fd5 --- /dev/null +++ b/newlib/doc/ansidecl.h @@ -0,0 +1,116 @@ +/* ANSI and traditional C compatability macros + Copyright 1991 Free Software Foundation, Inc. + This file is part of the GNU C Library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* ANSI and traditional C compatibility macros + + Some ANSI environments are "broken" in the sense that __STDC__ cannot be + relied upon to have it's intended meaning. Therefore we must use our own + concoction: _HAVE_STDC. Always use _HAVE_STDC instead of __STDC__ in newlib + sources! + + ANSI C is assumed if _HAVE_STDC is #defined. + + Macro ANSI C definition Traditional C definition + ----- ---- - ---------- ----------- - ---------- + PTR `void *' `char *' + LONG_DOUBLE `long double' `double' + CONST `const' `' + VOLATILE `volatile' `' + SIGNED `signed' `' + PTRCONST `void *const' `char *' + + DEFUN(name, arglist, args) + + Defines function NAME. + + ARGLIST lists the arguments, separated by commas and enclosed in + parentheses. ARGLIST becomes the argument list in traditional C. + + ARGS list the arguments with their types. It becomes a prototype in + ANSI C, and the type declarations in traditional C. Arguments should + be separated with `AND'. For functions with a variable number of + arguments, the last thing listed should be `DOTS'. + + DEFUN_VOID(name) + + Defines a function NAME, which takes no arguments. + + EXFUN(name, prototype) + + Is used in an external function declaration. + In ANSI C it is `NAMEPROTOTYPE' (so PROTOTYPE should be enclosed in + parentheses). In traditional C it is `NAME()'. + For a function that takes no arguments, PROTOTYPE should be `(NOARGS)'. + + For example: + extern int EXFUN(printf, (CONST char *format DOTS)); + int DEFUN(fprintf, (stream, format), + FILE *stream AND CONST char *format DOTS) { ... } + void DEFUN_VOID(abort) { ... } +*/ + +#ifndef _ANSIDECL_H + +#define _ANSIDECL_H 1 + + +/* Every source file includes this file, + so they will all get the switch for lint. */ +/* LINTLIBRARY */ + + +#ifdef _HAVE_STDC + +#define PTR void * +#define PTRCONST void *CONST +#define LONG_DOUBLE long double + +#define AND , +#define NOARGS void +#define CONST const +#define VOLATILE volatile +#define SIGNED signed +#define DOTS , ... + +#define EXFUN(name, proto) name proto +#define DEFUN(name, arglist, args) name(args) +#define DEFUN_VOID(name) name(NOARGS) + +#else /* Not ANSI C. */ + +#define PTR char * +#define PTRCONST PTR +#define LONG_DOUBLE double + +#define AND ; +#define NOARGS +#define CONST +#define VOLATILE +#define SIGNED +#define DOTS + +#define const + +#define EXFUN(name, proto) name() +#define DEFUN(name, arglist, args) name arglist args; +#define DEFUN_VOID(name) name() + +#endif /* ANSI C. */ + + +#endif /* ansidecl.h */ diff --git a/newlib/doc/configure b/newlib/doc/configure new file mode 100755 index 000000000..7955c8df5 --- /dev/null +++ b/newlib/doc/configure @@ -0,0 +1,1714 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=makedoc.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:567: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:620: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:677: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:710: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:743: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}.." + fi +else + newlib_basedir="${srcdir}/.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:829: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:870: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:883: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:896: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:909: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:922: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:947: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:977: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1026: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1050: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1083: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1104: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1136: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1168: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1200: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1245: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1299: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1333: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +# Put a plausible default for CC_FOR_BUILD in Makefile. +if test -z "$CC_FOR_BUILD"; then + if test "x$cross_compiling" = "xno"; then + CC_FOR_BUILD='$(CC)' + else + CC_FOR_BUILD=gcc + fi +fi + + +# Also set EXEEXT_FOR_BUILD. +if test "x$cross_compiling" = "xno"; then + EXEEXT_FOR_BUILD='$(EXEEXT)' +else + echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6 +echo "configure:1403: checking for build system executable suffix" >&5 +if eval "test \"`echo '$''{'newlib_cv_build_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > ac_c_test.c << 'EOF' +int main() { +/* Nothing needed here */ +} +EOF + ${CC_FOR_BUILD} -o ac_c_test am_c_test.c 1>&5 2>&5 + newlib_cv_build_exeext=`echo ac_c_test.* | grep -v ac_c_test.c | sed -e s/ac_c_test//` + rm -f ac_c_test* + test x"${newlib_cv_build_exeext}" = x && newlib_cv_build_exeext=no +fi + +echo "$ac_t""$newlib_cv_build_exeext" 1>&6 + EXEEXT_FOR_BUILD="" + test x"${newlib_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${newlib_cv_build_exeext} +fi + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g +s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g +s%@EXEEXT_FOR_BUILD@%$EXEEXT_FOR_BUILD%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/doc/configure.in b/newlib/doc/configure.in new file mode 100644 index 000000000..b116b3538 --- /dev/null +++ b/newlib/doc/configure.in @@ -0,0 +1,41 @@ +dnl This is the newlib/doc configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(makedoc.c) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../..) + +NEWLIB_CONFIGURE(..) + +# Put a plausible default for CC_FOR_BUILD in Makefile. +if test -z "$CC_FOR_BUILD"; then + if test "x$cross_compiling" = "xno"; then + CC_FOR_BUILD='$(CC)' + else + CC_FOR_BUILD=gcc + fi +fi +AC_SUBST(CC_FOR_BUILD) + +# Also set EXEEXT_FOR_BUILD. +if test "x$cross_compiling" = "xno"; then + EXEEXT_FOR_BUILD='$(EXEEXT)' +else + AC_CACHE_CHECK([for build system executable suffix], newlib_cv_build_exeext, + [cat > ac_c_test.c << 'EOF' +int main() { +/* Nothing needed here */ +} +EOF + ${CC_FOR_BUILD} -o ac_c_test am_c_test.c 1>&5 2>&5 + newlib_cv_build_exeext=`echo ac_c_test.* | grep -v ac_c_test.c | sed -e s/ac_c_test//` + rm -f ac_c_test* + test x"${newlib_cv_build_exeext}" = x && newlib_cv_build_exeext=no]) + EXEEXT_FOR_BUILD="" + test x"${newlib_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${newlib_cv_build_exeext} +fi +AC_SUBST(EXEEXT_FOR_BUILD) + +AC_OUTPUT(Makefile) diff --git a/newlib/doc/doc.str b/newlib/doc/doc.str new file mode 100644 index 000000000..4d557c6f5 --- /dev/null +++ b/newlib/doc/doc.str @@ -0,0 +1,178 @@ +: nokill_bogus_lines ; + +: ENDDD + skip_past_newline + ; + +: TABLE + skip_past_newline + "@table @code\n" catstr + ; + +: ENDTABLE + skip_past_newline + "@end table\n" + catstr + ; + +: QUICKREF + skip_past_newline + get_stuff_in_command + "&&~&&~&&\cr\tablerule\n" + quickref + ; + + +: ITEM + "@item " catstr ; + +: EXAMPLE + skip_past_newline + + get_stuff_in_command nokill_bogus_lines translatecomments + courierize catstr + + ; + +: INODE + "@node " catstr skip_past_newline copy_past_newline catstr + ; + +: CODE_FRAGMENT + EXAMPLE + ; + +: SYNOPSIS + skip_past_newline + "@strong{Synopsis}\n" catstr + "@example\n" catstr + get_stuff_in_command + do_fancy_stuff + nokill_bogus_lines + indent + catstr + "@end example\n" catstr + + ; + + +: ANSI_SYNOPSIS + skip_past_newline + "@strong{Synopsis}\n" catstr + "@example\n" catstr + get_stuff_in_command + do_fancy_stuff + nokill_bogus_lines + indent + catstr + "@end example\n" catstr + + ; + +: OLDTRAD_SYNOPSIS + skip_past_newline + "@strong{Traditional Synopsis}\n" catstr + "@example\n" catstr + get_stuff_in_command + do_fancy_stuff + nokill_bogus_lines + indent + catstr + "@end example\n" catstr + + ; + +: TRAD_SYNOPSIS + skip_past_newline + + ; + +: INDEX + "@findex " skip_past_newline copy_past_newline catstr catstr + ; + +: FUNCTION + "@node " - a + skip_past_newline + copy_past_newline + dup - a x x + get_stuff_in_angle -a x y + swap + do_fancy_stuff + "@section " - a x x b + swap + remchar + "\n" - a x b x c + catstr catstr catstr catstr catstr + ; + +: bodytext + get_stuff_in_command + bulletize + courierize + do_fancy_stuff + catstr + "@*\n" catstr + ; + +: asection + skip_past_newline + catstr + copy_past_newline + do_fancy_stuff catstr + bodytext + ; + +: SECTION + "@section " asection ; + +: SUBSECTION + "@section " asection ; + +: SUBSUBSECTION + "@subsection " asection ; + +: subhead + skip_past_newline + bodytext + ; + + + +: DESCRIPTION + "@strong{Description}@*\n" catstr subhead ; + +: RETURNS + "@strong{Returns}@*\n" catstr subhead ; + +: ERRORS + "@strong{Errors}@*\n" catstr subhead ; + + +: PORTABILITY + "@strong{Portability}@*\n" catstr subhead ; + + +: WARNINGS + "@strong{Warnings}@*\n" catstr subhead ; + + + +: INTERNAL_FUNCTION + func ; + + +: INTERNAL_DEFINITION + func ; + + +: INTERNAL + func ; + +: TYPEDEF + FUNCTION ; + + + +: NEWPAGE + "@page\n" catstr subhead ; diff --git a/newlib/doc/makedoc.c b/newlib/doc/makedoc.c new file mode 100644 index 000000000..12dfc90dd --- /dev/null +++ b/newlib/doc/makedoc.c @@ -0,0 +1,1469 @@ +/* chew + Copyright (C) 1990-1992 Free Software Foundation, Inc. + Contributed by steve chamberlain @cygnus + + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* + Yet another way of extracting documentation from source. + No, I haven't finished it yet, but I hope you people like it better + that the old way + + sac + +Basically, this is a sort of string forth, maybe we should call it +struth? + +You define new words thus: +: ; +There is no + +*/ + + + +#include "ansidecl.h" +#include +#include + +extern PTR malloc(); +extern PTR realloc(); + +#define DEF_SIZE 5000 +#define STACK 50 + +int internal_wanted; +int internal_mode; + + + +/* Here is a string type ... */ + +typedef struct buffer +{ + char *ptr; + unsigned int write_idx; + unsigned int size; +} string_type; + + + + + + + +static void DEFUN(init_string_with_size,(buffer, size), + string_type *buffer AND + unsigned int size ) +{ + buffer->write_idx = 0; + buffer->size = size; + buffer->ptr = malloc(size); +} + +static void DEFUN(init_string,(buffer), + string_type *buffer) +{ + init_string_with_size(buffer, DEF_SIZE); + +} + +static int DEFUN(find, (str, what), + string_type *str AND + char *what) +{ + unsigned int i; + char *p; + p = what; + for (i = 0; i < str->write_idx && *p; i++) + { + if (*p == str->ptr[i]) + p++; + else + p = what; + } + return (*p == 0); + +} + +static void DEFUN(write_buffer,(buffer), + string_type *buffer) +{ + fwrite(buffer->ptr, buffer->write_idx, 1, stdout); +} + + +static void DEFUN(delete_string,(buffer), + string_type *buffer) +{ + free(buffer->ptr); +} + + +static char *DEFUN(addr, (buffer, idx), + string_type *buffer AND + unsigned int idx) +{ + return buffer->ptr + idx; +} + +static char DEFUN(at,(buffer, pos), + string_type *buffer AND + unsigned int pos) +{ + if ( pos >= buffer->write_idx) + { + return 0; + } + return buffer->ptr[pos]; +} + +static void DEFUN(catchar,(buffer, ch), + string_type *buffer AND + char ch) +{ + if (buffer->write_idx == buffer->size) + { + buffer->size *=2; + buffer->ptr = realloc(buffer->ptr, buffer->size); + } + + buffer->ptr[buffer->write_idx ++ ] = ch; +} + + +static void DEFUN(overwrite_string,(dst, src), + string_type *dst AND + string_type *src) +{ + free(dst->ptr); + dst->size = src->size; + dst->write_idx = src->write_idx; + dst->ptr = src->ptr; +} + +static void DEFUN(catstr,(dst, src), + string_type *dst AND + string_type *src) +{ + unsigned int i; + for (i = 0; i < src->write_idx; i++) + { + catchar(dst, src->ptr[i]); + } +} + + +static void DEFUN(cattext,(buffer, string), + string_type *buffer AND + char *string) +{ + + while (*string) + { + catchar(buffer, *string); + string++; + } +} + +static void DEFUN(catbuf,(buffer, buf, len), + string_type *buffer AND + char *buf AND + unsigned int len) +{ + + while (len--) + { + catchar(buffer, *buf); + buf++; + } +} + + + +static unsigned int +DEFUN(skip_white_and_stars,(src, idx), + string_type *src AND + unsigned int idx) +{ + while (isspace(at(src,idx)) + || (at(src,idx) == '*' && at(src,idx +1) !='/')) + idx++; + return idx; + + +} +/***********************************************************************/ + + +string_type stack[STACK]; +string_type *tos; + +unsigned int idx = 0; /* Pos in input buffer */ +string_type *ptr; /* and the buffer */ +typedef void (*stinst_type)(); +stinst_type *pc; +stinst_type sstack[STACK]; +stinst_type *ssp = &sstack[0]; +int istack[STACK]; +int *isp = &istack[0]; + +typedef int *word_type; + + + +struct dict_struct +{ + char *word; + struct dict_struct *next; + stinst_type *code; + int code_length; + int code_end; + int var; + +}; +typedef struct dict_struct dict_type; +#define WORD(x) static void x() + +static void DEFUN(exec,(word), + dict_type *word) +{ + pc = word->code; + while (*pc) + { + (*pc)(); + } + +} +WORD(call) +{ +stinst_type *oldpc = pc; + dict_type *e; + e = (dict_type *)(pc [1]); + exec(e); + pc = oldpc + 2; + +} + +WORD(remchar) +{ + tos->write_idx--; + pc++; + +} + +WORD(push_number) +{ + isp++; + pc++; + *isp = (int)(*pc); + pc++; + +} + + + + +WORD(push_text) +{ + + tos++; + init_string(tos); + pc++; + cattext(tos,*((char **)pc)); + pc++; + +} + + + +/* This function removes everything not inside comments starting on + the first char of the line from the string, also when copying + comments, removes blank space and leading *'s + Blank lines are turned into one blank line + */ + +static void +DEFUN(remove_noncomments,(src,dst), + string_type *src AND + string_type *dst) +{ + unsigned int idx = 0; + + while (at(src,idx)) + { + /* Now see if we have a comment at the start of the line */ + if (at(src,idx) == '\n' + && at(src,idx+1) == '/' + && at(src,idx+2) == '*') + { + idx+=3; + + idx = skip_white_and_stars(src,idx); + + /* Remove leading dot */ + if (at(src, idx) == '.') + idx++; + + /* Copy to the end of the line, or till the end of the + comment */ + while (at(src, idx)) + { + if (at(src, idx) == '\n') + { + /* end of line, echo and scrape of leading blanks */ + if (at(src,idx +1) == '\n') + catchar(dst,'\n'); + catchar(dst,'\n'); + idx++; + idx = skip_white_and_stars(src, idx); + } + else if (at(src, idx) == '*' && at(src,idx+1) == '/') + { + idx +=2 ; + cattext(dst,"\nENDDD\n"); + break; + } + else + { + catchar(dst, at(src, idx)); + idx++; + } + } + } + else idx++; + } +} +/* turn foobar name(stuff); into foobar EXFUN(name,(stuff)); + + */ + +static void +DEFUN_VOID(exfunstuff) +{ + unsigned int openp; + unsigned int fname; + unsigned int idx; + string_type out; + init_string(&out); + + + /* make sure that it's not already exfuned */ + if(find(tos,"EXFUN") || find(tos,"PROTO") || !find(tos,"(")) { + catstr(&out,tos); + } + else + { + + /*Find the open paren*/ + for (openp = 0; at(tos, openp) != '(' && at(tos,openp); openp++) + ; + + fname = openp; + /* Step back to the fname */ + fname--; + while (fname && isspace(at(tos, fname))) + fname --; + while (fname && !isspace(at(tos,fname)) && at(tos,fname) != '*') + fname--; + + fname++; + + for (idx = 0; idx < fname; idx++) + { + catchar(&out, at(tos,idx)); + } + + cattext(&out,"EXFUN("); + for (idx = fname; idx < openp; idx++) + { + catchar(&out, at(tos,idx)); + } + cattext(&out,", "); + while (at(tos,idx) && at(tos,idx) !=';') + { + catchar(&out, at(tos, idx)); + idx++; + } + cattext(&out,");\n"); + } + overwrite_string(tos, &out); + pc++; + +} + + + +/* turn {* + and *} into comments */ + +WORD(translatecomments) +{ + unsigned int idx = 0; + string_type out; + init_string(&out); + + while (at(tos, idx)) + { + if (at(tos,idx) == '{' && at(tos,idx+1) =='*') + { + cattext(&out," /*"); + idx+=2; + } + else if (at(tos,idx) == '*' && at(tos,idx+1) =='}') + { + cattext(&out,"*/"); + idx+=2; + } + else + { + catchar(&out, at(tos, idx)); + idx++; + } + } + + + overwrite_string(tos, &out); + + pc++; + +} + +/* find something like + QUICKREF + memchar ansi pure + + into + merge with words on tos and output them to stderror + +*/ +WORD(quickref) +{ + string_type *nos = tos-1; + unsigned int scan=0; + unsigned int nosscan = 0; + unsigned int idx = 0; + + while (at(tos, idx)) + { + if (at(tos,idx) == '~') + { + /* Skip the whitespace */ + while (at(nos, nosscan) == ' ') + nosscan++; + + /* Sub the next word from the nos*/ + while (at(nos, nosscan) != ' ' && + at(nos, nosscan) != 0) + { + fprintf(stderr, "%c", at(nos, nosscan)); + nosscan++; + } + } + + else + { + fprintf(stderr,"%c", at(tos, idx)); + + } + idx++; + } + + delete_string(tos); + delete_string(nos); + tos-=2; + pc++; + +} + +/* turn everything not starting with a . into a comment */ + +WORD(manglecomments) +{ + unsigned int idx = 0; + string_type out; + init_string(&out); + + while (at(tos, idx)) + { + if (at(tos,idx) == '\n' && at(tos,idx+1) =='*') + { + cattext(&out," /*"); + idx+=2; + } + else if (at(tos,idx) == '*' && at(tos,idx+1) =='}') + { + cattext(&out,"*/"); + idx+=2; + } + else + { + catchar(&out, at(tos, idx)); + idx++; + } + } + + + overwrite_string(tos, &out); + + pc++; + +} + +/* Mod tos so that only lines with leading dots remain */ +static void +DEFUN_VOID(outputdots) +{ + unsigned int idx = 0; + string_type out; + init_string(&out); + + while (at(tos, idx)) + { + if (at(tos, idx) == '\n' && at(tos, idx+1) == '.') + { + idx += 2; + + while (at(tos, idx) && at(tos, idx)!='\n') + { + if (at(tos,idx) == '{' && at(tos,idx+1) =='*') + { + cattext(&out," /*"); + idx+=2; + } + else if (at(tos,idx) == '*' && at(tos,idx+1) =='}') + { + cattext(&out,"*/"); + idx+=2; + } + else + { + catchar(&out, at(tos, idx)); + idx++; + } + } + catchar(&out,'\n'); + } + else + { + idx++; + } + } + + overwrite_string(tos, &out); + pc++; + +} + +/* Find lines starting with . and | and put example around them on tos + turn + {* into open comment and *} into close comment + escape curlies + +*/ +WORD(courierize) +{ + string_type out; + unsigned int idx = 0; + + init_string(&out); + + while (at(tos, idx)) + { + if (at(tos, idx) == '\n' + && (at(tos, idx +1 ) == '.' + || at(tos,idx+1) == '|')) + { + cattext(&out,"\n@smallexample\n"); + do + { + idx += 2; + + while (at(tos, idx) && at(tos, idx)!='\n') + { + if (at(tos,idx)=='{' && at(tos,idx+1) =='*') + { + cattext(&out," /*"); + idx+=2; + } + else if (at(tos,idx)=='*' && at(tos,idx+1) =='}') + { + cattext(&out,"*/"); + idx+=2; + } + else if (at(tos,idx) == '{') + { + cattext(&out,"@{"); + idx++; + } + else if (at(tos,idx) == '}') + { + cattext(&out,"@}"); + idx++; + } + else + { + catchar(&out, at(tos, idx)); + idx++; + } + + } + catchar(&out,'\n'); + } + while (at(tos, idx) == '\n' + && (at(tos, idx+1) == '.') + || (at(tos,idx+1) == '|')); + cattext(&out,"@end smallexample"); + } + else + { + catchar(&out, at(tos, idx)); + idx++; + } + } + + overwrite_string(tos, &out); + pc++; + + +} + +/* + O+ emit @itemize @bullet + OO emit @item + O- emit @end itemize + + o+ emit @table @code + oo @item + o- emit @end table +*/ + + +WORD(bulletize) +{ + unsigned int idx = 0; + int on = 0; + string_type out; + init_string(&out); + + while (at(tos, idx)) { + if (at(tos, idx) == '@' && + at(tos, idx+1) == '*') + { + cattext(&out,"*"); + idx+=2; + } + + else + if (at(tos, idx) == '\n' && at(tos, idx+1) == 'o') + { + if (at(tos,idx+2) == '+') { + cattext(&out,"\n@table @code\n"); + idx+=3; + } + else if (at(tos,idx+2) == '-') { + cattext(&out,"\n@end table\n"); + idx+=3; + } + else if (isspace(at(tos,idx+2))) { + cattext(&out,"\n@item "); + idx+=3; + } + else { + catchar(&out, at(tos, idx)); + idx++; + } + } + + else + if (at(tos, idx) == '\n' && at(tos, idx+1) == 'O') + { + if (at(tos,idx+2) == '+') { + cattext(&out,"\n@itemize @bullet\n"); + idx+=3; + } + + else if (at(tos,idx+2) == '-') { + cattext(&out,"\n@end itemize\n"); + idx+=3; + } + else { + catchar(&out, at(tos, idx)); + idx++; + } + } + else + { + catchar(&out, at(tos, idx)); + idx++; + } + } + + delete_string(tos); + *tos = out; + pc++; + +} + +/* Turn <> into @code{foo} in place at TOS + Turn <[foo]> into @var{foo} in place at TOS + nest them too ! + +*/ + + +WORD(do_fancy_stuff) + { + unsigned int idx = 0; + string_type out; + init_string(&out); + while (at(tos, idx)) + { + if (at(tos, idx) == '<' + && at(tos, idx+1) == '<' + && (!isspace(at(tos,idx + 2)) || at(tos,idx+3) == '>')) + { + /* This qualifies as a << startup */ + idx +=2; + cattext(&out,"@code{"); + } + + else if (at(tos, idx) == '<' + && at(tos, idx+1) == '[' + && !isspace(at(tos,idx + 2))) + { + /* This qualifies as a <[ startup */ + idx +=2; + cattext(&out,"@var{"); + } + else if (at(tos, idx) == '>' + && at(tos,idx+1) =='>') + { + + cattext(&out,"}"); + idx+=2; + } + else if (at(tos, idx) == ']' + && at(tos,idx+1) =='>') + { + cattext(&out,"}"); + idx+=2; + } + else + { + catchar(&out, at(tos, idx)); + idx++; + } + } + delete_string(tos); + *tos = out; + pc++; + +} +/* A command is all upper case,and alone on a line */ +static int +DEFUN( iscommand,(ptr, idx), + string_type *ptr AND + unsigned int idx) +{ + unsigned int len = 0; + while (at(ptr,idx)) { + if (isupper(at(ptr,idx)) || at(ptr,idx) == ' ' || + at(ptr,idx) == '_') + { + len++; + idx++; + } + else if(at(ptr,idx) == '\n') + { + if (len >4) return 1; + return 0; + } + else return 0; + } + return 0; + +} + + +DEFUN(copy_past_newline,(ptr, idx, dst), + string_type *ptr AND + unsigned int idx AND + string_type *dst) +{ + while (at(ptr, idx) && at(ptr, idx) != '\n') + { + catchar(dst, at(ptr, idx)); + idx++; + + } + catchar(dst, at(ptr, idx)); + idx++; + return idx; + +} + +WORD(icopy_past_newline) +{ + tos++; + init_string(tos); + idx = copy_past_newline(ptr, idx, tos); + pc++; +} + + +/* indent + Take the string at the top of the stack, do some prettying */ + + + + +WORD(kill_bogus_lines) +{ + int sl ; + + int nl = 0; + int idx = 0; + int c; + int dot = 0 ; + + string_type out; + init_string(&out); + /* Drop leading nl */ + while (at(tos,idx) == '\n') + { + idx++; + } + c = idx; + + /* Find the last char */ + while (at(tos,idx)) + { + idx++; + } + + /* find the last non white before the nl */ + idx--; + + while (idx && isspace(at(tos,idx))) + idx--; + idx++; + + /* Copy buffer upto last char, but blank lines before and after + dots don't count */ + sl = 1; + + while (c < idx) + { + if (at(tos,c) == '\n' + && at(tos,c+1) == '\n' + && at(tos,c+2) == '.') + { + /* Ignore two linelines before a dot*/ + c++; + } + else if (at(tos,c) == '.' && sl) + { + /* remember that this line started with a dot */ + dot=2; + } + else if (at(tos,c) == '\n' + && at(tos,c+1) == '\n' + && dot) + { + c++; + /* Ignore two newlines when last line was dot */ + } + + catchar(&out, at(tos,c)); + if (at(tos,c) == '\n') + { + sl = 1; + + if (dot == 2)dot=1;else dot = 0; + } + + c++; + + } + + /* Append nl*/ + catchar(&out, '\n'); + pc++; + delete_string(tos); + *tos = out; + + +} + +WORD(indent) +{ + string_type out; + int tab = 0; + int idx = 0; + int ol =0; + init_string(&out); + while (at(tos,idx)) { + switch (at(tos,idx)) + { + case '\n': + cattext(&out,"\n"); + idx++; + if (tab) + { + cattext(&out," "); + } + ol = 0; + break; + case '(': + tab++; + if (ol == 0) + cattext(&out," "); + idx++; + cattext(&out,"("); + ol = 1; + break; + case ')': + tab--; + cattext(&out,")"); + idx++; + ol=1; + + break; + default: + catchar(&out,at(tos,idx)); + ol=1; + + idx++; + break; + } + } + + pc++; + delete_string(tos); + *tos = out; + +} + +/* Change the TOS so that all that is left is the stuff inside the + first <> . +*/ + +WORD(get_stuff_in_angle) +{ + unsigned int idx = 0; + string_type out; + init_string(&out); + + while (at(tos, idx)) + { + if (at(tos,idx) == '<' && at(tos,idx+1) =='<') + { + idx+=2; + + while (!(at(tos,idx) == '>' && at(tos,idx+1) == '>')) + { + catchar(&out, at(tos, idx)); + idx++; + } + break; + } + idx++; + } + catchar(&out,'\n'); + + overwrite_string(tos, &out); + pc++; +} + + +WORD(get_stuff_in_command) +{ + tos++; + init_string(tos); + + while (at(ptr, idx)) { + if (iscommand(ptr, idx)) break; + idx = copy_past_newline(ptr, idx, tos); + } + pc++; +} + +WORD(swap) +{ + string_type t; + + t = tos[0]; + tos[0] = tos[-1]; + tos[-1] =t; + pc++; + +} + +WORD(dup) +{ + tos++; + init_string(tos); + catstr(tos, tos-1); + pc++; + +} + + + +WORD(icatstr) +{ + catstr(tos-1, tos); + delete_string(tos); + tos--; + pc++; + +} + +WORD(skip_past_newline) +{ + while (at(ptr,idx) + && at(ptr,idx) != '\n') + idx++; + idx++; + pc++; +} + + +WORD(internalmode) +{ + internal_mode = *(isp); + isp--; + pc++; +} + +WORD(maybecatstr) +{ + if (internal_wanted == internal_mode) + { + catstr(tos-1, tos); + } + delete_string(tos); + tos--; + pc++; + +} + +char * +DEFUN(nextword,(string, word), + char *string AND + char **word) +{ + char *word_start; + int idx; + char *dst; + char *src; + + int length = 0; + + while (isspace(*string) || *string == '-') { + if (*string == '-') + { + while (*string && *string != '\n') + string++; + + } + else { + string++; + } + } + if (!*string) return 0; + + word_start = string; + if (*string == '"') + { + string++; + length++; + + while (*string != '"') + { + string++; + length++; + } + } + else + { + + + while (!isspace(*string)) + { + string++; + length++; + } + } + + *word = malloc(length + 1); + + dst = *word; + src = word_start; + + + for (idx= 0; idx < length; idx++) + { + + if (src[idx] == '\\' && src[idx+1] == 'n') + { + *dst++ = '\n'; + idx++; + + } + else *dst++ = src[idx]; + } + *dst++ = 0; + + + + + + if(*string) + return string + 1; + else + return 0; + +} +dict_type *root; +dict_type * +DEFUN(lookup_word,(word), + char *word) +{ + dict_type *ptr = root; + while (ptr) { + if (strcmp(ptr->word, word) == 0) return ptr; + ptr = ptr->next; + + } + fprintf(stderr,"Can't find %s\n",word); + return 0; + + +} + +static void DEFUN_VOID(perform) +{ + tos = stack; + + while (at(ptr, idx)) { + /* It's worth looking through the command list */ + if (iscommand(ptr, idx)) + { + unsigned int i; + int found = 0; + + char *next; + dict_type *word ; + + (void) nextword(addr(ptr, idx), &next); + + + word = lookup_word(next); + + + + + if (word) + { + exec(word); + } + else + { + fprintf(stderr,"warning, %s is not recognised\n", next); + skip_past_newline(); + } + + } + else skip_past_newline(); + + } +} + +dict_type * +DEFUN(newentry,(word), + char *word) +{ + dict_type *new = (dict_type *)malloc(sizeof(dict_type)); + new->word = word; + new->next = root; + root = new; + new->code = (stinst_type *)malloc(sizeof(stinst_type )); + new->code_length = 1; + new->code_end = 0; + return new; + +} + + +unsigned int +DEFUN(add_to_definition,(entry, word), + dict_type *entry AND + stinst_type word) +{ + if (entry->code_end == entry->code_length) + { + entry->code_length += 2; + entry->code = + (stinst_type *) realloc((char *)(entry->code), + entry->code_length *sizeof(word_type)); + } + entry->code[entry->code_end] = word; + +return entry->code_end++; +} + + + + + + + +void +DEFUN(add_intrinsic,(name, func), + char *name AND + void (*func)()) +{ + dict_type *new = newentry(name); + add_to_definition(new, func); + add_to_definition(new, 0); +} + +WORD(push_addr) +{ + + +} + +void +DEFUN(add_var,(name), + char *name) +{ + dict_type *new = newentry(name); + add_to_definition(new, push_number); + add_to_definition(new, (stinst_type)(&(new->var))); + add_to_definition(new,0); + +} + + + + +void +DEFUN(compile, (string), + char *string) + +{ + int jstack[STACK]; + int *jptr = jstack; + /* add words to the dictionary */ + char *word; + string = nextword(string, &word); + while (string && *string && word[0]) + { + if (strcmp(word,"var")==0) + { + string=nextword(string, &word); + + add_var(word); + string=nextword(string, &word); + } +else + + if (word[0] == ':') + { + dict_type *ptr; + /* Compile a word and add to dictionary */ + string = nextword(string, &word); + + ptr = newentry(word); + string = nextword(string, &word); + while (word[0] != ';' ) + { + switch (word[0]) + { + + + case '"': + /* got a string, embed magic push string + function */ + add_to_definition(ptr, push_text); + add_to_definition(ptr, (stinst_type)(word+1)); + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + /* Got a number, embedd the magic push number + function */ + add_to_definition(ptr, push_number); + add_to_definition(ptr, atol(word)); + break; + default: + add_to_definition(ptr, call); + add_to_definition(ptr, lookup_word(word)); + } + + string = nextword(string, &word); + } + add_to_definition(ptr,0); + string = nextword(string, &word); + } + else + { + fprintf(stderr,"syntax error at %s\n",string-1); + } + } + +} + + +static void DEFUN_VOID(bang) +{ +*(int *)((isp[0])) = isp[-1]; +isp-=2; +pc++; + +} + +WORD(atsign) +{ + isp[0] = *(int *)(isp[0]); + pc++; +} + +WORD(hello) +{ + + printf("hello\n"); + pc++; +} + + + +static void DEFUN(read_in, (str, file), + string_type *str AND + FILE *file) +{ + char buff[10000]; + unsigned int r; + do + { + r = fread(buff, 1, sizeof(buff), file); + catbuf(str, buff, r); + } + while (r); + buff[0] = 0; + + catbuf(str, buff,1); + +} + + +static void DEFUN_VOID(usage) +{ + fprintf(stderr,"usage: -[d|i|g] file\n"); + exit(33); +} + +int DEFUN(main,(ac,av), +int ac AND +char *av[]) +{ + unsigned int i; + + + string_type buffer; + string_type pptr; + + + init_string(&buffer); + init_string(&pptr); + init_string(stack+0); + tos=stack+1; + ptr = &pptr; + + add_intrinsic("push_text", push_text); + add_intrinsic("!", bang); + add_intrinsic("@", atsign); + add_intrinsic("hello",hello); + add_intrinsic("skip_past_newline", skip_past_newline ); + add_intrinsic("catstr", icatstr ); + add_intrinsic("copy_past_newline", icopy_past_newline ); + add_intrinsic("dup", dup ); + add_intrinsic("remchar", remchar ); + add_intrinsic("get_stuff_in_command", get_stuff_in_command ); + add_intrinsic("get_stuff_in_angle", get_stuff_in_angle ); + add_intrinsic("do_fancy_stuff", do_fancy_stuff ); + add_intrinsic("bulletize", bulletize ); + add_intrinsic("courierize", courierize ); + add_intrinsic("swap", swap ); + add_intrinsic("outputdots", outputdots ); + add_intrinsic("exfunstuff", exfunstuff ); + add_intrinsic("maybecatstr", maybecatstr ); + add_intrinsic("translatecomments", translatecomments ); + add_intrinsic("kill_bogus_lines", kill_bogus_lines); + add_intrinsic("indent", indent); + add_intrinsic("quickref", quickref); + add_intrinsic("internalmode", internalmode); + + /* Put a nl at the start */ + catchar(&buffer,'\n'); + + read_in(&buffer, stdin); + remove_noncomments(&buffer, ptr); + for (i= 1; i < ac; i++) + { + if (av[i][0] == '-') + { + if (av[i][1] == 'f') + { + string_type b; + FILE *f; + init_string(&b); + + f = fopen(av[i+1],"r"); + if (!f) + { + fprintf(stderr,"Can't open the input file %s\n",av[i+1]); + return 33; + } + + + read_in(&b, f); + compile(b.ptr); + perform(); + } + else if (av[i][1] == 'i') + { + internal_wanted = 1; + } + } + + } + write_buffer(stack+0); + return 0; +} + + + diff --git a/newlib/libc/Makefile.am b/newlib/libc/Makefile.am new file mode 100644 index 000000000..b8e410c0c --- /dev/null +++ b/newlib/libc/Makefile.am @@ -0,0 +1,119 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +if HAVE_POSIX_DIR +POSIX_SUBDIR = posix +endif + +if HAVE_SIGNAL_DIR +SIGNAL_SUBDIR = signal +endif + +if HAVE_SYSCALL_DIR +SYSCALLS_SUBDIR = syscalls +endif + +if HAVE_UNIX_DIR +UNIX_SUBDIR = unix +endif + +# The order of SUBDIRS is important for the integrated documentation. +# Do not change the order without considering the doc impact. +SUBDIRS = stdlib ctype stdio string $(SIGNAL_SUBDIR) time locale sys reent \ + errno misc machine $(UNIX_SUBDIR) $(POSIX_SUBDIR) $(SYSCALLS_SUBDIR) . + +noinst_LIBRARIES = libc.a +noinst_DATA = $(CRT0) + +SUBLIBS = \ + stdlib/lib.a \ + ctype/lib.a \ + stdio/lib.a \ + string/lib.a \ + $(LIBC_SIGNAL_LIB) \ + time/lib.a \ + locale/lib.a \ + $(LIBC_SYS_LIB) \ + reent/lib.a \ + errno/lib.a \ + misc/lib.a \ + $(LIBC_MACHINE_LIB) \ + $(LIBC_UNIX_LIB) \ + $(LIBC_POSIX_LIB) \ + $(LIBC_SYSCALL_LIB) + +libc.a: $(SUBLIBS) + rm -f $@ + rm -rf tmp + mkdir tmp + cd tmp; \ + for i in $(SUBLIBS); do \ + $(AR) x ../$$i; \ + done; \ + $(AR) $(AR_FLAGS) ../$@ *.o + $(RANLIB) $@ + rm -rf tmp + +$(SUBLIBS): ; @true + +crt0.o: sys/crt0.o + rm -f $@ + ln sys/crt0.o $@ >/dev/null 2>/dev/null || cp sys/crt0.o $@ + +sys/crt0.o: ; @true + +info_TEXINFOS = libc.texinfo + +# This is a list of the stmp-def files in each subdirectory which +# builds .def files. We don't list subdirectories which don't build +# .def files; if the list of subdirectories changes, we must change +# this as well. +SUBDEFS = \ + stdlib/stmp-def \ + ctype/stmp-def \ + stdio/stmp-def \ + string/stmp-def \ + $(LIBC_SIGNAL_DEF) \ + time/stmp-def \ + locale/stmp-def \ + reent/stmp-def \ + misc/stmp-def + +libc.info: sigset.texi targetdep.tex $(SUBDEFS) + +stmp-sigset: config.status + if test -n "$(LIBC_SIGNAL_LIB)"; then \ + echo "@set SIGNALS" >tmp.texi; \ + else \ + echo "@clear SIGNALS" >tmp.texi; \ + fi + $(SHELL) $(newlib_basedir)/../move-if-change tmp.texi sigset.texi + touch $@ + +sigset.texi: stmp-sigset ; @true + +stmp-targetdep: force + rm -f tmp.texi + targetdoc=`pwd`/tmp.texi; \ + for d in $(SUBDIRS); do \ + if test "$$d" != "."; then \ + (cd $$d && $(MAKE) TARGETDOC=$${targetdoc} doc) || exit 1; \ + fi; \ + done + cat $(srcdir)/sys.tex >>tmp.texi + $(SHELL) $(newlib_basedir)/../move-if-change tmp.texi targetdep.tex + touch $@ + +targetdep.tex: stmp-targetdep ; @true + +$(SUBDEFS): stmp-targetdep ; @true + +.PHONY: force +force: + +CLEANFILES = crt0.o \ + sigset.texi stmp-sigset tmp.texi targetdep.tex stmp-targetdep + +ACLOCAL_AMFLAGS = -I .. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/Makefile.in b/newlib/libc/Makefile.in new file mode 100644 index 000000000..a704b63d6 --- /dev/null +++ b/newlib/libc/Makefile.in @@ -0,0 +1,632 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +CRT0 = @CRT0@ +EXEEXT = @EXEEXT@ +LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@ +LIBC_POSIX_LIB = @LIBC_POSIX_LIB@ +LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@ +LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@ +LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ +LIBC_SYS_LIB = @LIBC_SYS_LIB@ +LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +@HAVE_POSIX_DIR_TRUE@POSIX_SUBDIR = \ +@HAVE_POSIX_DIR_TRUE@posix + +@HAVE_SIGNAL_DIR_TRUE@SIGNAL_SUBDIR = \ +@HAVE_SIGNAL_DIR_TRUE@signal + +@HAVE_SYSCALL_DIR_TRUE@SYSCALLS_SUBDIR = \ +@HAVE_SYSCALL_DIR_TRUE@syscalls + +@HAVE_UNIX_DIR_TRUE@UNIX_SUBDIR = \ +@HAVE_UNIX_DIR_TRUE@unix + +# The order of SUBDIRS is important for the integrated documentation. +# Do not change the order without considering the doc impact. +SUBDIRS = stdlib ctype stdio string $(SIGNAL_SUBDIR) time locale sys reent \ + errno misc machine $(UNIX_SUBDIR) $(POSIX_SUBDIR) $(SYSCALLS_SUBDIR) . + + +noinst_LIBRARIES = libc.a +noinst_DATA = $(CRT0) + +SUBLIBS = \ + stdlib/lib.a \ + ctype/lib.a \ + stdio/lib.a \ + string/lib.a \ + $(LIBC_SIGNAL_LIB) \ + time/lib.a \ + locale/lib.a \ + $(LIBC_SYS_LIB) \ + reent/lib.a \ + errno/lib.a \ + misc/lib.a \ + $(LIBC_MACHINE_LIB) \ + $(LIBC_UNIX_LIB) \ + $(LIBC_POSIX_LIB) \ + $(LIBC_SYSCALL_LIB) + + +info_TEXINFOS = libc.texinfo + +# This is a list of the stmp-def files in each subdirectory which +# builds .def files. We don't list subdirectories which don't build +# .def files; if the list of subdirectories changes, we must change +# this as well. +SUBDEFS = \ + stdlib/stmp-def \ + ctype/stmp-def \ + stdio/stmp-def \ + string/stmp-def \ + $(LIBC_SIGNAL_DEF) \ + time/stmp-def \ + locale/stmp-def \ + reent/stmp-def \ + misc/stmp-def + + +CLEANFILES = crt0.o \ + sigset.texi stmp-sigset tmp.texi targetdep.tex stmp-targetdep + + +ACLOCAL_AMFLAGS = -I .. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +libc_a_LIBADD = +libc_a_SOURCES = libc.a.c +libc_a_OBJECTS = libc.a.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi` +TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex +INFO_DEPS = libc.info +DVIS = libc.dvi +TEXINFOS = libc.texinfo +DATA = $(noinst_DATA) + +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +DIST_SUBDIRS = stdlib ctype stdio string signal time locale sys reent \ +errno misc machine unix posix syscalls . +SOURCES = libc.a.c +OBJECTS = libc.a.o + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .dvi .info .o .ps .s .texi .texinfo .txi +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in ../acinclude.m4 \ + ../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +libc.info: libc.texinfo +libc.dvi: libc.texinfo + + +DVIPS = dvips + +.texi.info: + @rm -f $@ $@-[0-9] $@-[0-9][0-9] + $(MAKEINFO) -I $(srcdir) $< + +.texi.dvi: + TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.texi: + @rm -f $@ $@-[0-9] $@-[0-9][0-9] + $(MAKEINFO) -I $(srcdir) $< + +.texinfo.info: + @rm -f $@ $@-[0-9] $@-[0-9][0-9] + $(MAKEINFO) -I $(srcdir) $< + +.texinfo: + @rm -f $@ $@-[0-9] $@-[0-9][0-9] + $(MAKEINFO) -I $(srcdir) $< + +.texinfo.dvi: + TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.txi.info: + @rm -f $@ $@-[0-9] $@-[0-9][0-9] + $(MAKEINFO) -I $(srcdir) $< + +.txi.dvi: + TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.txi: + @rm -f $@ $@-[0-9] $@-[0-9][0-9] + $(MAKEINFO) -I $(srcdir) $< +.dvi.ps: + $(DVIPS) $< -o $@ + +install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(infodir) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ + if test -f $$d/$$ifile; then \ + echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ + $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ + else : ; fi; \ + done; \ + done + @$(POST_INSTALL) + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ + install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ + done; \ + else : ; fi + +uninstall-info: + $(PRE_UNINSTALL) + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + ii=yes; \ + else ii=; fi; \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + test -z "$ii" \ + || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ + done + @$(NORMAL_UNINSTALL) + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ + done + +dist-info: $(INFO_DEPS) + list='$(INFO_DEPS)'; \ + for base in $$list; do \ + if test -f $$base; then d=.; else d=$(srcdir); fi; \ + for file in `cd $$d && eval echo $$base*`; do \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done; \ + done + +mostlyclean-aminfo: + -rm -f libc.aux libc.cp libc.cps libc.dvi libc.fn libc.fns libc.ky \ + libc.kys libc.ps libc.log libc.pg libc.toc libc.tp libc.tps \ + libc.vr libc.vrs libc.op libc.tr libc.cv libc.cn + +clean-aminfo: + +distclean-aminfo: + +maintainer-clean-aminfo: + for i in $(INFO_DEPS); do \ + rm -f $$i; \ + if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ + rm -f $$i-[0-9]*; \ + fi; \ + done +clean-info: mostlyclean-aminfo + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive install-info-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(DIST_SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info +info-am: $(INFO_DEPS) +info: info-recursive +dvi-am: $(DVIS) +dvi: dvi-recursive +check-am: +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +install-info-am: +install-info: install-info-recursive +install-exec-am: +install-exec: install-exec-recursive + +install-data-am: +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: +uninstall: uninstall-recursive +all-am: Makefile $(LIBRARIES) $(DATA) +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-aminfo mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-noinstLIBRARIES clean-compile clean-aminfo clean-tags \ + clean-generic mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-aminfo distclean-tags distclean-generic \ + clean-am + +distclean: distclean-recursive + -rm -f config.status + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-aminfo \ + maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile install-info-am uninstall-info \ +mostlyclean-aminfo distclean-aminfo clean-aminfo \ +maintainer-clean-aminfo install-data-recursive uninstall-data-recursive \ +install-exec-recursive uninstall-exec-recursive installdirs-recursive \ +uninstalldirs-recursive all-recursive check-recursive \ +installcheck-recursive info-recursive dvi-recursive \ +mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-info-am \ +install-info install-exec-am install-exec install-data-am install-data \ +install-am install uninstall-am uninstall all-redirect all-am all \ +installdirs-am installdirs mostlyclean-generic distclean-generic \ +clean-generic maintainer-clean-generic clean mostlyclean distclean \ +maintainer-clean + + +libc.a: $(SUBLIBS) + rm -f $@ + rm -rf tmp + mkdir tmp + cd tmp; \ + for i in $(SUBLIBS); do \ + $(AR) x ../$$i; \ + done; \ + $(AR) $(AR_FLAGS) ../$@ *.o + $(RANLIB) $@ + rm -rf tmp + +$(SUBLIBS): ; @true + +crt0.o: sys/crt0.o + rm -f $@ + ln sys/crt0.o $@ >/dev/null 2>/dev/null || cp sys/crt0.o $@ + +sys/crt0.o: ; @true + +libc.info: sigset.texi targetdep.tex $(SUBDEFS) + +stmp-sigset: config.status + if test -n "$(LIBC_SIGNAL_LIB)"; then \ + echo "@set SIGNALS" >tmp.texi; \ + else \ + echo "@clear SIGNALS" >tmp.texi; \ + fi + $(SHELL) $(newlib_basedir)/../move-if-change tmp.texi sigset.texi + touch $@ + +sigset.texi: stmp-sigset ; @true + +stmp-targetdep: force + rm -f tmp.texi + targetdoc=`pwd`/tmp.texi; \ + for d in $(SUBDIRS); do \ + if test "$$d" != "."; then \ + (cd $$d && $(MAKE) TARGETDOC=$${targetdoc} doc) || exit 1; \ + fi; \ + done + cat $(srcdir)/sys.tex >>tmp.texi + $(SHELL) $(newlib_basedir)/../move-if-change tmp.texi targetdep.tex + touch $@ + +targetdep.tex: stmp-targetdep ; @true + +$(SUBDEFS): stmp-targetdep ; @true + +.PHONY: force +force: + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/aclocal.m4 b/newlib/libc/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/configure b/newlib/libc/configure new file mode 100755 index 000000000..5fe538828 --- /dev/null +++ b/newlib/libc/configure @@ -0,0 +1,1887 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=sys.tex + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}.." + fi +else + newlib_basedir="${srcdir}/.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +subdirs="machine sys" + + +CRT0= +if test -n "${sys_dir}"; then + CRT0=crt0.o +fi + + + +LIBC_POSIX_LIB= +if test -n "${posix_dir}"; then + LIBC_POSIX_LIB=${posix_dir}/lib.a +fi + + + +if test x${posix_dir} != x; then + HAVE_POSIX_DIR_TRUE= + HAVE_POSIX_DIR_FALSE='#' +else + HAVE_POSIX_DIR_TRUE='#' + HAVE_POSIX_DIR_FALSE= +fi + +LIBC_SIGNAL_LIB= +LIBC_SIGNAL_DEF= +if test -n "${signal_dir}"; then + LIBC_SIGNAL_LIB=${signal_dir}/lib.a + LIBC_SIGNAL_DEF=${signal_dir}/stmp-def +fi + + + + +if test x${signal_dir} != x; then + HAVE_SIGNAL_DIR_TRUE= + HAVE_SIGNAL_DIR_FALSE='#' +else + HAVE_SIGNAL_DIR_TRUE='#' + HAVE_SIGNAL_DIR_FALSE= +fi + +LIBC_SYSCALL_LIB= +if test -n "${syscall_dir}"; then + LIBC_SYSCALL_LIB=${syscall_dir}/lib.a +fi + + + +if test x${syscall_dir} != x; then + HAVE_SYSCALL_DIR_TRUE= + HAVE_SYSCALL_DIR_FALSE='#' +else + HAVE_SYSCALL_DIR_TRUE='#' + HAVE_SYSCALL_DIR_FALSE= +fi + +LIBC_UNIX_LIB= +if test -n "${unix_dir}"; then + LIBC_UNIX_LIB=${unix_dir}/lib.a +fi + + + +if test x${unix_dir} != x; then + HAVE_UNIX_DIR_TRUE= + HAVE_UNIX_DIR_FALSE='#' +else + HAVE_UNIX_DIR_TRUE='#' + HAVE_UNIX_DIR_FALSE= +fi + + +LIBC_SYS_LIB= +if test -n "${sys_dir}"; then + LIBC_SYS_LIB=sys/lib.a +fi + + +LIBC_MACHINE_LIB= +if test -n "${machine_dir}"; then + LIBC_MACHINE_LIB=machine/lib.a +fi + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile ctype/Makefile errno/Makefile locale/Makefile misc/Makefile reent/Makefile stdio/Makefile stdlib/Makefile string/Makefile time/Makefile posix/Makefile signal/Makefile syscalls/Makefile unix/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g +s%@subdirs@%$subdirs%g +s%@CRT0@%$CRT0%g +s%@LIBC_POSIX_LIB@%$LIBC_POSIX_LIB%g +s%@HAVE_POSIX_DIR_TRUE@%$HAVE_POSIX_DIR_TRUE%g +s%@HAVE_POSIX_DIR_FALSE@%$HAVE_POSIX_DIR_FALSE%g +s%@LIBC_SIGNAL_LIB@%$LIBC_SIGNAL_LIB%g +s%@LIBC_SIGNAL_DEF@%$LIBC_SIGNAL_DEF%g +s%@HAVE_SIGNAL_DIR_TRUE@%$HAVE_SIGNAL_DIR_TRUE%g +s%@HAVE_SIGNAL_DIR_FALSE@%$HAVE_SIGNAL_DIR_FALSE%g +s%@LIBC_SYSCALL_LIB@%$LIBC_SYSCALL_LIB%g +s%@HAVE_SYSCALL_DIR_TRUE@%$HAVE_SYSCALL_DIR_TRUE%g +s%@HAVE_SYSCALL_DIR_FALSE@%$HAVE_SYSCALL_DIR_FALSE%g +s%@LIBC_UNIX_LIB@%$LIBC_UNIX_LIB%g +s%@HAVE_UNIX_DIR_TRUE@%$HAVE_UNIX_DIR_TRUE%g +s%@HAVE_UNIX_DIR_FALSE@%$HAVE_UNIX_DIR_FALSE%g +s%@LIBC_SYS_LIB@%$LIBC_SYS_LIB%g +s%@LIBC_MACHINE_LIB@%$LIBC_MACHINE_LIB%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + +if test "$no_recursion" != yes; then + + # Remove --cache-file and --srcdir arguments so they do not pile up. + ac_sub_configure_args= + ac_prev= + for ac_arg in $ac_configure_args; do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case "$ac_arg" in + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; + esac + done + + for ac_config_dir in machine sys; do + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + if test ! -d $srcdir/$ac_config_dir; then + continue + fi + + echo configuring in $ac_config_dir + + case "$srcdir" in + .) ;; + *) + if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :; + else + { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; } + fi + ;; + esac + + ac_popdir=`pwd` + cd $ac_config_dir + + # A "../" for each directory in /$ac_config_dir. + ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` + + case "$srcdir" in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + /*) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_config_dir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure; then + ac_sub_configure=$ac_sub_srcdir/configure + elif test -f $ac_sub_srcdir/configure.in; then + ac_sub_configure=$ac_configure + else + echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2 + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + + # Make the cache file name correct relative to the subdirectory. + case "$cache_file" in + /*) ac_sub_cache_file=$cache_file ;; + *) # Relative path. + ac_sub_cache_file="$ac_dots$cache_file" ;; + esac + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir" + # The eval makes quoting arguments work. + if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir + then : + else + { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; } + fi + fi + + cd $ac_popdir + done +fi + diff --git a/newlib/libc/configure.in b/newlib/libc/configure.in new file mode 100644 index 000000000..19d0f2196 --- /dev/null +++ b/newlib/libc/configure.in @@ -0,0 +1,70 @@ +dnl This is the newlib/libc configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(sys.tex) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../..) + +NEWLIB_CONFIGURE(..) + +AC_CONFIG_SUBDIRS(machine sys) + +CRT0= +if test -n "${sys_dir}"; then + CRT0=crt0.o +fi +AC_SUBST(CRT0) + +dnl For each directory which we may or may not want, we define a name +dnl for the library and an automake conditional for whether we should +dnl build the library. + +LIBC_POSIX_LIB= +if test -n "${posix_dir}"; then + LIBC_POSIX_LIB=${posix_dir}/lib.a +fi +AC_SUBST(LIBC_POSIX_LIB) +AM_CONDITIONAL(HAVE_POSIX_DIR, test x${posix_dir} != x) + +LIBC_SIGNAL_LIB= +LIBC_SIGNAL_DEF= +if test -n "${signal_dir}"; then + LIBC_SIGNAL_LIB=${signal_dir}/lib.a + LIBC_SIGNAL_DEF=${signal_dir}/stmp-def +fi +AC_SUBST(LIBC_SIGNAL_LIB) +AC_SUBST(LIBC_SIGNAL_DEF) +AM_CONDITIONAL(HAVE_SIGNAL_DIR, test x${signal_dir} != x) + +LIBC_SYSCALL_LIB= +if test -n "${syscall_dir}"; then + LIBC_SYSCALL_LIB=${syscall_dir}/lib.a +fi +AC_SUBST(LIBC_SYSCALL_LIB) +AM_CONDITIONAL(HAVE_SYSCALL_DIR, test x${syscall_dir} != x) + +LIBC_UNIX_LIB= +if test -n "${unix_dir}"; then + LIBC_UNIX_LIB=${unix_dir}/lib.a +fi +AC_SUBST(LIBC_UNIX_LIB) +AM_CONDITIONAL(HAVE_UNIX_DIR, test x${unix_dir} != x) + +dnl We always recur into sys and machine, and let them decide what to +dnl do. However, we do need to know whether they will produce a library. + +LIBC_SYS_LIB= +if test -n "${sys_dir}"; then + LIBC_SYS_LIB=sys/lib.a +fi +AC_SUBST(LIBC_SYS_LIB) + +LIBC_MACHINE_LIB= +if test -n "${machine_dir}"; then + LIBC_MACHINE_LIB=machine/lib.a +fi +AC_SUBST(LIBC_MACHINE_LIB) + +AC_OUTPUT(Makefile ctype/Makefile errno/Makefile locale/Makefile misc/Makefile reent/Makefile stdio/Makefile stdlib/Makefile string/Makefile time/Makefile posix/Makefile signal/Makefile syscalls/Makefile unix/Makefile) diff --git a/newlib/libc/ctype/Makefile.am b/newlib/libc/ctype/Makefile.am new file mode 100644 index 000000000..4aab995a5 --- /dev/null +++ b/newlib/libc/ctype/Makefile.am @@ -0,0 +1,57 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + ctype_.c \ + isalnum.c \ + isalpha.c \ + isascii.c \ + iscntrl.c \ + isdigit.c \ + islower.c \ + isupper.c \ + isprint.c \ + ispunct.c \ + isspace.c \ + isxdigit.c \ + toascii.c \ + tolower.c \ + toupper.c \ + _tolower.c \ + _toupper.c + +CHEWOUT_FILES= \ + isalnum.def \ + isalpha.def \ + isascii.def \ + iscntrl.def \ + isdigit.def \ + islower.def \ + isprint.def \ + ispunct.def \ + isspace.def \ + isupper.def \ + isxdigit.def \ + toascii.def \ + tolower.def \ + toupper.def + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +TARGETDOC = ../tmp.texi + +doc: $(CHEWOUT_FILES) + cat $(srcdir)/ctype.tex >> $(TARGETDOC) + +CLEANFILES = $(CHEWOUT_FILES) *.ref diff --git a/newlib/libc/ctype/Makefile.in b/newlib/libc/ctype/Makefile.in new file mode 100644 index 000000000..17a4f8d5f --- /dev/null +++ b/newlib/libc/ctype/Makefile.in @@ -0,0 +1,332 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +CRT0 = @CRT0@ +EXEEXT = @EXEEXT@ +LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@ +LIBC_POSIX_LIB = @LIBC_POSIX_LIB@ +LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@ +LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@ +LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ +LIBC_SYS_LIB = @LIBC_SYS_LIB@ +LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + ctype_.c \ + isalnum.c \ + isalpha.c \ + isascii.c \ + iscntrl.c \ + isdigit.c \ + islower.c \ + isupper.c \ + isprint.c \ + ispunct.c \ + isspace.c \ + isxdigit.c \ + toascii.c \ + tolower.c \ + toupper.c \ + _tolower.c \ + _toupper.c + + +CHEWOUT_FILES = \ + isalnum.def \ + isalpha.def \ + isascii.def \ + iscntrl.def \ + isdigit.def \ + islower.def \ + isprint.def \ + ispunct.def \ + isspace.def \ + isupper.def \ + isxdigit.def \ + toascii.def \ + tolower.def \ + toupper.def + + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +TARGETDOC = ../tmp.texi + +CLEANFILES = $(CHEWOUT_FILES) *.ref +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = ctype_.o isalnum.o isalpha.o isascii.o iscntrl.o \ +isdigit.o islower.o isupper.o isprint.o ispunct.o isspace.o isxdigit.o \ +toascii.o tolower.o toupper.o _tolower.o _toupper.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .def .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus ctype/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = ctype + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ +check-am installcheck-am installcheck install-info-am install-info \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +doc: $(CHEWOUT_FILES) + cat $(srcdir)/ctype.tex >> $(TARGETDOC) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/ctype/_tolower.c b/newlib/libc/ctype/_tolower.c new file mode 100644 index 000000000..968dcf738 --- /dev/null +++ b/newlib/libc/ctype/_tolower.c @@ -0,0 +1,9 @@ +#include <_ansi.h> +#include + +#undef _tolower +int +_DEFUN(_tolower,(c),int c) +{ + return isupper(c) ? (c) - 'A' + 'a' : c; +} diff --git a/newlib/libc/ctype/_toupper.c b/newlib/libc/ctype/_toupper.c new file mode 100644 index 000000000..db4e00dd0 --- /dev/null +++ b/newlib/libc/ctype/_toupper.c @@ -0,0 +1,9 @@ +#include <_ansi.h> +#include + +#undef _toupper +int +_DEFUN(_toupper,(c),int c) +{ + return islower(c) ? c - 'a' + 'A' : c; +} diff --git a/newlib/libc/ctype/ctype.tex b/newlib/libc/ctype/ctype.tex new file mode 100644 index 000000000..a0971d88c --- /dev/null +++ b/newlib/libc/ctype/ctype.tex @@ -0,0 +1,68 @@ +@node Ctype +@chapter Character Type Macros and Functions (@file{ctype.h}) +This chapter groups macros (which are also available as subroutines) +to classify characters into several categories (alphabetic, +numeric, control characters, whitespace, and so on), or to perform +simple character mappings. + +The header file @file{ctype.h} defines the macros. +@menu +* isalnum:: Alphanumeric character predicate +* isalpha:: Alphabetic character predicate +* isascii:: ASCII character predicate +* iscntrl:: Control character predicate +* isdigit:: Decimal digit predicate +* islower:: Lower-case character predicate +* isprint:: Printable character predicates (isprint, isgraph) +* ispunct:: Punctuation character predicate +* isspace:: Whitespace character predicate +* isupper:: Uppercase character predicate +* isxdigit:: Hexadecimal digit predicate +* toascii:: Force integers to ASCII range +* tolower:: Translate characters to lower case +* toupper:: Translate characters to upper case +@end menu + +@page +@include ctype/isalnum.def + +@page +@include ctype/isalpha.def + +@page +@include ctype/isascii.def + +@page +@include ctype/iscntrl.def + +@page +@include ctype/isdigit.def + +@page +@include ctype/islower.def + +@page +@include ctype/isprint.def + +@page +@include ctype/ispunct.def + +@page +@include ctype/isspace.def + +@page +@include ctype/isupper.def + +@page +@include ctype/isxdigit.def + +@page +@include ctype/toascii.def + +@page +@include ctype/tolower.def + +@page +@include ctype/toupper.def + + diff --git a/newlib/libc/ctype/ctype_.c b/newlib/libc/ctype/ctype_.c new file mode 100644 index 000000000..45fcaa767 --- /dev/null +++ b/newlib/libc/ctype/ctype_.c @@ -0,0 +1,62 @@ +/* + * Copyright (c) 1989 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ctype_.c 5.6 (Berkeley) 6/1/90"; +#endif /* LIBC_SCCS and not lint */ + +#include + +#if defined(__CYGWIN__) || defined(__CYGWIN32__) +_CONST char __declspec(dllexport) _ctype_[1 + 256] = { +#else +_CONST char _ctype_[1 + 256] = { +#endif + 0, + _C, _C, _C, _C, _C, _C, _C, _C, + _C, _C|_S, _C|_S, _C|_S, _C|_S, _C|_S, _C, _C, + _C, _C, _C, _C, _C, _C, _C, _C, + _C, _C, _C, _C, _C, _C, _C, _C, + _S|_B, _P, _P, _P, _P, _P, _P, _P, + _P, _P, _P, _P, _P, _P, _P, _P, + _N, _N, _N, _N, _N, _N, _N, _N, + _N, _N, _P, _P, _P, _P, _P, _P, + _P, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U, + _U, _U, _U, _U, _U, _U, _U, _U, + _U, _U, _U, _U, _U, _U, _U, _U, + _U, _U, _U, _P, _P, _P, _P, _P, + _P, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L, + _L, _L, _L, _L, _L, _L, _L, _L, + _L, _L, _L, _L, _L, _L, _L, _L, + _L, _L, _L, _P, _P, _P, _P, _C +}; diff --git a/newlib/libc/ctype/isalnum.c b/newlib/libc/ctype/isalnum.c new file mode 100644 index 000000000..7e05bd1a2 --- /dev/null +++ b/newlib/libc/ctype/isalnum.c @@ -0,0 +1,46 @@ +/* +FUNCTION + <>---alphanumeric character predicate + +INDEX + isalnum + +ANSI_SYNOPSIS + #include + int isalnum(int <[c]>); + +TRAD_SYNOPSIS + #include + int isalnum(<[c]>); + + +DESCRIPTION +<> is a macro which classifies ASCII integer values by table +lookup. It is a predicate returning non-zero for alphabetic or +numeric ASCII characters, and <<0>> for other arguments. It is defined +for all integer values. + +You can use a compiled subroutine instead of the macro definition by +undefining the macro using `<<#undef isalnum>>'. + +RETURNS +<> returns non-zero if <[c]> is a letter (<>--<> or +<>--<>) or a digit (<<0>>--<<9>>). + +PORTABILITY +<> is ANSI C. + +No OS subroutines are required. +*/ + +#include <_ansi.h> +#include + +#undef isalnum + +int +_DEFUN(isalnum,(c),int c) +{ + return((_ctype_ + 1)[c] & (_U|_L|_N)); +} + diff --git a/newlib/libc/ctype/isalpha.c b/newlib/libc/ctype/isalpha.c new file mode 100644 index 000000000..35f14d396 --- /dev/null +++ b/newlib/libc/ctype/isalpha.c @@ -0,0 +1,44 @@ +/* +FUNCTION + <>---alphabetic character predicate + +INDEX + isalpha + +ANSI_SYNOPSIS + #include + int isalpha(int <[c]>); + +TRAD_SYNOPSIS + #include + int isalpha(<[c]>); + +DESCRIPTION +<> is a macro which classifies ASCII integer values by table +lookup. It is a predicate returning non-zero when <[c]> represents an +alphabetic ASCII character, and 0 otherwise. It is defined only when +<>(<[c]>) is true or <[c]> is EOF. + +You can use a compiled subroutine instead of the macro definition by +undefining the macro using `<<#undef isalpha>>'. + +RETURNS +<> returns non-zero if <[c]> is a letter (<>--<> or +<>--<>). + +PORTABILITY +<> is ANSI C. + +No supporting OS subroutines are required. +*/ + +#include <_ansi.h> +#include + +#undef isalpha +int +_DEFUN(isalpha,(c),int c) +{ + return((_ctype_ + 1)[c] & (_U|_L)); +} + diff --git a/newlib/libc/ctype/isascii.c b/newlib/libc/ctype/isascii.c new file mode 100644 index 000000000..109fd3ace --- /dev/null +++ b/newlib/libc/ctype/isascii.c @@ -0,0 +1,43 @@ +/* +FUNCTION + <>---ASCII character predicate + +INDEX + isascii + +ANSI_SYNOPSIS + #include + int isascii(int <[c]>); + +TRAD_SYNOPSIS + #include + int isascii(<[c]>); + +DESCRIPTION +<> is a macro which returns non-zero when <[c]> is an ASCII +character, and 0 otherwise. It is defined for all integer values. + +You can use a compiled subroutine instead of the macro definition by +undefining the macro using `<<#undef isascii>>'. + +RETURNS +<> returns non-zero if the low order byte of <[c]> is in the range +0 to 127 (<<0x00>>--<<0x7F>>). + +PORTABILITY +<> is ANSI C. + +No supporting OS subroutines are required. +*/ +#include <_ansi.h> +#include + + + +#undef isascii + +int +_DEFUN(isascii,(c),int c) +{ + return c >= 0 && c< 128; +} diff --git a/newlib/libc/ctype/iscntrl.c b/newlib/libc/ctype/iscntrl.c new file mode 100644 index 000000000..7b6da349d --- /dev/null +++ b/newlib/libc/ctype/iscntrl.c @@ -0,0 +1,48 @@ + +/* +FUNCTION + <>---control character predicate + +INDEX + iscntrl + +ANSI_SYNOPSIS + #include + int iscntrl(int <[c]>); + +TRAD_SYNOPSIS + #include + int iscntrl(<[c]>); + +DESCRIPTION +<> is a macro which classifies ASCII integer values by table +lookup. It is a predicate returning non-zero for control characters, and 0 +for other characters. It is defined only when <>(<[c]>) is +true or <[c]> is EOF. + +You can use a compiled subroutine instead of the macro definition by +undefining the macro using `<<#undef iscntrl>>'. + +RETURNS +<> returns non-zero if <[c]> is a delete character or ordinary +control character (<<0x7F>> or <<0x00>>--<<0x1F>>). + +PORTABILITY +<> is ANSI C. + +No supporting OS subroutines are required. +*/ + +#include <_ansi.h> +#include + + + +#undef iscntrl +int +_DEFUN(iscntrl,(c),int c) +{ + return((_ctype_ + 1)[c] & _C); +} + + diff --git a/newlib/libc/ctype/isdigit.c b/newlib/libc/ctype/isdigit.c new file mode 100644 index 000000000..5c21898e6 --- /dev/null +++ b/newlib/libc/ctype/isdigit.c @@ -0,0 +1,43 @@ +/* +FUNCTION +<>---decimal digit predicate + +INDEX +isdigit + +ANSI_SYNOPSIS +#include +int isdigit(int <[c]>); + +TRAD_SYNOPSIS +#include +int isdigit(<[c]>); + +DESCRIPTION +<> is a macro which classifies ASCII integer values by table +lookup. It is a predicate returning non-zero for decimal digits, and 0 for +other characters. It is defined only when <>(<[c]>) is true +or <[c]> is EOF. + +You can use a compiled subroutine instead of the macro definition by +undefining the macro using `<<#undef isdigit>>'. + +RETURNS +<> returns non-zero if <[c]> is a decimal digit (<<0>>--<<9>>). + +PORTABILITY +<> is ANSI C. + +No supporting OS subroutines are required. +*/ + +#include <_ansi.h> +#include + + +#undef isdigit +int +_DEFUN(isdigit,(c),int c) +{ + return((_ctype_ + 1)[c] & _N); +} diff --git a/newlib/libc/ctype/islower.c b/newlib/libc/ctype/islower.c new file mode 100644 index 000000000..81ad0bb27 --- /dev/null +++ b/newlib/libc/ctype/islower.c @@ -0,0 +1,43 @@ + +/* +FUNCTION +<>---lower-case character predicate + +INDEX +islower + +ANSI_SYNOPSIS +#include +int islower(int <[c]>); + +TRAD_SYNOPSIS +#include +int islower(<[c]>); + +DESCRIPTION +<> is a macro which classifies ASCII integer values by table +lookup. It is a predicate returning non-zero for minuscules +(lower-case alphabetic characters), and 0 for other characters. +It is defined only when <>(<[c]>) is true or <[c]> is EOF. + +You can use a compiled subroutine instead of the macro definition by +undefining the macro using `<<#undef islower>>'. + +RETURNS +<> returns non-zero if <[c]> is a lower case letter (<>--<>). + +PORTABILITY +<> is ANSI C. + +No supporting OS subroutines are required. +*/ +#include <_ansi.h> +#include + +#undef islower +int +_DEFUN(islower,(c),int c) +{ + return((_ctype_ + 1)[c] & _L); +} + diff --git a/newlib/libc/ctype/isprint.c b/newlib/libc/ctype/isprint.c new file mode 100644 index 000000000..2ff00f4e3 --- /dev/null +++ b/newlib/libc/ctype/isprint.c @@ -0,0 +1,60 @@ + +/* +FUNCTION + <>, <>---printable character predicates + +INDEX + isprint +INDEX + isgraph + +ANSI_SYNOPSIS + #include + int isprint(int <[c]>); + int isgraph(int <[c]>); + +TRAD_SYNOPSIS + #include + int isprint(<[c]>); + int isgraph(<[c]>); + + +DESCRIPTION +<> is a macro which classifies ASCII integer values by table +lookup. It is a predicate returning non-zero for printable +characters, and 0 for other character arguments. +It is defined only when <>(<[c]>) is true or <[c]> is EOF. + +You can use a compiled subroutine instead of the macro definition by +undefining either macro using `<<#undef isprint>>' or `<<#undef isgraph>>'. + +RETURNS +<> returns non-zero if <[c]> is a printing character, +(<<0x20>>--<<0x7E>>). +<> behaves identically to <>, except that the space +character (<<0x20>>) is excluded. + +PORTABILITY +<> and <> are ANSI C. + +No supporting OS subroutines are required. +*/ + +#include <_ansi.h> +#include + +#undef isgraph +int +_DEFUN(isgraph,(c),int c) +{ + return((_ctype_ + 1)[c] & (_P|_U|_L|_N)); +} + + +#undef isprint +int +_DEFUN(isprint,(c),int c) +{ + return((_ctype_ + 1)[c] & (_P|_U|_L|_N|_B)); +} + diff --git a/newlib/libc/ctype/ispunct.c b/newlib/libc/ctype/ispunct.c new file mode 100644 index 000000000..c5679323c --- /dev/null +++ b/newlib/libc/ctype/ispunct.c @@ -0,0 +1,46 @@ + +/* +FUNCTION +<>---punctuation character predicate + +INDEX +ispunct + +ANSI_SYNOPSIS +#include +int ispunct(int <[c]>); + +TRAD_SYNOPSIS +#include +int ispunct(<[c]>); + +DESCRIPTION +<> is a macro which classifies ASCII integer values by table +lookup. It is a predicate returning non-zero for printable +punctuation characters, and 0 for other characters. It is defined +only when <>(<[c]>) is true or <[c]> is EOF. + +You can use a compiled subroutine instead of the macro definition by +undefining the macro using `<<#undef ispunct>>'. + +RETURNS +<> returns non-zero if <[c]> is a printable punctuation character +(<) && !isalnum(<[c]>)>>). + +PORTABILITY +<> is ANSI C. + +No supporting OS subroutines are required. +*/ + +#include <_ansi.h> +#include + + +#undef ispunct +int +_DEFUN(ispunct,(c),int c) +{ + return((_ctype_ + 1)[c] & _P); +} + diff --git a/newlib/libc/ctype/isspace.c b/newlib/libc/ctype/isspace.c new file mode 100644 index 000000000..1bc0798a2 --- /dev/null +++ b/newlib/libc/ctype/isspace.c @@ -0,0 +1,44 @@ + +/* +FUNCTION + <>---whitespace character predicate + +INDEX + isspace + +ANSI_SYNOPSIS + #include + int isspace(int <[c]>); + +TRAD_SYNOPSIS + #include + int isspace(<[c]>); + +DESCRIPTION +<> is a macro which classifies ASCII integer values by table +lookup. It is a predicate returning non-zero for whitespace +characters, and 0 for other characters. It is defined only when <>(<[c]>) is true or <[c]> is EOF. + +You can use a compiled subroutine instead of the macro definition by +undefining the macro using `<<#undef isspace>>'. + +RETURNS +<> returns non-zero if <[c]> is a space, tab, carriage return, new +line, vertical tab, or formfeed (<<0x09>>--<<0x0D>>, <<0x20>>). + +PORTABILITY +<> is ANSI C. + +No supporting OS subroutines are required. +*/ +#include <_ansi.h> +#include + + +#undef isspace +int +_DEFUN(isspace,(c),int c) +{ + return((_ctype_ + 1)[c] & _S); +} + diff --git a/newlib/libc/ctype/isupper.c b/newlib/libc/ctype/isupper.c new file mode 100644 index 000000000..8127e25da --- /dev/null +++ b/newlib/libc/ctype/isupper.c @@ -0,0 +1,43 @@ + +/* +FUNCTION +<>---uppercase character predicate + +INDEX +isupper + +ANSI_SYNOPSIS +#include +int isupper(int <[c]>); + +TRAD_SYNOPSIS +#include +int isupper(<[c]>); + +DESCRIPTION +<> is a macro which classifies ASCII integer values by table +lookup. It is a predicate returning non-zero for upper-case letters +(<>--<>), and 0 for other characters. It is defined only when +<>(<[c]>) is true or <[c]> is EOF. + +You can use a compiled subroutine instead of the macro definition by +undefining the macro using `<<#undef isupper>>'. + +RETURNS +<> returns non-zero if <[c]> is a upper case letter (A-Z). + +PORTABILITY +<> is ANSI C. + +No supporting OS subroutines are required. +*/ +#include <_ansi.h> +#include + +#undef isupper +int +_DEFUN(isupper,(c),int c) +{ + return((_ctype_ + 1)[c] & _U); +} + diff --git a/newlib/libc/ctype/isxdigit.c b/newlib/libc/ctype/isxdigit.c new file mode 100644 index 000000000..f8a035f37 --- /dev/null +++ b/newlib/libc/ctype/isxdigit.c @@ -0,0 +1,45 @@ + +/* +FUNCTION +<>---hexadecimal digit predicate + +INDEX +isxdigit + +ANSI_SYNOPSIS +#include +int isxdigit(int <[c]>); + +TRAD_SYNOPSIS +#include +int isxdigit(int <[c]>); + +DESCRIPTION +<> is a macro which classifies ASCII integer values by table +lookup. It is a predicate returning non-zero for hexadecimal digits, +and <<0>> for other characters. It is defined only when +<>(<[c]>) is true or <[c]> is EOF. + +You can use a compiled subroutine instead of the macro definition by +undefining the macro using `<<#undef isxdigit>>'. + +RETURNS +<> returns non-zero if <[c]> is a hexadecimal digit +(<<0>>--<<9>>, <>--<>, or <>--<>). + +PORTABILITY +<> is ANSI C. + +No supporting OS subroutines are required. +*/ +#include <_ansi.h> +#include + + +#undef isxdigit +int +_DEFUN(isxdigit,(c),int c) +{ + return((_ctype_ + 1)[c] & ((_X)|(_N))); +} + diff --git a/newlib/libc/ctype/toascii.c b/newlib/libc/ctype/toascii.c new file mode 100644 index 000000000..4506f355d --- /dev/null +++ b/newlib/libc/ctype/toascii.c @@ -0,0 +1,41 @@ +/* +FUNCTION + <>---force integers to ASCII range + +INDEX + toascii + +ANSI_SYNOPSIS + #include + int toascii(int <[c]>); + +TRAD_SYNOPSIS + #include + int toascii(<[c]>); + int (<[c]>); + +DESCRIPTION +<> is a macro which coerces integers to the ASCII range (0--127) by zeroing any higher-order bits. + +You can use a compiled subroutine instead of the macro definition by +undefining this macro using `<<#undef toascii>>'. + +RETURNS +<> returns integers between 0 and 127. + +PORTABILITY +<> is not ANSI C. + +No supporting OS subroutines are required. +*/ + +#include <_ansi.h> +#include +#undef toascii + +int +_DEFUN(toascii,(c),int c) +{ + return (c)&0177; +} + diff --git a/newlib/libc/ctype/tolower.c b/newlib/libc/ctype/tolower.c new file mode 100644 index 000000000..e43fa6c9d --- /dev/null +++ b/newlib/libc/ctype/tolower.c @@ -0,0 +1,55 @@ +/* +FUNCTION + <>---translate characters to lower case + +INDEX + tolower +INDEX + _tolower + +ANSI_SYNOPSIS + #include + int tolower(int <[c]>); + int _tolower(int <[c]>); + +TRAD_SYNOPSIS + #include + int tolower(<[c]>); + int _tolower(<[c]>); + + +DESCRIPTION +<> is a macro which converts upper-case characters to lower +case, leaving all other characters unchanged. It is only defined when +<[c]> is an integer in the range <> to <<255>>. + +You can use a compiled subroutine instead of the macro definition by +undefining this macro using `<<#undef tolower>>'. + +<<_tolower>> performs the same conversion as <>, but should +only be used when <[c]> is known to be an uppercase character (<>--<>). + +RETURNS +<> returns the lower-case equivalent of <[c]> when it is a +character between <> and <>, and <[c]> otherwise. + +<<_tolower>> returns the lower-case equivalent of <[c]> when it is a +character between <> and <>. If <[c]> is not one of these +characters, the behaviour of <<_tolower>> is undefined. + +PORTABILITY +<> is ANSI C. <<_tolower>> is not recommended for portable +programs. + +No supporting OS subroutines are required. +*/ + +#include <_ansi.h> +#include + +#undef tolower +int +_DEFUN(tolower,(c),int c) +{ + return isupper(c) ? (c) - 'A' + 'a' : c; +} diff --git a/newlib/libc/ctype/toupper.c b/newlib/libc/ctype/toupper.c new file mode 100644 index 000000000..7977beb79 --- /dev/null +++ b/newlib/libc/ctype/toupper.c @@ -0,0 +1,54 @@ +/* +FUNCTION + <>---translate characters to upper case + +INDEX + toupper +INDEX + _toupper + +ANSI_SYNOPSIS + #include + int toupper(int <[c]>); + int _toupper(int <[c]>); + +TRAD_SYNOPSIS + #include + int toupper(<[c]>); + int _toupper(<[c]>); + + +DESCRIPTION +<> is a macro which converts lower-case characters to upper +case, leaving all other characters unchanged. It is only defined when +<[c]> is an integer in the range <> to <<255>>. + +You can use a compiled subroutine instead of the macro definition by +undefining this macro using `<<#undef toupper>>'. + +<<_toupper>> performs the same conversion as <>, but should +only be used when <[c]> is known to be a lowercase character (<>--<>). + +RETURNS +<> returns the upper-case equivalent of <[c]> when it is a +character between <> and <>, and <[c]> otherwise. + +<<_toupper>> returns the upper-case equivalent of <[c]> when it is a +character between <> and <>. If <[c]> is not one of these +characters, the behaviour of <<_toupper>> is undefined. + +PORTABILITY +<> is ANSI C. <<_toupper>> is not recommended for portable programs. + +No supporting OS subroutines are required. +*/ + +#include <_ansi.h> +#include + +#undef toupper +int +_DEFUN(toupper,(c),int c) +{ + return islower(c) ? c - 'a' + 'A' : c; +} diff --git a/newlib/libc/errno/Makefile.am b/newlib/libc/errno/Makefile.am new file mode 100644 index 000000000..67038849a --- /dev/null +++ b/newlib/libc/errno/Makefile.am @@ -0,0 +1,26 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = errno.c + +CHEWOUT_FILES = + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +TARGETDOC = ../tmp.texi + +# No doc for errno. +doc: + +CLEANFILES = $(CHEWOUT_FILES) *.ref diff --git a/newlib/libc/errno/Makefile.in b/newlib/libc/errno/Makefile.in new file mode 100644 index 000000000..d4073b7d8 --- /dev/null +++ b/newlib/libc/errno/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +CRT0 = @CRT0@ +EXEEXT = @EXEEXT@ +LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@ +LIBC_POSIX_LIB = @LIBC_POSIX_LIB@ +LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@ +LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@ +LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ +LIBC_SYS_LIB = @LIBC_SYS_LIB@ +LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = errno.c + +CHEWOUT_FILES = + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +TARGETDOC = ../tmp.texi + +CLEANFILES = $(CHEWOUT_FILES) *.ref +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = errno.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .def .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus errno/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = errno + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ +check-am installcheck-am installcheck install-info-am install-info \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +# No doc for errno. +doc: + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/errno/errno.c b/newlib/libc/errno/errno.c new file mode 100644 index 000000000..fd1743d73 --- /dev/null +++ b/newlib/libc/errno/errno.c @@ -0,0 +1,16 @@ +/* The errno variable is stored in the reentrancy structure. This + function returns its address for use by the macro errno defined in + errno.h. */ + +#include +#include + +#ifndef _REENT_ONLY + +int * +__errno () +{ + return &_REENT->_errno; +} + +#endif diff --git a/newlib/libc/include/_ansi.h b/newlib/libc/include/_ansi.h new file mode 100644 index 000000000..b4dc01105 --- /dev/null +++ b/newlib/libc/include/_ansi.h @@ -0,0 +1,71 @@ +/* Provide support for both ANSI and non-ANSI environments. */ + +/* Some ANSI environments are "broken" in the sense that __STDC__ cannot be + relied upon to have it's intended meaning. Therefore we must use our own + concoction: _HAVE_STDC. Always use _HAVE_STDC instead of __STDC__ in newlib + sources! + + To get a strict ANSI C environment, define macro __STRICT_ANSI__. This will + "comment out" the non-ANSI parts of the ANSI header files (non-ANSI header + files aren't affected). */ + +#ifndef _ANSIDECL_H_ +#define _ANSIDECL_H_ + +#include + +/* First try to figure out whether we really are in an ANSI C environment. */ +/* FIXME: This probably needs some work. Perhaps sys/config.h can be + prevailed upon to give us a clue. */ + +#ifdef __STDC__ +#define _HAVE_STDC +#endif + +#ifdef _HAVE_STDC +#define _PTR void * +#define _AND , +#define _NOARGS void +#define _CONST const +#define _VOLATILE volatile +#define _SIGNED signed +#define _DOTS , ... +#define _VOID void +#define _EXFUN(name, proto) name proto +#define _DEFUN(name, arglist, args) name(args) +#define _DEFUN_VOID(name) name(_NOARGS) +#define _CAST_VOID (void) +#ifndef _LONG_DOUBLE +#define _LONG_DOUBLE long double +#endif +#ifndef _PARAMS +#define _PARAMS(paramlist) paramlist +#endif +#else +#define _PTR char * +#define _AND ; +#define _NOARGS +#define _CONST +#define _VOLATILE +#define _SIGNED +#define _DOTS +#define _VOID void +#define _EXFUN(name, proto) name() +#define _DEFUN(name, arglist, args) name arglist args; +#define _DEFUN_VOID(name) name() +#define _CAST_VOID +#define _LONG_DOUBLE double +#ifndef _PARAMS +#define _PARAMS(paramlist) () +#endif +#endif + +/* Support gcc's __attribute__ facility. */ + +#ifdef __GNUC__ +#define _ATTRIBUTE(attrs) __attribute__ (attrs) +#else +#define _ATTRIBUTE(attrs) +#endif + +#endif /* _ANSIDECL_H_ */ diff --git a/newlib/libc/include/_syslist.h b/newlib/libc/include/_syslist.h new file mode 100644 index 000000000..fa552fb60 --- /dev/null +++ b/newlib/libc/include/_syslist.h @@ -0,0 +1,29 @@ +/* internal use only -- mapping of "system calls" for libraries that lose + and only provide C names, so that we end up in violation of ANSI */ +#ifndef __SYSLIST_H +#define __SYSLIST_H +#ifdef MISSING_SYSCALL_NAMES +#define _close close +#define _execve execve +#define _fcntl fcntl +#define _fork fork +#define _fstat fstat +#define _getpid getpid +#define _gettimeofday gettimeofday +#define _kill kill +#define _link link +#define _lseek lseek +#define _open open +#define _read read +#define _sbrk sbrk +#define _stat stat +#define _times times +#define _unlink unlink +#define _wait wait +#define _write write +/* functions not yet sysfaked */ +#define _opendir opendir +#define _readdir readdir +#define _closedir closedir +#endif +#endif diff --git a/newlib/libc/include/ar.h b/newlib/libc/include/ar.h new file mode 100644 index 000000000..ac2e4ca92 --- /dev/null +++ b/newlib/libc/include/ar.h @@ -0,0 +1,69 @@ +/* $NetBSD: ar.h,v 1.4 1994/10/26 00:55:43 cgd Exp $ */ + +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * This code is derived from software contributed to Berkeley by + * Hugh Smith at The University of Guelph. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ar.h 8.2 (Berkeley) 1/21/94 + */ + +#ifndef _AR_H_ +#define _AR_H_ + +/* Pre-4BSD archives had these magic numbers in them. */ +#define OARMAG1 0177555 +#define OARMAG2 0177545 + +#define ARMAG "!\n" /* ar "magic number" */ +#define SARMAG 8 /* strlen(ARMAG); */ + +#define AR_EFMT1 "#1/" /* extended format #1 */ + +struct ar_hdr { + char ar_name[16]; /* name */ + char ar_date[12]; /* modification time */ + char ar_uid[6]; /* user id */ + char ar_gid[6]; /* group id */ + char ar_mode[8]; /* octal file permissions */ + char ar_size[10]; /* size in bytes */ +#define ARFMAG "`\n" + char ar_fmag[2]; /* consistency check */ +}; + +#endif /* !_AR_H_ */ diff --git a/newlib/libc/include/assert.h b/newlib/libc/include/assert.h new file mode 100644 index 000000000..b681a8518 --- /dev/null +++ b/newlib/libc/include/assert.h @@ -0,0 +1,29 @@ +/* + assert.h +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "_ansi.h" + +#undef assert + +#ifdef NDEBUG /* required by ANSI standard */ +#define assert(p) ((void)0) +#else + +#ifdef __STDC__ +#define assert(e) ((e) ? (void)0 : __assert(__FILE__, __LINE__, #e)) +#else /* PCC */ +#define assert(e) ((e) ? (void)0 : __assert(__FILE__, __LINE__, "e")) +#endif + +#endif /* NDEBUG */ + +void _EXFUN(__assert,(const char *, int, const char *)); + +#ifdef __cplusplus +} +#endif diff --git a/newlib/libc/include/ctype.h b/newlib/libc/include/ctype.h new file mode 100644 index 000000000..224b703ad --- /dev/null +++ b/newlib/libc/include/ctype.h @@ -0,0 +1,73 @@ +#ifndef _CTYPE_H_ +#ifdef __cplusplus +extern "C" { +#endif +#define _CTYPE_H_ + +#include "_ansi.h" + +int _EXFUN(isalnum, (int __c)); +int _EXFUN(isalpha, (int __c)); +int _EXFUN(iscntrl, (int __c)); +int _EXFUN(isdigit, (int __c)); +int _EXFUN(isgraph, (int __c)); +int _EXFUN(islower, (int __c)); +int _EXFUN(isprint, (int __c)); +int _EXFUN(ispunct, (int __c)); +int _EXFUN(isspace, (int __c)); +int _EXFUN(isupper, (int __c)); +int _EXFUN(isxdigit,(int __c)); +int _EXFUN(tolower, (int __c)); +int _EXFUN(toupper, (int __c)); + +#ifndef __STRICT_ANSI__ +int _EXFUN(isascii, (int __c)); +int _EXFUN(toascii, (int __c)); +int _EXFUN(_tolower, (int __c)); +int _EXFUN(_toupper, (int __c)); +#endif + +#define _U 01 +#define _L 02 +#define _N 04 +#define _S 010 +#define _P 020 +#define _C 040 +#define _X 0100 +#define _B 0200 + +#if !defined(__CYGWIN32__) || defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB) +extern _CONST char _ctype_[]; +#else +extern _CONST char _ctype_[] __declspec(dllimport); +#endif + +#define isalpha(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L)) +#define isupper(c) ((_ctype_+1)[(unsigned)(c)]&_U) +#define islower(c) ((_ctype_+1)[(unsigned)(c)]&_L) +#define isdigit(c) ((_ctype_+1)[(unsigned)(c)]&_N) +#define isxdigit(c) ((_ctype_+1)[(unsigned)(c)]&(_X|_N)) +#define isspace(c) ((_ctype_+1)[(unsigned)(c)]&_S) +#define ispunct(c) ((_ctype_+1)[(unsigned)(c)]&_P) +#define isalnum(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L|_N)) +#define isprint(c) ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N|_B)) +#define isgraph(c) ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N)) +#define iscntrl(c) ((_ctype_+1)[(unsigned)(c)]&_C) +/* Non-gcc versions will get the library versions, and will be + slightly slower */ +#ifdef __GNUC__ +# define toupper(c) \ + ({ int __x = (c); islower(__x) ? (__x - 'a' + 'A') : __x;}) +# define tolower(c) \ + ({ int __x = (c); isupper(__x) ? (__x - 'A' + 'a') : __x;}) +#endif + +#ifndef __STRICT_ANSI__ +#define isascii(c) ((unsigned)(c)<=0177) +#define toascii(c) ((c)&0177) +#endif + +#ifdef __cplusplus +} +#endif +#endif /* _CTYPE_H_ */ diff --git a/newlib/libc/include/dirent.h b/newlib/libc/include/dirent.h new file mode 100644 index 000000000..eaa4c190d --- /dev/null +++ b/newlib/libc/include/dirent.h @@ -0,0 +1,7 @@ +#ifdef __cplusplus +extern "C" { +#endif +#include +#ifdef __cplusplus +} +#endif diff --git a/newlib/libc/include/errno.h b/newlib/libc/include/errno.h new file mode 100644 index 000000000..fa8efb7f5 --- /dev/null +++ b/newlib/libc/include/errno.h @@ -0,0 +1 @@ +#include diff --git a/newlib/libc/include/fastmath.h b/newlib/libc/include/fastmath.h new file mode 100644 index 000000000..95eea5f34 --- /dev/null +++ b/newlib/libc/include/fastmath.h @@ -0,0 +1,13 @@ +#ifndef _FASTMATH_H_ +#ifdef __cplusplus +extern "C" { +#endif +#define _FASTMATH_H_ + +#include +#include + +#ifdef __cplusplus +} +#endif +#endif /* _FASTMATH_H_ */ diff --git a/newlib/libc/include/fcntl.h b/newlib/libc/include/fcntl.h new file mode 100644 index 000000000..86a916775 --- /dev/null +++ b/newlib/libc/include/fcntl.h @@ -0,0 +1 @@ +#include diff --git a/newlib/libc/include/grp.h b/newlib/libc/include/grp.h new file mode 100644 index 000000000..b8680a5d8 --- /dev/null +++ b/newlib/libc/include/grp.h @@ -0,0 +1,85 @@ +/* $NetBSD: grp.h,v 1.7 1995/04/29 05:30:40 cgd Exp $ */ + +/*- + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)grp.h 8.2 (Berkeley) 1/21/94 + */ + +#ifndef _GRP_H_ +#define _GRP_H_ + +#include + +#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) +#define _PATH_GROUP "/etc/group" +#endif + +struct group { + char *gr_name; /* group name */ + char *gr_passwd; /* group password */ + gid_t gr_gid; /* group id */ + char **gr_mem; /* group members */ +}; + + +#ifdef __cplusplus +extern "C" { +#endif + +struct group *getgrgid (gid_t); +struct group *getgrnam (const char *); +int getgrnam_r (const char *, struct group *, + char *, size_t, struct group **); +int getgrgid_r (gid_t, struct group *, + char *, size_t, struct group **); +#ifndef _POSIX_SOURCE +struct group *getgrent (void); +void setgrent (void); +void endgrent (void); +void setgrfile (const char *); +#ifndef _XOPEN_SOURCE +char *group_from_gid (gid_t, int); +int setgroupent (int); +#endif /* !_XOPEN_SOURCE */ +#endif /* !_POSIX_SOURCE */ + +#ifdef __cplusplus +} +#endif + +#endif /* !_GRP_H_ */ diff --git a/newlib/libc/include/ieeefp.h b/newlib/libc/include/ieeefp.h new file mode 100644 index 000000000..78bb5bf62 --- /dev/null +++ b/newlib/libc/include/ieeefp.h @@ -0,0 +1,241 @@ +#ifndef _IEEE_FP_H_ +#define _IEEE_FP_H_ + +#include "_ansi.h" + +#include + +/* FIXME FIXME FIXME: + Neither of __ieee_{float,double}_shape_tape seem to be used anywhere + except in libm/test. If that is the case, please delete these from here. + If that is not the case, please insert documentation here describing why + they're needed. */ + +#ifdef __IEEE_BIG_ENDIAN + +typedef union +{ + double value; + struct + { + unsigned int sign : 1; + unsigned int exponent: 11; + unsigned int fraction0:4; + unsigned int fraction1:16; + unsigned int fraction2:16; + unsigned int fraction3:16; + + } number; + struct + { + unsigned int sign : 1; + unsigned int exponent: 11; + unsigned int quiet:1; + unsigned int function0:3; + unsigned int function1:16; + unsigned int function2:16; + unsigned int function3:16; + } nan; + struct + { + unsigned long msw; + unsigned long lsw; + } parts; + long aslong[2]; +} __ieee_double_shape_type; + +#endif + +#ifdef __IEEE_LITTLE_ENDIAN + +typedef union +{ + double value; + struct + { +#ifdef __SMALL_BITFIELDS + unsigned int fraction3:16; + unsigned int fraction2:16; + unsigned int fraction1:16; + unsigned int fraction0: 4; +#else + unsigned int fraction1:32; + unsigned int fraction0:20; +#endif + unsigned int exponent :11; + unsigned int sign : 1; + } number; + struct + { +#ifdef __SMALL_BITFIELDS + unsigned int function3:16; + unsigned int function2:16; + unsigned int function1:16; + unsigned int function0:3; +#else + unsigned int function1:32; + unsigned int function0:19; +#endif + unsigned int quiet:1; + unsigned int exponent: 11; + unsigned int sign : 1; + } nan; + struct + { + unsigned long lsw; + unsigned long msw; + } parts; + + long aslong[2]; + +} __ieee_double_shape_type; + +#endif + +#ifdef __IEEE_BIG_ENDIAN + +typedef union +{ + float value; + struct + { + unsigned int sign : 1; + unsigned int exponent: 8; + unsigned int fraction0: 7; + unsigned int fraction1: 16; + } number; + struct + { + unsigned int sign:1; + unsigned int exponent:8; + unsigned int quiet:1; + unsigned int function0:6; + unsigned int function1:16; + } nan; + long p1; + +} __ieee_float_shape_type; + +#endif + +#ifdef __IEEE_LITTLE_ENDIAN + +typedef union +{ + float value; + struct + { + unsigned int fraction0: 7; + unsigned int fraction1: 16; + unsigned int exponent: 8; + unsigned int sign : 1; + } number; + struct + { + unsigned int function1:16; + unsigned int function0:6; + unsigned int quiet:1; + unsigned int exponent:8; + unsigned int sign:1; + } nan; + long p1; + +} __ieee_float_shape_type; + +#endif + + + + + +/* FLOATING ROUNDING */ + +typedef int fp_rnd; +#define FP_RN 0 /* Round to nearest */ +#define FP_RM 1 /* Round down */ +#define FP_RP 2 /* Round up */ +#define FP_RZ 3 /* Round to zero (trunate) */ + +fp_rnd _EXFUN(fpgetround,(void)); +fp_rnd _EXFUN(fpsetround, (fp_rnd)); + +/* EXCEPTIONS */ + +typedef int fp_except; +#define FP_X_INV 0x10 /* Invalid operation */ +#define FP_X_DX 0x80 /* Divide by zero */ +#define FP_X_OFL 0x04 /* Overflow exception */ +#define FP_X_UFL 0x02 /* Underflow exception */ +#define FP_X_IMP 0x01 /* imprecise exception */ + +fp_except _EXFUN(fpgetmask,(void)); +fp_except _EXFUN(fpsetmask,(fp_except)); +fp_except _EXFUN(fpgetsticky,(void)); +fp_except _EXFUN(fpsetsticky, (fp_except)); + +/* INTEGER ROUNDING */ + +typedef int fp_rdi; +#define FP_RDI_TOZ 0 /* Round to Zero */ +#define FP_RDI_RD 1 /* Follow float mode */ + +fp_rdi _EXFUN(fpgetroundtoi,(void)); +fp_rdi _EXFUN(fpsetroundtoi,(fp_rdi)); + +int _EXFUN(isnan, (double)); +int _EXFUN(isinf, (double)); +int _EXFUN(finite, (double)); + + + +int _EXFUN(isnanf, (float)); +int _EXFUN(isinff, (float)); +int _EXFUN(finitef, (float)); + +#define __IEEE_DBL_EXPBIAS 1023 +#define __IEEE_FLT_EXPBIAS 127 + +#define __IEEE_DBL_EXPLEN 11 +#define __IEEE_FLT_EXPLEN 8 + + +#define __IEEE_DBL_FRACLEN (64 - (__IEEE_DBL_EXPLEN + 1)) +#define __IEEE_FLT_FRACLEN (32 - (__IEEE_FLT_EXPLEN + 1)) + +#define __IEEE_DBL_MAXPOWTWO ((double)(1L << 32 - 2) * (1L << (32-11) - 32 + 1)) +#define __IEEE_FLT_MAXPOWTWO ((float)(1L << (32-8) - 1)) + +#define __IEEE_DBL_NAN_EXP 0x7ff +#define __IEEE_FLT_NAN_EXP 0xff + + +#define isnanf(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \ + ((*(long *)&(x) & 0x007fffffL)!=0000000000L)) + +#define isinff(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \ + ((*(long *)&(x) & 0x007fffffL)==0000000000L)) + +#define finitef(x) (((*(long *)&(x) & 0x7f800000L)!=0x7f800000L)) + +#ifdef _DOUBLE_IS_32BITS +#undef __IEEE_DBL_EXPBIAS +#define __IEEE_DBL_EXPBIAS __IEEE_FLT_EXPBIAS + +#undef __IEEE_DBL_EXPLEN +#define __IEEE_DBL_EXPLEN __IEEE_FLT_EXPLEN + +#undef __IEEE_DBL_FRACLEN +#define __IEEE_DBL_FRACLEN __IEEE_FLT_FRACLEN + +#undef __IEEE_DBL_MAXPOWTWO +#define __IEEE_DBL_MAXPOWTWO __IEEE_FLT_MAXPOWTWO + +#undef __IEEE_DBL_NAN_EXP +#define __IEEE_DBL_NAN_EXP __IEEE_FLT_NAN_EXP + +#undef __ieee_double_shape_type +#define __ieee_double_shape_type __ieee_float_shape_type + +#endif /* _DOUBLE_IS_32BITS */ + +#endif /* _IEEE_FP_H_ */ diff --git a/newlib/libc/include/locale.h b/newlib/libc/include/locale.h new file mode 100644 index 000000000..c8d9c081d --- /dev/null +++ b/newlib/libc/include/locale.h @@ -0,0 +1,60 @@ +/* + locale.h + Values appropriate for the formatting of monetary and other + numberic quantities. +*/ + +#ifndef _LOCALE_H_ +#ifdef __cplusplus +extern "C" { +#endif +#define _LOCALE_H_ + +#include "_ansi.h" + +#ifndef NULL +#define NULL 0 +#endif + +#define LC_ALL 0 +#define LC_COLLATE 1 +#define LC_CTYPE 2 +#define LC_MONETARY 3 +#define LC_NUMERIC 4 +#define LC_TIME 5 + +struct lconv +{ + char *decimal_point; + char *thousands_sep; + char *grouping; + char *int_curr_symbol; + char *currency_symbol; + char *mon_decimal_point; + char *mon_thousands_sep; + char *mon_grouping; + char *positive_sign; + char *negative_sign; + char int_frac_digits; + char frac_digits; + char p_cs_precedes; + char p_sep_by_space; + char n_cs_precedes; + char n_sep_by_space; + char p_sign_posn; + char n_sign_posn; +}; + +#ifndef _REENT_ONLY +char *_EXFUN(setlocale,(int category, const char *locale)); +struct lconv *_EXFUN(localeconv,(void)); +#endif + +struct _reent; +char *_EXFUN(_setlocale_r,(struct _reent *, int category, const char *locale)); +struct lconv *_EXFUN(_localeconv_r,(struct _reent *)); + +#ifdef __cplusplus +} +#endif +#endif /* _LOCALE_H_ */ diff --git a/newlib/libc/include/machine/fastmath.h b/newlib/libc/include/machine/fastmath.h new file mode 100644 index 000000000..b13befa22 --- /dev/null +++ b/newlib/libc/include/machine/fastmath.h @@ -0,0 +1,100 @@ +#ifdef __sysvnecv70_target +double EXFUN(fast_sin,(double)); +double EXFUN(fast_cos,(double)); +double EXFUN(fast_tan,(double)); + +double EXFUN(fast_asin,(double)); +double EXFUN(fast_acos,(double)); +double EXFUN(fast_atan,(double)); + +double EXFUN(fast_sinh,(double)); +double EXFUN(fast_cosh,(double)); +double EXFUN(fast_tanh,(double)); + +double EXFUN(fast_asinh,(double)); +double EXFUN(fast_acosh,(double)); +double EXFUN(fast_atanh,(double)); + +double EXFUN(fast_abs,(double)); +double EXFUN(fast_sqrt,(double)); +double EXFUN(fast_exp2,(double)); +double EXFUN(fast_exp10,(double)); +double EXFUN(fast_expe,(double)); +double EXFUN(fast_log10,(double)); +double EXFUN(fast_log2,(double)); +double EXFUN(fast_loge,(double)); + + +#define sin(x) fast_sin(x) +#define cos(x) fast_cos(x) +#define tan(x) fast_tan(x) +#define asin(x) fast_asin(x) +#define acos(x) fast_acos(x) +#define atan(x) fast_atan(x) +#define sinh(x) fast_sinh(x) +#define cosh(x) fast_cosh(x) +#define tanh(x) fast_tanh(x) +#define asinh(x) fast_asinh(x) +#define acosh(x) fast_acosh(x) +#define atanh(x) fast_atanh(x) +#define abs(x) fast_abs(x) +#define sqrt(x) fast_sqrt(x) +#define exp2(x) fast_exp2(x) +#define exp10(x) fast_exp10(x) +#define expe(x) fast_expe(x) +#define log10(x) fast_log10(x) +#define log2(x) fast_log2(x) +#define loge(x) fast_loge(x) + +#ifdef _HAVE_STDC +/* These functions are in assembler, they really do take floats. This + can only be used with a real ANSI compiler */ + +float EXFUN(fast_sinf,(float)); +float EXFUN(fast_cosf,(float)); +float EXFUN(fast_tanf,(float)); + +float EXFUN(fast_asinf,(float)); +float EXFUN(fast_acosf,(float)); +float EXFUN(fast_atanf,(float)); + +float EXFUN(fast_sinhf,(float)); +float EXFUN(fast_coshf,(float)); +float EXFUN(fast_tanhf,(float)); + +float EXFUN(fast_asinhf,(float)); +float EXFUN(fast_acoshf,(float)); +float EXFUN(fast_atanhf,(float)); + +float EXFUN(fast_absf,(float)); +float EXFUN(fast_sqrtf,(float)); +float EXFUN(fast_exp2f,(float)); +float EXFUN(fast_exp10f,(float)); +float EXFUN(fast_expef,(float)); +float EXFUN(fast_log10f,(float)); +float EXFUN(fast_log2f,(float)); +float EXFUN(fast_logef,(float)); +#define sinf(x) fast_sinf(x) +#define cosf(x) fast_cosf(x) +#define tanf(x) fast_tanf(x) +#define asinf(x) fast_asinf(x) +#define acosf(x) fast_acosf(x) +#define atanf(x) fast_atanf(x) +#define sinhf(x) fast_sinhf(x) +#define coshf(x) fast_coshf(x) +#define tanhf(x) fast_tanhf(x) +#define asinhf(x) fast_asinhf(x) +#define acoshf(x) fast_acoshf(x) +#define atanhf(x) fast_atanhf(x) +#define absf(x) fast_absf(x) +#define sqrtf(x) fast_sqrtf(x) +#define exp2f(x) fast_exp2f(x) +#define exp10f(x) fast_exp10f(x) +#define expef(x) fast_expef(x) +#define log10f(x) fast_log10f(x) +#define log2f(x) fast_log2f(x) +#define logef(x) fast_logef(x) +#endif +/* Override the functions defined in math.h */ +#endif /* __sysvnecv70_target */ + diff --git a/newlib/libc/include/machine/ieeefp.h b/newlib/libc/include/machine/ieeefp.h new file mode 100644 index 000000000..ce8f0ffc5 --- /dev/null +++ b/newlib/libc/include/machine/ieeefp.h @@ -0,0 +1,157 @@ +#ifndef __IEEE_BIG_ENDIAN +#ifndef __IEEE_LITTLE_ENDIAN + +#if defined(__arm__) || defined(__thumb__) +/* ARM always has big-endian words. Within those words the byte ordering + appears to be big or little endian. Newlib doesn't seem to care about + the byte ordering within words. */ +#define __IEEE_BIG_ENDIAN +#endif + +#ifdef __hppa__ +#define __IEEE_BIG_ENDIAN +#endif + +#ifdef __sparc__ +#ifdef __LITTLE_ENDIAN_DATA__ +#define __IEEE_LITTLE_ENDIAN +#else +#define __IEEE_BIG_ENDIAN +#endif +#endif + +#if defined(__m68k__) || defined(__mc68000__) +#define __IEEE_BIG_ENDIAN +#endif + +#if defined (__H8300__) || defined (__H8300H__) || defined (__H8300S__) +#define __IEEE_BIG_ENDIAN +#define __SMALL_BITFIELDS +#define _DOUBLE_IS_32BITS +#endif + +#ifdef __H8500__ +#define __IEEE_BIG_ENDIAN +#define __SMALL_BITFIELDS +#define _DOUBLE_IS_32BITS +#endif + +#ifdef __sh__ +#ifdef __LITTLE_ENDIAN__ +#define __IEEE_LITTLE_ENDIAN +#else +#define __IEEE_BIG_ENDIAN +#endif +#if defined(__SH3E__) || defined(__SH4_SINGLE_ONLY__) +#define _DOUBLE_IS_32BITS +#endif +#endif + +#ifdef _AM29K +#define __IEEE_BIG_ENDIAN +#endif + +#ifdef _WIN32 +#define __IEEE_LITTLE_ENDIAN +#endif + +#ifdef __i386__ +#define __IEEE_LITTLE_ENDIAN +#endif + +#ifdef __i960__ +#define __IEEE_LITTLE_ENDIAN +#endif + +#ifdef __M32R__ +#define __IEEE_BIG_ENDIAN +#endif + +#ifdef __TIC80__ +#define __IEEE_LITTLE_ENDIAN +#endif + +#ifdef __MIPSEL__ +#define __IEEE_LITTLE_ENDIAN +#endif +#ifdef __MIPSEB__ +#define __IEEE_BIG_ENDIAN +#endif + +/* necv70 was __IEEE_LITTLE_ENDIAN. */ + +#ifdef __W65__ +#define __IEEE_LITTLE_ENDIAN +#define __SMALL_BITFIELDS +#define _DOUBLE_IS_32BITS +#endif + +#if defined(__Z8001__) || defined(__Z8002__) +#define __IEEE_BIG_ENDIAN +#endif + +#ifdef __m88k__ +#define __IEEE_BIG_ENDIAN +#endif + +#ifdef __mn10300__ +#define __IEEE_LITTLE_ENDIAN +#endif + +#ifdef __mn10200__ +#define __IEEE_LITTLE_ENDIAN +#define __SMALL_BITFIELDS +#define _DOUBLE_IS_32BITS +#endif + +#ifdef __v800 +#define __IEEE_LITTLE_ENDIAN +#endif + +#ifdef __v850 +#define __IEEE_LITTLE_ENDIAN +#endif + +#ifdef __D10V__ +#define __IEEE_BIG_ENDIAN +#define _DOUBLE_IS_32BITS +#define __SMALL_BITFIELDS +#endif + +#ifdef __PPC__ +#if (defined(_BIG_ENDIAN) && _BIG_ENDIAN) || (defined(_AIX) && _AIX) +#define __IEEE_BIG_ENDIAN +#else +#if (defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN) || (defined(__sun__) && __sun__) || (defined(_WIN32) && _WIN32) +#define __IEEE_LITTLE_ENDIAN +#endif +#endif +#endif + +#ifdef __arc__ +#ifdef __big_endian__ +#define __IEEE_BIG_ENDIAN +#else +#define __IEEE_LITTLE_ENDIAN +#endif +#endif + +#ifdef __fr30__ +#define __IEEE_BIG_ENDIAN +#endif + +#ifdef __mcore__ +#define __IEEE_BIG_ENDIAN +#endif + + + +#ifndef __IEEE_BIG_ENDIAN +#ifndef __IEEE_LITTLE_ENDIAN +#error Endianess not declared!! +#endif /* not __IEEE_LITTLE_ENDIAN */ +#endif /* not __IEEE_BIG_ENDIAN */ + +#endif /* not __IEEE_LITTLE_ENDIAN */ +#endif /* not __IEEE_BIG_ENDIAN */ + diff --git a/newlib/libc/include/machine/setjmp-dj.h b/newlib/libc/include/machine/setjmp-dj.h new file mode 100644 index 000000000..0243f7e76 --- /dev/null +++ b/newlib/libc/include/machine/setjmp-dj.h @@ -0,0 +1,44 @@ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/* Modified to use SETJMP_DJ_H rather than SETJMP_H to avoid + conflicting with setjmp.h. Ian Taylor, Cygnus support, April, + 1993. */ + +#ifndef _SETJMP_DJ_H_ +#define _SETJMP_DJ_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + unsigned long eax; + unsigned long ebx; + unsigned long ecx; + unsigned long edx; + unsigned long esi; + unsigned long edi; + unsigned long ebp; + unsigned long esp; + unsigned long eip; +} jmp_buf[1]; + +extern int setjmp(jmp_buf); +extern void longjmp(jmp_buf, int); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/newlib/libc/include/machine/setjmp.h b/newlib/libc/include/machine/setjmp.h new file mode 100644 index 000000000..4656c0ff1 --- /dev/null +++ b/newlib/libc/include/machine/setjmp.h @@ -0,0 +1,168 @@ +#if defined(__arm__) || defined(__thumb__) +/* + * All callee preserved registers: + * v1 - v7, fp, ip, sp, lr, f4, f5, f6, f7 + */ +#define _JBLEN 23 +#endif + +#ifdef __sparc__ +/* + * onsstack,sigmask,sp,pc,npc,psr,g1,o0,wbcnt (sigcontext). + * All else recovered by under/over(flow) handling. + */ +#define _JBLEN 13 +#endif + +/* necv70 was 9 as well. */ + +#ifdef __mc68000__ +/* + * onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6, + * fp2-fp7 for 68881. + * All else recovered by under/over(flow) handling. + */ +#define _JBLEN 34 +#endif + +#if defined(__Z8001__) || defined(__Z8002__) +/* 16 regs + pc */ +#define _JBLEN 20 +#endif + +#ifdef _AM29K +/* + * onsstack,sigmask,sp,pc,npc,psr,g1,o0,wbcnt (sigcontext). + * All else recovered by under/over(flow) handling. + */ +#define _JBLEN 9 +#endif + +#if defined(__CYGWIN__) && !defined (_JBLEN) +#define _JBLEN (13 * 4) +#elif defined (__i386__) +#ifdef __unix__ +# define _JBLEN 36 +#else +#include "setjmp-dj.h" +#endif +#endif + +#ifdef __i960__ +#define _JBLEN 35 +#endif + +#ifdef __M32R__ +/* Only 8 words are currently needed. 10 gives us some slop if we need + to expand. */ +#define _JBLEN 10 +#endif + +#ifdef __mips__ +#define _JBLEN 11 +#endif + +#ifdef __m88000__ +#define _JBLEN 21 +#endif + +#ifdef __H8300__ +#define _JBLEN 5 +typedef int jmp_buf[_JBLEN]; +#endif + +#ifdef __H8300H__ +/* same as H8/300 but registers are twice as big */ +#define _JBLEN 5 +#define _JBTYPE long +#endif + +#ifdef __H8300S__ +/* same as H8/300 but registers are twice as big */ +#define _JBLEN 5 +#define _JBTYPE long +#endif + +#ifdef __H8500__ +#define _JBLEN 4 +#endif + +#ifdef __sh__ +#define _JBLEN 20 +#endif + +#ifdef __v800 +#define _JBLEN 28 +#endif + +#ifdef __PPC__ +#define _JBLEN 32 +#define _JBTYPE double +#endif + +#ifdef __hppa__ +/* %r30, %r2-%r18, %r27, pad, %fr12-%fr15. + Note space exists for the FP registers, but they are not + saved. */ +#define _JBLEN 28 +#endif + +#if defined(__mn10300__) || defined(__mn10200__) +/* A guess */ +#define _JBLEN 10 +#endif + +#ifdef __v850 +/* I think our setjmp is saving 15 regs at the moment. Gives us one word + slop if we need to expand. */ +#define _JBLEN 16 +#endif + +#ifdef __TIC80__ +#define _JBLEN 13 +#endif + +#ifdef __D10V__ +#define _JBLEN 8 +#endif + +#ifdef __D30V__ +#define _JBLEN ((64 /* GPR */ + (2*2) /* ACs */ + 18 /* CRs */) / 2) +#define _JBTYPE double +#endif + + +#ifdef __fr30__ +#define _JBLEN 10 +#endif + +#ifdef __mcore__ +#define _JBLEN 16 +#endif + +#ifdef _JBLEN +#ifdef _JBTYPE +typedef _JBTYPE jmp_buf[_JBLEN]; +#else +typedef int jmp_buf[_JBLEN]; +#endif + +#if defined(__CYGWIN32__) || defined(__rtems__) +#include + +/* POSIX sigsetjmp/siglongjmp macros */ +typedef int sigjmp_buf[_JBLEN+2]; + +#define _SAVEMASK _JBLEN +#define _SIGMASK (_JBLEN+1) + +#define sigsetjmp(env, savemask) (env[_SAVEMASK] = savemask,\ + sigprocmask (SIG_SETMASK, 0, (sigset_t *) &env[_SIGMASK]),\ + setjmp (env)) + +#define siglongjmp(env, val) (((env[_SAVEMASK])?\ + sigprocmask (SIG_SETMASK, (sigset_t *) &env[_SIGMASK], 0):0),\ + longjmp (env, val)) + +#endif /* __CYGWIN32__ or __rtems__ */ +#endif diff --git a/newlib/libc/include/machine/time.h b/newlib/libc/include/machine/time.h new file mode 100644 index 000000000..13857bfde --- /dev/null +++ b/newlib/libc/include/machine/time.h @@ -0,0 +1,10 @@ +#ifndef _MACHTIME_H_ +#define _MACHTIME_H_ + +#if defined(__arm__) || defined(__thumb__) +#define _CLOCKS_PER_SEC_ 100 +#endif + +#endif /* _MACHTIME_H_ */ + + diff --git a/newlib/libc/include/machine/types.h b/newlib/libc/include/machine/types.h new file mode 100644 index 000000000..b71a67f56 --- /dev/null +++ b/newlib/libc/include/machine/types.h @@ -0,0 +1,9 @@ +#ifndef _MACHTYPES_H_ +#define _MACHTYPES_H_ + +#define _CLOCK_T_ unsigned long /* clock() */ +#define _TIME_T_ long /* time() */ + +#endif /* _MACHTYPES_H_ */ + + diff --git a/newlib/libc/include/malloc.h b/newlib/libc/include/malloc.h new file mode 100644 index 000000000..64abe91cf --- /dev/null +++ b/newlib/libc/include/malloc.h @@ -0,0 +1,97 @@ +/* malloc.h -- header file for memory routines. */ + +#ifndef _INCLUDE_MALLOC_H_ +#define _INCLUDE_MALLOC_H_ + +#include <_ansi.h> +#include + +#define __need_size_t +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* This version of struct mallinfo must match the one in + libc/stdlib/mallocr.c. */ + +struct mallinfo { + int arena; /* total space allocated from system */ + int ordblks; /* number of non-inuse chunks */ + int smblks; /* unused -- always zero */ + int hblks; /* number of mmapped regions */ + int hblkhd; /* total space in mmapped regions */ + int usmblks; /* unused -- always zero */ + int fsmblks; /* unused -- always zero */ + int uordblks; /* total allocated space */ + int fordblks; /* total non-inuse space */ + int keepcost; /* top-most, releasable (via malloc_trim) space */ +}; + +/* The routines. */ + +extern _PTR malloc _PARAMS ((size_t)); +extern _PTR _malloc_r _PARAMS ((struct _reent *, size_t)); + +extern _VOID free _PARAMS ((_PTR)); +extern _VOID _free_r _PARAMS ((struct _reent *, _PTR)); + +extern _PTR realloc _PARAMS ((_PTR, size_t)); +extern _PTR _realloc_r _PARAMS ((struct _reent *, _PTR, size_t)); + +extern _PTR calloc _PARAMS ((size_t, size_t)); +extern _PTR _calloc_r _PARAMS ((struct _reent *, size_t, size_t)); + +extern _PTR memalign _PARAMS ((size_t, size_t)); +extern _PTR _memalign_r _PARAMS ((struct _reent *, size_t, size_t)); + +extern struct mallinfo mallinfo _PARAMS ((void)); +extern struct mallinfo _mallinfo_r _PARAMS ((struct _reent *)); + +extern void malloc_stats _PARAMS ((void)); +extern void _malloc_stats_r _PARAMS ((struct _reent *)); + +extern int mallopt _PARAMS ((int, int)); +extern int _mallopt_r _PARAMS ((struct _reent *, int, int)); + +extern size_t malloc_usable_size _PARAMS ((_PTR)); +extern size_t _malloc_usable_size_r _PARAMS ((struct _reent *, _PTR)); + +/* These aren't too useful on an embedded system, but we define them + anyhow. */ + +extern _PTR valloc _PARAMS ((size_t)); +extern _PTR _valloc_r _PARAMS ((struct _reent *, size_t)); + +extern _PTR pvalloc _PARAMS ((size_t)); +extern _PTR _pvalloc_r _PARAMS ((struct _reent *, size_t)); + +extern int malloc_trim _PARAMS ((size_t)); +extern int _malloc_trim_r _PARAMS ((struct _reent *, size_t)); + +/* Some systems provide this, so do too for compatibility. */ + +extern void cfree _PARAMS ((_PTR)); + +/* A compatibility routine for an earlier version of the allocator. */ + +extern _VOID mstats _PARAMS ((char *)); +extern _VOID _mstats_r _PARAMS ((struct _reent *, char *)); + +#ifdef __CYGWIN32__ + +/* Cygwin32 needs to be able to copy all the malloc information from + the parent to the child. However, cygwin32 does not normally copy + any data in the DLL data section. This routine handles copying + that information. */ + +extern int __malloc_copy _PARAMS ((int (*) (void *, void *, void *, int), + void *, int)); +#endif /* __CYGWIN32 */ + +#ifdef __cplusplus +} +#endif + +#endif /* _INCLUDE_MALLOC_H_ */ diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h new file mode 100644 index 000000000..d3f2e99ae --- /dev/null +++ b/newlib/libc/include/math.h @@ -0,0 +1,273 @@ +/* math.h -- Definitions for the math floating point package. */ + +#ifndef _MATH_H_ +#ifdef __cplusplus +extern "C" { +#endif +#define _MATH_H_ + +#include +#include +#include "_ansi.h" + +#ifndef HUGE_VAL + +/* Define HUGE_VAL as infinity, unless HUGE_VAL is already defined + (which might have been done by something like math-68881.h). */ + +union __dmath +{ + __uint32_t i[2]; + double d; +}; + +extern const union __dmath __infinity; + +#define HUGE_VAL (__infinity.d) + +#endif /* ! defined (HUGE_VAL) */ + +/* Reentrant ANSI C functions. */ + +#ifndef __math_68881 +extern double atan _PARAMS((double)); +extern double cos _PARAMS((double)); +extern double sin _PARAMS((double)); +extern double tan _PARAMS((double)); +extern double tanh _PARAMS((double)); +extern double frexp _PARAMS((double, int *)); +extern double modf _PARAMS((double, double *)); +extern double ceil _PARAMS((double)); +extern double fabs _PARAMS((double)); +extern double floor _PARAMS((double)); +#endif /* ! defined (__math_68881) */ + +/* Non reentrant ANSI C functions. */ + +#ifndef _REENT_ONLY +#ifndef __math_6881 +extern double acos _PARAMS((double)); +extern double asin _PARAMS((double)); +extern double atan2 _PARAMS((double, double)); +extern double cosh _PARAMS((double)); +extern double sinh _PARAMS((double)); +extern double exp _PARAMS((double)); +extern double ldexp _PARAMS((double, int)); +extern double log _PARAMS((double)); +extern double log10 _PARAMS((double)); +extern double pow _PARAMS((double, double)); +extern double sqrt _PARAMS((double)); +extern double fmod _PARAMS((double, double)); +#endif /* ! defined (__math_68881) */ +#endif /* ! defined (_REENT_ONLY) */ + +#ifndef __STRICT_ANSI__ + +/* Non ANSI double precision functions. */ + +extern double infinity _PARAMS((void)); +extern double nan _PARAMS((void)); +extern int isnan _PARAMS((double)); +extern int isinf _PARAMS((double)); +extern int finite _PARAMS((double)); +extern double copysign _PARAMS((double, double)); +extern int ilogb _PARAMS((double)); + +extern double asinh _PARAMS((double)); +extern double cbrt _PARAMS((double)); +extern double nextafter _PARAMS((double, double)); +extern double rint _PARAMS((double)); +extern double scalbn _PARAMS((double, int)); + +#ifndef __math_68881 +extern double log1p _PARAMS((double)); +extern double expm1 _PARAMS((double)); +#endif /* ! defined (__math_68881) */ + +#ifndef _REENT_ONLY +extern double acosh _PARAMS((double)); +extern double atanh _PARAMS((double)); +extern double remainder _PARAMS((double, double)); +extern double gamma _PARAMS((double)); +extern double gamma_r _PARAMS((double, int *)); +extern double lgamma _PARAMS((double)); +extern double lgamma_r _PARAMS((double, int *)); +extern double erf _PARAMS((double)); +extern double erfc _PARAMS((double)); +extern double y0 _PARAMS((double)); +extern double y1 _PARAMS((double)); +extern double yn _PARAMS((int, double)); +extern double j0 _PARAMS((double)); +extern double j1 _PARAMS((double)); +extern double jn _PARAMS((int, double)); +#define log2(x) (log (x) / M_LOG2_E) + +#ifndef __math_68881 +extern double hypot _PARAMS((double, double)); +#endif + +extern double cabs(); +extern double drem _PARAMS((double, double)); + +#endif /* ! defined (_REENT_ONLY) */ + +/* Single precision versions of ANSI functions. */ + +extern float atanf _PARAMS((float)); +extern float cosf _PARAMS((float)); +extern float sinf _PARAMS((float)); +extern float tanf _PARAMS((float)); +extern float tanhf _PARAMS((float)); +extern float frexpf _PARAMS((float, int *)); +extern float modff _PARAMS((float, float *)); +extern float ceilf _PARAMS((float)); +extern float fabsf _PARAMS((float)); +extern float floorf _PARAMS((float)); + +#ifndef _REENT_ONLY +extern float acosf _PARAMS((float)); +extern float asinf _PARAMS((float)); +extern float atan2f _PARAMS((float, float)); +extern float coshf _PARAMS((float)); +extern float sinhf _PARAMS((float)); +extern float expf _PARAMS((float)); +extern float ldexpf _PARAMS((float, int)); +extern float logf _PARAMS((float)); +extern float log10f _PARAMS((float)); +extern float powf _PARAMS((float, float)); +extern float sqrtf _PARAMS((float)); +extern float fmodf _PARAMS((float, float)); +#endif /* ! defined (_REENT_ONLY) */ + +/* Other single precision functions. */ + +extern float infinityf _PARAMS((void)); +extern float nanf _PARAMS((void)); +extern int isnanf _PARAMS((float)); +extern int isinff _PARAMS((float)); +extern int finitef _PARAMS((float)); +extern float copysignf _PARAMS((float, float)); +extern int ilogbf _PARAMS((float)); + +extern float asinhf _PARAMS((float)); +extern float cbrtf _PARAMS((float)); +extern float nextafterf _PARAMS((float, float)); +extern float rintf _PARAMS((float)); +extern float scalbnf _PARAMS((float, int)); +extern float log1pf _PARAMS((float)); +extern float expm1f _PARAMS((float)); + +#ifndef _REENT_ONLY +extern float acoshf _PARAMS((float)); +extern float atanhf _PARAMS((float)); +extern float remainderf _PARAMS((float, float)); +extern float gammaf _PARAMS((float)); +extern float gammaf_r _PARAMS((float, int *)); +extern float lgammaf _PARAMS((float)); +extern float lgammaf_r _PARAMS((float, int *)); +extern float erff _PARAMS((float)); +extern float erfcf _PARAMS((float)); +extern float y0f _PARAMS((float)); +extern float y1f _PARAMS((float)); +extern float ynf _PARAMS((int, float)); +extern float j0f _PARAMS((float)); +extern float j1f _PARAMS((float)); +extern float jnf _PARAMS((int, float)); +#define log2f(x) (logf (x) / (float) M_LOG2_E) +extern float hypotf _PARAMS((float, float)); + +extern float cabsf(); +extern float dremf _PARAMS((float, float)); + +#endif /* ! defined (_REENT_ONLY) */ + +/* The gamma functions use a global variable, signgam. */ + +extern int signgam; + +/* The exception structure passed to the matherr routine. */ + +#ifdef __cplusplus +struct __exception +#else +struct exception +#endif +{ + int type; + char *name; + double arg1; + double arg2; + double retval; + int err; +}; + +#ifdef __cplusplus +extern int matherr _PARAMS((struct __exception *e)); +#else +extern int matherr _PARAMS((struct exception *e)); +#endif + +/* Values for the type field of struct exception. */ + +#define DOMAIN 1 +#define SING 2 +#define OVERFLOW 3 +#define UNDERFLOW 4 +#define TLOSS 5 +#define PLOSS 6 + +/* Useful constants. */ + +#define M_E 2.7182818284590452354 +#define M_LOG2E 1.4426950408889634074 +#define M_LOG10E 0.43429448190325182765 +#define M_LN2 0.69314718055994530942 +#define M_LN10 2.30258509299404568402 +#define M_PI 3.14159265358979323846 +#define M_TWOPI (M_PI * 2.0) +#define M_PI_2 1.57079632679489661923 +#define M_PI_4 0.78539816339744830962 +#define M_3PI_4 2.3561944901923448370E0 +#define M_SQRTPI 1.77245385090551602792981 +#define M_1_PI 0.31830988618379067154 +#define M_2_PI 0.63661977236758134308 +#define M_2_SQRTPI 1.12837916709551257390 +#define M_SQRT2 1.41421356237309504880 +#define M_SQRT1_2 0.70710678118654752440 +#define M_LN2LO 1.9082149292705877000E-10 +#define M_LN2HI 6.9314718036912381649E-1 +#define M_SQRT3 1.73205080756887719000 +#define M_IVLN10 0.43429448190325182765 /* 1 / log(10) */ +#define M_LOG2_E 0.693147180559945309417 +#define M_INVLN2 1.4426950408889633870E0 /* 1 / log(2) */ + +/* Global control over fdlibm error handling. */ + +enum __fdlibm_version +{ + __fdlibm_ieee = -1, + __fdlibm_svid, + __fdlibm_xopen, + __fdlibm_posix +}; + +#define _LIB_VERSION_TYPE enum __fdlibm_version +#define _LIB_VERSION __fdlib_version + +extern _CONST _LIB_VERSION_TYPE _LIB_VERSION; + +#define _IEEE_ __fdlibm_ieee +#define _SVID_ __fdlibm_svid +#define _XOPEN_ __fdlibm_xopen +#define _POSIX_ __fdlibm_posix + +#endif /* ! defined (__STRICT_ANSI__) */ + +#ifdef __FAST_MATH__ +#include +#endif + +#ifdef __cplusplus +} +#endif +#endif /* _MATH_H_ */ diff --git a/newlib/libc/include/paths.h b/newlib/libc/include/paths.h new file mode 100644 index 000000000..36cf78a9b --- /dev/null +++ b/newlib/libc/include/paths.h @@ -0,0 +1,7 @@ +#ifndef _PATHS_H_ +#define _PATHS_H_ + +#define _PATH_DEV "/dev/" +#define _PATH_BSHELL "/bin/sh" + +#endif /* _PATHS_H_ */ diff --git a/newlib/libc/include/process.h b/newlib/libc/include/process.h new file mode 100644 index 000000000..ca5b451ce --- /dev/null +++ b/newlib/libc/include/process.h @@ -0,0 +1,60 @@ +/* process.h. This file comes with MSDOS and WIN32 systems. */ + +#ifndef __PROCESS_H_ +#define __PROCESS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +int execl(const char *path, const char *argv0, ...); +int execle(const char *path, const char *argv0, ... /*, char * const *envp */); +int execlp(const char *path, const char *argv0, ...); +int execlpe(const char *path, const char *argv0, ... /*, char * const *envp */); + +int execv(const char *path, char * const *argv); +int execve(const char *path, char * const *argv, char * const *envp); +int execvp(const char *path, char * const *argv); +int execvpe(const char *path, char * const *argv, char * const *envp); + +int spawnl(int mode, const char *path, const char *argv0, ...); +int spawnle(int mode, const char *path, const char *argv0, ... /*, char * const *envp */); +int spawnlp(int mode, const char *path, const char *argv0, ...); +int spawnlpe(int mode, const char *path, const char *argv0, ... /*, char * const *envp */); + +int spawnv(int mode, const char *path, const char * const *argv); +int spawnve(int mode, const char *path, char * const *argv, const char * const *envp); +int spawnvp(int mode, const char *path, const char * const *argv); +int spawnvpe(int mode, const char *path, const char * const *argv, const char * const *envp); + +#ifdef __CYGWIN32__ +/* Secure exec() functions family */ +/* The first arg should really be a HANDLE which is a void *. But we + can't include windows.h here so... */ +#include +pid_t sexecl(void *, const char *path, const char *argv0, ...); +pid_t sexecle(void *, const char *path, const char *argv0, ... /*, char * const *envp */); +pid_t sexeclp(void *, const char *path, const char *argv0, ...); +pid_t sexeclpe(void *, const char *path, const char *argv0, ... /*, char * const *envp */); + +pid_t sexecv(void *, const char *path, const char * const *argv); +pid_t sexecve(void *, const char *path, const char * const *argv, const char * const *envp); +pid_t sexecvp(void *, const char *path, const char * const *argv); +pid_t sexecvpe(void *, const char *path, const char * const *argv, const char * const *envp); +#endif + +int cwait(int *, int, int); + +#define _P_WAIT 1 +#define _P_NOWAIT 2 /* always generates error */ +#define _P_OVERLAY 3 +#define _P_NOWAITO 4 +#define _P_DETACH 5 + +#define WAIT_CHILD 1 + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/newlib/libc/include/pwd.h b/newlib/libc/include/pwd.h new file mode 100644 index 000000000..59d6ab555 --- /dev/null +++ b/newlib/libc/include/pwd.h @@ -0,0 +1,76 @@ +/*- + * Copyright (c) 1989 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)pwd.h 5.13 (Berkeley) 5/28/91 + */ + +#ifndef _PWD_H_ +#ifdef __cplusplus +extern "C" { +#endif +#define _PWD_H_ + +#include + +#ifndef _POSIX_SOURCE +#define _PATH_PASSWD "/etc/passwd" + +#define _PASSWORD_LEN 128 /* max length, not counting NULL */ +#endif + +struct passwd { + char *pw_name; /* user name */ + char *pw_passwd; /* encrypted password */ + int pw_uid; /* user uid */ + int pw_gid; /* user gid */ + char *pw_comment; /* comment */ + char *pw_gecos; /* Honeywell login info */ + char *pw_dir; /* home directory */ + char *pw_shell; /* default shell */ +}; + +struct passwd *getpwuid (uid_t); +struct passwd *getpwnam (const char *); +int getpwnam_r (const char *, struct passwd *, + char *, size_t , struct passwd **); +int getpwuid_r (uid_t, struct passwd *, char *, + size_t, struct passwd **); +#ifndef _POSIX_SOURCE +struct passwd *getpwent (void); +void setpwent (void); +void endpwent (void); +#endif + +#ifdef __cplusplus +} +#endif +#endif /* _PWD_H_ */ diff --git a/newlib/libc/include/reent.h b/newlib/libc/include/reent.h new file mode 100644 index 000000000..56fae91a4 --- /dev/null +++ b/newlib/libc/include/reent.h @@ -0,0 +1,87 @@ +/* This header file provides the reentrancy. */ + +/* The reentrant system calls here serve two purposes: + + 1) Provide reentrant versions of the system calls the ANSI C library + requires. + 2) Provide these system calls in a namespace clean way. + + It is intended that *all* system calls that the ANSI C library needs + be declared here. It documents them all in one place. All library access + to the system is via some form of these functions. + + There are three ways a target may provide the needed syscalls. + + 1) Define the reentrant versions of the syscalls directly. + (eg: _open_r, _close_r, etc.). Please keep the namespace clean. + When you do this, set "syscall_dir" to "syscalls" in configure.in, + and add -DREENTRANT_SYSCALLS_PROVIDED to target_cflags in configure.in. + + 2) Define namespace clean versions of the system calls by prefixing + them with '_' (eg: _open, _close, etc.). Technically, there won't be + true reentrancy at the syscall level, but the library will be namespace + clean. + When you do this, set "syscall_dir" to "syscalls" in configure.in. + + 3) Define or otherwise provide the regular versions of the syscalls + (eg: open, close, etc.). The library won't be reentrant nor namespace + clean, but at least it will work. + When you do this, add -DMISSING_SYSCALL_NAMES to target_cflags in + configure.in. + + Stubs of the reentrant versions of the syscalls exist in the libc/reent + source directory and are used if REENTRANT_SYSCALLS_PROVIDED isn't defined. + They use the native system calls: _open, _close, etc. if they're available + (MISSING_SYSCALL_NAMES is *not* defined), otherwise open, close, etc. + (MISSING_SYSCALL_NAMES *is* defined). */ + +/* WARNING: All identifiers here must begin with an underscore. This file is + included by stdio.h and others and we therefore must only use identifiers + in the namespace allotted to us. */ + +#ifndef _REENT_H_ +#ifdef __cplusplus +extern "C" { +#endif +#define _REENT_H_ + +#include +#include +#include + +#define __need_size_t +#include + +/* FIXME: not namespace clean */ +struct stat; +struct tms; +struct timeval; +struct timezone; + +/* Reentrant versions of system calls. */ + +extern int _close_r _PARAMS ((struct _reent *, int)); +extern int _execve_r _PARAMS ((struct _reent *, char *, char **, char **)); +extern int _fcntl_r _PARAMS ((struct _reent *, int, int, int)); +extern int _fork_r _PARAMS ((struct _reent *)); +extern int _fstat_r _PARAMS ((struct _reent *, int, struct stat *)); +extern int _getpid_r _PARAMS ((struct _reent *)); +extern int _kill_r _PARAMS ((struct _reent *, int, int)); +extern int _link_r _PARAMS ((struct _reent *, const char *, const char *)); +extern _off_t _lseek_r _PARAMS ((struct _reent *, int, _off_t, int)); +extern int _open_r _PARAMS ((struct _reent *, const char *, int, int)); +extern _ssize_t _read_r _PARAMS ((struct _reent *, int, void *, size_t)); +extern void *_sbrk_r _PARAMS ((struct _reent *, size_t)); +extern int _stat_r _PARAMS ((struct _reent *, const char *, struct stat *)); +extern _CLOCK_T_ _times_r _PARAMS ((struct _reent *, struct tms *)); +extern int _unlink_r _PARAMS ((struct _reent *, const char *)); +extern int _wait_r _PARAMS ((struct _reent *, int *)); +extern _ssize_t _write_r _PARAMS ((struct _reent *, int, const void *, size_t)); + +/* This one is not guaranteed to be available on all targets. */ +extern int _gettimeofday_r _PARAMS ((struct _reent *, struct timeval *tp, struct timezone *tzp)); + +#ifdef __cplusplus +} +#endif +#endif /* _REENT_H_ */ diff --git a/newlib/libc/include/regdef.h b/newlib/libc/include/regdef.h new file mode 100644 index 000000000..8cf144b85 --- /dev/null +++ b/newlib/libc/include/regdef.h @@ -0,0 +1,7 @@ +/* regdef.h -- define register names. */ + +/* This is a standard include file for MIPS targets. Other target + probably don't define it, and attempts to include this file will + fail. */ + +#include diff --git a/newlib/libc/include/setjmp.h b/newlib/libc/include/setjmp.h new file mode 100644 index 000000000..53d0223fd --- /dev/null +++ b/newlib/libc/include/setjmp.h @@ -0,0 +1,22 @@ +/* + setjmp.h + stubs for future use. +*/ + +#ifndef _SETJMP_H_ +#ifdef __cplusplus +extern "C" { +#endif +#define _SETJMP_H_ + +#include "_ansi.h" +#include + +void _EXFUN(longjmp,(jmp_buf __jmpb, int __retval)); +int _EXFUN(setjmp,(jmp_buf __jmpb)); + +#ifdef __cplusplus +} +#endif +#endif /* _SETJMP_H_ */ + diff --git a/newlib/libc/include/signal.h b/newlib/libc/include/signal.h new file mode 100644 index 000000000..311149146 --- /dev/null +++ b/newlib/libc/include/signal.h @@ -0,0 +1,37 @@ +#ifndef _SIGNAL_H_ +#ifdef __cplusplus +extern "C" { +#endif +#define _SIGNAL_H_ + +#include "_ansi.h" +#include + +typedef int sig_atomic_t; /* Atomic entity type (ANSI) */ + +#if defined(__STDC__) || defined(__cplusplus) +#define SIG_DFL ((void (*)(int))0) /* Default action */ +#define SIG_IGN ((void (*)(int))1) /* Ignore action */ +#define SIG_ERR ((void (*)(int))-1) /* Error return */ +#else +#define SIG_DFL ((void (*)())0) /* Default action */ +#define SIG_IGN ((void (*)())1) /* Ignore action */ +#define SIG_ERR ((void (*)())-1) /* Error return */ +#endif + +typedef void (*_sig_func_ptr) (int); + +struct _reent; + +_sig_func_ptr _EXFUN(_signal_r, (struct _reent *, int, _sig_func_ptr)); +int _EXFUN(_raise_r, (struct _reent *, int)); + +#ifndef _REENT_ONLY +_sig_func_ptr _EXFUN(signal, (int, _sig_func_ptr)); +int _EXFUN(raise, (int)); +#endif + +#ifdef __cplusplus +} +#endif +#endif /* _SIGNAL_H_ */ diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h new file mode 100644 index 000000000..2c2b46cf2 --- /dev/null +++ b/newlib/libc/include/stdio.h @@ -0,0 +1,313 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * @(#)stdio.h 5.3 (Berkeley) 3/15/86 + */ + +/* + * NB: to fit things in six character monocase externals, the + * stdio code uses the prefix `__s' for stdio objects, typically + * followed by a three-character attempt at a mnemonic. + */ + +#ifndef _STDIO_H_ +#ifdef __cplusplus +extern "C" { +#endif +#define _STDIO_H_ + +#include "_ansi.h" + +#define _FSTDIO /* ``function stdio'' */ + +#define __need_size_t +#include + +#define __need___va_list +#include + +/* + * defines __sFILE, _fpos_t. + * They must be defined there because struct _reent needs them (and we don't + * want reent.h to include this file. + */ + +#include + +typedef _fpos_t fpos_t; + +typedef struct __sFILE FILE; + +#define __SLBF 0x0001 /* line buffered */ +#define __SNBF 0x0002 /* unbuffered */ +#define __SRD 0x0004 /* OK to read */ +#define __SWR 0x0008 /* OK to write */ + /* RD and WR are never simultaneously asserted */ +#define __SRW 0x0010 /* open for reading & writing */ +#define __SEOF 0x0020 /* found EOF */ +#define __SERR 0x0040 /* found error */ +#define __SMBF 0x0080 /* _buf is from malloc */ +#define __SAPP 0x0100 /* fdopen()ed in append mode - so must write to end */ +#define __SSTR 0x0200 /* this is an sprintf/snprintf string */ +#define __SOPT 0x0400 /* do fseek() optimisation */ +#define __SNPT 0x0800 /* do not do fseek() optimisation */ +#define __SOFF 0x1000 /* set iff _offset is in fact correct */ +#define __SMOD 0x2000 /* true => fgetline modified _p text */ + +/* + * The following three definitions are for ANSI C, which took them + * from System V, which stupidly took internal interface macros and + * made them official arguments to setvbuf(), without renaming them. + * Hence, these ugly _IOxxx names are *supposed* to appear in user code. + * + * Although these happen to match their counterparts above, the + * implementation does not rely on that (so these could be renumbered). + */ +#define _IOFBF 0 /* setvbuf should set fully buffered */ +#define _IOLBF 1 /* setvbuf should set line buffered */ +#define _IONBF 2 /* setvbuf should set unbuffered */ + +#ifndef NULL +#define NULL 0 +#endif + +#define BUFSIZ 1024 +#define EOF (-1) + +#define FOPEN_MAX 20 /* must be <= OPEN_MAX */ +#define FILENAME_MAX 1024 /* must be <= PATH_MAX */ +#define L_tmpnam 1024 /* XXX must be == PATH_MAX */ +#ifndef __STRICT_ANSI__ +#define P_tmpdir "/tmp" +#endif + +#ifndef SEEK_SET +#define SEEK_SET 0 /* set file offset to offset */ +#endif +#ifndef SEEK_CUR +#define SEEK_CUR 1 /* set file offset to current plus offset */ +#endif +#ifndef SEEK_END +#define SEEK_END 2 /* set file offset to EOF plus offset */ +#endif + +#define TMP_MAX 26 + +#define stdin (_impure_ptr->_stdin) +#define stdout (_impure_ptr->_stdout) +#define stderr (_impure_ptr->_stderr) + +#define _stdin_r(x) ((x)->_stdin) +#define _stdout_r(x) ((x)->_stdout) +#define _stderr_r(x) ((x)->_stderr) + +/* + * Functions defined in ANSI C standard. + */ + +#ifdef __GNUC__ +#define __VALIST __gnuc_va_list +#else +#define __VALIST char* +#endif + +#ifndef _REENT_ONLY +int _EXFUN(remove, (const char *)); +int _EXFUN(rename, (const char *, const char *)); +#endif +char * _EXFUN(tempnam, (const char *, const char *)); +FILE * _EXFUN(tmpfile, (void)); +char * _EXFUN(tmpnam, (char *)); +int _EXFUN(fclose, (FILE *)); +int _EXFUN(fflush, (FILE *)); +FILE * _EXFUN(freopen, (const char *, const char *, FILE *)); +void _EXFUN(setbuf, (FILE *, char *)); +int _EXFUN(setvbuf, (FILE *, char *, int, size_t)); +int _EXFUN(fprintf, (FILE *, const char *, ...)); +int _EXFUN(fscanf, (FILE *, const char *, ...)); +int _EXFUN(printf, (const char *, ...)); +int _EXFUN(scanf, (const char *, ...)); +int _EXFUN(sscanf, (const char *, const char *, ...)); +int _EXFUN(vfprintf, (FILE *, const char *, __VALIST)); +int _EXFUN(vprintf, (const char *, __VALIST)); +int _EXFUN(vsprintf, (char *, const char *, __VALIST)); +int _EXFUN(vsnprintf, (char *, size_t, const char *, __VALIST)); +int _EXFUN(fgetc, (FILE *)); +char * _EXFUN(fgets, (char *, int, FILE *)); +int _EXFUN(fputc, (int, FILE *)); +int _EXFUN(fputs, (const char *, FILE *)); +int _EXFUN(getc, (FILE *)); +int _EXFUN(getchar, (void)); +char * _EXFUN(gets, (char *)); +int _EXFUN(putc, (int, FILE *)); +int _EXFUN(putchar, (int)); +int _EXFUN(puts, (const char *)); +int _EXFUN(ungetc, (int, FILE *)); +size_t _EXFUN(fread, (_PTR, size_t _size, size_t _n, FILE *)); +size_t _EXFUN(fwrite, (const _PTR , size_t _size, size_t _n, FILE *)); +int _EXFUN(fgetpos, (FILE *, fpos_t *)); +int _EXFUN(fseek, (FILE *, long, int)); +int _EXFUN(fsetpos, (FILE *, const fpos_t *)); +long _EXFUN(ftell, ( FILE *)); +void _EXFUN(rewind, (FILE *)); +void _EXFUN(clearerr, (FILE *)); +int _EXFUN(feof, (FILE *)); +int _EXFUN(ferror, (FILE *)); +void _EXFUN(perror, (const char *)); +#ifndef _REENT_ONLY +FILE * _EXFUN(fopen, (const char *_name, const char *_type)); +int _EXFUN(sprintf, (char *, const char *, ...)); +int _EXFUN(snprintf, (char *, size_t, const char *, ...)); +#endif +#ifndef __STRICT_ANSI__ +int _EXFUN(vfiprintf, (FILE *, const char *, __VALIST)); +int _EXFUN(iprintf, (const char *, ...)); +int _EXFUN(fiprintf, (FILE *, const char *, ...)); +int _EXFUN(siprintf, (char *, const char *, ...)); +#endif + +/* + * Routines in POSIX 1003.1. + */ + +#ifndef __STRICT_ANSI__ +#ifndef _REENT_ONLY +FILE * _EXFUN(fdopen, (int, const char *)); +#endif +int _EXFUN(fileno, (FILE *)); +int _EXFUN(getw, (FILE *)); +int _EXFUN(pclose, (FILE *)); +FILE * _EXFUN(popen, (const char *, const char *)); +int _EXFUN(putw, (int, FILE *)); +void _EXFUN(setbuffer, (FILE *, char *, int)); +int _EXFUN(setlinebuf, (FILE *)); +#endif + +/* + * Recursive versions of the above. + */ + +FILE * _EXFUN(_fdopen_r, (struct _reent *, int, const char *)); +FILE * _EXFUN(_fopen_r, (struct _reent *, const char *, const char *)); +int _EXFUN(_getchar_r, (struct _reent *)); +char * _EXFUN(_gets_r, (struct _reent *, char *)); +int _EXFUN(_iprintf_r, (struct _reent *, const char *, ...)); +int _EXFUN(_mkstemp_r, (struct _reent *, char *)); +char * _EXFUN(_mktemp_r, (struct _reent *, char *)); +void _EXFUN(_perror_r, (struct _reent *, const char *)); +int _EXFUN(_printf_r, (struct _reent *, const char *, ...)); +int _EXFUN(_putchar_r, (struct _reent *, int)); +int _EXFUN(_puts_r, (struct _reent *, const char *)); +int _EXFUN(_remove_r, (struct _reent *, const char *)); +int _EXFUN(_rename_r, (struct _reent *, + const char *_old, const char *_new)); +int _EXFUN(_scanf_r, (struct _reent *, const char *, ...)); +int _EXFUN(_sprintf_r, (struct _reent *, char *, const char *, ...)); +int _EXFUN(_snprintf_r, (struct _reent *, char *, size_t, const char *, ...)); +char * _EXFUN(_tempnam_r, (struct _reent *, const char *, const char *)); +FILE * _EXFUN(_tmpfile_r, (struct _reent *)); +char * _EXFUN(_tmpnam_r, (struct _reent *, char *)); +int _EXFUN(_vfprintf_r, (struct _reent *, FILE *, const char *, __VALIST)); +int _EXFUN(_vprintf_r, (struct _reent *, const char *, __VALIST)); +int _EXFUN(_vsprintf_r, (struct _reent *, char *, const char *, __VALIST)); +int _EXFUN(_vsnprintf_r, (struct _reent *, char *, size_t, const char *, __VALIST)); + +/* + * Routines internal to the implementation. + */ + +int _EXFUN(__srget, (FILE *)); +int _EXFUN(__swbuf, (int, FILE *)); + +/* + * Stdio function-access interface. + */ + +#ifndef __STRICT_ANSI__ +FILE *_EXFUN(funopen,(const _PTR _cookie, + int (*readfn)(_PTR _cookie, char *_buf, int _n), + int (*writefn)(_PTR _cookie, const char *_buf, int _n), + fpos_t (*seekfn)(_PTR _cookie, fpos_t _off, int _whence), + int (*closefn)(_PTR _cookie))); + +#define fropen(cookie, fn) funopen(cookie, fn, (int (*)())0, (fpos_t (*)())0, (int (*)())0) +#define fwopen(cookie, fn) funopen(cookie, (int (*)())0, fn, (fpos_t (*)())0, (int (*)())0) +#endif + +/* + * The __sfoo macros are here so that we can + * define function versions in the C library. + */ +#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++)) +#ifdef _never /* __GNUC__ */ +/* If this inline is actually used, then systems using coff debugging + info get hopelessly confused. 21sept93 rich@cygnus.com. */ +static __inline int __sputc(int _c, FILE *_p) { + if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) + return (*_p->_p++ = _c); + else + return (__swbuf(_c, _p)); +} +#else +/* + * This has been tuned to generate reasonable code on the vax using pcc + */ +#define __sputc(c, p) \ + (--(p)->_w < 0 ? \ + (p)->_w >= (p)->_lbfsize ? \ + (*(p)->_p = (c)), *(p)->_p != '\n' ? \ + (int)*(p)->_p++ : \ + __swbuf('\n', p) : \ + __swbuf((int)(c), p) : \ + (*(p)->_p = (c), (int)*(p)->_p++)) +#endif + +#define __sfeof(p) (((p)->_flags & __SEOF) != 0) +#define __sferror(p) (((p)->_flags & __SERR) != 0) +#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) +#define __sfileno(p) ((p)->_file) + +#define feof(p) __sfeof(p) +#define ferror(p) __sferror(p) +#define clearerr(p) __sclearerr(p) + +#if 0 /*ndef __STRICT_ANSI__ - FIXME: must initialize stdio first, use fn */ +#define fileno(p) __sfileno(p) +#endif + +#ifndef lint +#define getc(fp) __sgetc(fp) +#define putc(x, fp) __sputc(x, fp) +#endif /* lint */ + +#define getchar() getc(stdin) +#define putchar(x) putc(x, stdout) + +#ifndef __STRICT_ANSI__ +/* fast always-buffered version, true iff error */ +#define fast_putc(x,p) (--(p)->_w < 0 ? \ + __swbuf((int)(x), p) == EOF : (*(p)->_p = (x), (p)->_p++, 0)) + +#define L_cuserid 9 /* posix says it goes in stdio.h :( */ +#ifdef __CYGWIN32__ +#define L_ctermid 16 +#endif +#endif + +#ifdef __cplusplus +} +#endif +#endif /* _STDIO_H_ */ diff --git a/newlib/libc/include/stdlib.h b/newlib/libc/include/stdlib.h new file mode 100644 index 000000000..8c21de647 --- /dev/null +++ b/newlib/libc/include/stdlib.h @@ -0,0 +1,142 @@ +/* + * stdlib.h + * + * Definitions for common types, variables, and functions. + */ + +#ifndef _STDLIB_H_ +#ifdef __cplusplus +extern "C" { +#endif +#define _STDLIB_H_ + +#include "_ansi.h" + +#define __need_size_t +#define __need_wchar_t +#include + +#include + +typedef struct +{ + int quot; /* quotient */ + int rem; /* remainder */ +} div_t; + +typedef struct +{ + long quot; /* quotient */ + long rem; /* remainder */ +} ldiv_t; + +#ifndef NULL +#define NULL 0 +#endif + +#define EXIT_FAILURE 1 +#define EXIT_SUCCESS 0 + +#define RAND_MAX 0x7fffffff + +#if (defined(__CYGWIN__) || defined(__CYGWIN32__)) && ! defined(_COMPILING_NEWLIB) +extern __declspec(dllimport) int __mb_cur_max; +#else +extern int __mb_cur_max; +#endif + +#define MB_CUR_MAX __mb_cur_max + +_VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((noreturn))); +int _EXFUN(abs,(int)); +int _EXFUN(atexit,(_VOID (*__func)(_VOID))); +double _EXFUN(atof,(const char *__nptr)); +#ifndef __STRICT_ANSI__ +float _EXFUN(atoff,(const char *__nptr)); +#endif +int _EXFUN(atoi,(const char *__nptr)); +long _EXFUN(atol,(const char *__nptr)); +_PTR _EXFUN(bsearch,(const _PTR __key, + const _PTR __base, + size_t __nmemb, + size_t __size, + int _EXFUN((*_compar),(const _PTR, const _PTR)))); +_PTR _EXFUN(calloc,(size_t __nmemb, size_t __size)); +div_t _EXFUN(div,(int __numer, int __denom)); +_VOID _EXFUN(exit,(int __status) _ATTRIBUTE ((noreturn))); +_VOID _EXFUN(free,(_PTR)); +char * _EXFUN(getenv,(const char *__string)); +char * _EXFUN(_getenv_r,(struct _reent *, const char *__string)); +char * _EXFUN(_findenv,(_CONST char *, int *)); +char * _EXFUN(_findenv_r,(struct _reent *, _CONST char *, int *)); +long _EXFUN(labs,(long)); +ldiv_t _EXFUN(ldiv,(long __numer, long __denom)); +_PTR _EXFUN(malloc,(size_t __size)); +int _EXFUN(mblen,(const char *, size_t)); +int _EXFUN(_mblen_r,(struct _reent *, const char *, size_t, int *)); +int _EXFUN(mbtowc,(wchar_t *, const char *, size_t)); +int _EXFUN(_mbtowc_r,(struct _reent *, wchar_t *, const char *, size_t, int *)); +int _EXFUN(wctomb,(char *, wchar_t)); +int _EXFUN(_wctomb_r,(struct _reent *, char *, wchar_t, int *)); +size_t _EXFUN(mbstowcs,(wchar_t *, const char *, size_t)); +size_t _EXFUN(_mbstowcs_r,(struct _reent *, wchar_t *, const char *, size_t, int *)); +size_t _EXFUN(wcstombs,(char *, const wchar_t *, size_t)); +size_t _EXFUN(_wcstombs_r,(struct _reent *, char *, const wchar_t *, size_t, int *)); +_VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, int(*_compar)(const _PTR, const _PTR))); +int _EXFUN(rand,(_VOID)); +_PTR _EXFUN(realloc,(_PTR __r, size_t __size)); +_VOID _EXFUN(srand,(unsigned __seed)); +double _EXFUN(strtod,(const char *__n, char **_end_PTR)); +#ifndef __STRICT_ANSI__ +float _EXFUN(strtodf,(const char *__n, char **_end_PTR)); +#endif +long _EXFUN(strtol,(const char *__n, char **_end_PTR, int __base)); +unsigned long _EXFUN(strtoul,(const char *_n_PTR, char **_end_PTR, int __base)); +unsigned long _EXFUN(_strtoul_r,(struct _reent *,const char *_n_PTR, char **_end_PTR, int __base)); +int _EXFUN(system,(const char *__string)); + +#ifndef __STRICT_ANSI__ +_VOID _EXFUN(cfree,(_PTR)); +int _EXFUN(putenv,(const char *__string)); +int _EXFUN(_putenv_r,(struct _reent *, const char *__string)); +int _EXFUN(setenv,(const char *__string, const char *__value, int __overwrite)); +int _EXFUN(_setenv_r,(struct _reent *, const char *__string, const char *__value, int __overwrite)); + +char * _EXFUN(gcvt,(double,int,char *)); +char * _EXFUN(gcvtf,(float,int,char *)); +char * _EXFUN(fcvt,(double,int,int *,int *)); +char * _EXFUN(fcvtf,(float,int,int *,int *)); +char * _EXFUN(ecvt,(double,int,int *,int *)); +char * _EXFUN(ecvtbuf,(double, int, int*, int*, char *)); +char * _EXFUN(fcvtbuf,(double, int, int*, int*, char *)); +char * _EXFUN(ecvtf,(float,int,int *,int *)); +char * _EXFUN(dtoa,(double, int, int, int *, int*, char**)); +int _EXFUN(rand_r,(unsigned *__seed)); + +#ifdef __CYGWIN32__ +char * _EXFUN(realpath,(const char *, char *)); +void _EXFUN(unsetenv,(const char *__string)); +void _EXFUN(_unsetenv_r,(struct _reent *, const char *__string)); +int _EXFUN(random,(_VOID)); +long _EXFUN(srandom,(unsigned __seed)); +char * _EXFUN(ptsname, (int)); +int _EXFUN(grantpt, (int)); +int _EXFUN(unlockpt,(int)); +#endif + +#endif /* ! __STRICT_ANSI__ */ + +char * _EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**)); +_PTR _EXFUN(_malloc_r,(struct _reent *, size_t)); +_PTR _EXFUN(_calloc_r,(struct _reent *, size_t, size_t)); +_VOID _EXFUN(_free_r,(struct _reent *, _PTR)); +_PTR _EXFUN(_realloc_r,(struct _reent *, _PTR, size_t)); +_VOID _EXFUN(_mstats_r,(struct _reent *, char *)); +int _EXFUN(_system_r,(struct _reent *, const char *)); + +_VOID _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *)); + +#ifdef __cplusplus +} +#endif +#endif /* _STDLIB_H_ */ diff --git a/newlib/libc/include/string.h b/newlib/libc/include/string.h new file mode 100644 index 000000000..a9494f826 --- /dev/null +++ b/newlib/libc/include/string.h @@ -0,0 +1,92 @@ +/* + * string.h + * + * Definitions for memory and string functions. + */ + +#ifndef _STRING_H_ +#define _STRING_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "_ansi.h" +#include + +#define __need_size_t +#include + +#ifndef NULL +#define NULL 0 +#endif + +_PTR _EXFUN(memchr,(const _PTR, int, size_t)); +int _EXFUN(memcmp,(const _PTR, const _PTR, size_t)); +_PTR _EXFUN(memcpy,(_PTR, const _PTR, size_t)); +_PTR _EXFUN(memmove,(_PTR, const _PTR, size_t)); +_PTR _EXFUN(memset,(_PTR, int, size_t)); +char *_EXFUN(strcat,(char *, const char *)); +char *_EXFUN(strchr,(const char *, int)); +int _EXFUN(strcmp,(const char *, const char *)); +int _EXFUN(strcoll,(const char *, const char *)); +char *_EXFUN(strcpy,(char *, const char *)); +size_t _EXFUN(strcspn,(const char *, const char *)); +char *_EXFUN(strerror,(int)); +size_t _EXFUN(strlen,(const char *)); +char *_EXFUN(strncat,(char *, const char *, size_t)); +int _EXFUN(strncmp,(const char *, const char *, size_t)); +char *_EXFUN(strncpy,(char *, const char *, size_t)); +char *_EXFUN(strpbrk,(const char *, const char *)); +char *_EXFUN(strrchr,(const char *, int)); +size_t _EXFUN(strspn,(const char *, const char *)); +char *_EXFUN(strstr,(const char *, const char *)); + +#ifndef _REENT_ONLY +char *_EXFUN(strtok,(char *, const char *)); +#endif + +size_t _EXFUN(strxfrm,(char *, const char *, size_t)); + +#ifndef __STRICT_ANSI__ +char *_EXFUN(strtok_r,(char *, const char *, char **)); + +int _EXFUN(bcmp,(const char *, const char *, size_t)); +void _EXFUN(bcopy,(const char *, char *, size_t)); +void _EXFUN(bzero,(char *, size_t)); +int _EXFUN(ffs,(int)); +char *_EXFUN(index,(const char *, int)); +_PTR _EXFUN(memccpy,(_PTR, const _PTR, int, size_t)); +char *_EXFUN(rindex,(const char *, int)); +int _EXFUN(strcasecmp,(const char *, const char *)); +char *_EXFUN(strdup,(const char *)); +char *_EXFUN(_strdup_r,(struct _reent *, const char *)); +int _EXFUN(strncasecmp,(const char *, const char *, size_t)); +char *_EXFUN(strsep,(char **, const char *)); +char *_EXFUN(strlwr,(char *)); +char *_EXFUN(strupr,(char *)); +#ifdef __CYGWIN32__ +char *_EXFUN(strsignal, (int __signo)); +int _EXFUN(strtosigno, (const char *__name)); +#endif + +/* These function names are used on Windows and perhaps other systems. */ +#ifndef strcmpi +#define strcmpi strcasecmp +#endif +#ifndef stricmp +#define stricmp strcasecmp +#endif +#ifndef strncmpi +#define strncmpi strncasecmp +#endif +#ifndef strnicmp +#define strnicmp strncasecmp +#endif + +#endif /* ! __STRICT_ANSI__ */ + +#ifdef __cplusplus +} +#endif +#endif /* _STRING_H_ */ diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h new file mode 100644 index 000000000..8186f2d9d --- /dev/null +++ b/newlib/libc/include/sys/_types.h @@ -0,0 +1,15 @@ +/* ANSI C namespace clean utility typedefs */ + +/* This file defines various typedefs needed by the system calls that support + the C library. Basically, they're just the POSIX versions with an '_' + prepended. This file lives in the `sys' directory so targets can provide + their own if desired (or they can put target dependant conditionals here). +*/ + +#ifndef _SYS__TYPES_H +#define _SYS__TYPES_H + +typedef long _off_t; +typedef long _ssize_t; + +#endif /* _SYS__TYPES_H */ diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h new file mode 100644 index 000000000..e274119bc --- /dev/null +++ b/newlib/libc/include/sys/config.h @@ -0,0 +1,115 @@ +#ifndef __SYS_CONFIG_H__ +#define __SYS_CONFIG_H__ + +/* exceptions first */ +/* ??? Why is much of this stuff duplicated with machine/ieeefp.h? */ +#if defined(__H8300__) || defined(__H8500__) || defined (__H8300H__) || defined(__W65__) || defined (__H8300S__) +#define _FLOAT_ARG float +#define __SMALL_BITFIELDS +#define _DOUBLE_IS_32BITS +#define __IEEE_BIG_ENDIAN +/* ??? This conditional is true for the h8500 and the w65, defining H8300 + in those cases probably isn't the right thing to do. */ +#define H8300 1 +#endif + +#ifdef __W65__ +#define _DOUBLE_IS_32BITS +#define __SMALL_BITFIELDS +#define __IEEE_BIG_ENDIAN +#undef INT_MAX +#undef UINT_MAX +#define INT_MAX 32767 +#define UINT_MAX 65535 + +#endif + +/* 16 bit integer machines */ +#if defined(__Z8001__) || defined(__Z8002__) || defined(__H8300__) || defined(__H8500__) || defined(__W65__) || defined (__H8300H__) || defined (__H8300S__) || defined (__mn10200__) + +#undef INT_MAX +#undef UINT_MAX +#define INT_MAX 32767 +#define UINT_MAX 65535 +#endif + +#if defined(__D10V__) +#undef INT_MAX +#undef UINT_MAX +#define INT_MAX __INT_MAX__ +#define UINT_MAX (__INT_MAX__ * 2U + 1) +#define _DOUBLE_IS_32BITS +#define _POINTER_INT short +#define __IEEE_BIG_ENDIAN +#endif + +#ifdef ___AM29K__ +#define _FLOAT_RET double +#endif + +#ifdef __i386__ +#ifndef __unix__ +/* in other words, go32 */ +#define _FLOAT_RET double +#endif +#endif + +#ifdef __M32R__ +#define __IEEE_BIG_ENDIAN +#endif + +#ifdef __m68k__ +/* This is defined in machine/ieeefp.h; need to check is it redundant here? */ +#define __IEEE_BIG_ENDIAN +#endif + +#ifdef __mn10300__ +#define __IEEE_LITTLE_ENDIAN +#endif + +#ifdef __mn10200__ +#define _DOUBLE_IS_32BITS +#define __SMALL_BITFIELDS +#define __IEEE_LITTLE_ENDIAN +#endif + +#ifdef __TIC80__ +#define __IEEE_LITTLE_ENDIAN +#endif + +#ifdef __v850 +#define __IEEE_LITTLE_ENDIAN +#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__sda__)) +#endif + +#ifdef __D30V__ +#define __IEEE_BIG_ENDIAN +#endif + +/* For the PowerPC eabi, force the _impure_ptr to be in .sdata */ +#if defined(__PPC__) && defined(_CALL_SYSV) +#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) +#endif + +#ifdef __sparc__ +#ifdef __LITTLE_ENDIAN_DATA__ +#define __IEEE_LITTLE_ENDIAN +#else +#define __IEEE_BIG_ENDIAN +#endif +#endif + +#if INT_MAX == 32767 +typedef long int __int32_t; +typedef unsigned long int __uint32_t; +#else +typedef int __int32_t; +typedef unsigned int __uint32_t; +#endif + +#ifndef _POINTER_INT +#define _POINTER_INT long +#endif + + +#endif /* __SYS_CONFIG_H__ */ diff --git a/newlib/libc/include/sys/dirent.h b/newlib/libc/include/sys/dirent.h new file mode 100644 index 000000000..f2f2342d5 --- /dev/null +++ b/newlib/libc/include/sys/dirent.h @@ -0,0 +1,15 @@ +/* includes , which is this file. On a + system which supports , this file is overridden by + dirent.h in the libc/sys/.../sys directory. On a system which does + not support , we will get this file which tries to find + any other which may be lurking around. If there isn't + one, the user will get an error indicating that there is no + . */ + +#ifdef __cplusplus +extern "C" { +#endif +#include_next +#ifdef __cplusplus +} +#endif diff --git a/newlib/libc/include/sys/errno.h b/newlib/libc/include/sys/errno.h new file mode 100644 index 000000000..0247fa232 --- /dev/null +++ b/newlib/libc/include/sys/errno.h @@ -0,0 +1,154 @@ +/* errno is not a global variable, because that would make using it + non-reentrant. Instead, its address is returned by the function + __errno. */ + +#ifndef _SYS_ERRNO_H_ +#ifdef __cplusplus +extern "C" { +#endif +#define _SYS_ERRNO_H_ + +#include + +#ifndef _REENT_ONLY +#define errno (*__errno()) +extern int *__errno _PARAMS ((void)); +#endif + +#if !defined(__CYGWIN32__) || defined(__INSIDE_CYGWIN__) +extern _CONST char * _CONST _sys_errlist[]; +extern int _sys_nerr; +#else +extern _CONST char * _CONST _sys_errlist[] __declspec(dllimport); +extern int _sys_nerr __declspec(dllimport); +#endif + +#define __errno_r(ptr) ((ptr)->_errno) + +#define EPERM 1 /* Not super-user */ +#define ENOENT 2 /* No such file or directory */ +#define ESRCH 3 /* No such process */ +#define EINTR 4 /* Interrupted system call */ +#define EIO 5 /* I/O error */ +#define ENXIO 6 /* No such device or address */ +#define E2BIG 7 /* Arg list too long */ +#define ENOEXEC 8 /* Exec format error */ +#define EBADF 9 /* Bad file number */ +#define ECHILD 10 /* No children */ +#define EAGAIN 11 /* No more processes */ +#define ENOMEM 12 /* Not enough core */ +#define EACCES 13 /* Permission denied */ +#define EFAULT 14 /* Bad address */ +#define ENOTBLK 15 /* Block device required */ +#define EBUSY 16 /* Mount device busy */ +#define EEXIST 17 /* File exists */ +#define EXDEV 18 /* Cross-device link */ +#define ENODEV 19 /* No such device */ +#define ENOTDIR 20 /* Not a directory */ +#define EISDIR 21 /* Is a directory */ +#define EINVAL 22 /* Invalid argument */ +#define ENFILE 23 /* Too many open files in system */ +#define EMFILE 24 /* Too many open files */ +#define ENOTTY 25 /* Not a typewriter */ +#define ETXTBSY 26 /* Text file busy */ +#define EFBIG 27 /* File too large */ +#define ENOSPC 28 /* No space left on device */ +#define ESPIPE 29 /* Illegal seek */ +#define EROFS 30 /* Read only file system */ +#define EMLINK 31 /* Too many links */ +#define EPIPE 32 /* Broken pipe */ +#define EDOM 33 /* Math arg out of domain of func */ +#define ERANGE 34 /* Math result not representable */ +#define ENOMSG 35 /* No message of desired type */ +#define EIDRM 36 /* Identifier removed */ +#define ECHRNG 37 /* Channel number out of range */ +#define EL2NSYNC 38 /* Level 2 not synchronized */ +#define EL3HLT 39 /* Level 3 halted */ +#define EL3RST 40 /* Level 3 reset */ +#define ELNRNG 41 /* Link number out of range */ +#define EUNATCH 42 /* Protocol driver not attached */ +#define ENOCSI 43 /* No CSI structure available */ +#define EL2HLT 44 /* Level 2 halted */ +#define EDEADLK 45 /* Deadlock condition */ +#define ENOLCK 46 /* No record locks available */ +#define EBADE 50 /* Invalid exchange */ +#define EBADR 51 /* Invalid request descriptor */ +#define EXFULL 52 /* Exchange full */ +#define ENOANO 53 /* No anode */ +#define EBADRQC 54 /* Invalid request code */ +#define EBADSLT 55 /* Invalid slot */ +#define EDEADLOCK 56 /* File locking deadlock error */ +#define EBFONT 57 /* Bad font file fmt */ +#define ENOSTR 60 /* Device not a stream */ +#define ENODATA 61 /* No data (for no delay io) */ +#define ETIME 62 /* Timer expired */ +#define ENOSR 63 /* Out of streams resources */ +#define ENONET 64 /* Machine is not on the network */ +#define ENOPKG 65 /* Package not installed */ +#define EREMOTE 66 /* The object is remote */ +#define ENOLINK 67 /* The link has been severed */ +#define EADV 68 /* Advertise error */ +#define ESRMNT 69 /* Srmount error */ +#define ECOMM 70 /* Communication error on send */ +#define EPROTO 71 /* Protocol error */ +#define EMULTIHOP 74 /* Multihop attempted */ +#define ELBIN 75 /* Inode is remote (not really error) */ +#define EDOTDOT 76 /* Cross mount point (not really error) */ +#define EBADMSG 77 /* Trying to read unreadable message */ +#define ENOTUNIQ 80 /* Given log. name not unique */ +#define EBADFD 81 /* f.d. invalid for this operation */ +#define EREMCHG 82 /* Remote address changed */ +#define ELIBACC 83 /* Can't access a needed shared lib */ +#define ELIBBAD 84 /* Accessing a corrupted shared lib */ +#define ELIBSCN 85 /* .lib section in a.out corrupted */ +#define ELIBMAX 86 /* Attempting to link in too many libs */ +#define ELIBEXEC 87 /* Attempting to exec a shared library */ +#define ENOSYS 88 /* Function not implemented */ +#define ENMFILE 89 /* No more files */ +#define ENOTEMPTY 90 /* Directory not empty */ +#define ENAMETOOLONG 91 /* File or path name too long */ +#define ELOOP 92 /* Too many symbolic links */ +#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ +#define EPFNOSUPPORT 96 /* Protocol family not supported */ +#define ECONNRESET 104 /* Connection reset by peer */ +#define ENOBUFS 105 /* No buffer space available */ +#define EAFNOSUPPORT 106 +#define EPROTOTYPE 107 +#define ENOTSOCK 108 +#define ENOPROTOOPT 109 +#define ESHUTDOWN 110 +#define ECONNREFUSED 111 /* Connection refused */ +#define EADDRINUSE 112 /* Address already in use */ +#define ECONNABORTED 113 /* Connection aborted */ +#define ENETUNREACH 114 +#define ENETDOWN 115 +#define ETIMEDOUT 116 +#define EHOSTDOWN 117 +#define EHOSTUNREACH 118 +#define EINPROGRESS 119 +#define EALREADY 120 +#define EDESTADDRREQ 121 +#define EMSGSIZE 122 +#define EPROTONOSUPPORT 123 +#define ESOCKTNOSUPPORT 124 +#define EADDRNOTAVAIL 125 +#define ENETRESET 126 +#define EISCONN 127 +#define ENOTCONN 128 +#define ETOOMANYREFS 129 +#define EPROCLIM 130 +#define EUSERS 131 +#define EDQUOT 132 +#define ESTALE 133 +#define ENOTSUP 134 +#define ENOMEDIUM 135 + +/* From cygwin32. */ +#define EWOULDBLOCK EAGAIN /* Operation would block */ + +#define __ELASTERROR 2000 /* Users can add values starting here */ + +#ifdef __cplusplus +} +#endif +#endif /* _SYS_ERRNO_H */ diff --git a/newlib/libc/include/sys/fcntl.h b/newlib/libc/include/sys/fcntl.h new file mode 100644 index 000000000..ed32fab9b --- /dev/null +++ b/newlib/libc/include/sys/fcntl.h @@ -0,0 +1,178 @@ + +#ifndef _FCNTL_ +#ifdef __cplusplus +extern "C" { +#endif +#define _FCNTL_ +#include <_ansi.h> +#define _FOPEN (-1) /* from sys/file.h, kernel use only */ +#define _FREAD 0x0001 /* read enabled */ +#define _FWRITE 0x0002 /* write enabled */ +#define _FNDELAY 0x0004 /* non blocking I/O (4.2 style) */ +#define _FAPPEND 0x0008 /* append (writes guaranteed at the end) */ +#define _FMARK 0x0010 /* internal; mark during gc() */ +#define _FDEFER 0x0020 /* internal; defer for next gc pass */ +#define _FASYNC 0x0040 /* signal pgrp when data ready */ +#define _FSHLOCK 0x0080 /* BSD flock() shared lock present */ +#define _FEXLOCK 0x0100 /* BSD flock() exclusive lock present */ +#define _FCREAT 0x0200 /* open with file create */ +#define _FTRUNC 0x0400 /* open with truncation */ +#define _FEXCL 0x0800 /* error on open if file exists */ +#define _FNBIO 0x1000 /* non blocking I/O (sys5 style) */ +#define _FSYNC 0x2000 /* do all writes synchronously */ +#define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */ +#define _FNOCTTY 0x8000 /* don't assign a ctty on this open */ + +#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) + +/* + * Flag values for open(2) and fcntl(2) + * The kernel adds 1 to the open modes to turn it into some + * combination of FREAD and FWRITE. + */ +#define O_RDONLY 0 /* +1 == FREAD */ +#define O_WRONLY 1 /* +1 == FWRITE */ +#define O_RDWR 2 /* +1 == FREAD|FWRITE */ +#define O_APPEND _FAPPEND +#define O_CREAT _FCREAT +#define O_TRUNC _FTRUNC +#define O_EXCL _FEXCL +/* O_SYNC _FSYNC not posix, defined below */ +/* O_NDELAY _FNDELAY set in include/fcntl.h */ +/* O_NDELAY _FNBIO set in 5include/fcntl.h */ +#define O_NONBLOCK _FNONBLOCK +#define O_NOCTTY _FNOCTTY +/* For machines which care - */ +#if defined (_WIN32) || defined (__CYGWIN__) +#define _FBINARY 0x10000 +#define _FTEXT 0x20000 +#define _FNOINHERIT 0x40000 + +#define O_BINARY _FBINARY +#define O_TEXT _FTEXT +#define O_NOINHERIT _FNOINHERIT + +/* The windows header files define versions with a leading underscore. */ +#define _O_RDONLY O_RDONLY +#define _O_WRONLY O_WRONLY +#define _O_RDWR O_RDWR +#define _O_APPEND O_APPEND +#define _O_CREAT O_CREAT +#define _O_TRUNC O_TRUNC +#define _O_EXCL O_EXCL +#define _O_TEXT O_TEXT +#define _O_BINARY O_BINARY +#define _O_RAW O_BINARY +#define _O_NOINHERIT O_NOINHERIT +#endif + +#ifndef _POSIX_SOURCE + +#define O_SYNC _FSYNC + +/* + * Flags that work for fcntl(fd, F_SETFL, FXXXX) + */ +#define FAPPEND _FAPPEND +#define FSYNC _FSYNC +#define FASYNC _FASYNC +#define FNBIO _FNBIO +#define FNONBIO _FNONBLOCK /* XXX fix to be NONBLOCK everywhere */ +#define FNDELAY _FNDELAY + +/* + * Flags that are disallowed for fcntl's (FCNTLCANT); + * used for opens, internal state, or locking. + */ +#define FREAD _FREAD +#define FWRITE _FWRITE +#define FMARK _FMARK +#define FDEFER _FDEFER +#define FSHLOCK _FSHLOCK +#define FEXLOCK _FEXLOCK + +/* + * The rest of the flags, used only for opens + */ +#define FOPEN _FOPEN +#define FCREAT _FCREAT +#define FTRUNC _FTRUNC +#define FEXCL _FEXCL +#define FNOCTTY _FNOCTTY + +#endif /* !_POSIX_SOURCE */ + +/* XXX close on exec request; must match UF_EXCLOSE in user.h */ +#define FD_CLOEXEC 1 /* posix */ + +/* fcntl(2) requests */ +#define F_DUPFD 0 /* Duplicate fildes */ +#define F_GETFD 1 /* Get fildes flags (close on exec) */ +#define F_SETFD 2 /* Set fildes flags (close on exec) */ +#define F_GETFL 3 /* Get file flags */ +#define F_SETFL 4 /* Set file flags */ +#ifndef _POSIX_SOURCE +#define F_GETOWN 5 /* Get owner - for ASYNC */ +#define F_SETOWN 6 /* Set owner - for ASYNC */ +#endif /* !_POSIX_SOURCE */ +#define F_GETLK 7 /* Get record-locking information */ +#define F_SETLK 8 /* Set or Clear a record-lock (Non-Blocking) */ +#define F_SETLKW 9 /* Set or Clear a record-lock (Blocking) */ +#ifndef _POSIX_SOURCE +#define F_RGETLK 10 /* Test a remote lock to see if it is blocked */ +#define F_RSETLK 11 /* Set or unlock a remote lock */ +#define F_CNVT 12 /* Convert a fhandle to an open fd */ +#define F_RSETLKW 13 /* Set or Clear remote record-lock(Blocking) */ +#endif /* !_POSIX_SOURCE */ + +/* fcntl(2) flags (l_type field of flock structure) */ +#define F_RDLCK 1 /* read lock */ +#define F_WRLCK 2 /* write lock */ +#define F_UNLCK 3 /* remove lock(s) */ +#ifndef _POSIX_SOURCE +#define F_UNLKSYS 4 /* remove remote locks for a given system */ +#endif /* !_POSIX_SOURCE */ + +/*#include */ + +/* file segment locking set data type - information passed to system by user */ +struct flock { + short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */ + short l_whence; /* flag to choose starting offset */ + long l_start; /* relative offset, in bytes */ + long l_len; /* length, in bytes; 0 means lock to EOF */ + short l_pid; /* returned with F_GETLK */ + short l_xxx; /* reserved for future use */ +}; + +#ifndef _POSIX_SOURCE +/* extended file segment locking set data type */ +struct eflock { + short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */ + short l_whence; /* flag to choose starting offset */ + long l_start; /* relative offset, in bytes */ + long l_len; /* length, in bytes; 0 means lock to EOF */ + short l_pid; /* returned with F_GETLK */ + short l_xxx; /* reserved for future use */ + long l_rpid; /* Remote process id wanting this lock */ + long l_rsys; /* Remote system id wanting this lock */ +}; +#endif /* !_POSIX_SOURCE */ + + +#include +#include /* sigh. for the mode bits for open/creat */ + +extern int open _PARAMS ((const char *, int, ...)); +extern int creat _PARAMS ((const char *, mode_t)); +extern int fcntl _PARAMS ((int, int, ...)); + +/* Provide _ prototypes for functions provided by some versions + of newlib. */ +extern int _open _PARAMS ((const char *, int, ...)); +extern int _fcntl _PARAMS ((int, int, ...)); + +#ifdef __cplusplus +} +#endif +#endif /* !_FCNTL_ */ diff --git a/newlib/libc/include/sys/file.h b/newlib/libc/include/sys/file.h new file mode 100644 index 000000000..58d4fac31 --- /dev/null +++ b/newlib/libc/include/sys/file.h @@ -0,0 +1,2 @@ + +#include diff --git a/newlib/libc/include/sys/param.h b/newlib/libc/include/sys/param.h new file mode 100644 index 000000000..3470ef5d0 --- /dev/null +++ b/newlib/libc/include/sys/param.h @@ -0,0 +1,18 @@ +/* This is a dummy file, not customized for any + particular system. If there is a param.h in libc/sys/SYSDIR/sys, + it will override this one. */ + +#ifndef _SYS_PARAM_H +# define _SYS_PARAM_H + +# define HZ (60) +# define NOFILE (60) +# define PATHSIZE (1024) + +#ifdef __i386__ +#define BIG_ENDIAN 4321 +#define LITTLE_ENDIAN 1234 +#define BYTE_ORDER LITTLE_ENDIAN +#endif + +#endif diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h new file mode 100644 index 000000000..110493675 --- /dev/null +++ b/newlib/libc/include/sys/reent.h @@ -0,0 +1,238 @@ +/* This header file provides the reentrancy. */ + +/* WARNING: All identifiers here must begin with an underscore. This file is + included by stdio.h and others and we therefore must only use identifiers + in the namespace allotted to us. */ + +#ifndef _SYS_REENT_H_ +#ifdef __cplusplus +extern "C" { +#endif +#define _SYS_REENT_H_ + +#include <_ansi.h> +#include + +#ifndef __Long +#if __LONG_MAX__ == 2147483647L +#define __Long long +typedef unsigned __Long __ULong; +#elif __INT_MAX__ == 2147483647 +#define __Long int +typedef unsigned __Long __ULong; +#endif +#endif + +#ifndef __Long +#define __Long __int32_t +typedef __uint32_t __ULong; +#endif + +struct _glue +{ + struct _glue *_next; + int _niobs; + struct __sFILE *_iobs; +}; + +struct _Bigint +{ + struct _Bigint *_next; + int _k, _maxwds, _sign, _wds; + __ULong _x[1]; +}; + +/* + * atexit() support + */ + +#define _ATEXIT_SIZE 32 /* must be at least 32 to guarantee ANSI conformance */ + +struct _atexit { + struct _atexit *_next; /* next in list */ + int _ind; /* next index in this table */ + void (*_fns[_ATEXIT_SIZE])(void); /* the table itself */ +}; + +/* + * Stdio buffers. + * + * This and __sFILE are defined here because we need them for struct _reent, + * but we don't want stdio.h included when stdlib.h is. + */ + +struct __sbuf { + unsigned char *_base; + int _size; +}; + +/* + * We need fpos_t for the following, but it doesn't have a leading "_", + * so we use _fpos_t instead. + */ + +typedef long _fpos_t; /* XXX must match off_t in */ + /* (and must be `long' for now) */ + +/* + * Stdio state variables. + * + * The following always hold: + * + * if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR), + * _lbfsize is -_bf._size, else _lbfsize is 0 + * if _flags&__SRD, _w is 0 + * if _flags&__SWR, _r is 0 + * + * This ensures that the getc and putc macros (or inline functions) never + * try to write or read from a file that is in `read' or `write' mode. + * (Moreover, they can, and do, automatically switch from read mode to + * write mode, and back, on "r+" and "w+" files.) + * + * _lbfsize is used only to make the inline line-buffered output stream + * code as compact as possible. + * + * _ub, _up, and _ur are used when ungetc() pushes back more characters + * than fit in the current _bf, or when ungetc() pushes back a character + * that does not match the previous one in _bf. When this happens, + * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff + * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. + */ + +struct __sFILE { + unsigned char *_p; /* current position in (some) buffer */ + int _r; /* read space left for getc() */ + int _w; /* write space left for putc() */ + short _flags; /* flags, below; this FILE is free if 0 */ + short _file; /* fileno, if Unix descriptor, else -1 */ + struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ + int _lbfsize; /* 0 or -_bf._size, for inline putc */ + + /* operations */ + _PTR _cookie; /* cookie passed to io functions */ + + int _EXFUN((*_read),(_PTR _cookie, char *_buf, int _n)); + int _EXFUN((*_write),(_PTR _cookie, const char *_buf, int _n)); + _fpos_t _EXFUN((*_seek),(_PTR _cookie, _fpos_t _offset, int _whence)); + int _EXFUN((*_close),(_PTR _cookie)); + + /* separate buffer for long sequences of ungetc() */ + struct __sbuf _ub; /* ungetc buffer */ + unsigned char *_up; /* saved _p when _p is doing ungetc data */ + int _ur; /* saved _r when _r is counting ungetc data */ + + /* tricks to meet minimum requirements even when malloc() fails */ + unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */ + unsigned char _nbuf[1]; /* guarantee a getc() buffer */ + + /* separate buffer for fgetline() when line crosses buffer boundary */ + struct __sbuf _lb; /* buffer for fgetline() */ + + /* Unix stdio files get aligned to block boundaries on fseek() */ + int _blksize; /* stat.st_blksize (may be != _bf._size) */ + int _offset; /* current lseek offset */ + + struct _reent *_data; +}; + +/* + * struct _reent + * + * This structure contains *all* globals needed by the library. + * It's raison d'etre is to facilitate threads by making all library routines + * reentrant. IE: All state information is contained here. + */ + +struct _reent +{ + /* local copy of errno */ + int _errno; + + /* FILE is a big struct and may change over time. To try to achieve binary + compatibility with future versions, put stdin,stdout,stderr here. + These are pointers into member __sf defined below. */ + struct __sFILE *_stdin, *_stdout, *_stderr; + + int _inc; /* used by tmpnam */ + char _emergency[25]; + + int _current_category; /* used by setlocale */ + _CONST char *_current_locale; + + int __sdidinit; /* 1 means stdio has been init'd */ + + void _EXFUN((*__cleanup),(struct _reent *)); + + /* used by mprec routines */ + struct _Bigint *_result; + int _result_k; + struct _Bigint *_p5s; + struct _Bigint **_freelist; + + /* used by some fp conversion routines */ + int _cvtlen; /* should be size_t */ + char *_cvtbuf; + + union + { + struct + { + unsigned int _rand_next; + char * _strtok_last; + char _asctime_buf[26]; + struct tm _localtime_buf; + int _gamma_signgam; + } _reent; + /* Two next two fields were once used by malloc. They are no longer + used. They are used to preserve the space used before so as to + allow addition of new reent fields and keep binary compatibility. */ + struct + { +#define _N_LISTS 30 + unsigned char * _nextf[_N_LISTS]; + unsigned int _nmalloc[_N_LISTS]; + } _unused; + } _new; + + /* atexit stuff */ + struct _atexit *_atexit; /* points to head of LIFO stack */ + struct _atexit _atexit0; /* one guaranteed table, required by ANSI */ + + /* signal info */ + void (**(_sig_func))(int); + + /* These are here last so that __sFILE can grow without changing the offsets + of the above members (on the off chance that future binary compatibility + would be broken otherwise). */ + struct _glue __sglue; /* root of glue chain */ + struct __sFILE __sf[3]; /* first three file descriptors */ +}; + +#define _REENT_INIT(var) \ + { 0, &var.__sf[0], &var.__sf[1], &var.__sf[2], 0, "", 0, "C", \ + 0, NULL, NULL, 0, NULL, NULL, 0, NULL, { {1, NULL, "", \ + { 0,0,0,0,0,0,0,0}, 0 } } } + +/* + * All references to struct _reent are via this pointer. + * Internally, newlib routines that need to reference it should use _REENT. + */ + +#ifndef __ATTRIBUTE_IMPURE_PTR__ +#define __ATTRIBUTE_IMPURE_PTR__ +#endif + +extern struct _reent *_impure_ptr __ATTRIBUTE_IMPURE_PTR__; + +void _reclaim_reent _PARAMS ((struct _reent *)); + +/* #define _REENT_ONLY define this to get only reentrant routines */ + +#ifndef _REENT_ONLY +#define _REENT _impure_ptr +#endif + +#ifdef __cplusplus +} +#endif +#endif /* _SYS_REENT_H_ */ diff --git a/newlib/libc/include/sys/resource.h b/newlib/libc/include/sys/resource.h new file mode 100644 index 000000000..eb827552c --- /dev/null +++ b/newlib/libc/include/sys/resource.h @@ -0,0 +1,15 @@ +#ifndef _SYS_RESOURCE_H_ +#define _SYS_RESOURCE_H_ + +#include + +#define RUSAGE_SELF 0 /* calling process */ +#define RUSAGE_CHILDREN -1 /* terminated child processes */ + +struct rusage { + struct timeval ru_utime; /* user time used */ + struct timeval ru_stime; /* system time used */ +}; + +#endif + diff --git a/newlib/libc/include/sys/signal.h b/newlib/libc/include/sys/signal.h new file mode 100644 index 000000000..00d25ead3 --- /dev/null +++ b/newlib/libc/include/sys/signal.h @@ -0,0 +1,182 @@ +/* sys/signal.h */ + +#ifndef _SYS_SIGNAL_H +#define _SYS_SIGNAL_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "_ansi.h" + +#ifndef __STRICT_ANSI__ +typedef unsigned long sigset_t; +struct sigaction +{ + void (*sa_handler)(int); + sigset_t sa_mask; + int sa_flags; +}; +#define SA_NOCLDSTOP 1 /* only value supported now for sa_flags */ +#define SIG_SETMASK 0 /* set mask with sigprocmask() */ +#define SIG_BLOCK 1 /* set of signals to block */ +#define SIG_UNBLOCK 2 /* set of signals to, well, unblock */ + +/* These depend upon the type of sigset_t, which right now + is always a long.. They're in the POSIX namespace, but + are not ANSI. */ +#define sigaddset(what,sig) (*(what) |= (1<<(sig))) +#define sigemptyset(what) (*(what) = 0) + +int sigprocmask (int __how, const sigset_t *__a, sigset_t *__b); + +/* protos for functions found in winsup sources */ +#if defined(__CYGWIN32__) +#undef sigaddset +#undef sigemptyset +/* The first argument to kill should be pid_t. Right now + always defines pid_t to be int. If that ever + changes, then we will need to do something else, perhaps along the + lines of . */ +int _EXFUN(kill, (int, int)); +int _EXFUN(sigaction, (int, const struct sigaction *, struct sigaction *)); +int _EXFUN(sigaddset, (sigset_t *, const int)); +int _EXFUN(sigdelset, (sigset_t *, const int)); +int _EXFUN(sigismember, (const sigset_t *, int)); +int _EXFUN(sigfillset, (sigset_t *)); +int _EXFUN(sigemptyset, (sigset_t *)); +int _EXFUN(sigpending, (sigset_t *)); +int _EXFUN(sigsuspend, (const sigset_t *)); +int _EXFUN(sigpause, (int)); +#endif + +#endif /* __STRICT_ANSI__ */ + +#if defined(___AM29K__) +/* These all need to be defined for ANSI C, but I don't think they are + meaningful. */ +#define SIGABRT 1 +#define SIGFPE 1 +#define SIGILL 1 +#define SIGINT 1 +#define SIGSEGV 1 +#define SIGTERM 1 +/* These need to be defined for POSIX, and some others do too. */ +#define SIGHUP 1 +#define SIGQUIT 1 +#define NSIG 2 +#elif defined(__GO32__) +#define SIGINT 1 +#define SIGKILL 2 +#define SIGPIPE 3 +#define SIGFPE 4 +#define SIGHUP 5 +#define SIGTERM 6 +#define SIGSEGV 7 +#define SIGTSTP 8 +#define SIGQUIT 9 +#define SIGTRAP 10 +#define SIGILL 11 +#define SIGEMT 12 +#define SIGALRM 13 +#define SIGBUS 14 +#define SIGLOST 15 +#define SIGSTOP 16 +#define SIGABRT 17 +#define SIGUSR1 18 +#define SIGUSR2 19 +#define NSIG 20 +#elif defined(__CYGWIN32__) /* BSD signals symantics */ +#define SIGHUP 1 /* hangup */ +#define SIGINT 2 /* interrupt */ +#define SIGQUIT 3 /* quit */ +#define SIGILL 4 /* illegal instruction (not reset when caught) */ +#define SIGTRAP 5 /* trace trap (not reset when caught) */ +#define SIGABRT 6 /* used by abort */ +#define SIGEMT 7 /* EMT instruction */ +#define SIGFPE 8 /* floating point exception */ +#define SIGKILL 9 /* kill (cannot be caught or ignored) */ +#define SIGBUS 10 /* bus error */ +#define SIGSEGV 11 /* segmentation violation */ +#define SIGSYS 12 /* bad argument to system call */ +#define SIGPIPE 13 /* write on a pipe with no one to read it */ +#define SIGALRM 14 /* alarm clock */ +#define SIGTERM 15 /* software termination signal from kill */ +#define SIGURG 16 /* urgent condition on IO channel */ +#define SIGSTOP 17 /* sendable stop signal not from tty */ +#define SIGTSTP 18 /* stop signal from tty */ +#define SIGCONT 19 /* continue a stopped process */ +#define SIGCHLD 20 /* to parent on child stop or exit */ +#define SIGCLD 20 /* System V name for SIGCHLD */ +#define SIGTTIN 21 /* to readers pgrp upon background tty read */ +#define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */ +#define SIGIO 23 /* input/output possible signal */ +#define SIGPOLL SIGIO /* System V name for SIGIO */ +#define SIGXCPU 24 /* exceeded CPU time limit */ +#define SIGXFSZ 25 /* exceeded file size limit */ +#define SIGVTALRM 26 /* virtual time alarm */ +#define SIGPROF 27 /* profiling time alarm */ +#define SIGWINCH 28 /* window changed */ +#define SIGLOST 29 /* resource lost (eg, record-lock lost) */ +#define SIGUSR1 30 /* user defined signal 1 */ +#define SIGUSR2 31 /* user defined signal 2 */ +#define NSIG 32 /* signal 0 implied */ +#else +#define SIGHUP 1 /* hangup */ +#define SIGINT 2 /* interrupt */ +#define SIGQUIT 3 /* quit */ +#define SIGILL 4 /* illegal instruction (not reset when caught) */ +#define SIGTRAP 5 /* trace trap (not reset when caught) */ +#define SIGIOT 6 /* IOT instruction */ +#define SIGABRT 6 /* used by abort, replace SIGIOT in the future */ +#define SIGEMT 7 /* EMT instruction */ +#define SIGFPE 8 /* floating point exception */ +#define SIGKILL 9 /* kill (cannot be caught or ignored) */ +#define SIGBUS 10 /* bus error */ +#define SIGSEGV 11 /* segmentation violation */ +#define SIGSYS 12 /* bad argument to system call */ +#define SIGPIPE 13 /* write on a pipe with no one to read it */ +#define SIGALRM 14 /* alarm clock */ +#define SIGTERM 15 /* software termination signal from kill */ + +#if defined(__svr4__) +/* svr4 specifics. different signals above 15, and sigaction. */ +#define SIGUSR1 16 +#define SIGUSR2 17 +#define SIGCLD 18 +#define SIGPWR 19 +#define SIGWINCH 20 +#define SIGPOLL 22 /* 20 for x.out binaries!!!! */ +#define SIGSTOP 23 /* sendable stop signal not from tty */ +#define SIGTSTP 24 /* stop signal from tty */ +#define SIGCONT 25 /* continue a stopped process */ +#define SIGTTIN 26 /* to readers pgrp upon background tty read */ +#define SIGTTOU 27 /* like TTIN for output if (tp->t_local<OSTOP) */ +#define NSIG 28 +#else +#define SIGURG 16 /* urgent condition on IO channel */ +#define SIGSTOP 17 /* sendable stop signal not from tty */ +#define SIGTSTP 18 /* stop signal from tty */ +#define SIGCONT 19 /* continue a stopped process */ +#define SIGCHLD 20 /* to parent on child stop or exit */ +#define SIGCLD 20 /* System V name for SIGCHLD */ +#define SIGTTIN 21 /* to readers pgrp upon background tty read */ +#define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */ +#define SIGIO 23 /* input/output possible signal */ +#define SIGPOLL SIGIO /* System V name for SIGIO */ +#define SIGXCPU 24 /* exceeded CPU time limit */ +#define SIGXFSZ 25 /* exceeded file size limit */ +#define SIGVTALRM 26 /* virtual time alarm */ +#define SIGPROF 27 /* profiling time alarm */ +#define SIGWINCH 28 /* window changed */ +#define SIGLOST 29 /* resource lost (eg, record-lock lost) */ +#define SIGUSR1 30 /* user defined signal 1 */ +#define SIGUSR2 31 /* user defined signal 2 */ +#define NSIG 32 /* signal 0 implied */ +#endif +#endif + +#ifdef __cplusplus +} +#endif +#endif /* _SYS_SIGNAL_H */ diff --git a/newlib/libc/include/sys/stat-dj.h b/newlib/libc/include/sys/stat-dj.h new file mode 100644 index 000000000..b533a167a --- /dev/null +++ b/newlib/libc/include/sys/stat-dj.h @@ -0,0 +1,59 @@ +/* This is file STAT.H */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#ifndef _STAT_H_ +#define _STAT_H_ + +struct stat { + short st_dev; + short st_ino; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + short st_rdev; + short st_align_for_word32; + long st_size; + long st_atime; + long st_mtime; + long st_ctime; + long st_blksize; +}; + +#define S_IFMT 0xF000 /* file type mask */ +#define S_IFDIR 0x4000 /* directory */ +#define S_IFIFO 0x1000 /* FIFO special */ +#define S_IFCHR 0x2000 /* character special */ +#define S_IFBLK 0x3000 /* block special */ +#define S_IFREG 0x8000 /* or just 0x0000, regular */ +#define S_IREAD 0x0100 /* owner may read */ +#define S_IWRITE 0x0080 /* owner may write */ +#define S_IEXEC 0x0040 /* owner may execute */ + +#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) +#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) +#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) +#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) + +#ifdef __cplusplus +extern "C" { +#endif +int stat(const char *, struct stat *); +int fstat(int, struct stat *); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/newlib/libc/include/sys/stat.h b/newlib/libc/include/sys/stat.h new file mode 100644 index 000000000..31dfaf49f --- /dev/null +++ b/newlib/libc/include/sys/stat.h @@ -0,0 +1,149 @@ +#ifndef _SYS_STAT_H +#define _SYS_STAT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <_ansi.h> +#include +#include + +#ifdef __i386__ +#ifdef __MSDOS__ +#include "stat-dj.h" +#endif +#endif + +/* dj's stat defines _STAT_H_ */ +#ifndef _STAT_H_ + +/* It is intended that the layout of this structure not change when the + sizes of any of the basic types change (short, int, long) [via a compile + time option]. */ + +struct stat +{ + dev_t st_dev; + ino_t st_ino; + mode_t st_mode; + nlink_t st_nlink; + uid_t st_uid; + gid_t st_gid; + dev_t st_rdev; + off_t st_size; + /* SysV/sco doesn't have the rest... But Solaris, eabi does. */ +#if defined(__svr4__) && !defined(__PPC__) && !defined(__sun__) + time_t st_atime; + time_t st_mtime; + time_t st_ctime; +#else + time_t st_atime; + long st_spare1; + time_t st_mtime; + long st_spare2; + time_t st_ctime; + long st_spare3; + long st_blksize; + long st_blocks; + long st_spare4[2]; +#endif +}; + +#define _IFMT 0170000 /* type of file */ +#define _IFDIR 0040000 /* directory */ +#define _IFCHR 0020000 /* character special */ +#define _IFBLK 0060000 /* block special */ +#define _IFREG 0100000 /* regular */ +#define _IFLNK 0120000 /* symbolic link */ +#define _IFSOCK 0140000 /* socket */ +#define _IFIFO 0010000 /* fifo */ + +#define S_BLKSIZE 1024 /* size of a block */ + +#define S_ISUID 0004000 /* set user id on execution */ +#define S_ISGID 0002000 /* set group id on execution */ +#ifndef _POSIX_SOURCE +#define S_ISVTX 0001000 /* save swapped text even after use */ +#define S_IREAD 0000400 /* read permission, owner */ +#define S_IWRITE 0000200 /* write permission, owner */ +#define S_IEXEC 0000100 /* execute/search permission, owner */ + +#define S_ENFMT 0002000 /* enforcement-mode locking */ + +#define S_IFMT _IFMT +#define S_IFDIR _IFDIR +#define S_IFCHR _IFCHR +#define S_IFBLK _IFBLK +#define S_IFREG _IFREG +#define S_IFLNK _IFLNK +#define S_IFSOCK _IFSOCK +#define S_IFIFO _IFIFO +#endif /* !_POSIX_SOURCE */ + +#ifdef _WIN32 +/* The Windows header files define _S_ forms of these, so we do too + for easier portability. */ +#define _S_IFMT _IFMT +#define _S_IFDIR _IFDIR +#define _S_IFCHR _IFCHR +#define _S_IFIFO _IFIFO +#define _S_IFREG _IFREG +#define _S_IREAD 0000400 +#define _S_IWRITE 0000200 +#define _S_IEXEC 0000100 +#endif + +#define S_IRWXU 0000700 /* rwx, owner */ +#define S_IRUSR 0000400 /* read permission, owner */ +#define S_IWUSR 0000200 /* write permission, owner */ +#define S_IXUSR 0000100 /* execute/search permission, owner */ +#define S_IRWXG 0000070 /* rwx, group */ +#define S_IRGRP 0000040 /* read permission, group */ +#define S_IWGRP 0000020 /* write permission, grougroup */ +#define S_IXGRP 0000010 /* execute/search permission, group */ +#define S_IRWXO 0000007 /* rwx, other */ +#define S_IROTH 0000004 /* read permission, other */ +#define S_IWOTH 0000002 /* write permission, other */ +#define S_IXOTH 0000001 /* execute/search permission, other */ + +#define S_ISBLK(m) (((m)&_IFMT) == _IFBLK) +#define S_ISCHR(m) (((m)&_IFMT) == _IFCHR) +#define S_ISDIR(m) (((m)&_IFMT) == _IFDIR) +#define S_ISFIFO(m) (((m)&_IFMT) == _IFIFO) +#define S_ISREG(m) (((m)&_IFMT) == _IFREG) +#define S_ISLNK(m) (((m)&_IFMT) == _IFLNK) +#define S_ISSOCK(m) (((m)&_IFMT) == _IFSOCK) + + +int _EXFUN(chmod,( const char *__path, mode_t __mode )); +int _EXFUN(fchmod,(int __fd, mode_t __mode)); +int _EXFUN(fstat,( int __fd, struct stat *__sbuf )); +int _EXFUN(mkdir,( const char *_path, mode_t __mode )); +int _EXFUN(mkfifo,( const char *__path, mode_t __mode )); +int _EXFUN(stat,( const char *__path, struct stat *__sbuf )); +mode_t _EXFUN(umask,( mode_t __mask )); + +#if defined(__rtems__) +int _EXFUN(mknod,( const char *_path, mode_t _mode, dev_t dev )); +#endif + +/* Provide prototypes for most of the _ names that are + provided in newlib for some compilers. */ +int _EXFUN(_fstat,( int __fd, struct stat *__sbuf )); +int _EXFUN(_stat,( const char *__path, struct stat *__sbuf )); + +#ifdef __CYGWIN32__ +int _EXFUN(lstat,( const char *__path, struct stat *__buf )); +#endif + +#if defined(__rtems__) +int _EXFUN(mknod,( const char *_path, mode_t _mode, dev_t dev )); +int _EXFUN(lstat,( const char *_path, struct stat *_sbuf )); +#endif + +#endif /* !_STAT_H_ */ +#ifdef __cplusplus +} +#endif +#endif /* _SYS_STAT_H */ diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h new file mode 100644 index 000000000..bc08820a5 --- /dev/null +++ b/newlib/libc/include/sys/time.h @@ -0,0 +1,51 @@ +/* time.h -- An implementation of the standard Unix file. + Written by Geoffrey Noer + Public domain; no rights reserved. */ + +#ifndef _SYS_TIME_H_ +#define _SYS_TIME_H_ + +#include <_ansi.h> +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _WINSOCK_H +struct timeval { + long tv_sec; + long tv_usec; +}; + +struct timezone { + int tz_minuteswest; + int tz_dsttime; +}; + +#ifdef __CYGWIN32__ +#include +#endif /* __CYGWIN32__ */ + +#endif /* _WINSOCK_H */ + +#define ITIMER_REAL 0 +#define ITIMER_VIRTUAL 1 +#define ITIMER_PROF 2 + +struct itimerval { + struct timeval it_interval; + struct timeval it_value; +}; + +int _EXFUN(gettimeofday, (struct timeval *__p, struct timezone *__z)); +int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *)); +int _EXFUN(utimes, (const char *__path, struct timeval *__tvp)); +int _EXFUN(getitimer, (int __which, struct itimerval *__value)); +int _EXFUN(setitimer, (int __which, const struct itimerval *__value, + struct itimerval *__ovalue)); + +#ifdef __cplusplus +} +#endif +#endif /* _SYS_TIME_H_ */ diff --git a/newlib/libc/include/sys/timeb.h b/newlib/libc/include/sys/timeb.h new file mode 100644 index 000000000..0a2c3de8b --- /dev/null +++ b/newlib/libc/include/sys/timeb.h @@ -0,0 +1,39 @@ +/* timeb.h -- An implementation of the standard Unix file. + Written by Ian Lance Taylor + Public domain; no rights reserved. + + declares the structure used by the ftime function, as + well as the ftime function itself. Newlib does not provide an + implementation of ftime. */ + +#ifndef _SYS_TIMEB_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define _SYS_TIMEB_H + +#include <_ansi.h> +#include + +#ifndef __time_t_defined +typedef _TIME_T_ time_t; +#define __time_t_defined +#endif + +struct timeb +{ + time_t time; + unsigned short millitm; + short timezone; + short dstflag; +}; + +extern int ftime _PARAMS ((struct timeb *)); + +#ifdef __cplusplus +} +#endif + +#endif /* ! defined (_SYS_TIMEB_H) */ diff --git a/newlib/libc/include/sys/times.h b/newlib/libc/include/sys/times.h new file mode 100644 index 000000000..c973ae1b0 --- /dev/null +++ b/newlib/libc/include/sys/times.h @@ -0,0 +1,27 @@ +#ifndef _SYS_TIMES_H +#ifdef __cplusplus +extern "C" { +#endif +#define _SYS_TIMES_H + +#include <_ansi.h> +#include + +#ifndef __clock_t_defined +typedef _CLOCK_T_ clock_t; +#define __clock_t_defined +#endif + +struct tms { + clock_t tms_utime; /* user time */ + clock_t tms_stime; /* system time */ + clock_t tms_cutime; /* user time, children */ + clock_t tms_cstime; /* system time, children */ +}; + +clock_t _EXFUN(times,(struct tms *)); + +#ifdef __cplusplus +} +#endif +#endif /* !_SYS_TIMES_H */ diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h new file mode 100644 index 000000000..7d2e52461 --- /dev/null +++ b/newlib/libc/include/sys/types.h @@ -0,0 +1,174 @@ +/* unified sys/types.h: + start with sef's sysvi386 version. + merge go32 version -- a few ifdefs. + h8300hms, h8300xray, and sysvnecv70 disagree on the following types: + + typedef int gid_t; + typedef int uid_t; + typedef int dev_t; + typedef int ino_t; + typedef int mode_t; + typedef int caddr_t; + + however, these aren't "reasonable" values, the sysvi386 ones make far + more sense, and should work sufficiently well (in particular, h8300 + doesn't have a stat, and the necv70 doesn't matter.) -- eichin + */ + +#ifndef _SYS_TYPES_H +#define _SYS_TYPES_H + +#if defined (_WIN32) || defined (__CYGWIN__) +#define __MS_types__ +#endif + +#ifdef __i386__ +#if defined (GO32) || defined (__MSDOS__) +#define __MS_types__ +#endif +#endif + +# include +# include + +/* To ensure the stat struct's layout doesn't change when sizeof(int), etc. + changes, we assume sizeof short and long never change and have all types + used to define struct stat use them and not int where possible. + Where not possible, _ST_INTxx are used. It would be preferable to not have + such assumptions, but until the extra fluff is necessary, it's avoided. + No 64 bit targets use stat yet. What to do about them is postponed + until necessary. */ +#ifdef __GNUC__ +#define _ST_INT32 __attribute__ ((__mode__ (__SI__))) +#else +#define _ST_INT32 +#endif + +# ifndef _POSIX_SOURCE + +# define physadr physadr_t +# define quad quad_t + +#ifndef _WINSOCK_H +typedef unsigned char u_char; +typedef unsigned short u_short; +typedef unsigned int u_int; +typedef unsigned long u_long; +#endif + +typedef unsigned short ushort; /* System V compatibility */ +typedef unsigned int uint; /* System V compatibility */ +# endif /*!_POSIX_SOURCE */ + +#ifndef __time_t_defined +typedef _TIME_T_ time_t; +#define __time_t_defined +#endif + +typedef long daddr_t; +typedef char * caddr_t; + +#ifdef __MS_types__ +typedef unsigned long ino_t; +#else +#ifdef __sparc__ +typedef unsigned long ino_t; +#else +typedef unsigned short ino_t; +#endif +#endif + +#ifdef __MS_types__ +typedef unsigned long vm_offset_t; +typedef unsigned long vm_size_t; + +#define __BIT_TYPES_DEFINED__ + +typedef char int8_t; +typedef unsigned char u_int8_t; +typedef short int16_t; +typedef unsigned short u_int16_t; +typedef int int32_t; +typedef unsigned int u_int32_t; +typedef long long int64_t; +typedef unsigned long long u_int64_t; +typedef int32_t register_t; +#endif /* __MS_types__ */ + +/* + * All these should be machine specific - right now they are all broken. + * However, for all of Cygnus' embedded targets, we want them to all be + * the same. Otherwise things like sizeof (struct stat) might depend on + * how the file was compiled (e.g. -mint16 vs -mint32, etc.). + */ + +typedef short dev_t; + +typedef long off_t; + +typedef unsigned short uid_t; +typedef unsigned short gid_t; +typedef int pid_t; +typedef long key_t; +typedef long ssize_t; + +#ifdef __MS_types__ +typedef char * addr_t; +typedef int mode_t; +#else +#if defined (__sparc__) && !defined (__sparc_v9__) +#ifdef __svr4__ +typedef unsigned long mode_t; +#else +typedef unsigned short mode_t; +#endif +#else +typedef unsigned int mode_t _ST_INT32; +#endif +#endif /* ! __MS_types__ */ + +typedef unsigned short nlink_t; + +/* We don't define fd_set and friends if we are compiling POSIX + source, or if we have included the Windows Sockets.h header (which + defines Windows versions of them). Note that a program which + includes the Windows sockets.h header must know what it is doing; + it must not call the cygwin32 select function. */ +# if ! defined (_POSIX_SOURCE) && ! defined (_WINSOCK_H) + +# define NBBY 8 /* number of bits in a byte */ +/* + * Select uses bit masks of file descriptors in longs. + * These macros manipulate such bit fields (the filesystem macros use chars). + * FD_SETSIZE may be defined by the user, but the default here + * should be >= NOFILE (param.h). + */ +# ifndef FD_SETSIZE +# define FD_SETSIZE 64 +# endif + +typedef long fd_mask; +# define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */ +# ifndef howmany +# define howmany(x,y) (((x)+((y)-1))/(y)) +# endif + +/* We use a macro for fd_set so that including Sockets.h afterwards + can work. */ +typedef struct _types_fd_set { + fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; +} _types_fd_set; + +#define fd_set _types_fd_set + +# define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS))) +# define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS))) +# define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS))) +# define FD_ZERO(p) bzero((caddr_t)(p), sizeof (*(p))) + +# endif /* ! defined (_POSIX_SOURCE) && ! defined (_WINSOCK_H) */ + +#undef __MS_types__ +#undef _ST_INT32 + +#endif /* _SYS_TYPES_H */ diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h new file mode 100644 index 000000000..98d1e1f2a --- /dev/null +++ b/newlib/libc/include/sys/unistd.h @@ -0,0 +1,175 @@ +#ifndef _SYS_UNISTD_H +#define _SYS_UNISTD_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <_ansi.h> +#include +#define __need_size_t +#include + +extern char **environ; + +void _EXFUN(_exit, (int __status ) _ATTRIBUTE ((noreturn))); + +int _EXFUN(access,(const char *__path, int __amode )); +unsigned _EXFUN(alarm, (unsigned __secs )); +int _EXFUN(chdir, (const char *__path )); +int _EXFUN(chmod, (const char *__path, mode_t __mode )); +int _EXFUN(chown, (const char *__path, uid_t __owner, gid_t __group )); +int _EXFUN(close, (int __fildes )); +char _EXFUN(*ctermid, (char *__s )); +char _EXFUN(*cuserid, (char *__s )); +int _EXFUN(dup, (int __fildes )); +int _EXFUN(dup2, (int __fildes, int __fildes2 )); +int _EXFUN(execl, (const char *__path, const char *, ... )); +int _EXFUN(execle, (const char *__path, const char *, ... )); +int _EXFUN(execlp, (const char *__file, const char *, ... )); +int _EXFUN(execv, (const char *__path, char * const __argv[] )); +int _EXFUN(execve, (const char *__path, char * const __argv[], char * const __envp[] )); +int _EXFUN(execvp, (const char *__file, char * const __argv[] )); +pid_t _EXFUN(fork, (void )); +long _EXFUN(fpathconf, (int __fd, int __name )); +int _EXFUN(fsync, (int __fd)); +char _EXFUN(*getcwd, (char *__buf, size_t __size )); +gid_t _EXFUN(getegid, (void )); +uid_t _EXFUN(geteuid, (void )); +gid_t _EXFUN(getgid, (void )); +int _EXFUN(getgroups, (int __gidsetsize, gid_t __grouplist[] )); +char _EXFUN(*getlogin, (void )); +char _EXFUN(*getpass, (__const char *__prompt)); +size_t _EXFUN(getpagesize, (void)); +pid_t _EXFUN(getpgrp, (void )); +pid_t _EXFUN(getpid, (void )); +pid_t _EXFUN(getppid, (void )); +uid_t _EXFUN(getuid, (void )); +int _EXFUN(isatty, (int __fildes )); +int _EXFUN(link, (const char *__path1, const char *__path2 )); +int _EXFUN(nice, (int __nice_value )); +off_t _EXFUN(lseek, (int __fildes, off_t __offset, int __whence )); +long _EXFUN(pathconf, (const char *__path, int __name )); +int _EXFUN(pause, (void )); +int _EXFUN(pipe, (int __fildes[2] )); +int _EXFUN(read, (int __fildes, void *__buf, size_t __nbyte )); +int _EXFUN(rmdir, (const char *__path )); +void * _EXFUN(sbrk, (size_t __incr)); +int _EXFUN(setgid, (gid_t __gid )); +int _EXFUN(setpgid, (pid_t __pid, pid_t __pgid )); +pid_t _EXFUN(setsid, (void )); +int _EXFUN(setuid, (uid_t __uid )); +unsigned _EXFUN(sleep, (unsigned int __seconds )); +void _EXFUN(swab, (const void *, void *, ssize_t)); +long _EXFUN(sysconf, (int __name )); +pid_t _EXFUN(tcgetpgrp, (int __fildes )); +int _EXFUN(tcsetpgrp, (int __fildes, pid_t __pgrp_id )); +char _EXFUN(*ttyname, (int __fildes )); +int _EXFUN(unlink, (const char *__path )); +int _EXFUN(write, (int __fildes, const void *__buf, size_t __nbyte )); + +/* Provide prototypes for most of the _ names that are + provided in newlib for some compilers. */ +int _EXFUN(_close, (int __fildes )); +pid_t _EXFUN(_fork, (void )); +pid_t _EXFUN(_getpid, (void )); +int _EXFUN(_link, (const char *__path1, const char *__path2 )); +off_t _EXFUN(_lseek, (int __fildes, off_t __offset, int __whence )); +int _EXFUN(_read, (int __fildes, void *__buf, size_t __nbyte )); +void * _EXFUN(_sbrk, (size_t __incr)); +int _EXFUN(_unlink, (const char *__path )); +int _EXFUN(_write, (int __fildes, const void *__buf, size_t __nbyte )); + +#if defined(__CYGWIN32__) || defined(__rtems__) +unsigned _EXFUN(usleep, (unsigned int __useconds)); +int _EXFUN(ftruncate, (int __fd, off_t __length)); +int _EXFUN(truncate, (const char *, off_t __length)); +int _EXFUN(gethostname, (char *__name, size_t __len)); +char * _EXFUN(mktemp, (char *)); +int _EXFUN(sync, (void)); +int _EXFUN(readlink, (const char *__path, char *__buf, int __buflen)); +int _EXFUN(symlink, (const char *__name1, const char *__name2)); +#endif + +# define F_OK 0 +# define R_OK 4 +# define W_OK 2 +# define X_OK 1 + +# define SEEK_SET 0 +# define SEEK_CUR 1 +# define SEEK_END 2 + +/* + * RTEMS adheres to a later version of POSIX -- 1003.1b. + * + * XXX this version string should change. + */ + +#ifdef __rtems__ +#ifndef _POSIX_JOB_CONTROL +# define _POSIX_JOB_CONTROL 1 +#endif +#ifndef _POSIX_SAVED_IDS +# define _POSIX_SAVED_IDS 1 +#endif +# define _POSIX_VERSION 199009L +#else +#ifdef __svr4__ +# define _POSIX_JOB_CONTROL 1 +# define _POSIX_SAVED_IDS 1 +# define _POSIX_VERSION 199009L +#endif +#endif + +#ifdef __CYGWIN32__ +# define _POSIX_JOB_CONTROL 1 +# define _POSIX_SAVED_IDS 0 +# define _POSIX_VERSION 199009L +#endif + +#define STDIN_FILENO 0 /* standard input file descriptor */ +#define STDOUT_FILENO 1 /* standard output file descriptor */ +#define STDERR_FILENO 2 /* standard error file descriptor */ + +long _EXFUN(sysconf, (int __name)); + +# define _SC_ARG_MAX 0 +# define _SC_CHILD_MAX 1 +# define _SC_CLK_TCK 2 +# define _SC_NGROUPS_MAX 3 +# define _SC_OPEN_MAX 4 +/* no _SC_STREAM_MAX */ +# define _SC_JOB_CONTROL 5 +# define _SC_SAVED_IDS 6 +# define _SC_VERSION 7 +# define _SC_PAGESIZE 8 + +# define _PC_LINK_MAX 0 +# define _PC_MAX_CANON 1 +# define _PC_MAX_INPUT 2 +# define _PC_NAME_MAX 3 +# define _PC_PATH_MAX 4 +# define _PC_PIPE_BUF 5 +# define _PC_CHOWN_RESTRICTED 6 +# define _PC_NO_TRUNC 7 +# define _PC_VDISABLE 8 +# define _PC_ASYNC_IO 9 +# define _PC_PRIO_IO 10 +# define _PC_SYNC_IO 11 + +# ifndef _POSIX_SOURCE +# define MAXNAMLEN 1024 +# endif /* _POSIX_SOURCE */ + +/* FIXME: This is temporary until winsup gets sorted out. */ +#ifdef __CYGWIN32__ +#define MAXPATHLEN (260 - 1 /* NUL */) +#else +# define MAXPATHLEN 1024 +#endif + +#ifdef __cplusplus +} +#endif +#endif /* _SYS_UNISTD_H */ diff --git a/newlib/libc/include/sys/utime.h b/newlib/libc/include/sys/utime.h new file mode 100644 index 000000000..5e937f103 --- /dev/null +++ b/newlib/libc/include/sys/utime.h @@ -0,0 +1,22 @@ +#ifndef _SYS_UTIME_H +#define _SYS_UTIME_H + +/* This is a dummy file, not customized for any + particular system. If there is a utime.h in libc/sys/SYSDIR/sys, + it will override this one. */ + +#ifdef __cplusplus +extern "C" { +#endif + +struct utimbuf +{ + time_t actime; + time_t modtime; +}; + +#ifdef __cplusplus +}; +#endif + +#endif /* _SYS_UTIME_H */ diff --git a/newlib/libc/include/sys/wait.h b/newlib/libc/include/sys/wait.h new file mode 100644 index 000000000..0e4a33945 --- /dev/null +++ b/newlib/libc/include/sys/wait.h @@ -0,0 +1,40 @@ +#ifndef _SYS_WAIT_H +#define _SYS_WAIT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#define WNOHANG 1 +#define WUNTRACED 2 + +/* A status looks like: + <2 bytes info> <2 bytes code> + + == 0, child has exited, info is the exit value + == 1..7e, child has exited, info is the signal number. + == 7f, child has stopped, info was the signal number. + == 80, there was a core dump. +*/ + +#define WIFEXITED(w) (((w) & 0xff) == 0) +#define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f)) +#define WIFSTOPPED(w) (((w) & 0xff) == 0x7f) +#define WEXITSTATUS(w) (((w) >> 8) & 0xff) +#define WTERMSIG(w) ((w) & 0x7f) +#define WSTOPSIG WEXITSTATUS + +pid_t wait (int *); +pid_t waitpid (pid_t, int *, int); + +/* Provide prototypes for most of the _ names that are + provided in newlib for some compilers. */ +pid_t _wait (int *); + +#ifdef __cplusplus +}; +#endif + +#endif diff --git a/newlib/libc/include/termios.h b/newlib/libc/include/termios.h new file mode 100644 index 000000000..ee1820ce0 --- /dev/null +++ b/newlib/libc/include/termios.h @@ -0,0 +1,7 @@ +#ifdef __cplusplus +extern "C" { +#endif +#include +#ifdef __cplusplus +} +#endif diff --git a/newlib/libc/include/time.h b/newlib/libc/include/time.h new file mode 100644 index 000000000..4a9661779 --- /dev/null +++ b/newlib/libc/include/time.h @@ -0,0 +1,90 @@ +/* + * time.h + * + * Struct and function declarations for dealing with time. + */ + +#ifndef _TIME_H_ +#define _TIME_H_ + +#include "_ansi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef NULL +#define NULL 0 +#endif + +/* Get _CLOCKS_PER_SEC_ */ +#include + +#ifndef _CLOCKS_PER_SEC_ +#define _CLOCKS_PER_SEC_ 1000 +#endif + +#define CLOCKS_PER_SEC _CLOCKS_PER_SEC_ +#define CLK_TCK CLOCKS_PER_SEC +#define __need_size_t +#include + +/* Get _CLOCK_T_ and _TIME_T_. */ +#include + +#ifndef __clock_t_defined +typedef _CLOCK_T_ clock_t; +#define __clock_t_defined +#endif + +#ifndef __time_t_defined +typedef _TIME_T_ time_t; +#define __time_t_defined +#endif + +struct tm +{ + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; +}; + +clock_t _EXFUN(clock, (void)); +double _EXFUN(difftime, (time_t _time2, time_t _time1)); +time_t _EXFUN(mktime, (struct tm *_timeptr)); +time_t _EXFUN(time, (time_t *_timer)); +#ifndef _REENT_ONLY +char *_EXFUN(asctime, (const struct tm *_tblock)); +char *_EXFUN(ctime, (const time_t *_time)); +struct tm *_EXFUN(gmtime, (const time_t *_timer)); +struct tm *_EXFUN(localtime,(const time_t *_timer)); +#endif +size_t _EXFUN(strftime, (char *_s, size_t _maxsize, const char *_fmt, const struct tm *_t)); + +char *_EXFUN(asctime_r, (const struct tm *, char *)); +char *_EXFUN(ctime_r, (const time_t *, char *)); +struct tm *_EXFUN(gmtime_r, (const time_t *, struct tm *)); +struct tm *_EXFUN(localtime_r, (const time_t *, struct tm *)); + +#ifdef __CYGWIN32__ +#ifndef __STRICT_ANSI__ +extern time_t _timezone __declspec(dllimport); +extern int _daylight __declspec(dllimport); +extern char *_tzname[2] __declspec(dllimport); + +char *_EXFUN(timezone, (void)); +void _EXFUN(tzset, (void)); +#endif +#endif /* __CYGWIN32__ */ + +#ifdef __cplusplus +} +#endif +#endif /* _TIME_H_ */ + diff --git a/newlib/libc/include/unctrl.h b/newlib/libc/include/unctrl.h new file mode 100644 index 000000000..8205ea60e --- /dev/null +++ b/newlib/libc/include/unctrl.h @@ -0,0 +1,46 @@ +/* From curses.h. */ +/* + * Copyright (c) 1981, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _UNCTRL_H_ +#define _UNCTRL_H_ + +#include <_ansi.h> + +#define unctrl(c) __unctrl[(c) & 0xff] +#define unctrllen(ch) __unctrllen[(ch) & 0xff] + +extern _CONST char * _CONST __unctrl[256]; /* Control strings. */ +extern _CONST char __unctrllen[256]; /* Control strings length. */ + +#endif /* _UNCTRL_H_ */ diff --git a/newlib/libc/include/unistd.h b/newlib/libc/include/unistd.h new file mode 100644 index 000000000..f9fca8476 --- /dev/null +++ b/newlib/libc/include/unistd.h @@ -0,0 +1,6 @@ +#ifndef _UNISTD_H_ +#define _UNISTD_H_ + +# include + +#endif /* _UNISTD_H_ */ diff --git a/newlib/libc/include/utime.h b/newlib/libc/include/utime.h new file mode 100644 index 000000000..c05e08e94 --- /dev/null +++ b/newlib/libc/include/utime.h @@ -0,0 +1,10 @@ +#ifdef __cplusplus +extern "C" { +#endif + +/* The utime function is defined in libc/sys//sys if it exists. */ +#include + +#ifdef __cplusplus +} +#endif diff --git a/newlib/libc/include/utmp.h b/newlib/libc/include/utmp.h new file mode 100644 index 000000000..88cf6f852 --- /dev/null +++ b/newlib/libc/include/utmp.h @@ -0,0 +1,8 @@ +#ifdef __cplusplus +extern "C" { +#endif +#include +#ifdef __cplusplus +} +#endif + diff --git a/newlib/libc/libc.texinfo b/newlib/libc/libc.texinfo new file mode 100644 index 000000000..b1ca8f9e7 --- /dev/null +++ b/newlib/libc/libc.texinfo @@ -0,0 +1,427 @@ +\input texinfo.tex +@setfilename libc.info +@tex +% NOTE LOCAL KLUGE TO AVOID TOO MUCH WHITESPACE FROM "makedoc" +\global\long\def\example{% +\begingroup +\let\aboveenvbreak=\par +\let\afterenvbreak=\par +\parskip=0pt +\lisp} +\global\long\def\Eexample{% +\Elisp +\endgroup +\vskip -\parskip% to cancel out effect of following \par +} +% END LOCAL WHITESPACE KLUGE +@end tex +@syncodeindex fn cp + +@ifinfo +@format +START-INFO-DIR-ENTRY +* libc:: The ANSI C library. +END-INFO-DIR-ENTRY +@end format +@end ifinfo + +@ifinfo +This file documents the ANSI C library. + +Copyright (C) 1992, 1993 Cygnus Support + +@file{libc} includes software developed by the +University of California, Berkeley and its contributors. + +libc includes software developed by Martin Jackson, Graham Haley +and Steve Chamberlain of Tadpole Technology and released to Cygnus. + +libc uses floating point converstion software developed at AT&T, which +includes this copyright information: + + The author of this software is David M. Gay. + + Copyright (c) 1991 by AT&T. + + Permission to use, copy, modify, and distribute this software for any + purpose without fee is hereby granted, provided that this entire notice + is included in all copies of any software which is or includes a copy + or modification of this software and in all copies of the supporting + documentation for such software. + + THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY + REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. + +@ignore +Permission is granted to process this file through Tex and print the +results, provided the printed document carries copying permission +notice identical to this one except for the removal of this paragraph +(this paragraph not being relevant to the printed manual). + +@end ignore +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, subject to the terms +of the GNU General Public License, which includes the provision that the +entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions. +@end ifinfo +@iftex +@c @smallbook +@c @cropmarks +@finalout +@setchapternewpage odd +@settitle Cygnus C Support Library, Full +@titlepage +@title The Cygnus C Support Library +@subtitle Full Configuration +@sp 1 +@subtitle @code{libc} 1.4 +@subtitle May 1993 +@author {Steve Chamberlain} +@author {Roland Pesch} +@author {Cygnus Support} +@page + +@tex +{\parskip=0pt +sac@@cygnus.com, pesch@@cygnus.com\hfill {\it The Cygnus C Support Library}\par +Copyright \copyright{} 1992, 1993 Cygnus Support +} +\global\parindent=0pt % Steve likes it this way +@end tex + +@file{libc} includes software developed by the +University of California, Berkeley and its contributors. + +@file{libc} includes software developed by Martin Jackson, Graham Haley +and Steve Chamberlain of Tadpole Technology and released to Cygnus. + +@file{libc} uses floating point converstion software developed at AT&T, +which includes this copyright information: + +@cartouche +@quotation +The author of this software is David M. Gay. + +Copyright (c) 1991 by AT&T. + +Permission to use, copy, modify, and distribute this software for any +purpose without fee is hereby granted, provided that this entire notice +is included in all copies of any software which is or includes a copy +or modification of this software and in all copies of the supporting +documentation for such software. + +THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED +WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY +REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY +OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. +@end quotation +@end cartouche + +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. + +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, subject to the terms +of the GNU General Public License, which includes the provision that the +entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions. +@end titlepage +@end iftex + +@ifinfo +@node Top +@top The Cygnus C Support Library + +@c The menu contents depend on the configuration, so we include them +@c as a separate file + +@c switch to set SIGNALS on or off, according to whether config picks up +@c signal subdirectory: +@include sigset.texi + +@menu +* Stdlib:: +* Ctype:: +* Stdio:: +* Strings:: +@ifset SIGNALS +* Signals:: +@end ifset + +* Timefns:: +* Locale:: +* Syscalls:: +* Misc:: +* Arglists:: +* Reentrancy:: +* Library Index:: +@end menu +@end ifinfo + +@include targetdep.tex + +@node Arglists +@chapter Variable Argument Lists + +The @code{printf} family of functions is defined to accept a variable +number of arguments, rather than a fixed argument list. You can define +your own functions with a variable argument list, by using macro +definitions from either @file{stdarg.h} (for compatibility with ANSI C) +or from @file{varargs.h} (for compatibility with a popular convention +prior to ANSI C). + +@menu +* Stdarg:: +* Varargs:: +@end menu + +@node Stdarg +@section ANSI-standard macros, @file{stdarg.h} + +In ANSI C, a function has a variable number of arguments when its +parameter list ends in an ellipsis (@code{...}). The parameter list +must also include at least one explicitly named argument; that argument +is used to initialize the variable list data structure. + +ANSI C defines three macros (@code{va_start}, @code{va_arg}, and +@code{va_end}) to operate on variable argument lists. @file{stdarg.h} +also defines a special type to represent variable argument lists: this +type is called @code{va_list}. + +@menu +* va_start:: +* va_arg:: +* va_end:: +@end menu + +@page +@node va_start +@subsection Initialize variable argument list +@findex va_start +@strong{Synopsis} +@example +#include +void va_start(va_list @var{ap}, @var{rightmost}); +@end example + +@strong{Description}@* +Use @code{va_start} to initialize the variable argument list @var{ap}, +so that @code{va_arg} can extract values from it. @var{rightmost} is +the name of the last explicit argument in the parameter list (the +argument immediately preceding the ellipsis @samp{...} that flags +variable arguments in an ANSI C function header). You can only use +@code{va_start} in a function declared using this ellipsis notation +(not, for example, in one of its subfunctions). + +@strong{Returns}@* +@code{va_start} does not return a result. + +@strong{Portability}@* +ANSI C requires @code{va_start}. + +@page +@node va_arg +@subsection Extract a value from argument list +@findex va_arg +@strong{Synopsis} +@example +#include +@var{type} va_arg(va_list @var{ap}, @var{type}); +@end example + +@strong{Description}@* +@code{va_arg} returns the next unprocessed value from a variable +argument list @var{ap} (which you must previously create with +@var{va_start}). Specify the type for the value as the second parameter +to the macro, @var{type}. + +You may pass a @code{va_list} object @var{ap} to a subfunction, and use +@code{va_arg} from the subfunction rather than from the function +actually declared with an ellipsis in the header; however, in that case +you may @emph{only} use @code{va_arg} from the subfunction. ANSI C does +not permit extracting successive values from a single variable-argument +list from different levels of the calling stack. + +There is no mechanism for testing whether there is actually a next +argument available; you might instead pass an argument count (or some +other data that implies an argument count) as one of the fixed arguments +in your function call. + +@strong{Returns}@* +@code{va_arg} returns the next argument, an object of type @var{type}. + +@strong{Portability}@* +ANSI C requires @code{va_arg}. + +@page +@node va_end +@subsection Abandon a variable argument list +@findex va_end +@strong{Synopsis} +@example +#include +void va_end(va_list @var{ap}); +@end example + +@strong{Description}@* +Use @code{va_end} to declare that your program will not use the variable +argument list @var{ap} any further. + +@strong{Returns}@* +@code{va_end} does not return a result. + +@strong{Portability}@* +ANSI C requires @code{va_end}. + +@node Varargs +@section Traditional macros, @file{varargs.h} + +If your C compiler predates ANSI C, you may still be able to use +variable argument lists using the macros from the @file{varargs.h} +header file. These macros resemble their ANSI counterparts, but have +important differences in usage. In particular, since traditional C has +no declaration mechanism for variable argument lists, two additional +macros are provided simply for the purpose of defining functions with +variable argument lists. + +As with @file{stdarg.h}, the type @code{va_list} is used to hold a data +structure representing a variable argument list. + +@menu +* va_alist:: +* va_start-trad:: +* va_arg-trad:: +* va_end-trad:: +@end menu + +@page +@node va_alist +@subsection Declare variable arguments +@findex va_alist +@findex va_dcl +@strong{Synopsis} +@example +#include +@var{function}(va_alist) +va_dcl +@end example + +@strong{Description}@* +To use the @file{varargs.h} version of variable argument lists, you must +declare your function with a call to the macro @code{va_alist} as its +argument list, and use @code{va_dcl} as the declaration. @emph{Do not +use a semicolon after @code{va_dcl}.} + +@strong{Returns}@* +These macros cannot be used in a context where a return is syntactically +possible. + +@strong{Portability}@* +@var{va_alist} and @var{va_dcl} were the most widespread method of +declaring variable argument lists prior to ANSI C. + +@page +@node va_start-trad +@subsection Initialize variable argument list +@findex va_start +@strong{Synopsis} +@example +#include +va_list @var{ap}; +va_start(@var{ap}); +@end example + +@strong{Description}@* +With the @file{varargs.h} macros, use @code{va_start} to initialize a +data structure @var{ap} to permit manipulating a variable argument list. +@var{ap} must have the type @var{va_alist}. + +@strong{Returns}@* +@code{va_start} does not return a result. + +@strong{Portability}@* +@code{va_start} is also defined as a macro in ANSI C, but the +definitions are incompatible; the ANSI version has another parameter +besides @var{ap}. + +@page +@node va_arg-trad +@subsection Extract a value from argument list +@findex va_arg +@strong{Synopsis} +@example +#include +@var{type} va_arg(va_list @var{ap}, @var{type}); +@end example + +@strong{Description}@* +@code{va_arg} returns the next unprocessed value from a variable +argument list @var{ap} (which you must previously create with +@var{va_start}). Specify the type for the value as the second parameter +to the macro, @var{type}. + +@strong{Returns}@* +@code{va_arg} returns the next argument, an object of type @var{type}. + +@strong{Portability}@* +The @code{va_arg} defined in @file{varargs.h} has the same syntax and +usage as the ANSI C version from @file{stdarg.h}. + +@page +@node va_end-trad +@subsection Abandon a variable argument list +@findex va_end +@strong{Synopsis} +@example +#include +va_end(va_list @var{ap}); +@end example + +@strong{Description}@* +Use @code{va_end} to declare that your program will not use the variable +argument list @var{ap} any further. + +@strong{Returns}@* +@code{va_end} does not return a result. + +@strong{Portability}@* +The @code{va_end} defined in @file{varargs.h} has the same syntax and +usage as the ANSI C version from @file{stdarg.h}. + +@node Library Index +@unnumbered Index +@printindex cp + +@tex +% I think something like @colophon should be in texinfo. In the +% meantime: +\long\def\colophon{\hbox to0pt{}\vfill +\centerline{The body of this manual is set in} +\centerline{\fontname\tenrm,} +\centerline{with headings in {\bf\fontname\tenbf}} +\centerline{and examples in {\tt\fontname\tentt}.} +\centerline{{\it\fontname\tenit\/} and} +\centerline{{\sl\fontname\tensl\/}} +\centerline{are used for emphasis.}\vfill} +\page\colophon +% Blame: pesch@cygnus.com, 28mar91. +@end tex + +@contents +@bye + + diff --git a/newlib/libc/locale/Makefile.am b/newlib/libc/locale/Makefile.am new file mode 100644 index 000000000..c007e0f92 --- /dev/null +++ b/newlib/libc/locale/Makefile.am @@ -0,0 +1,26 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = locale.c + +CHEWOUT_FILES = locale.def + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +TARGETDOC = ../tmp.texi + +doc: $(CHEWOUT_FILES) + cat $(srcdir)/locale.tex >> $(TARGETDOC) + +CLEANFILES = $(CHEWOUT_FILES) *.ref diff --git a/newlib/libc/locale/Makefile.in b/newlib/libc/locale/Makefile.in new file mode 100644 index 000000000..1d951a82c --- /dev/null +++ b/newlib/libc/locale/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +CRT0 = @CRT0@ +EXEEXT = @EXEEXT@ +LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@ +LIBC_POSIX_LIB = @LIBC_POSIX_LIB@ +LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@ +LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@ +LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ +LIBC_SYS_LIB = @LIBC_SYS_LIB@ +LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = locale.c + +CHEWOUT_FILES = locale.def + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +TARGETDOC = ../tmp.texi + +CLEANFILES = $(CHEWOUT_FILES) *.ref +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = locale.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .def .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus locale/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = locale + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ +check-am installcheck-am installcheck install-info-am install-info \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +doc: $(CHEWOUT_FILES) + cat $(srcdir)/locale.tex >> $(TARGETDOC) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/locale/locale.c b/newlib/libc/locale/locale.c new file mode 100644 index 000000000..81d6ae2bc --- /dev/null +++ b/newlib/libc/locale/locale.c @@ -0,0 +1,198 @@ +/* +FUNCTION +<>, <>---select or query locale + +INDEX + setlocale +INDEX + localeconv +INDEX + _setlocale_r +INDEX + _localeconv_r + +ANSI_SYNOPSIS + #include + char *setlocale(int <[category]>, const char *<[locale]>); + lconv *localeconv(void); + + char *_setlocale_r(void *<[reent]>, + int <[category]>, const char *<[locale]>); + lconv *_localeconv_r(void *<[reent]>); + +TRAD_SYNOPSIS + #include + char *setlocale(<[category]>, <[locale]>) + int <[category]>; + char *<[locale]>; + + lconv *localeconv(); + + char *_setlocale_r(<[reent]>, <[category]>, <[locale]>) + char *<[reent]>; + int <[category]>; + char *<[locale]>; + + lconv *_localeconv_r(<[reent]>); + char *<[reent]>; + +DESCRIPTION +<> is the facility defined by ANSI C to condition the +execution environment for international collating and formatting +information; <> reports on the settings of the current +locale. + +This is a minimal implementation, supporting only the required <<``C''>> +value for <[locale]>; strings representing other locales are not +honored unless MB_CAPABLE is defined in which case three new +extensions are allowed for LC_CTYPE only: <<''C-JIS''>>, <<''C-EUCJP''>>, +and <<''C-SJIS''>>. (<<``''>> is also accepted; it represents the default locale +for an implementation, here equivalent to <<``C''>>.) + +If you use <> as the <[locale]> argument, <> returns +a pointer to the string representing the current locale (always +<<``C''>> in this implementation). The acceptable values for +<[category]> are defined in `<>' as macros beginning with +<<"LC_">>, but this implementation does not check the values you pass +in the <[category]> argument. + +<> returns a pointer to a structure (also defined in +`<>') describing the locale-specific conventions currently +in effect. + +<<_localeconv_r>> and <<_setlocale_r>> are reentrant versions of +<> and <> respectively. The extra argument +<[reent]> is a pointer to a reentrancy structure. + +RETURNS +<> returns either a pointer to a string naming the locale +currently in effect (always <<``C''>> for this implementation, or, if +the locale request cannot be honored, <>. + +<> returns a pointer to a structure of type <>, +which describes the formatting and collating conventions in effect (in +this implementation, always those of the C locale). + +PORTABILITY +ANSI C requires <>, but the only locale required across all +implementations is the C locale. + +No supporting OS subroutines are required. +*/ + +/* + * setlocale, localeconv : internationalize your locale. + * (Only "C" or null supported). + */ + +#include +#include +#include +#include + +#ifdef __CYGWIN__ +int __declspec(dllexport) __mb_cur_max = 1; +#else +int __mb_cur_max = 1; +#endif + +static _CONST struct lconv lconv = +{ + ".", "", "", "", "", "", "", "", "", "", + CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX, + CHAR_MAX, CHAR_MAX, CHAR_MAX, CHAR_MAX, +}; + + +char * +_DEFUN(_setlocale_r, (p, category, locale), + struct _reent *p _AND + int category _AND + _CONST char *locale) +{ + static char lc_ctype[8] = "C"; + static char last_lc_ctype[8] = "C"; + +#ifndef MB_CAPABLE + if (locale) + { + if (strcmp (locale, "C") && strcmp (locale, "")) + return 0; + p->_current_category = category; + p->_current_locale = locale; + } + return "C"; +#else + if (locale) + { + if (category != LC_CTYPE) + { + if (strcmp (locale, "C") && strcmp (locale, "")) + return 0; + if (category == LC_ALL) + { + strcpy (last_lc_ctype, lc_ctype); + strcpy (lc_ctype, locale); + __mb_cur_max = 1; + } + } + else + { + if (strcmp (locale, "C") && strcmp (locale, "") && + strcmp (locale, "C") && strcmp (locale, "C-JIS") && + strcmp (locale, "C-EUCJP") && strcmp (locale, "C-SJIS")) + return 0; + + strcpy (last_lc_ctype, lc_ctype); + strcpy (lc_ctype, locale); + + if (!strcmp (locale, "C-JIS")) + __mb_cur_max = 8; + else if (strlen (locale) > 1) + __mb_cur_max = 2; + else + __mb_cur_max = 1; + } + p->_current_category = category; + p->_current_locale = locale; + + if (category == LC_CTYPE) + return last_lc_ctype; + } + else + { + if (category == LC_CTYPE) + return lc_ctype; + } + + return "C"; +#endif + +} + + +struct lconv * +_DEFUN(_localeconv_r, (data), + struct _reent *data) +{ + return (struct lconv *) &lconv; +} + +#ifndef _REENT_ONLY + +char * +_DEFUN(setlocale, (category, locale), + int category _AND + _CONST char *locale) +{ + return _setlocale_r (_REENT, category, locale); +} + + +struct lconv * +_DEFUN_VOID(localeconv) +{ + return _localeconv_r (_REENT); +} + +#endif diff --git a/newlib/libc/locale/locale.tex b/newlib/libc/locale/locale.tex new file mode 100644 index 000000000..7958a98a2 --- /dev/null +++ b/newlib/libc/locale/locale.tex @@ -0,0 +1,123 @@ +@node Locale +@chapter Locale (@file{locale.h}) + +A @dfn{locale} is the name for a collection of parameters (affecting +collating sequences and formatting conventions) that may be different +depending on location or culture. The @code{"C"} locale is the only +one defined in the ANSI C standard. + +This is a minimal implementation, supporting only the required @code{``C''} +value for locale; strings representing other locales are not +honored. (@code{``''} is also accepted; it represents the default locale +for an implementation, here equivalent to @code{``C''}. + + +@file{locale.h} defines the structure @code{lconv} to collect the +information on a locale, with the following fields: + +@table @code +@item char *decimal_point +The decimal point character used to format ``ordinary'' numbers (all +numbers except those referring to amounts of money). @code{``.''} in the +C locale. + +@item char *thousands_sep +The character (if any) used to separate groups of digits, when +formatting ordinary numbers. +@code{``''} in the C locale. + +@item char *grouping +Specifications for how many digits to group (if any grouping is done at +all) when formatting ordinary numbers. The @emph{numeric value} of each +character in the string represents the number of digits for the next +group, and a value of @code{0} (that is, the string's trailing +@code{NULL}) means to continue grouping digits using the last value +specified. Use @code{CHAR_MAX} to indicate that no further grouping is +desired. @code{``''} in the C locale. + +@item char *int_curr_symbol +The international currency symbol (first three characters), if any, and +the character used to separate it from numbers. +@code{``''} in the C locale. + +@item char *currency_symbol +The local currency symbol, if any. +@code{``''} in the C locale. + +@item char *mon_decimal_point +The symbol used to delimit fractions in amounts of money. +@code{``''} in the C locale. + +@item char *mon_thousands_sep +Similar to @code{thousands_sep}, but used for amounts of money. +@code{``''} in the C locale. + +@item char *mon_grouping +Similar to @code{grouping}, but used for amounts of money. +@code{``''} in the C locale. + +@item char *positive_sign +A string to flag positive amounts of money when formatting. +@code{``''} in the C locale. + +@item char *negative_sign +A string to flag negative amounts of money when formatting. +@code{``''} in the C locale. + +@item char int_frac_digits +The number of digits to display when formatting amounts of money to +international conventions. +@code{CHAR_MAX} (the largest number representable as a @code{char}) in +the C locale. + +@item char frac_digits +The number of digits to display when formatting amounts of money to +local conventions. +@code{CHAR_MAX} in the C locale. + +@item char p_cs_precedes +@code{1} indicates the local currency symbol is used before a +@emph{positive or zero} formatted amount of money; @code{0} indicates +the currency symbol is placed after the formatted number. +@code{CHAR_MAX} in the C locale. + +@item char p_sep_by_space +@code{1} indicates the local currency symbol must be separated from +@emph{positive or zero} numbers by a space; @code{0} indicates that it +is immediately adjacent to numbers. +@code{CHAR_MAX} in the C locale. + +@item char n_cs_precedes +@code{1} indicates the local currency symbol is used before a +@emph{negative} formatted amount of money; @code{0} indicates +the currency symbol is placed after the formatted number. +@code{CHAR_MAX} in the C locale. + +@item char n_sep_by_space +@code{1} indicates the local currency symbol must be separated from +@emph{negative} numbers by a space; @code{0} indicates that it +is immediately adjacent to numbers. +@code{CHAR_MAX} in the C locale. + +@item char p_sign_posn +Controls the position of the @emph{positive} sign for +numbers representing money. @code{0} means parentheses surround the +number; @code{1} means the sign is placed before both the number and the +currency symbol; @code{2} means the sign is placed after both the number +and the currency symbol; @code{3} means the sign is placed just before +the currency symbol; and @code{4} means the sign is placed just after +the currency symbol. +@code{CHAR_MAX} in the C locale. + +@item char n_sign_posn +Controls the position of the @emph{negative} sign for numbers +representing money, using the same rules as @code{p_sign_posn}. +@code{CHAR_MAX} in the C locale. +@end table + +@menu +* setlocale:: Select or query locale +@end menu + +@page +@include locale/locale.def diff --git a/newlib/libc/machine/Makefile.am b/newlib/libc/machine/Makefile.am new file mode 100644 index 000000000..8157e9aae --- /dev/null +++ b/newlib/libc/machine/Makefile.am @@ -0,0 +1,23 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +SUBDIRS = $(machine_dir) . + +if HAVE_MACHINE_DIR +MACHLIB = lib.a +endif + +noinst_LIBRARIES = $(MACHLIB) + +lib.a: $(machine_dir)/lib.a + rm -f $@ + ln $(machine_dir)/lib.a $@ >/dev/null 2>/dev/null || \ + cp $(machine_dir)/lib.a $@ + +$(machine_dir)/lib.a: + +doc: + +ACLOCAL_AMFLAGS = -I ../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/Makefile.in b/newlib/libc/machine/Makefile.in new file mode 100644 index 000000000..bb99fb981 --- /dev/null +++ b/newlib/libc/machine/Makefile.in @@ -0,0 +1,401 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +SUBDIRS = $(machine_dir) . + +@HAVE_MACHINE_DIR_TRUE@MACHLIB = \ +@HAVE_MACHINE_DIR_TRUE@lib.a + +noinst_LIBRARIES = $(MACHLIB) + +ACLOCAL_AMFLAGS = -I ../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_SOURCES = lib.a.c +lib_a_OBJECTS = lib.a.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = lib.a.c +OBJECTS = lib.a.o + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in ../../acinclude.m4 \ + ../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive install-info-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +install-info-am: +install-info: install-info-recursive +install-exec-am: +install-exec: install-exec-recursive + +install-data-am: +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: +uninstall: uninstall-recursive +all-am: Makefile $(LIBRARIES) +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-recursive + -rm -f config.status + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile install-data-recursive \ +uninstall-data-recursive install-exec-recursive \ +uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ +all-recursive check-recursive installcheck-recursive info-recursive \ +dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-info-am \ +install-info install-exec-am install-exec install-data-am install-data \ +install-am install uninstall-am uninstall all-redirect all-am all \ +installdirs-am installdirs mostlyclean-generic distclean-generic \ +clean-generic maintainer-clean-generic clean mostlyclean distclean \ +maintainer-clean + + +lib.a: $(machine_dir)/lib.a + rm -f $@ + ln $(machine_dir)/lib.a $@ >/dev/null 2>/dev/null || \ + cp $(machine_dir)/lib.a $@ + +$(machine_dir)/lib.a: + +doc: + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/a29k/Makefile.am b/newlib/libc/machine/a29k/Makefile.am new file mode 100644 index 000000000..ec5ca63e2 --- /dev/null +++ b/newlib/libc/machine/a29k/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/a29k/Makefile.in b/newlib/libc/machine/a29k/Makefile.in new file mode 100644 index 000000000..69bc22c90 --- /dev/null +++ b/newlib/libc/machine/a29k/Makefile.in @@ -0,0 +1,294 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/a29k/aclocal.m4 b/newlib/libc/machine/a29k/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/a29k/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/a29k/configure b/newlib/libc/machine/a29k/configure new file mode 100755 index 000000000..564788332 --- /dev/null +++ b/newlib/libc/machine/a29k/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=Makefile.am + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/a29k/configure.in b/newlib/libc/machine/a29k/configure.in new file mode 100644 index 000000000..1dffe2144 --- /dev/null +++ b/newlib/libc/machine/a29k/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/a29k configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(Makefile.am) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/aclocal.m4 b/newlib/libc/machine/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/arm/Makefile.am b/newlib/libc/machine/arm/Makefile.am new file mode 100644 index 000000000..ec5ca63e2 --- /dev/null +++ b/newlib/libc/machine/arm/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/arm/Makefile.in b/newlib/libc/machine/arm/Makefile.in new file mode 100644 index 000000000..69bc22c90 --- /dev/null +++ b/newlib/libc/machine/arm/Makefile.in @@ -0,0 +1,294 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/arm/aclocal.m4 b/newlib/libc/machine/arm/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/arm/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/arm/configure b/newlib/libc/machine/arm/configure new file mode 100755 index 000000000..564788332 --- /dev/null +++ b/newlib/libc/machine/arm/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=Makefile.am + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/arm/configure.in b/newlib/libc/machine/arm/configure.in new file mode 100644 index 000000000..a5384f62a --- /dev/null +++ b/newlib/libc/machine/arm/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/arm configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(Makefile.am) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/configure b/newlib/libc/machine/configure new file mode 100755 index 000000000..ce27db26f --- /dev/null +++ b/newlib/libc/machine/configure @@ -0,0 +1,1802 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=d10v + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../.. $srcdir/../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../.. $srcdir/../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../.." + fi +else + newlib_basedir="${srcdir}/../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +if test -n "${machine_dir}"; then + subdirs="${machine_dir}" + +fi + + + +if test x${machine_dir} != x; then + HAVE_MACHINE_DIR_TRUE= + HAVE_MACHINE_DIR_FALSE='#' +else + HAVE_MACHINE_DIR_TRUE='#' + HAVE_MACHINE_DIR_FALSE= +fi + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g +s%@subdirs@%$subdirs%g +s%@HAVE_MACHINE_DIR_TRUE@%$HAVE_MACHINE_DIR_TRUE%g +s%@HAVE_MACHINE_DIR_FALSE@%$HAVE_MACHINE_DIR_FALSE%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + +if test "$no_recursion" != yes; then + + # Remove --cache-file and --srcdir arguments so they do not pile up. + ac_sub_configure_args= + ac_prev= + for ac_arg in $ac_configure_args; do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case "$ac_arg" in + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; + esac + done + + for ac_config_dir in ${machine_dir}; do + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + if test ! -d $srcdir/$ac_config_dir; then + continue + fi + + echo configuring in $ac_config_dir + + case "$srcdir" in + .) ;; + *) + if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :; + else + { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; } + fi + ;; + esac + + ac_popdir=`pwd` + cd $ac_config_dir + + # A "../" for each directory in /$ac_config_dir. + ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` + + case "$srcdir" in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + /*) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_config_dir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure; then + ac_sub_configure=$ac_sub_srcdir/configure + elif test -f $ac_sub_srcdir/configure.in; then + ac_sub_configure=$ac_configure + else + echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2 + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + + # Make the cache file name correct relative to the subdirectory. + case "$cache_file" in + /*) ac_sub_cache_file=$cache_file ;; + *) # Relative path. + ac_sub_cache_file="$ac_dots$cache_file" ;; + esac + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir" + # The eval makes quoting arguments work. + if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir + then : + else + { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; } + fi + fi + + cd $ac_popdir + done +fi + diff --git a/newlib/libc/machine/configure.in b/newlib/libc/machine/configure.in new file mode 100644 index 000000000..6ac3486c6 --- /dev/null +++ b/newlib/libc/machine/configure.in @@ -0,0 +1,18 @@ +dnl This is the newlib/libc/machine configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(d10v) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../..) + +NEWLIB_CONFIGURE(../..) + +if test -n "${machine_dir}"; then + AC_CONFIG_SUBDIRS(${machine_dir}) +fi + +AM_CONDITIONAL(HAVE_MACHINE_DIR, test x${machine_dir} != x) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/d10v/Makefile.am b/newlib/libc/machine/d10v/Makefile.am new file mode 100644 index 000000000..1c65b9ffe --- /dev/null +++ b/newlib/libc/machine/d10v/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/d10v/Makefile.in b/newlib/libc/machine/d10v/Makefile.in new file mode 100644 index 000000000..5414b185d --- /dev/null +++ b/newlib/libc/machine/d10v/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = setjmp.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/d10v/aclocal.m4 b/newlib/libc/machine/d10v/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/d10v/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/d10v/configure b/newlib/libc/machine/d10v/configure new file mode 100755 index 000000000..b39571b6a --- /dev/null +++ b/newlib/libc/machine/d10v/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=setjmp.S + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/d10v/configure.in b/newlib/libc/machine/d10v/configure.in new file mode 100644 index 000000000..fd67e066d --- /dev/null +++ b/newlib/libc/machine/d10v/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/d10v configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(setjmp.S) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/d10v/setjmp.S b/newlib/libc/machine/d10v/setjmp.S new file mode 100644 index 000000000..22287dd1e --- /dev/null +++ b/newlib/libc/machine/d10v/setjmp.S @@ -0,0 +1,55 @@ +; setjmp/longjmp for D10V. The jmpbuf looks like this: +; +; Register jmpbuf offset +; R6 0x00 +; R7 0x02 +; R8 0x04 +; R9 0x06 +; R10 0x08 +; R11 0x0a +; R13 (return address) 0x0c +; R15 (SP) 0x0E + + .text + .globl setjmp + .type setjmp,@function + .stabs "setjmp.S",100,0,0,setjmp + .stabs "int:t(0,1)=r(0,1);-65536;65535;",128,0,0,0 + .stabs "setjmp:F(0,1)",36,0,1,setjmp + +setjmp: +; Address of jmpbuf is passed in R0. Save the appropriate registers. + st2w r6, @r0+ + st2w r8, @r0+ + st2w r10, @r0+ + st r13, @r0+ + st r15, @r0+ + +; Return 0 to caller + ldi r0, 0 + jmp r13 +.Lsetjmp: + .size setjmp,.Lsetjmp-setjmp + .stabs "",36,0,0,.Lsetjmp-setjmp + + .globl longjmp + .type longjmp,@function + .stabs "longjmp:F(0,1)",36,0,1,longjmp +longjmp: +; Address of jmpbuf is in R0. Restore the registers. + ld2w r6, @r0+ + ld2w r8, @r0+ + ld2w r10, @r0+ + ld r13, @r0+ + ld r15, @r0+ + +; Value to return to caller is in R1. If caller attemped to return 0, +; return 1 instead. + + mv r0, r1 + cmpeqi r0, 0 + exef0t || ldi r0,1 + jmp r13 +.Llongjmp: + .size longjmp,.Llongjmp-longjmp + .stabs "",36,0,0,.Llongjmp-longjmp diff --git a/newlib/libc/machine/d30v/Makefile.am b/newlib/libc/machine/d30v/Makefile.am new file mode 100644 index 000000000..1c65b9ffe --- /dev/null +++ b/newlib/libc/machine/d30v/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/d30v/Makefile.in b/newlib/libc/machine/d30v/Makefile.in new file mode 100644 index 000000000..5414b185d --- /dev/null +++ b/newlib/libc/machine/d30v/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = setjmp.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/d30v/aclocal.m4 b/newlib/libc/machine/d30v/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/d30v/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/d30v/configure b/newlib/libc/machine/d30v/configure new file mode 100755 index 000000000..b39571b6a --- /dev/null +++ b/newlib/libc/machine/d30v/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=setjmp.S + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/d30v/configure.in b/newlib/libc/machine/d30v/configure.in new file mode 100644 index 000000000..604025ecd --- /dev/null +++ b/newlib/libc/machine/d30v/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/d30v configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(setjmp.S) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/d30v/setjmp.S b/newlib/libc/machine/d30v/setjmp.S new file mode 100644 index 000000000..c0ca8250b --- /dev/null +++ b/newlib/libc/machine/d30v/setjmp.S @@ -0,0 +1,106 @@ +; setjmp/longjmp for D30V. + + .text + .globl setjmp + .type setjmp,@function + .stabs "setjmp.S",100,0,0,setjmp + .stabs "int:t(0,1)=r(0,1);-2147483648;2147483647;",128,0,0,0 + .stabs "setjmp:F(0,1)",36,0,1,setjmp + +setjmp: +; Address of jmpbuf is passed in R2. Save the appropriate registers. + st2w r26, @(r2+,r0) + st2w r28, @(r2+,r0) + st2w r30, @(r2+,r0) + st2w r32, @(r2+,r0) + st2w r34, @(r2+,r0) + st2w r36, @(r2+,r0) + st2w r38, @(r2+,r0) + st2w r40, @(r2+,r0) + st2w r42, @(r2+,r0) + st2w r44, @(r2+,r0) + st2w r46, @(r2+,r0) + st2w r48, @(r2+,r0) + st2w r50, @(r2+,r0) + st2w r52, @(r2+,r0) + st2w r54, @(r2+,r0) + st2w r56, @(r2+,r0) + st2w r58, @(r2+,r0) + st2w r60, @(r2+,r0) + st2w r62, @(r2+,r0) + + mvfacc r4, a1, 16 + mvfacc r5, a1, 0 + st2w r4, @(r2+,r0) + + mvfsys r4, psw + mvfsys r5, rpt_c + st2w r4, @(r2+,r0) + + mvfsys r4, rpt_s + mvfsys r5, rpt_e + st2w r4, @(r2+,r0) + + mvfsys r4, mod_s + mvfsys r5, mod_e + st2w r4, @(r2+,r0) + +; Return 0 to caller + add r2, r0, r0 + jmp link +.Lsetjmp: + .size setjmp,.Lsetjmp-setjmp + .stabs "",36,0,0,.Lsetjmp-setjmp + + .globl longjmp + .type longjmp,@function + .stabs "longjmp:F(0,1)",36,0,1,longjmp +longjmp: +; Address of jmpbuf is in R2. Restore the registers. + ld2w r26, @(r2+,r0) + ld2w r28, @(r2+,r0) + ld2w r30, @(r2+,r0) + ld2w r32, @(r2+,r0) + ld2w r34, @(r2+,r0) + ld2w r36, @(r2+,r0) + ld2w r38, @(r2+,r0) + ld2w r40, @(r2+,r0) + ld2w r42, @(r2+,r0) + ld2w r44, @(r2+,r0) + ld2w r46, @(r2+,r0) + ld2w r48, @(r2+,r0) + ld2w r50, @(r2+,r0) + ld2w r52, @(r2+,r0) + ld2w r54, @(r2+,r0) + ld2w r56, @(r2+,r0) + ld2w r58, @(r2+,r0) + ld2w r60, @(r2+,r0) + ld2w r62, @(r2+,r0) + + ld2w r4, @(r2+,r0) + mvtacc a1, r4, r5 + + mvfsys r6, psw + ld2w r4, @(r2+,r0) /* psw, rpt_c */ + and r6, r6, 0xfcff /* set rp, md bits from setjmp, leave */ + and r4, r4, 0x0300 /* all other psw bits the same */ + or r4, r4, r6 + mvtsys psw, r4 + mvtsys rpt_c, r5 + + ld2w r4, @(r2+,r0) + mvtsys rpt_s, r4 + mvtsys rpt_e, r5 + + ld2w r4, @(r2+,r0) + mvtsys mod_s, r4 + mvtsys mod_e, r5 + +; Value to return to caller is in R3. If caller attemped to return 0, +; return 1 instead. + + cmpeq f0, r3, 0 || add r2, r3, r0 + jmp link || add/tx r2, r2, 1 +.Llongjmp: + .size longjmp,.Llongjmp-longjmp + .stabs "",36,0,0,.Llongjmp-longjmp diff --git a/newlib/libc/machine/fr30/Makefile.am b/newlib/libc/machine/fr30/Makefile.am new file mode 100644 index 000000000..1c65b9ffe --- /dev/null +++ b/newlib/libc/machine/fr30/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/fr30/Makefile.in b/newlib/libc/machine/fr30/Makefile.in new file mode 100644 index 000000000..5688a96e9 --- /dev/null +++ b/newlib/libc/machine/fr30/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = setjmp.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/fr30/aclocal.m4 b/newlib/libc/machine/fr30/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/fr30/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/fr30/configure b/newlib/libc/machine/fr30/configure new file mode 100755 index 000000000..564788332 --- /dev/null +++ b/newlib/libc/machine/fr30/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=Makefile.am + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/fr30/configure.in b/newlib/libc/machine/fr30/configure.in new file mode 100644 index 000000000..a5384f62a --- /dev/null +++ b/newlib/libc/machine/fr30/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/arm configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(Makefile.am) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/fr30/setjmp.S b/newlib/libc/machine/fr30/setjmp.S new file mode 100644 index 000000000..98ac44d48 --- /dev/null +++ b/newlib/libc/machine/fr30/setjmp.S @@ -0,0 +1,64 @@ +# setjmp/longjmp for FR30. The jmpbuf looks like this: +# +# Register jmpbuf offset +# R8 0x00 +# R9 0x04 +# R10 0x08 +# R11 0x0c +# R12 0x10 +# R13 0x14 +# R14 (FP) 0x18 +# R15 (SP) 0x1c +# RP 0x20 + +.macro save reg + st \reg,@r4 + add #4,r4 +.endm + +.macro restore reg + ld @r4,\reg + add #4,r4 +.endm + + + .text + .global setjmp +setjmp: + save r8 + save r9 + save r10 + save r11 + save r12 + save r13 + save r14 + save r15 + mov RP,r5 + st r5,@r4 + +# Return 0 to caller. + ldi:8 #0,r4 + ret + + .global longjmp +longjmp: + restore r8 + restore r9 + restore r10 + restore r11 + restore r12 + restore r13 + restore r14 + restore r15 + ld @r4,r4 + mov r4,RP + +# If caller attempted to return 0, return 1 instead. + + mov r5,r4 + or r4,r4 + bne 1f + ldi:8 #1,r4 + 1: + ret + \ No newline at end of file diff --git a/newlib/libc/machine/h8300/Makefile.am b/newlib/libc/machine/h8300/Makefile.am new file mode 100644 index 000000000..2ce8319b4 --- /dev/null +++ b/newlib/libc/machine/h8300/Makefile.am @@ -0,0 +1,13 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = reg_memcpy.S reg_memset.S strcmp.S memcpy.S memset.S \ + setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/h8300/Makefile.in b/newlib/libc/machine/h8300/Makefile.in new file mode 100644 index 000000000..034b29ace --- /dev/null +++ b/newlib/libc/machine/h8300/Makefile.in @@ -0,0 +1,299 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = reg_memcpy.S reg_memset.S strcmp.S memcpy.S memset.S \ + setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = reg_memcpy.o reg_memset.o strcmp.o memcpy.o memset.o \ +setjmp.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/h8300/aclocal.m4 b/newlib/libc/machine/h8300/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/h8300/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/h8300/configure b/newlib/libc/machine/h8300/configure new file mode 100755 index 000000000..34f5f6b82 --- /dev/null +++ b/newlib/libc/machine/h8300/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=memcpy.S + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/h8300/configure.in b/newlib/libc/machine/h8300/configure.in new file mode 100644 index 000000000..013345e00 --- /dev/null +++ b/newlib/libc/machine/h8300/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/h8300 configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(memcpy.S) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/h8300/defines.h b/newlib/libc/machine/h8300/defines.h new file mode 100644 index 000000000..c6ae3df10 --- /dev/null +++ b/newlib/libc/machine/h8300/defines.h @@ -0,0 +1,86 @@ + +#define A0 r0 +#define A0L r0l +#define A0H r0h + +#define A1 r1 +#define A1L r1l +#define A1H r1h + +#define A2 r2 +#define A2L r2l +#define A2H r2h + +#define A3 r3 +#define A3L r3l +#define A3H r3h + +#define S0 r4 +#define S0L r4l +#define S0H r4h + +#define S1 r5 +#define S1L r5l +#define S1H r5h + +#define S2 r6 +#define S2L r6l +#define S2H r6h + +#ifdef __H8300__ +#define MOVP mov.w /* pointers are 16 bits */ +#define ADDP add.w +#define CMPP cmp.w +#define PUSHP push +#define POPP pop + +#define A0P r0 +#define A1P r1 +#define A2P r2 +#define A3P r3 +#define S0P r4 +#define S1P r5 +#define S2P r6 +#endif + +#ifdef __H8300H__ +#define MOVP mov.l /* pointers are 32 bits */ +#define ADDP add.l +#define CMPP cmp.l +#define PUSHP push.l +#define POPP pop.l + +#define A0P er0 +#define A1P er1 +#define A2P er2 +#define A3P er3 +#define S0P er4 +#define S1P er5 +#define S2P er6 + +#define A0E e0 +#define A1E e1 +#define A2E e2 +#define A3E e3 +#endif + +#ifdef __H8300S__ +#define MOVP mov.l /* pointers are 32 bits */ +#define ADDP add.l +#define CMPP cmp.l +#define PUSHP push.l +#define POPP pop.l + +#define A0P er0 +#define A1P er1 +#define A2P er2 +#define A3P er3 +#define S0P er4 +#define S1P er5 +#define S2P er6 + +#define A0E e0 +#define A1E e1 +#define A2E e2 +#define A3E e3 +#endif diff --git a/newlib/libc/machine/h8300/memcpy.S b/newlib/libc/machine/h8300/memcpy.S new file mode 100644 index 000000000..3465ce558 --- /dev/null +++ b/newlib/libc/machine/h8300/memcpy.S @@ -0,0 +1,48 @@ +#include "defines.h" + +#ifdef __H8300H__ + .h8300h +#endif + +#ifdef __H8300S__ + .h8300s +#endif + + .global _memcpy +_memcpy: +; MOVP @(2/4,r7),A0P ; dst +; MOVP @(4/8,r7),A1P ; src +; MOVP @(6/12,r7),A2P ; len + + MOVP A0P,A3P ; keep copy of final dst + ADDP A2P,A0P ; point to end of dst + CMPP A0P,A3P ; see if anything to do + beq quit + + ADDP A2P,A1P ; point to end of src + + ; lets see if we can do this in words + or A0L,A2L ; or in the dst address + or A3L,A2L ; or the length + or A1L,A2L ; or the src address + btst #0,A2L ; see if the lsb is zero + bne byteloop + +wordloop: + subs #2,A1P ; point to word + mov.w @A1P,A2 ; get word + mov.w A2,@-A0P ; save word + CMPP A0P,A3P ; at the front again ? + bne wordloop + rts + +byteloop: + subs #1,A1P ; point to byte + mov.b @A1P,A2L ; get byte + mov.b A2L,@-A0P ; save byte + CMPP A0P,A3P ; at the front again ? + bne byteloop + + ; return with A0 pointing to dst +quit: rts + diff --git a/newlib/libc/machine/h8300/memset.S b/newlib/libc/machine/h8300/memset.S new file mode 100644 index 000000000..c12f17b4e --- /dev/null +++ b/newlib/libc/machine/h8300/memset.S @@ -0,0 +1,51 @@ +#include "defines.h" + +#ifdef __H8300H__ + .h8300h +#endif + +#ifdef __H8300S__ + .h8300s +#endif + + +; A0P pointer to cursor +; A1P thing to copy + .global _memset + +_memset: + +; MOVP @(2/4,r7),A2P ; dst +; MOVP @(4/8,r7),A1 ; src thing +; MOVP @(6/12,r7),A3P ; len + + MOVP A2P,A2P + beq quit + + ; A3 points to the end of the area + MOVP A0P,A3P + ADDP A2P,A3P + + ; see if we can do it in words + ; by oring in the start of the buffer to the end address + + or A0L,A2L + btst #0,A2L + bne byteloop + + ; we can do it a word at a time + + mov.b A1L,A1H + +wordloop: + mov.w A1,@-A3P + CMPP A3P,A0P + bne wordloop +quit: rts + +byteloop: + mov.b A1L,@-A3P + CMPP A3P,A0P + bne byteloop + rts + diff --git a/newlib/libc/machine/h8300/reg_memcpy.S b/newlib/libc/machine/h8300/reg_memcpy.S new file mode 100644 index 000000000..772a43c27 --- /dev/null +++ b/newlib/libc/machine/h8300/reg_memcpy.S @@ -0,0 +1,33 @@ +#include "defines.h" + +#ifdef __H8300H__ + .h8300h +#endif + +#ifdef __H8300S__ + .h8300s +#endif + + + ; dst A0 + ; src A1 + ; len A2 + .global ___reg_memcpy +___reg_memcpy: + + MOVP A0P,A3P ; keep copy of result + ADDP A2P,A0P ; point to end of dst + ADDP A2P,A1P ; point to end of src + CMPP A0P,A3P ; see if anything to do + beq quit + + +loop: subs #1,A1P ; point to byte + mov.b @A1P,A2L ; get byte + mov.b A2L,@-A0P ; save byte + CMPP A0P,A3P ; at the front again ? + bne loop + + ; return with A0 pointing to dst +quit: rts + diff --git a/newlib/libc/machine/h8300/reg_memset.S b/newlib/libc/machine/h8300/reg_memset.S new file mode 100644 index 000000000..8e58c5ee8 --- /dev/null +++ b/newlib/libc/machine/h8300/reg_memset.S @@ -0,0 +1,32 @@ +#include "defines.h" + +#ifdef __H8300H__ + .h8300h +#endif + +#ifdef __H8300S__ + .h8300s +#endif + + + ; dst A0 + ; src A1 + ; len A2 + + .global ___reg_memset +___reg_memset: + MOVP A0P,A3P + MOVP A2P,A2P + beq noset + +memloop: + mov.b A1L,@A0P + adds #1,A0P + subs #1,A2P + MOVP A2P,A2P + bne memloop + +noset: + MOVP A3P,A0P + rts + diff --git a/newlib/libc/machine/h8300/setjmp.S b/newlib/libc/machine/h8300/setjmp.S new file mode 100644 index 000000000..9e7164095 --- /dev/null +++ b/newlib/libc/machine/h8300/setjmp.S @@ -0,0 +1,72 @@ + .file "setjmp.S" + +#ifdef __H8300H__ + .h8300h +#endif + +#ifdef __H8300S__ + .h8300s +#endif + + .section .text + .align 2 + .global _setjmp +_setjmp: +#ifdef __H8300H__ + mov.l er7,@er0 + mov.l er6,@(4,er0) + mov.l er5,@(8,er0) + mov.l er4,@(12,er0) + mov.l @sp,er1 + mov.l er1,@(16,er0) +#else +#ifdef __H8300S__ + mov.l er7,@er0 + mov.l er6,@(4,er0) + mov.l er5,@(8,er0) + mov.l er4,@(12,er0) + mov.l @sp,er1 + mov.l er1,@(16,er0) +#else + mov.w r7,@r0 + mov.w r6,@(2,r0) + mov.w r5,@(4,r0) + mov.w r4,@(6,r0) + mov.w @sp,r1 + mov.w r1,@(8,r0) +#endif +#endif + sub.w r0,r0 + rts + + .global _longjmp +_longjmp: +#ifdef __H8300H__ + mov.l @er0+,er7 + mov.l @er0+,er6 + mov.l @er0+,er5 + mov.l @er0+,er4 + mov.l @er0,er2 + mov.l er2,@sp +#else +#ifdef __H8300S__ + mov.l @er0+,er7 + mov.l @er0+,er6 + mov.l @er0+,er5 + mov.l @er0+,er4 + mov.l @er0,er2 + mov.l er2,@sp +#else + mov.w @r0+,r7 + mov.w @r0+,r6 + mov.w @r0+,r5 + mov.w @r0+,r4 + mov.w @r0,r2 + mov.w r2,@sp +#endif +#endif + mov.w r1,r0 + bne .L1 + mov.w #1,r0 +.L1: + rts diff --git a/newlib/libc/machine/h8300/strcmp.S b/newlib/libc/machine/h8300/strcmp.S new file mode 100644 index 000000000..8dec7c0b9 --- /dev/null +++ b/newlib/libc/machine/h8300/strcmp.S @@ -0,0 +1,45 @@ +#include "defines.h" + +#ifdef __H8300H__ + .h8300h +#endif + +#ifdef __H8300S__ + .h8300s +#endif + + .section .text + .align 2 + .global _strcmp +_strcmp: + MOVP A0P,A2P + MOVP A1P,A3P +.L5: + mov.b @A2P+,A1L + beq .L3 + mov.b @A3P+,A0L + cmp.b A0L,A1L + beq .L5 + subs #1,A3P +.L3: + mov.b @(-1,A2P),A0L + mov.b @A3P,A1L + sub.b A1L,A0L + ; We have to sign extend the result to 32bits just in case + ; we are using 32bit integers. +#ifdef __H8300H__ + exts.w r0 + exts.l er0 +#else +#ifdef __H8300S__ + exts.w r0 + exts.l er0 +#else + bld #7,r0l + subx r0h,r0h + subx r1l,r1l + subx r1h,r1h +#endif +#endif + rts + .end diff --git a/newlib/libc/machine/h8500/Makefile.am b/newlib/libc/machine/h8500/Makefile.am new file mode 100644 index 000000000..2d881a69a --- /dev/null +++ b/newlib/libc/machine/h8500/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = divsi3.c mulsi3.c divhi3.S shifts.c cmpsi.c psi.S setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/h8500/Makefile.in b/newlib/libc/machine/h8500/Makefile.in new file mode 100644 index 000000000..a3956ce3b --- /dev/null +++ b/newlib/libc/machine/h8500/Makefile.in @@ -0,0 +1,298 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = divsi3.c mulsi3.c divhi3.S shifts.c cmpsi.c psi.S setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = divsi3.o mulsi3.o divhi3.o shifts.o cmpsi.o psi.o \ +setjmp.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/h8500/aclocal.m4 b/newlib/libc/machine/h8500/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/h8500/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/h8500/cmpsi.c b/newlib/libc/machine/h8500/cmpsi.c new file mode 100644 index 000000000..3357343f5 --- /dev/null +++ b/newlib/libc/machine/h8500/cmpsi.c @@ -0,0 +1,126 @@ + +union u +{ + struct + { + short int msw; + unsigned short lsw; + } w; + long l; +}; + +union us +{ + struct + { + short int msw; + unsigned short lsw; + } w; + long l; +}; + +int +__cmpsi2(long arga, + short int msw_b, unsigned short int lsw_b) +{ + union u u; + u.l = arga; + + if (u.w.msw != msw_b) + { + if (u.w.msw < msw_b) return 0; + return 2; + } + if (u.w.lsw != lsw_b) + { + if (u.w.lsw < lsw_b) return 0; + return 2; + } + return 1; +} + + +int +__ucmpsi2(unsigned long arga, + unsigned short int msw_b, unsigned short int lsw_b) +{ + union us u; + u.l = arga; + + if (u.w.msw != msw_b) + { + if (u.w.msw < msw_b) return 0; + return 2; + } + if (u.w.lsw != lsw_b) + { + if (u.w.lsw < lsw_b) return 0; + return 2; + } + return 1; +} + + +union pu +{ + struct { + char ignore; + signed char msb; + unsigned short lsw; + } w; + long l; +}; + +union pun +{ + struct { + char ignore; + unsigned char msb; + unsigned short lsw; + } w; + long l; +}; + + +int +__cmppsi2(long arga, long argb) +{ + union pu a; + union pu b; + a.l = arga; + b.l = argb; + + if (a.w.msb != b.w.msb) + { + if (a.w.msb < b.w.msb) return 0; + return 2; + } + if (a.w.lsw != b.w.lsw) + { + if (a.w.lsw < b.w.lsw) return 0; + return 2; + } + return 1; +} + + +int +__ucmppsi2(long arga, long argb) +{ + union pun a; + union pun b; + a.l = arga; + b.l = argb; + + if (a.w.msb != b.w.msb) + { + if (a.w.msb < b.w.msb) return 0; + return 2; + } + if (a.w.lsw != b.w.lsw) + { + if (a.w.lsw < b.w.lsw) return 0; + return 2; + } + return 1; +} diff --git a/newlib/libc/machine/h8500/configure b/newlib/libc/machine/h8500/configure new file mode 100755 index 000000000..d862b2247 --- /dev/null +++ b/newlib/libc/machine/h8500/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=cmpsi.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/h8500/configure.in b/newlib/libc/machine/h8500/configure.in new file mode 100644 index 000000000..e51a5f424 --- /dev/null +++ b/newlib/libc/machine/h8500/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/h8500 configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(cmpsi.c) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/h8500/divhi3.S b/newlib/libc/machine/h8500/divhi3.S new file mode 100644 index 000000000..ee3135110 --- /dev/null +++ b/newlib/libc/machine/h8500/divhi3.S @@ -0,0 +1,54 @@ + .title "H8/500 DIVIDE" +!! 2 byte integer Divide code for the H8/500 +!! +!! Steve Chamberlain +!! sac@cygnus.com +!! +!! + +!! args in r1 and r4, result in r0/r1 + +#if __CODE__==32 +#define RET prts +#else +#define RET rts +#endif + .global __divmodhi4 + + +__divmodhi4: + clr.w r0 + tst.w r1 ! neg arg1 + bpl PU + + + neg.w r1 +NU: tst.w r4 + bmi NN + +NP: divxu.w r4,r0 + neg.w r0 + neg.w r1 + RET + +NN: neg.w r4 + divxu.w r4,r0 + neg.w r0 ! get rem sign right + RET + + +PU: + tst.w r4 + bpl PP + + +PN: neg.w r4 + divxu.w r4,r0 + neg.w r1 + RET + +PP: divxu.w r4,r0 ! rem in r0, q in r1 + RET + + + diff --git a/newlib/libc/machine/h8500/divsi3.c b/newlib/libc/machine/h8500/divsi3.c new file mode 100644 index 000000000..e19855d0a --- /dev/null +++ b/newlib/libc/machine/h8500/divsi3.c @@ -0,0 +1,134 @@ + +#define divnorm(num, den, sign) \ +{ \ + if (num < 0) \ + { \ + num = -num; \ + sign = 1; \ + } \ + else \ + { \ + sign = 0; \ + } \ + \ + if (den < 0) \ + { \ + den = - den; \ + sign = 1 - sign; \ + } \ +} + + + + + +unsigned long +divmodsi4(int modwanted, unsigned long num, unsigned long den) +{ + long int bit = 1; + long int res = 0; + long prevden; + while (den < num && bit && !(den & (1L<<31))) + { + den <<=1; + bit <<=1; + } + while (bit) + { + if (num >= den) + { + num -= den; + res |= bit; + } + bit >>=1; + den >>=1; + } + if (modwanted) return num; + return res; +} + + +#define exitdiv(sign, res) if (sign) { res = - res;} return res; + +long +__modsi3 (long numerator, long denominator) +{ + int sign = 0; + long dividend; + long modul; + + + if (numerator < 0) + { + numerator = -numerator; + sign = 1; + } + if (denominator < 0) + { + denominator = -denominator; + } + + modul = divmodsi4 (1, numerator, denominator); + if (sign) + return - modul; + return modul; +} + + +long +__divsi3 (long numerator, long denominator) +{ + int sign; + long dividend; + long modul; + divnorm (numerator, denominator, sign); + + dividend = divmodsi4 (0, numerator, denominator); + exitdiv (sign, dividend); +} + +long +__umodsi3 (unsigned long numerator, unsigned long denominator) +{ + long dividend; + long modul; + +modul= divmodsi4 (1, numerator, denominator); + return modul; +} + +long +__udivsi3 (unsigned long numerator, unsigned long denominator) +{ + int sign; + long dividend; + long modul; + dividend = divmodsi4 (0, numerator, denominator); + return dividend; +} + + + + + + +#ifdef TEST + + + +main () +{ + long int i, j, k, m; + for (i = -10000; i < 10000; i += 8) + { + for (j = -10000; j < 10000; j += 11) + { + k = i / j; + m = __divsi3 (i, j); + if (k != m) + printf ("fail %d %d %d %d\n", i, j, k, m); + } + } +} + +#endif diff --git a/newlib/libc/machine/h8500/mulhi3.c b/newlib/libc/machine/h8500/mulhi3.c new file mode 100644 index 000000000..869e131ea --- /dev/null +++ b/newlib/libc/machine/h8500/mulhi3.c @@ -0,0 +1,21 @@ + + +short +__mulhi3(short a, short b) +{ + int r; + + r = 0; + while (a) + { + if (a & 1) + { + r += b; + a>>=1; + b<<=1; + } + } + return r; +} + + diff --git a/newlib/libc/machine/h8500/mulsi3.c b/newlib/libc/machine/h8500/mulsi3.c new file mode 100644 index 000000000..a923e8db5 --- /dev/null +++ b/newlib/libc/machine/h8500/mulsi3.c @@ -0,0 +1,72 @@ + +typedef union { + struct { + unsigned int msw; + unsigned int lsw; +} s; + long v; +} u; + +long __mulsi3(u a, u b) +{ + int s; + long pp1; + long pp2; + long r; + + if (a.s.msw == 0 && + b.s.msw == 0) + { + return (long)a.s.lsw * b.s.lsw; + } + + s = 0; + if (a.v < 0) + { + s = 1; + a.v = - a.v; + } + if (b.v < 0) + { + s = 1-s; + b.v = - b.v; + } + + pp1 = (long)a.s.lsw * b.s.lsw ; + pp2 = (long)a.s.lsw * b.s.msw + (long)a.s.msw * b.s.lsw; + + pp1 += pp2 << 16; + + if (s) + { + pp1 = -pp1; + } + return pp1; +} +long __mulpsi3(long a, long b) +{ + return a*b; +} + + +short +__mulhi3(short a, short b) +{ + int r; + + r = 0; + while (a) + { + if (a & 1) + { + r += b; + + } + b<<=1; + a>>=1; + + } + return r; +} + + diff --git a/newlib/libc/machine/h8500/negsi2.c b/newlib/libc/machine/h8500/negsi2.c new file mode 100644 index 000000000..c5b31b19d --- /dev/null +++ b/newlib/libc/machine/h8500/negsi2.c @@ -0,0 +1,7 @@ + + +long +__negsi2(long x) +{ + return ~x+1; +} diff --git a/newlib/libc/machine/h8500/psi.S b/newlib/libc/machine/h8500/psi.S new file mode 100644 index 000000000..47c818329 --- /dev/null +++ b/newlib/libc/machine/h8500/psi.S @@ -0,0 +1,136 @@ +/* convert psi to si inplace + +Note that `fp' below isn't a segment register. +It's r6, the frame pointer. */ + +#if __CODE__==32 +#define RET prts +#else +#define RET rts +#endif + +#define EXTPSISI_SN(r_msw,r_lsw,sp) ; \ + .global __extpsisi##r_msw ; \ +__extpsisi##r_msw: ; \ + mov r_msw,r_lsw ; \ + stc sp,r_msw ; \ + RET + + EXTPSISI_SN(r2,r3,dp) + EXTPSISI_SN(r4,r5,ep) + + +#define ADDPSI_AR_RN(sr,an,r_msw,r_lsw) \ + .global __addpsi##an##r_msw ; \ +__addpsi##an##r_msw: ; \ + stc sr,@-sp ; \ + add an,r_lsw ; \ + addx @sp+,r_msw ; \ + RET + + ADDPSI_AR_RN(dp,r2,r0,r1) + ADDPSI_AR_RN(dp,r2,r3,r4) + ADDPSI_AR_RN(ep,r4,r0,r1) + ADDPSI_AR_RN(ep,r4,r1,r2) + ADDPSI_AR_RN(ep,r4,r3,r4) + ADDPSI_AR_RN(ep,r4,r5,fp) + + ADDPSI_AR_RN(tp,fp,r0,r1) + + +#define ADDPSI_RN_AR(r_msw,r_lsw,sr,an,t_msw,t_lsw) \ + .global __addpsi##r_msw##an ; \ +__addpsi##r_msw##an: ; \ + mov.w t_msw,@-sp ; \ + mov.w t_lsw,@-sp ; \ + stc sr,t_msw ; \ + mov an,t_lsw ; \ + add r_lsw,t_lsw ; \ + addx r_msw,t_msw ; \ + ldc t_msw,sr ; \ + mov.w t_lsw,an ; \ + mov.w @sp+,t_lsw ; \ + mov.w @sp+,t_msw ; \ + RET + + ADDPSI_RN_AR(r0,r1,dp,r2,r4,r5) + ADDPSI_RN_AR(r0,r1,ep,r4,r2,r3) + + + +#define EXTPSIHI_RN_RN(rm,r_msw,r_lsw) ; \ + .global __extpsihi##rm##r_msw ; \ +__extpsihi##rm##r_msw: ; \ + mov rm,r_lsw ; \ + clr.w r_msw ; \ + RET + + EXTPSIHI_RN_RN(r3,r0,r1) + EXTPSIHI_RN_RN(r4,r0,r1) + EXTPSIHI_RN_RN(r5,r0,r1) + EXTPSIHI_RN_RN(r2,r0,r1) + + + +/* ifdefed out, because gcc doesn't like the # character in the above + macro. The macro expands into an assembly languange comment anyways, + so it serves no useful purpose. */ +#if 0 +#define EXTPSIHI_RN_SN(rm,r_msw,r_lsw) ; \ + .global __extpsihi##rm##r_lsw ; \ +__extpsihi##rm##r_lsw: ; \ + mov rm,r_lsw ; \ + ldc \#0,r_msw ; \ + RET + + EXTPSIHI_RN_SN(r0,dp,r2) + EXTPSIHI_RN_SN(r0,ep,r4) + EXTPSIHI_RN_SN(r1,dp,r2) + EXTPSIHI_RN_SN(r1,ep,r4) + EXTPSIHI_RN_SN(r3,dp,r2) + EXTPSIHI_RN_SN(r3,ep,r4) + EXTPSIHI_RN_SN(r5,dp,r2) + EXTPSIHI_RN_SN(r5,ep,r4) + EXTPSIHI_RN_SN(r2,ep,r4) +#endif + + +#define EXTPSISI_RN(r_msw,r_lsw) ; \ + .global __extpsisi##r_msw ; \ +__extpsisi##r_msw: ; \ + RET + + EXTPSISI_RN(r0,r1) + + + +#define ADDPSI_SA_SB(sa,ra,sb,rb) ; \ + .global __addpsi##ra##rb ; \ +__addpsi##ra##rb: ; \ + mov.w r0,@-sp ; \ + mov.w r1,@-sp ; \ + stc sa,r0 ; \ + stc sb,r1 ; \ + add.w ra,rb ; \ + addx r0,r1 ; \ + ldc r1,sb ; \ + mov.w @sp+,r1 ; \ + mov.w @sp+,r0 ; \ + RET + + + ADDPSI_SA_SB(dp,r2,ep,r4) + ADDPSI_SA_SB(ep,r4,dp,r2) + ADDPSI_SA_SB(tp,fp,dp,r2) + ADDPSI_SA_SB(tp,fp,ep,r4) + + ADDPSI_SA_SB(dp,r2,dp,r2) + + + + .global __addpsir0r0 +__addpsir0r0: + add.w r1,r1 + addx r0,r0 + RET + diff --git a/newlib/libc/machine/h8500/setjmp.S b/newlib/libc/machine/h8500/setjmp.S new file mode 100644 index 000000000..4b25fc0c9 --- /dev/null +++ b/newlib/libc/machine/h8500/setjmp.S @@ -0,0 +1,27 @@ +! + .file "setjmp.S" + .section .text + + .global _setjmp +_setjmp: + mov.w r7,@r0+ + mov.w r6,@r0+ + mov.w r5,@r0+ + mov.w @sp,r1 + mov.w r1,@r0 + clr.w r0 + rts + + .global _longjmp +_longjmp: + mov.w @r0+,r7 + mov.w @r0+,r6 + mov.w @r0+,r5 + mov.w @r0,r2 + mov.w r2,@sp + mov.w r1,r0 + tst.w r0 + bne .L1 + mov.w #1,r0 +.L1: + rts diff --git a/newlib/libc/machine/h8500/shifts.c b/newlib/libc/machine/h8500/shifts.c new file mode 100644 index 000000000..5b8106931 --- /dev/null +++ b/newlib/libc/machine/h8500/shifts.c @@ -0,0 +1,45 @@ + + +int __ashrhi3(int a,int b) +{ + return a>>b; +} + +int __ashlhi3(int a,int b) +{ + return a<>b; +} + + + + +long __ashrsi3(long a, int b) +{ + return a>>b; +} + +long __ashlsi3(long a,int b) +{ + return a<>b; +} + diff --git a/newlib/libc/machine/hppa/DEFS.h b/newlib/libc/machine/hppa/DEFS.h new file mode 100644 index 000000000..9c0aa1e06 --- /dev/null +++ b/newlib/libc/machine/hppa/DEFS.h @@ -0,0 +1,160 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include "pcc_prefix.s" + +#define BLANK +#define BANNER(str) BLANK .VERSION str +#define ENTRY(Name) BLANK M_ENTRY (Name,PROF_/**/Name) +#define ENTRYC(Name) BLANK M_ENTRYC(Name,PROF_/**/Name) +#define EXIT(Name) BLANK M_EXIT (Name,PROF_/**/Name) +#define EXITC(Name) BLANK M_EXITC (Name,PROF_/**/Name) + +#ifdef PROF + +; +; All four argument registers are saved into caller save registers +; and restored after the call to _mcount. This is possible because +; the mcount routine does not modify them, so we can. Mcount takes +; 3 arguments; the first argument is the incoming 'rp', the second +; is the starting address of the profiled routine, and the third is +; the address of the PROF label (which is where mcount stores the +; profile data). +; +#define M_ENTRY(name,prof) \ + .SPACE $TEXT$ !\ + .SUBSPA $CODE$ !\ + .label name !\ + .PROC !\ + .CALLINFO CALLER,SAVE_RP !\ + .ENTRY !\ + stw rp,-20(sp) !\ + ldo 48(sp),sp !\ + or arg0,r0,r19 !\ + or arg1,r0,r20 !\ + or arg2,r0,r21 !\ + or arg3,r0,r22 !\ + or rp,r0,arg0 !\ + ldil L%name,r1 !\ + ldo R%name(r1),arg1 !\ + addil L%prof-$global$,dp !\ + bl _mcount,rp !\ + ldo R%prof-$global$(r1),arg2 !\ + ldw -68(sp),rp !\ + ldo -48(sp),sp !\ + or r19,r0,arg0 !\ + or r20,r0,arg1 !\ + or r21,r0,arg2 !\ + or r22,r0,arg3 !\ + + +#define M_ENTRYC(name,prof) \ + .SPACE $TEXT$ !\ + .SUBSPA $CODE$ !\ + .label name !\ + .PROC !\ + .CALLINFO CALLER,SAVE_RP !\ + .ENTRY !\ + stw rp,-20(sp) !\ + ldo 128(sp),sp !\ + or arg0,r0,r19 !\ + or arg1,r0,r20 !\ + or arg2,r0,r21 !\ + or arg3,r0,r22 !\ + or rp,r0,arg0 !\ + ldil L%name,r1 !\ + ldo R%name(r1),arg1 !\ + addil L%prof-$global$,dp !\ + bl _mcount,rp !\ + ldo R%prof-$global$(r1),arg2 !\ + ldw -148(sp),rp !\ + or r19,r0,arg0 !\ + or r20,r0,arg1 !\ + or r21,r0,arg2 !\ + or r22,r0,arg3 !\ + +; +; The HPUX profiler uses a word for each entrypoint to store the profiling +; information. The setup code passes the address to the _mcount routine. +; The EXIT macro defines a label (PROF_foo), and a word of storage. +; +#define M_EXIT(name,prof) \ + bv,n r0(rp) !\ + .EXIT !\ + .PROCEND !\ + .EXPORT name,ENTRY !\ + .SPACE $PRIVATE$ !\ + .SUBSPA $DATA$ !\ + .label prof !\ + .WORD 0 !\ + .IMPORT $global$,DATA !\ + .IMPORT _mcount,CODE + +#define M_EXITC(name,prof) \ + bv r0(rp) !\ + ldo -128(sp),sp !\ + .EXIT !\ + .PROCEND !\ + .EXPORT name,ENTRY !\ + .SPACE $PRIVATE$ !\ + .SUBSPA $DATA$ !\ + .label prof !\ + .WORD 0 !\ + .IMPORT $global$,DATA !\ + .IMPORT _mcount,CODE + +#else /* NOT profiling */ + +#define M_ENTRY(name,prof) \ + .SPACE $TEXT$ !\ + .SUBSPA $CODE$ !\ + .label name !\ + .PROC !\ + .CALLINFO !\ + .ENTRY + +#define M_ENTRYC(name,prof) \ + .SPACE $TEXT$ !\ + .SUBSPA $CODE$ !\ + .label name !\ + .PROC !\ + .CALLINFO CALLER,SAVE_RP !\ + .ENTRY !\ + stw rp,-20(sp) !\ + ldo 128(sp),sp + +#define M_EXIT(name,prof) \ + bv,n r0(rp) !\ + .EXIT !\ + .PROCEND !\ + .EXPORT name,ENTRY + +#define M_EXITC(name,prof) \ + ldw -148(sp),rp !\ + bv r0(rp) !\ + ldo -128(sp),sp !\ + .EXIT !\ + .PROCEND !\ + .EXPORT name,ENTRY + +#define ENTRY(Name) BLANK M_ENTRY (Name,PROF_/**/Name) +#define ENTRYC(Name) BLANK M_ENTRYC(Name,PROF_/**/Name) +#define EXIT(Name) BLANK M_EXIT (Name,PROF_/**/Name) +#define EXITC(Name) BLANK M_EXITC (Name,PROF_/**/Name) + + +#endif diff --git a/newlib/libc/machine/hppa/Makefile.am b/newlib/libc/machine/hppa/Makefile.am new file mode 100644 index 000000000..413cd722a --- /dev/null +++ b/newlib/libc/machine/hppa/Makefile.am @@ -0,0 +1,14 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + memchr.S memcmp.S memcpy.S memset.S setjmp.S strcat.S strcmp.S \ + strcpy.S strlen.S strncat.S strncmp.S strncpy.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/hppa/Makefile.in b/newlib/libc/machine/hppa/Makefile.in new file mode 100644 index 000000000..7fa027195 --- /dev/null +++ b/newlib/libc/machine/hppa/Makefile.in @@ -0,0 +1,300 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + memchr.S memcmp.S memcpy.S memset.S setjmp.S strcat.S strcmp.S \ + strcpy.S strlen.S strncat.S strncmp.S strncpy.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = memchr.o memcmp.o memcpy.o memset.o setjmp.o strcat.o \ +strcmp.o strcpy.o strlen.o strncat.o strncmp.o strncpy.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/hppa/aclocal.m4 b/newlib/libc/machine/hppa/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/hppa/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/hppa/configure b/newlib/libc/machine/hppa/configure new file mode 100755 index 000000000..5377ef3aa --- /dev/null +++ b/newlib/libc/machine/hppa/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=memchr.S + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/hppa/configure.in b/newlib/libc/machine/hppa/configure.in new file mode 100644 index 000000000..59ec18d3a --- /dev/null +++ b/newlib/libc/machine/hppa/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/hppa configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(memchr.S) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/hppa/memchr.S b/newlib/libc/machine/hppa/memchr.S new file mode 100644 index 000000000..1cca3e5e8 --- /dev/null +++ b/newlib/libc/machine/hppa/memchr.S @@ -0,0 +1,48 @@ +/* + * (c) Copyright 1986 HEWLETT-PACKARD COMPANY + * + * To anyone who acknowledges that this file is provided "AS IS" + * without any express or implied warranty: + * permission to use, copy, modify, and distribute this file + * for any purpose is hereby granted without fee, provided that + * the above copyright notice and this notice appears in all + * copies, and that the name of Hewlett-Packard Company not be + * used in advertising or publicity pertaining to distribution + * of the software without specific, written prior permission. + * Hewlett-Packard Company makes no representations about the + * suitability of this software for any purpose. + */ + +/* SPECTRUM_ID: @(#)memchr.s 37.4 86/04/23 */ +/* + * memchr(s, c, n) + * + * returns pointer to first occurrence of char c + * in first n characters of memory area s, + * or null if c does not occur. + */ + +#include "DEFS.h" + +#define FROM arg0 +#define CHAR arg1 +#define COUNT arg2 +#define TEMP1 r19 + +ENTRY(memchr) + comb,<= COUNT,r0,memchrexit /* return if count is zero */ + copy r0,ret0 /* null if c not found in n chars */ + depi 0,23,24,CHAR /* make char unsigned */ + + ldbs,ma 1(FROM),TEMP1 +memchrloop: + comb,=,n TEMP1,CHAR,memchrequal + addib,<> -1,COUNT,memchrloop + ldbs,ma 1(FROM),TEMP1 + b,n memchrexit + +memchrequal: + ldo -1(FROM),ret0 + +memchrexit: +EXIT(memchr) diff --git a/newlib/libc/machine/hppa/memcmp.S b/newlib/libc/machine/hppa/memcmp.S new file mode 100644 index 000000000..babb20761 --- /dev/null +++ b/newlib/libc/machine/hppa/memcmp.S @@ -0,0 +1,183 @@ +/* + * (c) Copyright 1986 HEWLETT-PACKARD COMPANY + * + * To anyone who acknowledges that this file is provided "AS IS" + * without any express or implied warranty: + * permission to use, copy, modify, and distribute this file + * for any purpose is hereby granted without fee, provided that + * the above copyright notice and this notice appears in all + * copies, and that the name of Hewlett-Packard Company not be + * used in advertising or publicity pertaining to distribution + * of the software without specific, written prior permission. + * Hewlett-Packard Company makes no representations about the + * suitability of this software for any purpose. + */ + +/* memcmp(s1, s2, n) */ +/* returns integer: < 0 iff s1 lexicographically less than s2 */ +/* > 0 iff s1 lexicographically greater than s2 */ +/* = 0 iff s1 lexicographically equal to s2 */ +/* = 0 iff s1 lexicographically equal to s2 */ +/* quit after n charachters */ +#ifndef _NAMESPACE_CLEAN +#define NOSECDEF /* prevents _memcmp from becoming primary entry */ +#endif + +#include "DEFS.h" + +#define s1 26 +#define s2 25 +#define tmp1 19 +#define s2word 20 +#define tmp3 21 +#define tmp7 22 +#define s1word 29 +#define save 1 +#define tmp6 23 +#define tmp5 28 +#define count 24 + +ENTRY(memcmp) + combt,<,n r0,count,search /*N <= 0 yields equality */ + b done /**/ + copy 0,ret0 /*return 0 (DELAY SLOT) */ +search: combf,=,n s1,s2,findout /*s1 != s2? */ + b done + copy 0,ret0 /*return 0 (delay slot) */ +findout: + comibf,=,n 0,s1,checks1 /*s1 == NULL? */ + ldbs 0(0,s2),ret0 /**/ + b done /*quit */ + sub 0,ret0,ret0 /*ret0 <- -*s2 */ +checks1: + comibf,=,n 0,s2,checkitout /*s2 == NULL? */ + b done /* quit */ + ldbs 0(0,s1),28 /* return *s1 */ + +checkitout: + extru s2,31,2,tmp1 /* Extract the low two bits of the s2. */ + extru s1,31,2,tmp5 /* Extract the low two bits of the s1 */ + sub,= tmp5,tmp1,tmp3 /* Are s1 & s2 aligned with each other? */ + b not_aligned /* It's more complicated (not_aligned) */ + dep 0,31,2,s1 /* Compute word address of s1 (DELAY SLOT) */ + dep 0,31,2,s2 /* Compute word address of s2 */ + ldwm 4(0,s1),s1word /* get next s1 word s1+=4 */ + combt,= tmp5,r0,skipmask /* skip masking, if we can */ + ldwm 4(0,s2),s2word /* get next s2 word s2+=4 (DELAY SLOT) */ + add tmp5,count,count /* bump count by the number of bytes */ + /* we are going to mask */ + sh3add tmp5,r0,save /* save now has number of bits to mask */ + mtctl save,11 + zvdepi -2,32,save /* load save with proper mask */ + or save,s1word,s1word /* mask s1word (s1) */ + or save,s2word,s2word /* mask s2word (s2) */ + + +skipmask: + combt,=,n s1word,s2word,checkN /* We may be done */ + +checkbyte: + extru s1word,7,8,tmp3 /* get first byte (character) */ +ckbyte2: extru s2word,7,8,tmp7 /* get first byte (character) */ + combf,= tmp3,tmp7,done /* quit if first byte is not equal */ + sub tmp3,tmp7,ret0 /* return difference (delay slot) */ + addibt,<=,n -1,count,done /* have we checked N chars? ret0 == 0 */ + extru s1word,15,8,tmp3 /* get second byte (character) */ + extru s2word,15,8,tmp7 /* get second byte (character) */ + combf,= tmp3,tmp7,done /* quit if second byte is not equal */ + sub tmp3,tmp7,ret0 /* return difference (delay slot) */ + addibt,<=,n -1,count,done /* have we checked N chars? */ + extru s1word,23,8,tmp3 /* get third byte (character) */ + extru s2word,23,8,tmp7 /* get third byte (character) */ + combf,= tmp3,tmp7,done /* done if third byte is not equal */ + sub tmp3,tmp7,ret0 /* return difference (delay slot) */ + addibt,<=,n -1,count,done /* have we checked N chars? */ + extru s1word,31,8,tmp3 /* get last byte (character) */ + extru s2word,31,8,tmp7 /* get last byte (character) */ + b done /* if we reach this point we know that */ + sub tmp3,tmp7,ret0 /* the last character in the word is */ + /* where the difference is, so return */ + /* the difference and we're outta here */ + + +checkN: + addibt,<=,n -4,count,zero /* have we checked N chars? */ + ldwm 4(0,s2),s2word /* get next s2 word s2+=4 */ + b skipmask /* keep checking */ + ldwm 4(0,s1),s1word /* get next s1 word s1+=4 */ + + +not_aligned: + dep r0,31,2,s2 /* Compute word address of s2 */ + combt,<,n r0,tmp3,shifts1 /* Do we shift s1 or s2 */ + sh3add tmp3,r0,tmp3 /* eight bits per byte so mul by 8 */ + ldwm 4(0,s1),s1word /* get first word of s1 */ + ldwm 4(0,s2),s2word /* get first word or s2 */ + combt,=,n r0,tmp5,masks2 /* Do we need to mask beginning of s1 */ + add tmp5,count,count /* bump count by the number of bytes */ + /* we are going to mask */ + sh3add tmp5,r0,save /* save now has number of bits to mask */ + mtctl save,11 + zvdepi -2,32,save /* load save with proper mask */ + or save,s1word,s1word /**/ +masks2: sh3add tmp1,r0,save /* save now has number of bits to mask */ + mtctl save,11 + zvdepi -2,32,save /* load save with proper mask */ + or save,s2word,s2word /**/ + subi 4,tmp1,tmp1 /* tmp1 now has the number of byte that */ + /* are valid in s2word before the vshd */ + mtctl tmp3,11 /* Move shift amount to CR11 */ +more: combt,<=,n count,tmp1,chunk1 /* Can we do the vshd? */ + ldwm 4(0,s2),tmp7 /* load second word to enable us to shift */ + vshd s2word,tmp7,s2word /**/ + combf,=,n s1word,s2word,ckbyte2 /**/ + extru s1word,7,8,tmp3 /* get first byte (DELAY SLOT) */ + addibt,<=,n -4,count,zero /* have we checked N chars? */ + copy tmp7,s2word /**/ + b more /* keep checking */ + ldwm 4(0,s1),s1word /* get next s1 (DELAY SLOT) */ + +chunk1: + vshd s2word,r0,s2word /* do an arithmetic shift left to position data */ + b ckbyte2 /**/ + extru s1word,7,8,tmp3 /**/ + + +shifts1: + sh3add tmp3,r0,tmp3 /* eight bits per byte so mul by 8 */ + sub r0,tmp3,tmp3 /* Get negative value for left shift */ + dep r0,31,2,s2 /* Compute word address of s2 */ + ldwm 4(0,s2),s2word /* get first word of s2 */ + ldwm 4(0,s1),s1word /* get first word or s1 */ + combt,=,n r0,tmp1,masks1 /*Do we need to mask beginning of s2 */ + add tmp1,count,count /*bump count by the number of bytes */ + /* we are going to mask */ + sh3add tmp1,r0,save /*save now has number of bits to mask */ + mtctl save,11 + zvdepi -2,32,save /*load save with proper mask */ + or save,s2word,s2word /**/ +masks1: sh3add tmp5,r0,save /*save now has number of bits to mask */ + mtctl save,11 + zvdepi -2,32,save /*load save with proper mask */ + or save,s1word,s1word /**/ + subi 4,tmp5,tmp5 /*tmp5 now has the number of byte that */ + /*are valid in s1word before the vshd */ + mtctl tmp3,11 /*Move shift amount to CR11 */ +more1: combt,<=,n count,tmp5,chunk2 /*Can we do the vshd? */ + ldwm 4(0,s1),tmp7 /*load second word to enable us to shift */ + vshd s1word,tmp7,s1word /**/ + combf,=,n s2word,s1word,ckbyte2 /**/ + extru s1word,7,8,tmp3 /*get first byte (DELAY SLOT) */ + addibt,<=,n -4,count,zero /*have we checked N chars? */ + copy tmp7,s1word /**/ + b more1 /*keep checking */ + ldwm 4(0,s2),s2word /*get next s2 (DELAY SLOT) */ + +chunk2: + vshd s1word,r0,s1word /**/ + b ckbyte2 /**/ + extru s1word,7,8,tmp3 /**/ + +zero: copy r0,ret0 +done: +EXIT(memcmp) diff --git a/newlib/libc/machine/hppa/memcpy.S b/newlib/libc/machine/hppa/memcpy.S new file mode 100644 index 000000000..713c1c11b --- /dev/null +++ b/newlib/libc/machine/hppa/memcpy.S @@ -0,0 +1,146 @@ +/* + * (c) Copyright 1986 HEWLETT-PACKARD COMPANY + * + * To anyone who acknowledges that this file is provided "AS IS" + * without any express or implied warranty: + * permission to use, copy, modify, and distribute this file + * for any purpose is hereby granted without fee, provided that + * the above copyright notice and this notice appears in all + * copies, and that the name of Hewlett-Packard Company not be + * used in advertising or publicity pertaining to distribution + * of the software without specific, written prior permission. + * Hewlett-Packard Company makes no representations about the + * suitability of this software for any purpose. + */ + +/* HPUX_ID: @(#) $Revision$ */ +/* + * memcpy(s1, s2, n) + * + * Copy n characters from s2 to s1; returns s1. + */ + +#define d_addr arg0 +#define s_addr arg1 +#define count arg2 +#define tmp5 arg3 +#define tmp1 r19 +#define tmp2 r20 +#define tmp3 r21 +#define tmp4 r22 +#define tmp6 r31 + +#include "DEFS.h" + +ENTRY(memcpy) + comib,>= 5,count,byteloop /* If count is <= 6 don't get fancy.*/ + movb,=,n d_addr,ret0,done /* The return value is defined to be the value of d_addr. DELAY SLOT */ + /* if d_addr is null then exit */ + extru s_addr,31,2,tmp1 /* Extract the low two bits of the source address. */ + extru d_addr,31,2,tmp2 /* Extract the low two bits of the destination address. */ + add count,tmp2,count /* pre increment the count to adjust for alignment of s1 */ + comb,<> tmp2,tmp1,not_aligned /* see if s1 is aligned w.r.t. s2. */ + dep 0,31,2,s_addr /* Compute the word address of the source. DELAY SLOT. */ + +/* aligned */ + +/* We will now begin the 16 byte at a time word move if count >= 16 ! */ +/* Else we will branch to the 4 byte-at-a time word move ! */ + + addibt,<,n -16,count,chekchunk /* If count < 16 then we can't move 16 byte chunks ! */ + /* actually we can legally move 13 or more bytes on the first loop. */ + /* These loads and stores are done so as to prevent processor interlock. */ +chunks: + ldwm 16(0,s_addr),tmp1 /* tmp1 = *s_addr s_addr += 16 */ + ldw -12(0,s_addr),tmp2 /* tmp2 = 2nd word */ + ldw -8(0,s_addr),tmp3 /* tmp3 = 3rd word */ + ldw -4(0,s_addr),tmp4 /* tmp4 = 4th word */ + /* Now store the results ! */ + stbys,b,m tmp1,4(0,d_addr) /* tmp1 = 1st word stored d_addr += 16 also take care of front porch. */ + stwm tmp2,4(0,d_addr) /* tmp2 = 2nd word stored. */ + stwm tmp3,4(0,d_addr) /* tmp3 = 3rd word stored. */ + addibf,< -16,count,chunks /* If count is still >= 16 do another loop. */ + stwm tmp4,4(0,d_addr) /* tmp4 = 4th word stored. DELAY SLOT */ + +chekchunk: + addibt,<,n 12,count,back_porch /* since the count is already decremented by -16 we're testing */ + /* to see if there are at least 4 bytes left ? */ +subchunk: + ldws,ma 4(s_addr),tmp1 /* tmp1 = *s_addr++ */ + addibf,< -4,count,subchunk /* count -= 4 */ + stbys,b,m tmp1,4(d_addr) /* *d_addr++ = tmp1 */ + + +back_porch: + addibt,=,n 4,count,done /* if count = 0 we're, of course, done ! */ + ldws 0(s_addr),tmp1 /* load up the back_porch */ + add d_addr,count,d_addr/* final store address is +1 too high ! */ + bv 0(r2) /* return--were done. */ + stbys,e tmp1,0(d_addr) /* kerplunk! whew ! */ + +/* Begin non_aligned code. (no refrence to politics) */ +not_aligned: + sub,>= tmp2,tmp1,tmp3 /* compute the shift quantity again and skip the load if tmp2 > tmp1. */ + ldwm 4(0,s_addr),tmp1 /* load up the first word from the source. tmp1 = *s_addr++ */ + zdep tmp3,28,29,tmp4 /* compute the number of bits to shift based on the number of bytes above. */ + mtctl tmp4,11 /* load the shift count into cr11 = shift count register. */ + + addibt,<,n -16,count,chkchnk2 /* first step in pre adjustment of count for looping. */ + +chunk2: + ldwm 16(0,s_addr),tmp2 /* get either first or second word . tmp2 = *s_addr++ */ + ldw -12(s_addr),tmp3 + ldw -8(s_addr),tmp4 + ldw -4(s_addr),tmp5 + vshd tmp1,tmp2,tmp6 /* position data ! */ + stbys,b,m tmp6,4(0,d_addr) /* store ! */ + + vshd tmp2,tmp3,tmp6 /* position data ! */ + stwm tmp6,4(0,d_addr) /* store ! */ + + vshd tmp3,tmp4,tmp6 /* position data ! */ + stwm tmp6,4(0,d_addr) /* store ! */ + + vshd tmp4,tmp5,tmp6 /* position data ! */ + stwm tmp6,4(0,d_addr) /* store the data ! */ + addibf,< -16,count,chunk2 /* If count is still >= 16 do another loop. */ + copy tmp5,tmp1 + + +chkchnk2: + addibt,<,n 12,count,bp_0 /* if we don't have 4 bytes left then do the back porch (bp_0) */ + +subchnk2: + ldwm 4(0,s_addr),tmp2 /* get next word ! */ + vshd tmp1,tmp2,tmp3 /* position data ! */ + addibt,< -4,count,bp_1 /* decrement count and when count < 4 goto back_porch (bp_1) */ + stbys,b,m tmp3,4(0,d_addr) /* store ! */ + + ldwm 4(0,s_addr),tmp1 /* get 4th word ! */ + vshd tmp2,tmp1,tmp3 /* position data ! */ + addib,>= -4,count,subchnk2 /* decrement count and when count <= 4 go to back porch (bp_2) */ + stbys,b,m tmp3,4(0,d_addr) /* store the data ! */ + +bp_0: copy tmp1,tmp2 /* switch registers used in the shift process. */ +bp_1: addibt,<=,n 4,count,done /* if count = -4 this implies that count = 0 -> done */ + add d_addr,count,d_addr /* bump destination address to be +1 too high ! */ + mfctl sar,tmp3 /* suppress final ldwm unless result used */ + extru tmp3,28,2,tmp3 /* convert bitshift to byteshift */ + sub,<= count,tmp3,r0 /* bytes unused if (count-byteshift <= 0*/ + + ldwm 4(0,s_addr),tmp1 /* get final word ! */ + vshd tmp2,tmp1,tmp3 /* position data ! */ + bv 0(r2) /* return */ + stbys,e tmp3,0(0,d_addr) /* store the data ! */ + +/* here we do ye old byte-at-a-time moves. */ +byteloop: + comb,>=,n 0,count,done + +encore: + ldbs,ma 1(s_addr),tmp1 + addibf,= -1,count,encore + stbs,ma tmp1,1(d_addr) + +done: +EXIT(memcpy) diff --git a/newlib/libc/machine/hppa/memset.S b/newlib/libc/machine/hppa/memset.S new file mode 100644 index 000000000..cea738251 --- /dev/null +++ b/newlib/libc/machine/hppa/memset.S @@ -0,0 +1,85 @@ +/* + * (c) Copyright 1986 HEWLETT-PACKARD COMPANY + * + * To anyone who acknowledges that this file is provided "AS IS" + * without any express or implied warranty: + * permission to use, copy, modify, and distribute this file + * for any purpose is hereby granted without fee, provided that + * the above copyright notice and this notice appears in all + * copies, and that the name of Hewlett-Packard Company not be + * used in advertising or publicity pertaining to distribution + * of the software without specific, written prior permission. + * Hewlett-Packard Company makes no representations about the + * suitability of this software for any purpose. + */ + +/* SPECTRUM_ID: @(#)memset.s 37.4 86/08/25 */ +/* + * memset(s, c, n) + * + * Sets first n chars in memory area s to value of character c. + * Returns s. + */ +#ifndef _NAMESPACE_CLEAN +#define NOSECDEF /* prevent _memset from being defined as entry */ +#endif + +#include "DEFS.h" + +#define TO arg0 +#define FILLCHAR arg1 +#define COUNT arg2 +#define TMP r31 + +ENTRY(memset) + comb,<= COUNT,r0,msexit /* return if count not positive */ + copy TO,ret0 /* return value is start of copy */ + comibf,<,n 5,COUNT,msbyteloop /* be straightforward */ + + dep FILLCHAR,23,8,FILLCHAR /* dup low byte */ + dep FILLCHAR,15,16,FILLCHAR /* into high bytes */ + + add TO,COUNT,TMP /* TMP points just past fill area */ + stbys,m FILLCHAR,0(TO) /* fill out first word */ + /* + * If we're pointing to high-order byte, no fill will happen, + * but permissions will be checked. We don't want this (we + * might be pointing at the beginning of a protected region), + * so we branch around stbys if neither low bits are set. + */ + bb,<,n TMP,31,filend /* if low bit is set, stbys */ + bb,>=,n TMP,30,endfil /* if next lowest bit isn't set */ + /* (and lowest isn't, either) */ + /* do not stbys */ +filend: + stbys,m,e FILLCHAR,0(TMP) /* fill out the last */ +endfil: + addi 4, TO, TO + sub TMP,TO,COUNT /* will now divide by 4 */ + comb,=,n COUNT,r0,msexit /* If count is zero ret. */ + + extru,<> COUNT,31,4,r1 + b msquadloop + depi 0,31,4,COUNT /* will now divide by 16 */ + + +mswordloop: + addib,<> -4,r1,mswordloop + stws,ma FILLCHAR,4(TO) + + comb,=,n COUNT,r0,msexit /* If count is zero ret. */ + +msquadloop: + stws,ma FILLCHAR,4(TO) + stws,ma FILLCHAR,4(TO) + stws,ma FILLCHAR,4(TO) + addib,<> -16,COUNT,msquadloop + stws,ma FILLCHAR,4(TO) + b,n msexit + +msbyteloop: + addib,<> -1,COUNT,msbyteloop + stbs,ma FILLCHAR,1(TO) + +msexit: +EXIT(memset) diff --git a/newlib/libc/machine/hppa/pcc_prefix.s b/newlib/libc/machine/hppa/pcc_prefix.s new file mode 100644 index 000000000..24d5254d9 --- /dev/null +++ b/newlib/libc/machine/hppa/pcc_prefix.s @@ -0,0 +1,389 @@ +; +; (c) Copyright 1986 HEWLETT-PACKARD COMPANY +; +; To anyone who acknowledges that this file is provided "AS IS" +; without any express or implied warranty: +; permission to use, copy, modify, and distribute this file +; for any purpose is hereby granted without fee, provided that +; the above copyright notice and this notice appears in all +; copies, and that the name of Hewlett-Packard Company not be +; used in advertising or publicity pertaining to distribution +; of the software without specific, written prior permission. +; Hewlett-Packard Company makes no representations about the +; suitability of this software for any purpose. +; + +; Standard Hardware Register Definitions for Use with Assembler +; version A.08.06 +; - fr16-31 added at Utah +;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; Hardware General Registers +r0: .equ 0 + +r1: .equ 1 + +r2: .equ 2 + +r3: .equ 3 + +r4: .equ 4 + +r5: .equ 5 + +r6: .equ 6 + +r7: .equ 7 + +r8: .equ 8 + +r9: .equ 9 + +r10: .equ 10 + +r11: .equ 11 + +r12: .equ 12 + +r13: .equ 13 + +r14: .equ 14 + +r15: .equ 15 + +r16: .equ 16 + +r17: .equ 17 + +r18: .equ 18 + +r19: .equ 19 + +r20: .equ 20 + +r21: .equ 21 + +r22: .equ 22 + +r23: .equ 23 + +r24: .equ 24 + +r25: .equ 25 + +r26: .equ 26 + +r27: .equ 27 + +r28: .equ 28 + +r29: .equ 29 + +r30: .equ 30 + +r31: .equ 31 + +; Hardware Space Registers +sr0: .equ 0 + +sr1: .equ 1 + +sr2: .equ 2 + +sr3: .equ 3 + +sr4: .equ 4 + +sr5: .equ 5 + +sr6: .equ 6 + +sr7: .equ 7 + +; Hardware Floating Point Registers +fr0: .equ 0 + +fr1: .equ 1 + +fr2: .equ 2 + +fr3: .equ 3 + +fr4: .equ 4 + +fr5: .equ 5 + +fr6: .equ 6 + +fr7: .equ 7 + +fr8: .equ 8 + +fr9: .equ 9 + +fr10: .equ 10 + +fr11: .equ 11 + +fr12: .equ 12 + +fr13: .equ 13 + +fr14: .equ 14 + +fr15: .equ 15 + +fr16: .equ 16 + +fr17: .equ 17 + +fr18: .equ 18 + +fr19: .equ 19 + +fr20: .equ 20 + +fr21: .equ 21 + +fr22: .equ 22 + +fr23: .equ 23 + +fr24: .equ 24 + +fr25: .equ 25 + +fr26: .equ 26 + +fr27: .equ 27 + +fr28: .equ 28 + +fr29: .equ 29 + +fr30: .equ 30 + +fr31: .equ 31 + +; Hardware Control Registers +cr0: .equ 0 + +rctr: .equ 0 ; Recovery Counter Register + + +cr8: .equ 8 ; Protection ID 1 + +pidr1: .equ 8 + + +cr9: .equ 9 ; Protection ID 2 + +pidr2: .equ 9 + + +cr10: .equ 10 + +ccr: .equ 10 ; Coprocessor Confiquration Register + + +cr11: .equ 11 + +sar: .equ 11 ; Shift Amount Register + + +cr12: .equ 12 + +pidr3: .equ 12 ; Protection ID 3 + + +cr13: .equ 13 + +pidr4: .equ 13 ; Protection ID 4 + + +cr14: .equ 14 + +iva: .equ 14 ; Interrupt Vector Address + + +cr15: .equ 15 + +eiem: .equ 15 ; External Interrupt Enable Mask + + +cr16: .equ 16 + +itmr: .equ 16 ; Interval Timer + + +cr17: .equ 17 + +pcsq: .equ 17 ; Program Counter Space queue + + +cr18: .equ 18 + +pcoq: .equ 18 ; Program Counter Offset queue + + +cr19: .equ 19 + +iir: .equ 19 ; Interruption Instruction Register + + +cr20: .equ 20 + +isr: .equ 20 ; Interruption Space Register + + +cr21: .equ 21 + +ior: .equ 21 ; Interruption Offset Register + + +cr22: .equ 22 + +ipsw: .equ 22 ; Interrpution Processor Status Word + + +cr23: .equ 23 + +eirr: .equ 23 ; External Interrupt Request + + +cr24: .equ 24 + +ppda: .equ 24 ; Physcial Page Directory Address + +tr0: .equ 24 ; Temporary register 0 + + +cr25: .equ 25 + +hta: .equ 25 ; Hash Table Address + +tr1: .equ 25 ; Temporary register 1 + + +cr26: .equ 26 + +tr2: .equ 26 ; Temporary register 2 + + +cr27: .equ 27 + +tr3: .equ 27 ; Temporary register 3 + + +cr28: .equ 28 + +tr4: .equ 28 ; Temporary register 4 + + +cr29: .equ 29 + +tr5: .equ 29 ; Temporary register 5 + + +cr30: .equ 30 + +tr6: .equ 30 ; Temporary register 6 + + +cr31: .equ 31 + +tr7: .equ 31 ; Temporary register 7 + +;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; Procedure Call Convention ~ +; Register Definitions for Use with Assembler ~ +; version A.08.06 +;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; Software Architecture General Registers +rp: .equ r2 ; return pointer + +mrp: .equ r31 ; millicode return pointer + +ret0: .equ r28 ; return value + +ret1: .equ r29 ; return value (high part of double) + +sl: .equ r29 ; static link + +sp: .equ r30 ; stack pointer + +dp: .equ r27 ; data pointer + +arg0: .equ r26 ; argument + +arg1: .equ r25 ; argument or high part of double argument + +arg2: .equ r24 ; argument + +arg3: .equ r23 ; argument or high part of double argument + +;_____________________________________________________________________________ +; Software Architecture Space Registers +; sr0 ; return link form BLE +sret: .equ sr1 ; return value + +sarg: .equ sr1 ; argument + +; sr4 ; PC SPACE tracker +; sr5 ; process private data +;_____________________________________________________________________________ +; Software Architecture Pseudo Registers +previous_sp: .equ 64 ; old stack pointer (locates previous frame) + +;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; Standard space and subspace definitions. version A.08.06 +; These are generally suitable for programs on HP_UX and HPE. +; Statements commented out are used when building such things as operating +; system kernels. +;;;;;;;;;;;;;;;; + .SPACE $TEXT$, SPNUM=0,SORT=8 +; .subspa $FIRST$, QUAD=0,ALIGN=2048,ACCESS=0x2c,SORT=4,FIRST +; .subspa $REAL$, QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=4,FIRST,LOCK + .subspa $MILLICODE$, QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=8 + .subspa $LIT$, QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=16 + .subspa $CODE$, QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=24 +; .subspa $UNWIND$, QUAD=0,ALIGN=4,ACCESS=0x2c,SORT=64 +; .subspa $RECOVER$, QUAD=0,ALIGN=4,ACCESS=0x2c,SORT=80 +; .subspa $RESERVED$, QUAD=0,ALIGN=8,ACCESS=0x73,SORT=82 +; .subspa $GATE$, QUAD=0,ALIGN=8,ACCESS=0x4c,SORT=84,CODE_ONLY +; Additional code subspaces should have ALIGN=8 for an interspace BV +; and should have SORT=24. +; +; For an incomplete executable (program bound to shared libraries), +; sort keys $GLOBAL$ -1 and $GLOBAL$ -2 are reserved for the $DLT$ +; and $PLT$ subspaces respectively. +;;;;;;;;;;;;;;; + .SPACE $PRIVATE$, SPNUM=1,PRIVATE,SORT=16 + .subspa $GLOBAL$, QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=40 + .import $global$ + .subspa $SHORTDATA$, QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=24 + .subspa $DATA$, QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=16 + .subspa $PFA_COUNTER$, QUAD=1,ALIGN=4,ACCESS=0x1f,SORT=8 + .subspa $SHORTBSS$, QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=80,ZERO + .subspa $BSS$, QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=82,ZERO +; .subspa $PCB$, QUAD=1,ALIGN=8,ACCESS=0x10,SORT=82 +; .subspa $STACK$, QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=82 +; .subspa $HEAP$, QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=82 +;;;;;;;;;;;;;;;; +; .SPACE $PFA$, SPNUM=0,PRIVATE,UNLOADABLE,SORT=64 +; .subspa $PFA_ADDRESS$, ALIGN=4,ACCESS=0x2c,UNLOADABLE +;;;;;;;;;;;;;;;; +; .SPACE $DEBUG$, SPNUM=2,PRIVATE,UNLOADABLE,SORT=80 +; .subspa $HEADER$, ALIGN=4,ACCESS=0,UNLOADABLE,FIRST +; .subspa $GNTT$, ALIGN=4,ACCESS=0,UNLOADABLE +; .subspa $LNTT$, ALIGN=4,ACCESS=0,UNLOADABLE +; .subspa $SLT$, ALIGN=4,ACCESS=0,UNLOADABLE +; .subspa $VT$, ALIGN=4,ACCESS=0,UNLOADABLE + +; To satisfy the copyright terms each .o will have a reference +; the the actual copyright. This will force the actual copyright +; message to be brought in from libgloss/hp-milli.s + .space $PRIVATE$ + .subspa $DATA$ + .import ___hp_free_copyright,data +L$copyright .word ___hp_free_copyright diff --git a/newlib/libc/machine/hppa/setjmp.S b/newlib/libc/machine/hppa/setjmp.S new file mode 100644 index 000000000..6f3668e92 --- /dev/null +++ b/newlib/libc/machine/hppa/setjmp.S @@ -0,0 +1,139 @@ +/* Copyright (c) 1995 Cygnus Support. + All rights reserved. + + Redistribution and use in source and binary forms are permitted + provided that the above copyright notice and this paragraph are + duplicated in all such forms and that any documentation, + advertising materials, and other materials related to such + distribution and use acknowledge that the software was developed + at Cygnus Support, Inc. Cygnus Support, Inc. may not be used to + endorse or promote products derived from this software without + specific prior written permission. + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ + +/* Note I don't know an easy way to get the FP version into the + traditional C library and the non-FP version into the soft-float + library. Maybe we'll have to have -msoft-float trigger something + like -DSOFT_FLOAT if this issue ever arises. */ + + .SPACE $PRIVATE$ + .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31 + .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82 + .SPACE $TEXT$ + .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44 + .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY + .IMPORT $global$,DATA + .IMPORT $$dyncall,MILLICODE +; gcc_compiled.: + .SPACE $TEXT$ + .SUBSPA $CODE$ + + .align 4 + .EXPORT setjmp,ENTRY,PRIV_LEV=3,ARGW0=GR,RTNVAL=GR +setjmp + .PROC + .CALLINFO FRAME=64,NO_CALLS,SAVE_SP,ENTRY_GR=3 + .ENTRY + stwm %r30,4(%r26) + stwm %r2,4(%r26) + stwm %r3,4(%r26) + stwm %r4,4(%r26) + stwm %r5,4(%r26) + stwm %r6,4(%r26) + stwm %r7,4(%r26) + stwm %r8,4(%r26) + stwm %r9,4(%r26) + stwm %r10,4(%r26) + stwm %r11,4(%r26) + stwm %r12,4(%r26) + stwm %r13,4(%r26) + stwm %r14,4(%r26) + stwm %r15,4(%r26) + stwm %r16,4(%r26) + stwm %r17,4(%r26) + stwm %r18,4(%r26) + stwm %r27,4(%r26) +#ifdef FP + ; jmp_buf may only have a 4 byte alignment, so handle FP stores + ; very carefully. + fstds %fr12,-16(%r30) + ldw -16(%r30),%r28 + stwm %r28,4(%r26) + ldw -12(%r30),%r28 + stwm %r28,4(%r26) + fstds %fr13,-16(%r30) + ldw -16(%r30),%r28 + stwm %r28,4(%r26) + ldw -12(%r30),%r28 + stwm %r28,4(%r26) + fstds %fr14,-16(%r30) + ldw -16(%r30),%r28 + stwm %r28,4(%r26) + ldw -12(%r30),%r28 + stwm %r28,4(%r26) + fstds %fr15,-16(%r30) + ldw -16(%r30),%r28 + stwm %r28,4(%r26) + ldw -12(%r30),%r28 + stwm %r28,4(%r26) +#endif + + bv 0(%r2) + copy %r0,%r28 + .EXIT + .PROCEND + .align 4 + .EXPORT longjmp,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,RTNVAL=GR +longjmp + .PROC + .CALLINFO FRAME=64,NO_CALLS,SAVE_SP,ENTRY_GR=3 + .ENTRY + ldwm 4(%r26),%r30 + ldwm 4(%r26),%r2 + ldwm 4(%r26),%r3 + ldwm 4(%r26),%r4 + ldwm 4(%r26),%r5 + ldwm 4(%r26),%r6 + ldwm 4(%r26),%r7 + ldwm 4(%r26),%r8 + ldwm 4(%r26),%r9 + ldwm 4(%r26),%r10 + ldwm 4(%r26),%r11 + ldwm 4(%r26),%r12 + ldwm 4(%r26),%r13 + ldwm 4(%r26),%r14 + ldwm 4(%r26),%r15 + ldwm 4(%r26),%r16 + ldwm 4(%r26),%r17 + ldwm 4(%r26),%r18 + ldwm 4(%r26),%r27 +#ifdef FP + ldwm 4(%r26),%r28 + stw %r28,-16(%r30) + ldwm 4(%r26),%r28 + stw %r28,-12(%r30) + fldds -16(%r30),%fr12 + ldwm 4(%r26),%r28 + stw %r28,-16(%r30) + ldwm 4(%r26),%r28 + stw %r28,-12(%r30) + fldds -16(%r30),%fr13 + ldwm 4(%r26),%r28 + stw %r28,-16(%r30) + ldwm 4(%r26),%r28 + stw %r28,-12(%r30) + fldds -16(%r30),%fr14 + ldwm 4(%r26),%r28 + stw %r28,-16(%r30) + ldwm 4(%r26),%r28 + stw %r28,-12(%r30) + fldds -16(%r30),%fr15 +#endif + comclr,<> %r0,%r25,%r0 + ldi 1,%r25 + bv 0(%r2) + copy %r25,%r28 + .EXIT + .PROCEND diff --git a/newlib/libc/machine/hppa/strcat.S b/newlib/libc/machine/hppa/strcat.S new file mode 100644 index 000000000..9fcdd790f --- /dev/null +++ b/newlib/libc/machine/hppa/strcat.S @@ -0,0 +1,178 @@ +/* + * (c) Copyright 1986 HEWLETT-PACKARD COMPANY + * + * To anyone who acknowledges that this file is provided "AS IS" + * without any express or implied warranty: + * permission to use, copy, modify, and distribute this file + * for any purpose is hereby granted without fee, provided that + * the above copyright notice and this notice appears in all + * copies, and that the name of Hewlett-Packard Company not be + * used in advertising or publicity pertaining to distribution + * of the software without specific, written prior permission. + * Hewlett-Packard Company makes no representations about the + * suitability of this software for any purpose. + */ + +/* HPUX_ID: @(#) $Revision$ */ +/* + * strcat(s1, s2) + * + * Concatenate s2 on the end of s1. S1's space must be large enough. + * Return s1. + */ +#include "DEFS.h" + +#define d_addr r26 +#define s_addr r25 +#define tmp6 r24 +#define tmp1 r19 +#define tmp2 r20 +#define tmp3 r21 +#define tmp4 r22 +#define tmp5 arg3 +#define save r1 + + +ENTRY(strcat) + + comb,= r0,s_addr,done /* quit if s2=NULL */ + copy d_addr,ret0 /* The return value is the value of d_addr. DELAY SLOT*/ + +/* First look for end of s1 (d_addr) */ + + extru d_addr,31,2,tmp1 /* Extract the low two bits of the dest address. */ + combt,= tmp1,r0,dont_mask + dep 0,31,2,d_addr /*set word alignment */ + ldwm 4(d_addr),tmp2 + sh3add tmp1,r0,save /* build mask based on tmp1 */ + mtctl save,11 + zvdepi -2,32,save + or save,tmp2,tmp2 + uxor,nbz tmp2,r0,save +search: + b,n found_end /* nullified under uxor conditions above and below */ +dont_mask: + ldwm 4(d_addr),tmp2 + comib,tr r0,r0,search + uxor,nbz tmp2,r0,save + +found_end: /* at this point d_addr points to word */ + extru,<> save,7,8,r0 /* following word with null */ + addib,tr,n -4,d_addr,begin_copy /*set d_addr to end of s1 */ + extru,<> save,15,8,r0 + addib,tr,n -3,d_addr,begin_copy + extru,<> save,23,8,r0 + addi -1,d_addr,d_addr + addi -1,d_addr,d_addr + + +begin_copy: + + extru s_addr,31,2,tmp1 /* Extract the low two bits of the source address. */ + extru d_addr,31,2,tmp6 /* Extract the low two bits of the destination address. */ + sub,= tmp6,tmp1,tmp3 /* Compute the shift quantity and don't branch if tmp6=tmp1. */ + b not_aligned /* Not_aligned says that shifts Will be needed. */ + dep 0,31,2,s_addr /* Compute the word address of the source. DELAY SLOT. */ +/* aligned */ + + combt,= tmp6,r0,skip_mask + ldwm 4(0,s_addr),tmp1 /* tmp1 = *s_addr s_addr += 4 (DELAY SLOT) */ + sh3add tmp6,r0,save + mtctl save,r11 + zvdepi -2,32,save + or save,tmp1,tmp1 + uxor,nbz tmp1,r0,save + b,n first_null /* special case: null in first word */ + b,n skip_mask2 + +chunks: + b,n null_found /* delay slot for uxor below */ + +skip_mask2: + stbys,b,m tmp1,4(d_addr) + ldwm 4(s_addr),tmp1 +skip_mask: + comib,tr 0,0,chunks + uxor,nbz tmp1,r0,save + +/* Begin non_aligned code. */ + +not_aligned: + sh3add,>= tmp3,r0,tmp4 /* compute the shift amt.and skip load if tmp6 > tmp1. */ + ldwm 4(0,s_addr),tmp1 /* load up the first word from the source. tmp1 = *s_addr++ */ + ldwm 4(0,s_addr),tmp2 /* get either first or second word from source. */ + combt,= tmp6,r0,chunk2 /* don't mask if whole word is valid */ + mtctl tmp4,11 /* load the shift count into cr11 = shift count register. */ + vshd tmp1,tmp2,tmp3 /* position data ! (delay slot) */ + sh3add tmp6,r0,save /* setup r1 */ + mtctl save,r11 /* set-up cr11 for mask */ + zvdepi -2,32,save + or save, tmp3, tmp3 + uxor,nbz tmp3,r0,save + b,n first_null2 + b did_mask + mtctl tmp4,11 /* re-load the shift count into cr11 */ + +chunk2: + vshd tmp1,tmp2,tmp3 + uxor,nbz tmp3, r0, save + b,n null_found +did_mask: + stbys,b,m tmp3,4(0,d_addr) /* store ! */ + + ldwm 4(0,s_addr),tmp1 /* get next word ! */ + vshd tmp2,tmp1,tmp3 /* position data ! */ + uxor,nbz tmp3, r0, save + b,n null_found + stwm tmp3,4(d_addr) + comib,tr 0,0,chunk2 + ldwm 4(s_addr),tmp2 + + +null_found: /* adjust d_addr and store final word */ + + extru,<> save,7,8,r0 + addib,tr,n 1,d_addr,store_final + extru,<> save,15,8,r0 + addib,tr,n 2,d_addr,store_final + extru,<> save,23,8,r0 + addib,tr 3,d_addr,store_final2 + bv 0(r2) + stw save,0(d_addr) + +store_final: + bv 0(r2) +store_final2: + stbys,e save,0(d_addr) /* delay slot */ + +first_null: /* null found in first word of aligned (wrt d_addr) */ + addi -4,s_addr,s_addr + ldbx tmp6(s_addr),tmp4 + add tmp6,s_addr,s_addr + comib,= 0,tmp4,done + stbs,ma tmp4,1(d_addr) + ldbs 1(s_addr),tmp4 + comib,= 0,tmp4,done + stbs,ma tmp4,1(d_addr) + bv 0(r2) /* done */ + stbs 0,0(d_addr) + +first_null2: /* null found in first word of non-aligned (wrt d_addr) */ + addibt,= -1,tmp6,check3 /* check last 3 bytes of word */ + extru save,15,8,tmp4 + addibt,=,n -1,tmp6,check2 /* check last 2 bytes */ + bv 0(r2) + stbys,b save, 0(d_addr) + +check3: + combt,= tmp4,r0,done + stbs,ma tmp4,1(d_addr) +check2: + extru,<> save,23,8,tmp4 + bv 0(r2) + stbs,ma tmp4,1(d_addr) + bv 0(r2) + stbs r0,0(d_addr) + +done: +EXIT(strcat) diff --git a/newlib/libc/machine/hppa/strcmp.S b/newlib/libc/machine/hppa/strcmp.S new file mode 100644 index 000000000..007a64849 --- /dev/null +++ b/newlib/libc/machine/hppa/strcmp.S @@ -0,0 +1,282 @@ +/* + * (c) Copyright 1986 HEWLETT-PACKARD COMPANY + * + * To anyone who acknowledges that this file is provided "AS IS" + * without any express or implied warranty: + * permission to use, copy, modify, and distribute this file + * for any purpose is hereby granted without fee, provided that + * the above copyright notice and this notice appears in all + * copies, and that the name of Hewlett-Packard Company not be + * used in advertising or publicity pertaining to distribution + * of the software without specific, written prior permission. + * Hewlett-Packard Company makes no representations about the + * suitability of this software for any purpose. + */ + +/* + + strcmp + + Jerry Huck + Edgar Circenis + +*/ +/* + * strcmp(s1, s2) + * + * returns integer: < 0 iff s1 lexicographically less than s2 + * > 0 iff s1 lexicographically greater than s2 + * = 0 iff s1 lexicographically equal to s2 + */ + +#include "DEFS.h" + +#define s1 26 +#define s2 25 +#define tmp1 19 +#define s2word 20 +#define tmp3 21 +#define tmp7 22 +#define s1word 23 +#define save 1 +#define tmp6 24 +#define tmp5 28 + +ENTRY(strcmp) + comb,=,n s1,s2,samestring + comib,=,n 0,s1,s1isnull + comib,=,n 0,s2,s2isnull +/* Hope for word alignment. Pick up low two bits of each adress */ + extru,<> s1,31,2,tmp1 + ldwm 4(s1),s1word + dep,= s2,29,2,tmp1 + b,n case_analysis + +/* Start looping until null is found in s1 or they mis-compare */ +loop: + ldwm 4(s2),s2word +loop_plus: + uxor,nbz s1word,r0,r0 /* Null in this? */ + b,n nullins1 + comb,=,n s1word,s2word,loop + ldwm 4(s1),s1word + +/* The words do not compare equal and s1 does not have a null. + Need to treat words as unsigned and generate either a positive + or negative return value */ +wordcomparereturn: + comclr,>> s1word,s2word,ret0 /*Set ret0 to 0 and skip if greater*/ + ldi -2,ret0 /*Set ret0 to -2 when less */ + bv r0(rp) + addi 1,ret0,ret0 /*Fix return value to be -1 or +1 */ + +/* s1 has a null. s2 has not been checked. */ +nullins1: + /*If s2 has no nulls this is simple, but assume that it might + and fix up s1 to allow the word comparision to work by + scanning s1 and duplicating all the bytes in s2 below that byte into + the remainder of s1. A remainder only exists if the zero byte + is found in the upper three bytes */ + extru,<> s1word,7,8,r0 /*in the first byte? */ + dep,tr s2word,31,24,s1word /*copy low 3 bytes of *s2 into *s1 */ + extru,<> s1word,15,8,r0 /*in the second byte? */ + dep,tr s2word,31,16,s1word /*copy low 2 bytes of *s2 into *s1 */ + extru,<> s1word,23,8,r0 /*in the third byte? */ + dep s2word,31,8,s1word /*copy low 1 byte of *s2 into *s1 */ + /* Do the normal unsigned compare and return */ + comclr,<> s1word,s2word,ret0 /*Set ret0 to 0 and skip if not equal */ + bv,n r0(rp) + comclr,>> s1word,s2word,ret0 /*Set ret0 to 0 and skip if greater*/ + ldi -2,ret0 /*Set ret0 to -2 when less */ + bv r0(rp) + addi 1,ret0,ret0 /*Fix return value to be -1 or +1 */ + +/* s1 and s2 are the same string and therefore equal */ +samestring: + bv r0(rp) + copy r0,ret0 +/* s1 is null. Treat as string of nulls. Therefore return + the negative of s2's first byte. s2 cannot be zero. */ +s1isnull: + ldbs 0(0,s2),ret0 + bv r0(rp) + sub 0,ret0,ret0 +/* s2 is null. Treat as string of nulls. Therefore return + s1's first byte. s1 cannot be zero. */ +s2isnull: + bv r0(rp) + ldbs 0(0,s1),ret0 + +case_analysis: + blr tmp1,r0 + nop + + /* + Case statement for non-aligned cases (we've already + checked the aligned case. + NOTE: for non-aligned cases, the absolute shift value + gets loaded into tmp3. + */ + + /* S2 S1 */ + nop /* 00 00 can't happen */ + nop + b shifts2 /* 00 01 */ + ldi 8,tmp3 /* load shift count (delay slot) */ + b shifts2 /* 00 10 */ + ldi 16,tmp3 /* load shift count (delay slot) */ + b shifts2 /* 00 11 */ + ldi 24,tmp3 /* load shift count (delay slot) */ + b shifts1_0 /* 01 00 */ + ldi 8,tmp3 /* load shift count (delay slot) */ + b eq_align1 /* 01 01 */ + ldbs,ma 1(s1),s1word + b shifts2 /* 01 10 */ + ldi 8,tmp3 /* load shift count (delay slot) */ + b shifts2 /* 01 11 */ + ldi 16,tmp3 /* load shift count (delay slot) */ + b shifts1_0 /* 10 00 */ + ldi 16,tmp3 /* load shift count (delay slot) */ + b shifts1 /* 10 01 */ + ldi 8,tmp3 /* load shift count (delay slot) */ + b eq_align2 /* 10 10 */ + ldhs,ma 2(s1),s1word + b shifts2 /* 10 11 */ + ldi 8,tmp3 /* load shift count (delay slot) */ + b shifts1_0 /* 11 00 */ + ldi 24,tmp3 /* load shift count (delay slot) */ + b shifts1 /* 11 01 */ + ldi 16,tmp3 /* load shift count (delay slot) */ + b shifts1 /* 11 10 */ + ldi 8,tmp3 /* load shift count (delay slot) */ + ldbs,ma 1(s1),s1word /* 11 11 */ + ldbs,ma 1(s2),s2word + sub,= s1word,s2word,ret0 /* if not equal, we can return now */ + bv,n r0(rp) + comclr,<> s1word,r0,ret0 + bv,n r0(rp) + b loop /* fall into main loop */ + ldwm 4(s1),s1word + +eq_align1: + ldbs,ma 1(s2),s2word + sub,= s1word,s2word,ret0 /* if not equal, we can return now */ + bv,n r0(rp) + comclr,<> s1word,r0,ret0 + bv,n r0(rp) + /* fall through to half-word aligned case */ + ldhs,ma 2(s1),s1word /* load next halfword */ +eq_align2: + ldhs,ma 2(s2),s2word /* load next halfword */ + /* form the mask: 0xffff0000 and mask leading nulls in s1word and s2word + so that we can fall into the main loop with word aligned data */ + ldi 16,save + mtctl save,r11 + zvdepi -2,32,save + or save,s1word,s1word + b loop_plus /* fall into main loop */ + or save,s2word,s2word + +/* s2's alignment is greater than s1's alignment, so we will shift s1 */ +shifts1_0: + addi -4,s1,s1 /* fix up s1 due to earlier read */ +shifts1: + extru s1,31,2,tmp1 + extru s2,31,2,tmp5 + dep r0,31,2,s1 /* Compute word address of s1 */ + dep r0,31,2,s2 /* Compute word address of s2 */ + ldwm 4(s1),s1word /* get first word of s1 */ + ldwm 4(s2),s2word /* get first word of s2 */ + combt,=,n r0,tmp1,masks2 /* Do we need to mask beginning of s1 */ + sh3add tmp1,r0,save /* save now has number of bits to mask */ + mtctl save,r11 + zvdepi -2,32,save /* load save with proper mask */ + or save,s1word,s1word +masks2: + sh3add tmp5,r0,save /* save now has number of bits to mask */ + mtctl save,r11 + zvdepi -2,32,save /* load save with proper mask */ + or save,s2word,s2word + ldi -1,tmp7 /* load tmp7 with 0xffffffff */ + mtctl tmp3,r11 /* Move shift amount to CR11 */ +more: uxor,nbz s1word,r0,r0 /* Is there a null in s1? */ + b ends1 + vshd tmp7,s1word,save + combf,=,n save,s2word,cmps1 + ldwm 4(s1),tmp7 + ldwm 4(s2),s2word + uxor,nbz tmp7,r0,r0 /* is there a null in s1? */ + b ends1_0 + vshd s1word,tmp7,save + combf,=,n save,s2word,cmps1 + ldwm 4(s1),s1word + b more + ldwm 4(s2),s2word + +cmps1: movb,tr save,s1word,wordcomparereturn + nop + +ends1_0: + copy tmp7,s1word /* move tmp7 to s1word */ +ends1: + combf,=,n save,s2word,nullins1 /* branch if no match */ + copy save,s1word /* delay slot */ +/* At this point, we know that we've read a null */ +/* from s1, so we can't read more from s1 */ + uxor,nbz save,r0,r0 /* are the strings equal? */ + b,n samestring + vshd s1word,r0,s1word + b nullins1 + ldwm 4(s2),s2word + +/* s1's alignment is greater than s2's alignment, so we will shift s2 */ +shifts2: + extru s1,31,2,tmp1 + extru s2,31,2,tmp5 + dep r0,31,2,s1 /* Compute word address of s1 */ + dep r0,31,2,s2 /* Compute word address of s2 */ + ldwm 4(s2),s2word /* get first word of s2 */ + ldwm 4(s1),s1word /* get first word of s1 */ + combt,=,n r0,tmp5,masks1 /* Do we need to mask beginning of s2 */ + sh3add tmp5,r0,save /* save now has number of bits to mask */ + mtctl save,r11 + zvdepi -2,32,save /* load save with proper mask */ + or save,s2word,s2word +masks1: + sh3add tmp1,r0,save /* save now has number of bits to mask */ + mtctl save,r11 + zvdepi -2,32,save /* load save with proper mask */ + or save,s1word,s1word + ldi -1,tmp7 /* load tmp7 with 0xffffffff */ + mtctl tmp3,r11 /* Move shift amount to CR11 */ +more1: uxor,nbz s2word,r0,r0 /* is there a null in s2? */ + b ends2 + vshd tmp7,s2word,save + combf,=,n s1word,save,cmps2 + ldwm 4(s2),tmp7 + ldwm 4(s1),s1word + uxor,nbz tmp7,r0,r0 /* is there a null in s2? */ + b ends2_0 + vshd s2word,tmp7,save + combf,=,n s1word,save,cmps2 + ldwm 4(s2),s2word + b more1 + ldwm 4(s1),s1word + +cmps2: movb,tr save,s2word,wordcomparereturn + nop + +ends2_0: + copy tmp7,s2word /* move tmp7 to s2word */ +ends2: + combf,=,n s1word,save,nullins1 /* branch if no match */ + copy save,s2word /* delay slot */ +/* At this point, we know that we've read a null */ +/* from s2, so we can't read more from s2 */ + uxor,nbz save,r0,r0 /* are the strings equal? */ + b,n samestring + vshd s2word,r0,s2word + b nullins1 + ldwm 4(s1),s1word + +EXIT(strcmp) diff --git a/newlib/libc/machine/hppa/strcpy.S b/newlib/libc/machine/hppa/strcpy.S new file mode 100644 index 000000000..3068cd5e1 --- /dev/null +++ b/newlib/libc/machine/hppa/strcpy.S @@ -0,0 +1,285 @@ +/* + * (c) Copyright 1986 HEWLETT-PACKARD COMPANY + * + * To anyone who acknowledges that this file is provided "AS IS" + * without any express or implied warranty: + * permission to use, copy, modify, and distribute this file + * for any purpose is hereby granted without fee, provided that + * the above copyright notice and this notice appears in all + * copies, and that the name of Hewlett-Packard Company not be + * used in advertising or publicity pertaining to distribution + * of the software without specific, written prior permission. + * Hewlett-Packard Company makes no representations about the + * suitability of this software for any purpose. + */ + +/* + A faster strcpy. + + by + + Jerry Huck (aligned case) + Daryl Odnert (equal-alignment case) + Edgar Circenis (non-aligned case) +*/ +/* + * strcpy(s1, s2) + * + * Copy string s2 to s1. s1 must be large enough. + * return s1 + */ + +#include "DEFS.h" + +#define d_addr r26 +#define s_addr r25 +#define tmp6 r24 +#define tmp1 r19 +#define evenside r19 +#define tmp2 r20 +#define oddside r20 +#define tmp3 r21 +#define tmp4 r22 +#define tmp5 arg3 +#define save r1 + + +ENTRY(strcpy) +/* Do some quick alignment checking on and fast path both word aligned */ + extru,<> s_addr,31,2,tmp6 /*Is source word aligned? */ + ldwm 4(0,s_addr),oddside /*Assume yes and guess that it + is double-word aligned. */ + dep,= d_addr,29,2,tmp6 /*Is target word aligned? */ + b case_analysis + copy d_addr,ret0 +/* Both are aligned. First source word already loaded assuming that + source was oddword aligned. Fall through (therefore fastest) code + shuffles the registers to join the main loop */ +bothaligned: + bb,>= s_addr,29,twoatatime /*Branch if source was odd aligned*/ + uxor,nbz oddside,r0,save + +/* Even aligned source. save holds that operand. + Do one iteration of the main copy loop juggling the registers to avoid + one copy. */ + b,n nullfound + ldwm 4(s_addr),oddside + stwm save,4(d_addr) + uxor,nbz oddside,r0,save + b,n nullfound + ldwm 4(s_addr),evenside + stwm oddside,4(d_addr) + uxor,nbz evenside,r0,save + b,n nullfound + ldwm 4(s_addr),oddside + +/* Main loop body. Entry expects evenside still to be stored, oddside + just loaded. */ +loop: + stwm evenside,4(d_addr) + uxor,nbz oddside,r0,save + +/* mid loop entry */ +twoatatime: + b,n nullfound + ldwm 4(s_addr),evenside + stwm oddside,4(d_addr) + uxor,sbz evenside,r0,save + b loop + ldwm 4(s_addr),oddside + +/* fall through when null found in evenside. oddside actually loaded */ +nullfound: /* adjust d_addr and store final word */ + + extru,<> save,7,8,r0 /* pick up leftmost byte */ + addib,tr,n 1,d_addr,store_final + extru,<> save,15,8,r0 + addib,tr,n 2,d_addr,store_final + extru,<> save,23,8,r0 + addib,tr 3,d_addr,store_final2 + bv 0(rp) + stw save,0(d_addr) + +store_final: + bv 0(rp) +store_final2: + stbys,e save,0(d_addr) /* delay slot */ + +case_analysis: + + blr tmp6,r0 + nop + + /* NOTE: the delay slots for the non-aligned cases load a */ + /* shift quantity which is TGT-SRC into tmp3. */ + /* Note also, the case for both strings being word aligned */ + /* is already checked before the BLR is executed, so that */ + /* case can never occur. */ + + /* TGT SRC */ + nop /* 00 00 can't happen */ + nop + b neg_aligned_copy /* 00 01 */ + ldi -1,tmp3 /* load shift quantity. delay slot */ + b neg_aligned_copy /* 00 10 */ + ldi -2,tmp3 /* load shift quantity. delay slot */ + b neg_aligned_copy /* 00 11 */ + ldi -3,tmp3 /* load shift quantity. delay slot */ + b pos_aligned_copy0 /* 01 00 */ + ldi 1,tmp3 /* load shift quantity. delay slot */ + b equal_alignment_1 /* 01 01 */ + ldbs,ma 1(s_addr),tmp1 + b neg_aligned_copy /* 01 10 */ + ldi -1,tmp3 /* load shift quantity. delay slot */ + b neg_aligned_copy /* 01 11 */ + ldi -2,tmp3 /* load shift quantity. delay slot */ + b pos_aligned_copy0 /* 10 00 */ + ldi 2,tmp3 /* load shift quantity. delay slot */ + b pos_aligned_copy /* 10 01 */ + ldi 1,tmp3 /* load shift quantity. delay slot */ + b equal_alignment_2 /* 10 10 */ + ldhs,ma 2(s_addr),tmp1 + b neg_aligned_copy /* 10 11 */ + ldi -1,tmp3 /* load shift quantity. delay slot */ + b pos_aligned_copy0 /* 11 00 */ + ldi 3,tmp3 /* load shift quantity. delay slot */ + b pos_aligned_copy /* 11 01 */ + ldi 2,tmp3 /* load shift quantity. delay slot */ + b pos_aligned_copy /* 11 10 */ + ldi 1,tmp3 /* load shift quantity. delay slot */ + ldbs,ma 1(s_addr),tmp1 /* 11 11 */ + comiclr,<> r0,tmp1,r0 + bv 0(rp) /* return if 1st byte was null */ + stbs,ma tmp1,1(d_addr) /* store a byte to dst string */ + b bothaligned /* can now goto word_aligned */ + ldwm 4(s_addr),oddside /* load next word of source */ + +equal_alignment_1: + comiclr,<> r0,tmp1,r0 /* nullify next if tmp1 <> 0 */ + bv 0(rp) /* return if null byte found */ + stbs,ma tmp1,1(d_addr) /* store a byte to dst string */ + ldhs,ma 2(s_addr),tmp1 /* load next halfword */ +equal_alignment_2: + extru,<> tmp1,23,8,tmp6 /* look at left byte of halfword */ + bv 0(rp) /* return if 1st byte was null */ + stbs,ma tmp6,1(d_addr) + extru,<> tmp1,31,8,r0 + bv 0(rp) /* return if 2nd byte was null */ + stbs,ma tmp1,1(d_addr) + b bothaligned + ldwm 4(s_addr),oddside /* load next word */ + +/* source and destination are not aligned, so we do it the hard way. */ + +/* target alignment is greater than source alignment */ +pos_aligned_copy0: + addi -4,s_addr,s_addr +pos_aligned_copy: + extru d_addr,31,2,tmp6 /* Extract low 2 bits of the dest addr */ + extru s_addr,31,2,tmp1 /* Extract low 2 bits of the src addr */ + dep r0,31,2,s_addr /* Compute word address of the source. */ + sh3add tmp3,r0,tmp4 /* compute shift amt */ + ldwm 4(0,s_addr),tmp2 /* get 1st source word */ + sh3add tmp1,r0,save /* setup mask shift amount */ + mtctl save,r11 /* set-up cr11 for mask */ + zvdepi -2,32,save /* create mask */ + or save,tmp2,tmp2 /* mask unused bytes in src */ + ldi -1,tmp1 /* load tmp1 with 0xffffffff */ + mtctl tmp4,r11 /* shift count -> shift count reg */ + vshd tmp1,tmp2,tmp3 /* position data ! */ + uxor,nbz tmp3,r0,save + b,n first_null + uxor,nbz tmp2,r0,save + b nullfound1 + mtctl tmp4,r11 /* re-load shift cnt (delay slot) */ + b loop_entry + ldwm 4(0,s_addr),tmp1 /* get next word. delay slot */ + +neg_aligned_copy: + extru d_addr,31,2,tmp6 /* Extract low 2 bits of the dest addr */ + extru s_addr,31,2,tmp2 /* Extract low 2 bits of the src addr */ + dep r0,31,2,s_addr /* Compute word address of the source. */ + sh3add tmp3,r0,tmp4 /* compute shift amt */ + ldwm 4(0,s_addr),tmp1 /* load first word from source. */ +/* check to see if next word can be read safely */ + sh3add tmp2,r0,save + mtctl save,r11 /* shift count -> shift count reg */ + zvdepi -2,32,save + or save, tmp1, tmp1 + uxor,nbz tmp1,r0,save /* any nulls in first word? */ + b first_null0 + mtctl tmp4,r11 + ldwm 4(0,s_addr),tmp2 /* load second word from source */ + combt,= tmp6,r0,chunk1 /* don't mask if whole word valid */ + vshd tmp1,tmp2,tmp3 /* position data ! */ + sh3add tmp6,r0,save /* setup r1 */ + mtctl save,r11 /* set-up cr11 for mask */ + zvdepi -2,32,save + or save, tmp3, tmp3 + uxor,nbz tmp3,r0,save + b,n first_null + uxor,nbz tmp2,r0,save + b nullfound1 + mtctl tmp4,r11 /* re-load shift cnt (delay slot) */ + b loop_entry + ldwm 4(0,s_addr),tmp1 /* get next word. delay slot */ + +chunk1: + uxor,nbz tmp2,r0,save + b nullfound0 + vshd tmp1,tmp2,tmp3 +did_mask: + ldwm 4(0,s_addr),tmp1 /* get next word ! */ +loop_entry: + stbys,b,m tmp3,4(0,d_addr) /* store ! */ + + uxor,nbz tmp1, r0, save + b nullfound2 + vshd tmp2,tmp1,tmp3 /* position data ! */ + ldwm 4(s_addr),tmp2 + stwm tmp3,4(d_addr) + uxor,sbz tmp2,r0,save + b did_mask +nullfound0: + vshd tmp1,tmp2,tmp3 /* delay slot */ + uxor,nbz tmp3,r0,save + b,n nullfound +nullfound1: + stbys,b,m tmp3,4(0,d_addr) + b nullfound + vshd tmp2,r0,save /* delay slot */ + +nullfound2: + uxor,nbz tmp3,r0,save + b,n nullfound + stwm tmp3,4(d_addr) + b nullfound + /* notice that delay slot is in next routine */ + +first_null0: /* null found in first word of non-aligned (wrt d_addr) */ + vshd tmp1,r0,save /* delay slot */ + combt,= tmp6,r0,check4 + extru save,7,8,tmp4 +first_null: + addibt,= -1,tmp6,check3 /* check last 3 bytes of word */ + extru save,15,8,tmp4 + addibt,=,n -1,tmp6,check2 /* check last 2 bytes */ + bv 0(rp) /* null in last byte--store and exit */ + stbys,b save, 0(d_addr) + +check4: + combt,= tmp4,r0,done + stbs,ma tmp4,1(d_addr) + extru,<> save,15,8,tmp4 +check3: + combt,= tmp4,r0,done + stbs,ma tmp4,1(d_addr) +check2: + extru,<> save,23,8,tmp4 + bv 0(rp) + stbs,ma tmp4,1(d_addr) + bv 0(rp) + stbs r0,0(d_addr) + +done: +EXIT(strcpy) diff --git a/newlib/libc/machine/hppa/strlen.S b/newlib/libc/machine/hppa/strlen.S new file mode 100644 index 000000000..12e9ef2a9 --- /dev/null +++ b/newlib/libc/machine/hppa/strlen.S @@ -0,0 +1,79 @@ +/* + * (c) Copyright 1986 HEWLETT-PACKARD COMPANY + * + * To anyone who acknowledges that this file is provided "AS IS" + * without any express or implied warranty: + * permission to use, copy, modify, and distribute this file + * for any purpose is hereby granted without fee, provided that + * the above copyright notice and this notice appears in all + * copies, and that the name of Hewlett-Packard Company not be + * used in advertising or publicity pertaining to distribution + * of the software without specific, written prior permission. + * Hewlett-Packard Company makes no representations about the + * suitability of this software for any purpose. + */ + +/* HPUX_ID = "@(#) $Revision$" */ +/* strlen(s): Return length of string s */ + +#define start arg0 +#define end ret0 +#define tmp1 arg1 +#define tmp2 arg2 + +#include "DEFS.h" + +ENTRY(strlen) + movb,=,n start,end,$null_ptr + depi 0,31,2,end + comb,<> start,end,$not_aligned + ldws,ma 4(end),tmp1 + comib,tr 0,0,$loop /* avoid INDIGO two register interlock */ + uxor,nbz 0,tmp1,0 +$not_aligned: + /* + ; Tricky code. The problem is that the value of of the word + ; including the start of the string has some garbage bytes that + ; may be 0. We don't want them to stop the string scan. So + ; we make those bytes non-zero (and any old non-zero value + ; will do). Notice that the end pointer has been rounded + ; down to a word boundary, and then incremented to the next + ; word by the time we get here. Therefore, (start-end) has + ; one of the values (-3, -2, or -1). Use uaddcm to do the + ; subtraction (instead of sub), and the result will be + ; (-4, -3, or -2). Multiply this by 8, and put into the + ; shift register (which truncates to the last 5 bits) and + ; the value will be (0, 8, or 16). Use this as a bit position, + ; and drop a mask down into tmp1. All the garbage bytes will + ; have at least 1 bit affected by the vdepi, so all the garbage + ; in this first word will be non-zero garbage. + */ + uaddcm start,end,tmp2 /* tmp2 <- { -4, -3, -2 } */ + sh3add tmp2,0,tmp2 /* tmp2 <- { -32, -24, -16 } */ + mtsar tmp2 /* sar <- { 0, 8, 16 } */ + vdepi -1,32,tmp1 + uxor,nbz 0,tmp1,0 +$loop: + b,n $end_loop + ldws,ma 4(end),tmp1 + comib,tr 0,0,$loop /* avoid INDIGO two register interlock */ + uxor,nbz 0,tmp1,0 +$end_loop: + /* adjust the end pointer to one past the end of the string */ + extru,<> tmp1,7,8,0 + addib,tr,n -3,end,$out + extru,<> tmp1,15,8,0 + addib,tr,n -2,end,$out + extru,<> tmp1,23,8,0 + addi -1,end,end +$out: + bv 0(rp) + /* + ; tricky code. the end pointer is just beyond the terminating + ; null byte, so the length is (end-start-1). use uaddcm + ; to do this in 1 instruction + */ + uaddcm end,start,ret0 + +$null_ptr: +EXIT(strlen) diff --git a/newlib/libc/machine/hppa/strncat.S b/newlib/libc/machine/hppa/strncat.S new file mode 100644 index 000000000..04bd156c9 --- /dev/null +++ b/newlib/libc/machine/hppa/strncat.S @@ -0,0 +1,238 @@ +/* + * (c) Copyright 1986 HEWLETT-PACKARD COMPANY + * + * To anyone who acknowledges that this file is provided "AS IS" + * without any express or implied warranty: + * permission to use, copy, modify, and distribute this file + * for any purpose is hereby granted without fee, provided that + * the above copyright notice and this notice appears in all + * copies, and that the name of Hewlett-Packard Company not be + * used in advertising or publicity pertaining to distribution + * of the software without specific, written prior permission. + * Hewlett-Packard Company makes no representations about the + * suitability of this software for any purpose. + */ + +/*HPUX_ID: @(#) $Revision$ */ +/* strncat(s1,s2,n) : concatonate at most n characters from s2 onto s1 */ + +#include "DEFS.h" + +#define d_addr r26 +#define s_addr r25 +#define count r24 +#define tmp1 r19 +#define tmp2 r20 +#define tmp3 r21 +#define tmp4 r22 +#define tmp5 arg3 +#define tmp6 r31 +#define save r1 +#define tmp7 ret1 /* source offset-- reset to orig source addr if not aligned */ + + +ENTRY(strncat) + + comb,= r0,s_addr,quit /* quit if s2=NULL */ + copy d_addr,ret0 /* The return value is the value of d_addr. DELAY SLOT*/ + +/* First look for end of s1 (d_addr) */ + + extru d_addr,31,2,tmp1 /* Extract the low two bits of the dest address. */ + combt,= tmp1,r0,dont_mask + dep 0,31,2,d_addr /*set word alignment */ + ldwm 4(d_addr),tmp2 + sh3add tmp1,r0,save /* build mask based on tmp1 */ + mtctl save,11 + zvdepi -2,32,save + or save,tmp2,tmp2 + uxor,nbz tmp2,r0,save +search: + b,n found_end /* nullified under uxor conditions above and below */ +dont_mask: + ldwm 4(d_addr),tmp2 + comib,tr r0,r0,search + uxor,nbz tmp2,r0,save + +found_end: /* at this point d_addr points to word */ + extru,<> save,7,8,r0 /* following word with null */ + addib,tr,n -4,d_addr,begin_copy /*set d_addr to end of s1 */ + extru,<> save,15,8,r0 + addib,tr,n -3,d_addr,begin_copy + extru,<> save,23,8,r0 + addi -1,d_addr,d_addr + addi -1,d_addr,d_addr + + +begin_copy: + addibt,<,n -4,count,byteloop /* If count is <= 4 don't get fancy.*/ + + extru s_addr,31,2,tmp4 /* Extract the low two bits of the source address.*/ + extru d_addr,31,2,tmp5 /* Extract the low two bits of the destination address.*/ + add count,tmp5,count /* pre increment the count by the byte address so that the count is*/ + copy s_addr,tmp6 /* save original s_addr in case we find null in first word */ + copy s_addr, tmp7 /* save s_addr in case we find null before first store */ + comb,<> tmp5,tmp4,not_aligned /* branch if tmp5<>tmp4. */ + dep 0,31,2,s_addr /* Compute the word address of the source. DELAY SLOT.*/ +/* aligned*/ + combt,= tmp5,r0,skip_mask + ldwm 4(0,s_addr),tmp1 /* tmp1 = *s_addr s_addr += 4 (DELAY SLOT)*/ + sh3add tmp5,r0,save /* compute mask in save*/ + mtctl save,11 + zvdepi -2,32,save + or save,tmp1,tmp1 /* or mask with data*/ + uxor,nbz tmp1,r0,save /* check for null*/ + b,n null1 + addibt,< -4,count,back_porch + stbys,b,m tmp1,4(0,d_addr) /* store word (delay slot)*/ + +chunks: + ldwm 4(0,s_addr),tmp1 /* get a word*/ + +skip_mask: + uxor,nbz tmp1,r0,save /* check for null*/ + b,n align_null1 + addibf,< -4,count,chunks + stbys,b,m tmp1,4(0,d_addr) /* store word (delay slot)*/ + +back_porch: /* last word to store*/ + addibt,=,n 4,count,done /* if count = 0 we're, of course, done !*/ + ldws 0(s_addr),tmp1 /* load up the back_porch*/ + sh3add count,r0, save /* setup right mask based on count*/ + mtctl save,r11 + zvdepi -2,32,save /*save now has left-hand mask*/ + uaddcm r0,save,save /*form right hand mask */ + or tmp1,save,tmp1 /*and insert data*/ + uxor,nbz tmp1,r0,save /* check for null*/ + b,n null2 + add d_addr,count,d_addr/* final store address is +1 too high !*/ + b done + stbys,e tmp1,0(d_addr) /* done */ + +/* Begin non_aligned code. */ +not_aligned: + sub,>= tmp5,tmp4,tmp6 /* compute the shift amt.and skip load if tmp5 > tmp4.*/ + ldwm 4(0,s_addr),tmp1 /* load up the first word from the source. tmp1 = *s_addr++*/ + zdep tmp6,28,29,tmp4 /* compute the number of bits to shift */ + mtctl tmp4,11 /* load the shift count into cr11 = shift count register.*/ + addibt,<,n -4,count,chkchnk2 /* first step in pre adjustment of count for looping.*/ + + ldwm 4(0,s_addr),tmp2 /* get either first or second word from source. */ + combt,= tmp5,r0,skip_mask4 /* don't mask if whole word is valid*/ + vshd tmp1,tmp2,tmp3 /* position data ! (delay slot)*/ + sh3add tmp5,r0,save /* setup r1*/ + mtctl save,r11 /* setup mask in save*/ + zvdepi -2,32,save + or save, tmp3, tmp3 + mtctl tmp4,11 /* re-load the shift count into cr11 */ + +skip_mask4: + uxor,nbz tmp3, r0, save + b,n null4 /* special case for first word */ + copy r0, tmp5 /* zero out tmp5 so we don't try to mask again*/ + copy r0, tmp7 /* zero out tmp7 so we don't try to use original s_addr anymore */ + b continue + stbys,b,m tmp3,4(0,d_addr) /* store ! */ + +chunk2: + ldwm 4(0,s_addr),tmp2 + vshd tmp1,tmp2,tmp3 + +skip_mask2: + uxor,nbz tmp3, r0, save + b,n null3 + stbys,b,m tmp3,4(0,d_addr) /* store ! */ + +continue: + ldwm 4(0,s_addr),tmp1 /* get 2nd word ! */ + vshd tmp2,tmp1,tmp3 /* position data ! */ + uxor,nbz tmp3, r0, save + b,n null3 + + addibf,< -8,count,chunk2 /* If count is still >= 8 do another loop.*/ + stbys,b,m tmp3,4(0,d_addr) /* store !*/ + +chkchnk2: + addibt,<,n 4,count,bp_0 /* if we don't have 4 bytes left then do the back porch (bp_0)*/ + +subchnk2: /* we have less than 8 chars to copy*/ + + ldwm 4(0,s_addr),tmp2 /* get next word !*/ + combt,= tmp5,r0,skip_mask3 + vshd tmp1,tmp2,tmp3 /* position data !*/ + sh3add tmp5,r0,save /* setup r1*/ + mtctl save,r11 /* setup mask in save*/ + zvdepi -2,32,save + or save, tmp3, tmp3 + mtctl tmp4,11 /* restore shift value again */ +skip_mask3: + uxor,nbz tmp3,r0,save + b,n null3 + copy r0,tmp5 /* zero out tmp5 so null3 does correct alignment */ + copy r0,tmp7 /* zero out tmp7 so we don't use orignal s_addr since no longer valid */ + b bp_1 /* we now have less than 4 bytes to move*/ + stbys,b,m tmp3,4(0,d_addr) /* store !*/ + +bp_0: + copy tmp1,tmp2 /* switch registers for shift process */ + addibt,<=,n 4,count,done /* if count = -4 this implies that count = 0 -> done */ + +bp_1: + ldwm 4(0,s_addr),tmp1 /* get final word ! */ + vshd tmp2,tmp1,tmp3 /* position data !*/ + uxor,nbz tmp3,r0,save /* if no-byte-zero */ + b,n bp_null /* don't goto no_null-find which null instead */ +no_null: + add d_addr,count,d_addr /* set up d_addr for stbys,e */ + b done /* were done*/ + stbys,e tmp3,0(0,d_addr) /* store the data !*/ + +/* here we do ye old byte-at-a-time moves.*/ +align_null1: + b byteloop + addi -4,s_addr,s_addr +null1: + copy tmp6,s_addr /* restore orig s_addr (aligned only) */ +byteloop: + addibt,= 4,count,done +null2: + ldbs,ma 1(s_addr),tmp1 +encore: + combt,=,n tmp1,r0, done + stbs,ma tmp1,1(d_addr) + addibf,=,n -1,count,encore + ldbs,ma 1(s_addr),tmp1 + b,n done + +bp_null: + addi -4,count,count /* fudge count 'cause byteloop will re-increment */ + +null3: /* not_aligned case reset s_addr and finish byte-wise */ + combt,=,n r0,tmp7,null3a /* if tmp7 is not valid address then branch below */ + b byteloop /* otherwise reset s_addr to tmp7 and finish */ + copy tmp7, s_addr + +null3a: /* right shift target */ + addibt,<,n 0,tmp6,null3b /* if left shifting */ + sub r0,tmp6,tmp6 /* do null3b code */ + addi -4,tmp6,tmp6 + b byteloop + add tmp6,s_addr,s_addr /* reset s_addr by 4 + shift_amt */ + +null3b: + subi -8,tmp6,tmp6 + add tmp5,tmp6,tmp6 /* adjust by the dest offset if this is our first store */ + b byteloop + add tmp6,s_addr,s_addr /* adjust s_addr by (8-shift_amt-dest_off) */ + +null4: + add,> tmp6,r0,tmp6 /* if left shift */ + b,n null3 /* then do null3 */ + b byteloop + addi -4,s_addr,s_addr /* adj source only by 4 */ + +done: + bv 0(r2) + stbs r0,0(d_addr) +quit: +EXIT(strncat) diff --git a/newlib/libc/machine/hppa/strncmp.S b/newlib/libc/machine/hppa/strncmp.S new file mode 100644 index 000000000..222384ee7 --- /dev/null +++ b/newlib/libc/machine/hppa/strncmp.S @@ -0,0 +1,189 @@ +/* + * (c) Copyright 1986 HEWLETT-PACKARD COMPANY + * + * To anyone who acknowledges that this file is provided "AS IS" + * without any express or implied warranty: + * permission to use, copy, modify, and distribute this file + * for any purpose is hereby granted without fee, provided that + * the above copyright notice and this notice appears in all + * copies, and that the name of Hewlett-Packard Company not be + * used in advertising or publicity pertaining to distribution + * of the software without specific, written prior permission. + * Hewlett-Packard Company makes no representations about the + * suitability of this software for any purpose. + */ + +/* strcmp(s1, s2) */ +/* returns integer: < 0 iff s1 lexicographically less than s2 */ +/* > 0 iff s1 lexicographically greater than s2 */ +/* = 0 iff s1 lexicographically equal to s2 */ +/* = 0 iff s1 lexicographically equal to s2 */ +/* quit after n charachters */ +#include "DEFS.h" + +#define s1 26 +#define s2 25 +#define tmp1 19 +#define s2word 20 +#define tmp3 21 +#define tmp7 22 +#define s1word 29 +#define save 1 +#define tmp6 23 +#define tmp5 28 +#define count 24 + +ENTRY(strncmp) + combt,<,n r0,count,search /* N <= 0 yields equality */ + bv r0(rp) /* */ + copy 0,ret0 /* return 0 (DELAY SLOT) */ +search: combf,=,n s1,s2,findout /* s1 != s2? */ + bv r0(rp) /* */ + copy 0,ret0 /* return 0 (delay slot) */ +findout: + comibf,=,n 0,s1,checks1 /* s1 == NULL? */ + ldbs 0(0,s2),ret0 /* */ + bv r0(rp) /* */ + subi 0,ret0,ret0 /* ret0 <- -*s2 */ +checks1: + comibf,=,n 0,s2,checkitout /* s2 == NULL? */ + bv r0(rp) /* */ + ldbs 0(0,s1),28 /* return *s1 */ + +checkitout: + extru s2,31,2,tmp1 /* Extract the low two bits of the s2. */ + extru s1,31,2,tmp5 /* Extract the low two bits of the s1 */ + sub,= tmp5,tmp1,tmp3 /* Are s1 & s2 aligned with each other? */ + b not_aligned /* It's more complicated (not_aligned) */ + dep 0,31,2,s1 /* Compute word address of s1 (DELAY SLOT) */ + dep 0,31,2,s2 /* Compute word address of s2 */ + ldwm 4(0,s1),s1word /* get next s1 word s1+=4 */ + combt,= tmp5,r0,skipmask /* skip masking, if we can */ + ldwm 4(0,s2),s2word /* get next s2 word s2+=4 (DELAY SLOT) */ + add tmp5,count,count /* bump count by the number of bytes */ + /* we are going to mask */ + sh3add tmp5,r0,save /* save now has number of bits to mask */ + mtctl save,11 + zvdepi -2,32,save /* load save with proper mask */ + or save,s1word,s1word /* mask s1word (s1) */ + or save,s2word,s2word /* mask s2word (s2) */ + + +skipmask: + combt,=,n s1word,s2word,chknulls /* are these words equal? */ + +checkbyte: + extru s1word,7,8,tmp3 /* get first byte (character) */ +ckbyte2: extru s2word,7,8,tmp7 /* get first byte (character) */ + combf,= tmp3,tmp7,done /* quit if first byte is not equal */ + sub tmp3,tmp7,ret0 /* return difference (delay slot) */ + comibt,=,n 0,tmp3,done /* have we reached the end of string */ + /* if so done ret0 already has zero */ + addibt,<=,n -1,count,done /* have we checked N chars? ret0 == 0 */ + extru s1word,15,8,tmp3 /* get second byte (character) */ + extru s2word,15,8,tmp7 /* get second byte (character) */ + combf,= tmp3,tmp7,done /* quit if second byte is not equal */ + sub tmp3,tmp7,ret0 /* return difference (delay slot) */ + comibt,=,n 0,tmp3,done /* have we reached the end of string */ + /* if so done ret0 already has zero */ + addibt,<=,n -1,count,done /* have we checked N chars? */ + extru s1word,23,8,tmp3 /* get third byte (character) */ + extru s2word,23,8,tmp7 /* get third byte (character) */ + combf,= tmp3,tmp7,done /* done if third byte is not equal */ + sub tmp3,tmp7,ret0 /* return difference (delay slot) */ + comibt,=,n 0,tmp3,done /* have we reached the end of string */ + /* if so done ret0 already has zero */ + addibt,<=,n -1,count,done /* have we checked N chars? */ + extru s1word,31,8,tmp3 /* get last byte (character) */ + extru s2word,31,8,tmp7 /* get last byte (character) */ + bv r0(rp) /* */ + sub tmp3,tmp7,ret0 /* the last characters in the word is */ + /* where the difference is, so return */ + /* the difference and we're outta here */ + + +chknulls: + addibt,<=,n -4,count,zero /* have we checked N chars? */ + uxor,nbz s1word,0,0 /* don't have to check s2 Just quit */ + bv r0(rp) /* */ + copy 0,28 /* return 0 */ + ldwm 4(0,s2),s2word /* get next s2 word s2+=4 */ + b skipmask /* keep checking */ + ldwm 4(0,s1),s1word /* get next s1 word s1+=4 */ + + +not_aligned: + dep r0,31,2,s2 /* Compute word address of s2 */ + combt,<,n r0,tmp3,shifts1 /* Do we shift s1 or s2 */ + sh3add tmp3,r0,tmp3 /* eight bits per byte so mul by 8 */ + ldwm 4(0,s1),s1word /* get first word of s1 */ + ldwm 4(0,s2),s2word /* get first word or s2 */ + combt,=,n r0,tmp5,masks2 /* Do we need to mask beginning of s1 */ + add tmp5,count,count /* bump count by the number of bytes */ + /* we are going to mask */ + sh3add tmp5,r0,save /* save now has number of bits to mask */ + mtctl save,11 + zvdepi -2,32,save /* load save with proper mask */ + or save,s1word,s1word /* */ +masks2: sh3add tmp1,r0,save /* save now has number of bits to mask */ + mtctl save,11 + zvdepi -2,32,save /* load save with proper mask */ + or save,s2word,s2word /* */ + mtctl tmp3,11 /* Move shift amount to CR11 */ +more: uxor,nbz s2word,r0,r0 /* Is there a null in first word */ + b,n chunk1 /* */ + ldwm 4(0,s2),tmp7 /* load second word to enable us to shift */ + vshd s2word,tmp7,s2word /* */ + combf,=,n s1word,s2word,ckbyte2 /* */ + extru s1word,7,8,tmp3 /* get first byte (DELAY SLOT) */ + addibt,<=,n -4,count,zero /* have we checked N chars? */ + uxor,nbz s1word,0,0 /* even though they're equal we could be done */ + b,n zero + copy tmp7,s2word /* */ + b more /* keep checking */ + ldwm 4(0,s1),s1word /* get next s1 (DELAY SLOT) */ + +chunk1: + vshd s2word,r0,s2word /* */ + b ckbyte2 /* */ + extru s1word,7,8,tmp3 /* */ + + +shifts1: + sh3add tmp3,r0,tmp3 /* eight bits per byte so mul by 4 */ + sub r0,tmp3,tmp3 /* Get negative value for left shift */ + ldwm 4(0,s2),s2word /* get first word of s2 */ + ldwm 4(0,s1),s1word /* get first word or s1 */ + combt,=,n r0,tmp1,masks1 /* Do we need to mask beginning of s2 */ + add tmp1,count,count /* bump count by the number of bytes */ + /* we are going to mask */ + sh3add tmp1,r0,save /* save now has number of bits to mask */ + mtctl save,11 + zvdepi -2,32,save /* load save with proper mask */ + or save,s2word,s2word /* */ +masks1: sh3add tmp5,r0,save /* save now has number of bits to mask */ + mtctl save,11 + zvdepi -2,32,save /* load save with proper mask */ + or save,s1word,s1word /* */ + mtctl tmp3,11 /* Move shift amount to CR11 */ +more1: uxor,nbz s1word,r0,r0 /* Is there a null in first byte */ + b,n chunk2 /* */ + ldwm 4(0,s1),tmp7 /* load second word to enable us to shift */ + vshd s1word,tmp7,s1word /* */ + combf,=,n s2word,s1word,ckbyte2 /* */ + extru s1word,7,8,tmp3 /* get first byte (DELAY SLOT) */ + addibt,<=,n -4,count,zero /* have we checked N chars? */ + uxor,nbz s2word,0,0 /* even though they're equal we could be done */ + b,n zero /* zero ret0 and quit */ + copy tmp7,s1word /* */ + b more1 /* keep checking */ + ldwm 4(0,s2),s2word /* get next s2 (DELAY SLOT) */ + +chunk2: + vshd s1word,r0,s1word /* */ + b ckbyte2 /* */ + extru s1word,7,8,tmp3 /* */ + +zero: copy r0,ret0 +done: +EXIT(strncmp) diff --git a/newlib/libc/machine/hppa/strncpy.S b/newlib/libc/machine/hppa/strncpy.S new file mode 100644 index 000000000..37ed83237 --- /dev/null +++ b/newlib/libc/machine/hppa/strncpy.S @@ -0,0 +1,256 @@ +/* + * (c) Copyright 1986 HEWLETT-PACKARD COMPANY + * + * To anyone who acknowledges that this file is provided "AS IS" + * without any express or implied warranty: + * permission to use, copy, modify, and distribute this file + * for any purpose is hereby granted without fee, provided that + * the above copyright notice and this notice appears in all + * copies, and that the name of Hewlett-Packard Company not be + * used in advertising or publicity pertaining to distribution + * of the software without specific, written prior permission. + * Hewlett-Packard Company makes no representations about the + * suitability of this software for any purpose. + */ + +/* HPUX_ID: @(#) $Revision$ */ +/* + * strncpy(s1, s2, n) + * + * Copy s2 to s1, truncating or null-padding to always copy n bytes + * return s1 + */ + +#include "DEFS.h" + +#define d_addr r26 +#define s_addr r25 +#define count r24 +#define tmp1 r19 +#define tmp2 r20 +#define tmp3 r21 +#define tmp4 r22 +#define tmp5 arg3 +#define save r1 + + +ENTRY(strncpy) + + combt,= s_addr,r0,pad_null_bytes1 /* if s2==NULL then pad nulls and exit */ + copy d_addr,ret0 /* The return value is defined to be the value of d_addr. DELAY SLOT*/ + addibt,<,n -4,count,byteloop /* If count is <= 4 don't get fancy.*/ + + extru s_addr,31,2,tmp1 /* Extract the low two bits of the source address.*/ + extru d_addr,31,2,tmp5 /* Extract the low two bits of the destination address.*/ + add count,tmp5,count /* pre increment the count by the byte address so that the count is*/ + comb,<> tmp5,tmp1,not_aligned /* branch if tmp5<>tmp1. */ + dep 0,31,2,s_addr /* Compute the word address of the source. DELAY SLOT.*/ +/* aligned*/ + combt,= tmp5,r0,skip_mask + ldwm 4(0,s_addr),tmp1 /* tmp1 = *s_addr s_addr += 4 (DELAY SLOT)*/ + sh3add tmp5,r0,save /* compute mask in save*/ + mtctl save,11 + zvdepi -2,32,save + b skip_mask /* don't reload tmp1*/ + or save,tmp1,tmp1 /* or mask with data*/ + +chunks: + ldwm 4(0,s_addr),tmp1 /* get a word*/ + +skip_mask: + uxor,nbz tmp1,r0,save /* check for null*/ + b,n null1 + addibf,< -4,count,chunks + stbys,b,m tmp1,4(0,d_addr) /* store word (delay slot)*/ + +/* back_porch last word to store*/ + addibt,=,n 4,count,done /* if count = 0 we're, of course, done !*/ + ldws 0(s_addr),tmp1 /* load up the back_porch*/ + add d_addr,count,d_addr/* final store address is +1 too high !*/ + sh3add count,r0, save /* setup right mask based on count*/ + mtctl save,r11 + zvdepi -2,32,save /*save now has left-hand mask*/ + uaddcm r0,save,save /*form right hand mask */ + or tmp1,save,tmp1 /*and insert data*/ + uxor,nbz tmp1,r0,save /* check for null*/ + b,n null2 + bv 0(r2) + stbys,e tmp1,0(d_addr) /* done */ + +/* Begin non_aligned code. */ +not_aligned: + sub,>= tmp5,tmp1,tmp3 /* compute the shift amt.and skip load if tmp5 > tmp1.*/ + ldwm 4(0,s_addr),tmp1 /* load up the first word from the source. tmp1 = *s_addr++*/ + zdep tmp3,28,29,tmp4 /* compute the number of bits to shift */ + mtctl tmp4,11 /* load the shift count into cr11 = shift count register.*/ + addibt,<,n -4,count,chkchnk2 /* first step in pre adjustment of count for looping.*/ + + ldwm 4(0,s_addr),tmp2 /* get either first or second word from source. */ + combt,= tmp5,r0,skip_mask2 /* don't mask if whole word is valid*/ + vshd tmp1,tmp2,tmp3 /* position data ! (delay slot)*/ + sh3add tmp5,r0,save /* setup r1*/ + mtctl save,r11 /* setup mask in save*/ + zvdepi -2,32,save + or save, tmp3, tmp3 + mtctl tmp4,11 /* re-load the shift count into cr11 */ + b skip_mask2 + copy r0, tmp5 /* zero out tmp5 so we don't try to mask again*/ + +chunk2: + ldwm 4(0,s_addr),tmp2 + vshd tmp1,tmp2,tmp3 + +skip_mask2: + uxor,nbz tmp3, r0, save + b,n null3 + stbys,b,m tmp3,4(0,d_addr) /* store ! */ + + ldwm 4(0,s_addr),tmp1 /* get 2nd word ! */ + vshd tmp2,tmp1,tmp3 /* position data ! */ + uxor,nbz tmp3, r0, save + b,n null4 + + addibf,< -8,count,chunk2 /* If count is still >= 8 do another loop.*/ + stbys,b,m tmp3,4(0,d_addr) /* store !*/ + +chkchnk2: + addibt,<,n 4,count,bp_0 /* if we don't have 4 bytes left then do the back porch (bp_0)*/ + +subchnk2: /* we have less than 8 chars to copy*/ + + ldwm 4(0,s_addr),tmp2 /* get next word !*/ + combt,= tmp5,r0,skip_mask3 + vshd tmp1,tmp2,tmp3 /* position data !*/ + sh3add tmp5,r0,save /* setup r1*/ + mtctl save,r11 /* setup mask in save*/ + zvdepi -2,32,save + or save, tmp3, tmp3 + mtctl tmp4,11 /* restore shift value again */ + copy r0, tmp5 /* zero out tmp5 so we don't try to mask again*/ +skip_mask3: + uxor,nbz tmp3,r0,save + b,n null4 + b bp_1 /* we now have less than 4 bytes to move*/ + stbys,b,m tmp3,4(0,d_addr) /* store !*/ + +bp_0: + copy tmp1,tmp2 /* switch registers used in the shift process.*/ + addibt,<=,n 4,count,done /* if count = -4 this implies that count = 0 -> done */ + +bp_1: + ldwm 4(0,s_addr),tmp1 /* get final word ! */ + vshd tmp2,tmp1,tmp3 /* position data !*/ + uxor,sbz tmp3,r0,save /* if some-byte-zero */ + b no_null /* don't goto no_null-find which null instead */ + add d_addr,count,d_addr /* get d_addr ready for stbys,e */ + extru,<> save,7,8,r0 + b found_null5 + copy r0, tmp5 + extru,<> save,15,8,r0 + b found_null5 + ldil 0x1FE000,tmp5 /* setup mask (FF000000)*/ + extru,<> save,23,8,r0 + b found_null5 + ldil 0x1FFFE0,tmp5 /* setup mask (FFFF0000)*/ + ldo -1(r0),tmp5 /* setup mask (FFFFFFFF)*/ +found_null5: + and tmp3,tmp5,tmp3 /* zero out tmp5 based on mask in tmp5*/ +no_null: + bv 0(r2) /* were done*/ + stbys,e tmp3,0(0,d_addr) /* store the data !*/ + +/* here we do ye old byte-at-a-time moves.*/ +byteloop: + addibt,=,n 4,count,done + comb,= 0,s_addr,done + stbs r0,0(d_addr) /* store null in case s_addr == NULL */ + ldbs,ma 1(s_addr),tmp1 +encore: + combt,=,n tmp1,r0, pad_null_bytes1 + stbs,ma tmp1,1(d_addr) + addibf,=,n -1,count,encore + ldbs,ma 1(s_addr),tmp1 + b,n done + +pnb_1: + addibt,=,n 4,count,done /* if count was already 0 then we're done*/ + +pad_null_bytes1: + combt,=,n count,r0,done /* if count==0 then exit */ +pad_null_bytes2: + addibf,= -1,count,pad_null_bytes2 + stbs,ma r0,1(d_addr) + b,n done + +pad_nulls: + addibf,<=,n -4,count,pad_nulls + stwm r0,4(d_addr) + b,n pnb_1 + + +null1: + extru,<> save,7,8,r0 + b found_null1 + copy r0, tmp5 + extru,<> save,15,8,r0 + b found_null1 + ldil 0x1FE000,tmp5 /* setup mask (FF000000)*/ + extru,<> save,23,8,r0 + b found_null1 + ldil 0x1FFFE0,tmp5 /* setup mask (FFFF0000)*/ + ldo -1(r0),tmp5 /* setup mask (FFFFFFFF)*/ +found_null1: + and tmp1,tmp5,tmp1 /*zero out tmp1 according to mask*/ + b pad_nulls /* nullify remaining count bytes*/ + stbys,b,m tmp1,4(0,d_addr) /* first word (account for alignment)*/ + + +null2: /* back porch case. We have less than 4 bytes to go.*/ + extru,<> save,7,8,r0 /* is null in 1st byte? */ + b found_null2 + copy r0, tmp5 + extru,<> save,15,8,r0 /* is null in 2nd byte? */ + b found_null2 + ldil 0x1FE000,tmp5 /* setup mask (FF000000)*/ + b found_null2 /* null must be in 3rd byte */ + ldil 0x1FFFE0,tmp5 /* setup mask (FFFF0000)*/ +found_null2: + and tmp1,tmp5,tmp1 /*zero out tmp1 according to mask*/ + bv 0(r2) /* we're done*/ + stbys,e tmp1,0(0,d_addr) /* last word (back porch)*/ + +null3: /* not_aligned case where null is found in first of two words--adjust count*/ + extru,<> save,7,8,r0 + b found_null3 + copy r0, tmp5 + extru,<> save,15,8,r0 + b found_null3 + ldil 0x1FE000,tmp5 /* setup mask (FF000000)*/ + extru,<> save,23,8,r0 + b found_null3 + ldil 0x1FFFE0,tmp5 /* setup mask (FFFF0000)*/ + ldo -1(r0),tmp5 /* setup mask (FFFFFFFF)*/ +found_null3: + addi 4,count,count /* fix count since null is in first of two words*/ + and tmp3,tmp5,tmp3 /*zero out tmp3 according to mask*/ + b pad_nulls /* nullify remaining count bytes*/ + stbys,b,m tmp3,4(d_addr) + +null4: /* not_aligned case where null is found in second of two words*/ + extru,<> save,7,8,r0 + b found_null4 + copy r0, tmp5 + extru,<> save,15,8,r0 + b found_null4 + ldil 0x1FE000,tmp5 /* setup mask (FF000000)*/ + extru,<> save,23,8,r0 + b found_null4 + ldil 0x1FFFE0,tmp5 /* setup mask (FFFF0000)*/ + ldo -1(r0),tmp5 /* setup mask (FFFFFFFF)*/ +found_null4: + and tmp3,tmp5,tmp3 /*zero out tmp4 according to mask*/ + b pad_nulls /* nullify remaining count bytes*/ + stbys,b,m tmp3,4(d_addr) + +done: +EXIT(strncpy) diff --git a/newlib/libc/machine/i386/Makefile.am b/newlib/libc/machine/i386/Makefile.am new file mode 100644 index 000000000..7de099e84 --- /dev/null +++ b/newlib/libc/machine/i386/Makefile.am @@ -0,0 +1,20 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = -I $(newlib_basedir)/libm/common $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +if MACH_ADD_SETJMP +mach_add_src=setjmp.S +else +mach_add_src= +endif + +lib_a_SOURCES = \ + memchr.S memcmp.S memcpy.S memset.S strchr.S \ + $(mach_add_src) + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/i386/Makefile.in b/newlib/libc/machine/i386/Makefile.in new file mode 100644 index 000000000..4856ba2d1 --- /dev/null +++ b/newlib/libc/machine/i386/Makefile.in @@ -0,0 +1,327 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = -I $(newlib_basedir)/libm/common $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a +@MACH_ADD_SETJMP_TRUE@mach_add_src = setjmp.S +@MACH_ADD_SETJMP_FALSE@mach_add_src = + +lib_a_SOURCES = memchr.S memcmp.S memcpy.S memset.S strchr.S \ + $(mach_add_src) + + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +@MACH_ADD_SETJMP_TRUE@lib_a_OBJECTS = memchr.o memcmp.o memcpy.o \ +@MACH_ADD_SETJMP_TRUE@memset.o strchr.o \ +@MACH_ADD_SETJMP_TRUE@setjmp.o +@MACH_ADD_SETJMP_FALSE@lib_a_OBJECTS = memchr.o memcmp.o memcpy.o \ +@MACH_ADD_SETJMP_FALSE@memset.o strchr.o + +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in \ + ../../../acinclude.m4 ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + -rm -f config.status + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ +check-am installcheck-am installcheck install-info-am install-info \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/i386/aclocal.m4 b/newlib/libc/machine/i386/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/i386/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/i386/configure b/newlib/libc/machine/i386/configure new file mode 100755 index 000000000..2c019d928 --- /dev/null +++ b/newlib/libc/machine/i386/configure @@ -0,0 +1,1699 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=setjmp.S + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + + + +if test "x$mach_add_setjmp" = 'xtrue'; then + MACH_ADD_SETJMP_TRUE= + MACH_ADD_SETJMP_FALSE='#' +else + MACH_ADD_SETJMP_TRUE='#' + MACH_ADD_SETJMP_FALSE= +fi + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g +s%@MACH_ADD_SETJMP_TRUE@%$MACH_ADD_SETJMP_TRUE%g +s%@MACH_ADD_SETJMP_FALSE@%$MACH_ADD_SETJMP_FALSE%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/i386/configure.in b/newlib/libc/machine/i386/configure.in new file mode 100644 index 000000000..63c080480 --- /dev/null +++ b/newlib/libc/machine/i386/configure.in @@ -0,0 +1,14 @@ +dnl This is the newlib/libc/machine/i386 configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(setjmp.S) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AM_CONDITIONAL(MACH_ADD_SETJMP, test "x$mach_add_setjmp" = 'xtrue') + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/i386/f_atan2.S b/newlib/libc/machine/i386/f_atan2.S new file mode 100644 index 000000000..c6f3a7acd --- /dev/null +++ b/newlib/libc/machine/i386/f_atan2.S @@ -0,0 +1,32 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +Fast version of atan2 using Intel float instructions. + + double _f_atan2 (double y, double x); + +Function computes arctan ( y / x ). +There is no error checking or setting of errno. +*/ + + #include "i386mach.h" + + .global SYM (_f_atan2) + +SYM (_f_atan2): + pushl ebp + movl esp,ebp + fldl 8(ebp) + fldl 16(ebp) + fpatan + + leave + ret diff --git a/newlib/libc/machine/i386/f_atan2f.S b/newlib/libc/machine/i386/f_atan2f.S new file mode 100644 index 000000000..d56a16709 --- /dev/null +++ b/newlib/libc/machine/i386/f_atan2f.S @@ -0,0 +1,32 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +Fast version of atan2f using Intel float instructions. + + float _f_atan2f (float y, float x); + +Function computes arctan ( y / x ). +There is no error checking or setting of errno. +*/ + + #include "i386mach.h" + + .global SYM (_f_atan2f) + +SYM (_f_atan2f): + pushl ebp + movl esp,ebp + flds 8(ebp) + flds 12(ebp) + fpatan + + leave + ret diff --git a/newlib/libc/machine/i386/f_exp.c b/newlib/libc/machine/i386/f_exp.c new file mode 100644 index 000000000..a7fb05507 --- /dev/null +++ b/newlib/libc/machine/i386/f_exp.c @@ -0,0 +1,45 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +Fast version of exp using Intel float instructions. + + double _f_exp (double x); + +Function computes e ** x. The following special cases exist: + 1. if x is 0.0 ==> return 1.0 + 2. if x is infinity ==> return infinity + 3. if x is -infinity ==> return 0.0 + 4. if x is NaN ==> return x +There is no error checking or setting of errno. +*/ + + +#include +#include +#include "f_math.h" + +double _f_exp (double x) +{ + if (check_finite(x)) + { + double result; + asm ("fldl2e; fmulp; fld %%st; frndint; fsub %%st,%%st(1); fxch;" \ + "fchs; f2xm1; fld1; faddp; fxch; fld1; fscale; fstp %%st(1); fmulp" : + "=t"(result) : "0"(x)); + return result; + } + else if (x == -infinity()) + return 0.0; + + return x; +} + + diff --git a/newlib/libc/machine/i386/f_expf.c b/newlib/libc/machine/i386/f_expf.c new file mode 100644 index 000000000..438772764 --- /dev/null +++ b/newlib/libc/machine/i386/f_expf.c @@ -0,0 +1,45 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +Fast version of exp using Intel float instructions. + + float _f_expf (float x); + +Function computes e ** x. The following special cases exist: + 1. if x is 0.0 ==> return 1.0 + 2. if x is infinity ==> return infinity + 3. if x is -infinity ==> return 0.0 + 4. if x is NaN ==> return x +There is no error checking or setting of errno. +*/ + + +#include +#include +#include "f_math.h" + +float _f_expf (float x) +{ + if (check_finitef(x)) + { + float result; + asm ("fldl2e; fmulp; fld %%st; frndint; fsub %%st,%%st(1); fxch;" \ + "fchs; f2xm1; fld1; faddp; fxch; fld1; fscale; fstp %%st(1); fmulp" : + "=t"(result) : "0"(x)); + return result; + } + else if (x == -infinityf()) + return 0.0; + + return x; +} + + diff --git a/newlib/libc/machine/i386/f_frexp.S b/newlib/libc/machine/i386/f_frexp.S new file mode 100644 index 000000000..8724f524a --- /dev/null +++ b/newlib/libc/machine/i386/f_frexp.S @@ -0,0 +1,43 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +Fast version of frexp using Intel float instructions. + + double _f_frexp (double x, int *exp); + +Function splits x into y * 2 ** z. It then +returns the value of y and updates *exp with z. +There is no error checking or setting of errno. +*/ + + #include "i386mach.h" + + .global SYM (_f_frexp) + +SYM (_f_frexp): + pushl ebp + movl esp,ebp + fldl 8(ebp) + movl 16(ebp),eax + + fxtract + fld1 + fchs + fxch + fscale + fstp st1 + fxch + fld1 + faddp + fistpl 0(eax) + + leave + ret diff --git a/newlib/libc/machine/i386/f_frexpf.S b/newlib/libc/machine/i386/f_frexpf.S new file mode 100644 index 000000000..05f0555d6 --- /dev/null +++ b/newlib/libc/machine/i386/f_frexpf.S @@ -0,0 +1,43 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +Fast version of frexpf using Intel float instructions. + + float _f_frexpf (float x, int *exp); + +Function splits x into y * 2 ** z. It then +returns the value of y and updates *exp with z. +There is no error checking or setting of errno. +*/ + + #include "i386mach.h" + + .global SYM (_f_frexpf) + +SYM (_f_frexpf): + pushl ebp + movl esp,ebp + flds 8(ebp) + movl 12(ebp),eax + + fxtract + fld1 + fchs + fxch + fscale + fstp st1 + fxch + fld1 + faddp + fistpl 0(eax) + + leave + ret diff --git a/newlib/libc/machine/i386/f_ldexp.S b/newlib/libc/machine/i386/f_ldexp.S new file mode 100644 index 000000000..8a877193f --- /dev/null +++ b/newlib/libc/machine/i386/f_ldexp.S @@ -0,0 +1,33 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +Fast version of ldexp using Intel float instructions. + + double _f_ldexp (double x, int exp); + +Function calculates x * 2 ** exp. +There is no error checking or setting of errno. +*/ + + #include "i386mach.h" + + .global SYM (_f_ldexp) + +SYM (_f_ldexp): + pushl ebp + movl esp,ebp + fild 16(ebp) + fldl 8(ebp) + fscale + fstp st1 + + leave + ret diff --git a/newlib/libc/machine/i386/f_ldexpf.S b/newlib/libc/machine/i386/f_ldexpf.S new file mode 100644 index 000000000..e2bf387b0 --- /dev/null +++ b/newlib/libc/machine/i386/f_ldexpf.S @@ -0,0 +1,33 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +Fast version of ldexpf using Intel float instructions. + + float _f_ldexpf (float x, int exp); + +Function calculates x * 2 ** exp. +There is no error checking or setting of errno. +*/ + + #include "i386mach.h" + + .global SYM (_f_ldexpf) + +SYM (_f_ldexpf): + pushl ebp + movl esp,ebp + fild 12(ebp) + flds 8(ebp) + fscale + fstp st1 + + leave + ret diff --git a/newlib/libc/machine/i386/f_log.S b/newlib/libc/machine/i386/f_log.S new file mode 100644 index 000000000..8d5ea7299 --- /dev/null +++ b/newlib/libc/machine/i386/f_log.S @@ -0,0 +1,35 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +Fast version of log using Intel float instructions. + + double _f_log (double x); + +Function calculates the log base e of x. +There is no error checking or setting of errno. +*/ + + #include "i386mach.h" + + .global SYM (_f_log) + +SYM (_f_log): + pushl ebp + movl esp,ebp + + fld1 + fldl2e + fdivrp + fldl 8(ebp) + fyl2x + + leave + ret diff --git a/newlib/libc/machine/i386/f_log10.S b/newlib/libc/machine/i386/f_log10.S new file mode 100644 index 000000000..95ab45bf3 --- /dev/null +++ b/newlib/libc/machine/i386/f_log10.S @@ -0,0 +1,35 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +Fast version of log10 using Intel float instructions. + + double _f_log10 (double x); + +Function calculates the log base 10 of x. +There is no error checking or setting of errno. +*/ + + #include "i386mach.h" + + .global SYM (_f_log10) + +SYM (_f_log10): + pushl ebp + movl esp,ebp + + fld1 + fldl2t + fdivrp + fldl 8(ebp) + fyl2x + + leave + ret diff --git a/newlib/libc/machine/i386/f_log10f.S b/newlib/libc/machine/i386/f_log10f.S new file mode 100644 index 000000000..cdf321ecc --- /dev/null +++ b/newlib/libc/machine/i386/f_log10f.S @@ -0,0 +1,35 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +Fast version of logf using Intel float instructions. + + float _f_log10f (float x); + +Function calculates the log base 10 of x. +There is no error checking or setting of errno. +*/ + + #include "i386mach.h" + + .global SYM (_f_log10f) + +SYM (_f_log10f): + pushl ebp + movl esp,ebp + + fld1 + fldl2t + fdivrp + flds 8(ebp) + fyl2x + + leave + ret diff --git a/newlib/libc/machine/i386/f_logf.S b/newlib/libc/machine/i386/f_logf.S new file mode 100644 index 000000000..cff3b359f --- /dev/null +++ b/newlib/libc/machine/i386/f_logf.S @@ -0,0 +1,35 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +Fast version of logf using Intel float instructions. + + float _f_logf (float x); + +Function calculates the log base e of x. +There is no error checking or setting of errno. +*/ + + #include "i386mach.h" + + .global SYM (_f_logf) + +SYM (_f_logf): + pushl ebp + movl esp,ebp + + fld1 + fldl2e + fdivrp + flds 8(ebp) + fyl2x + + leave + ret diff --git a/newlib/libc/machine/i386/f_math.h b/newlib/libc/machine/i386/f_math.h new file mode 100644 index 000000000..bd44b1e92 --- /dev/null +++ b/newlib/libc/machine/i386/f_math.h @@ -0,0 +1,29 @@ +#ifndef __F_MATH_H__ +#define __F_MATH_H__ + +#include <_ansi.h> +#include "fdlibm.h" + +__inline__ +static +int +_DEFUN (check_finite, (x), + double x) +{ + __int32_t hx; + GET_HIGH_WORD(hx,x); + return (int)((__uint32_t)((hx&0x7fffffff)-0x7ff00000)>>31); +} + +__inline__ +static +int +_DEFUN (check_finitef, (x), + float x) +{ + __int32_t ix; + GET_FLOAT_WORD(ix,x); + return (int)((__uint32_t)((ix&0x7fffffff)-0x7f800000)>>31); +} + +#endif /* __F_MATH_H__ */ diff --git a/newlib/libc/machine/i386/f_pow.c b/newlib/libc/machine/i386/f_pow.c new file mode 100644 index 000000000..ac7dcfe26 --- /dev/null +++ b/newlib/libc/machine/i386/f_pow.c @@ -0,0 +1,44 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +Fast version of pow using Intel float instructions. + + double _f_pow (double x, double y); + +Function calculates x to power of y. +The function optimizes the case where x is >0.0 and y is finite. +In such a case, there is no error checking or setting of errno. +All other cases defer to normal pow() function which will +set errno as normal. +*/ + +#include +#include +#include "f_math.h" + +double _f_pow (double x, double y) +{ + /* following sequence handles the majority of cases for pow() */ + if (x > 0.0 && check_finite(y)) + { + double result; + /* calculate x ** y as 2 ** (y log2(x)). On Intel, can only + raise 2 to an integer or a small fraction, thus, we have + to perform two steps 2**integer portion * 2**fraction. */ + asm ("fldl 8(%%ebp); fyl2x; fld %%st; frndint; fsub %%st,%%st(1);" \ + "fxch; fchs; f2xm1; fld1; faddp; fxch; fld1; fscale; fstp %%st(1);"\ + "fmulp" : "=t" (result) : "0" (y)); + return result; + } + else /* all other strange cases, defer to normal pow() */ + return pow (x,y); +} + diff --git a/newlib/libc/machine/i386/f_powf.c b/newlib/libc/machine/i386/f_powf.c new file mode 100644 index 000000000..501b6b1f3 --- /dev/null +++ b/newlib/libc/machine/i386/f_powf.c @@ -0,0 +1,44 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +Fast version of pow using Intel float instructions. + + float _f_powf (float x, float y); + +Function calculates x to power of y. +The function optimizes the case where x is >0.0 and y is finite. +In such a case, there is no error checking or setting of errno. +All other cases defer to normal powf() function which will +set errno as normal. +*/ + +#include +#include +#include "f_math.h" + +float _f_powf (float x, float y) +{ + /* following sequence handles the majority of cases for pow() */ + if (x > 0.0 && check_finitef(y)) + { + float result; + /* calculate x ** y as 2 ** (y log2(x)). On Intel, can only + raise 2 to an integer or a small fraction, thus, we have + to perform two steps 2**integer portion * 2**fraction. */ + asm ("flds 8(%%ebp); fyl2x; fld %%st; frndint; fsub %%st,%%st(1);" \ + "fxch; fchs; f2xm1; fld1; faddp; fxch; fld1; fscale; fstp %%st(1);"\ + "fmulp" : "=t" (result) : "0" (y)); + return result; + } + else /* all other strange cases, defer to normal pow() */ + return powf (x,y); +} + diff --git a/newlib/libc/machine/i386/f_tan.S b/newlib/libc/machine/i386/f_tan.S new file mode 100644 index 000000000..5221d5e1b --- /dev/null +++ b/newlib/libc/machine/i386/f_tan.S @@ -0,0 +1,32 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +Fast version of tan using Intel float instructions. + + double _f_tan (double x); + +Function calculates the tangent of x. +There is no error checking or setting of errno. +*/ + + #include "i386mach.h" + + .global SYM (_f_tan) + +SYM (_f_tan): + pushl ebp + movl esp,ebp + fldl 8(ebp) + fptan + fincstp + + leave + ret diff --git a/newlib/libc/machine/i386/f_tanf.S b/newlib/libc/machine/i386/f_tanf.S new file mode 100644 index 000000000..e8251e03c --- /dev/null +++ b/newlib/libc/machine/i386/f_tanf.S @@ -0,0 +1,32 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* +Fast version of tanf using Intel float instructions. + + float _f_tanf (float x); + +Function calculates the tangent of x. +There is no error checking or setting of errno. +*/ + + #include "i386mach.h" + + .global SYM (_f_tanf) + +SYM (_f_tanf): + pushl ebp + movl esp,ebp + flds 8(ebp) + fptan + fincstp + + leave + ret diff --git a/newlib/libc/machine/i386/i386mach.h b/newlib/libc/machine/i386/i386mach.h new file mode 100644 index 000000000..bd6cf22f0 --- /dev/null +++ b/newlib/libc/machine/i386/i386mach.h @@ -0,0 +1,69 @@ +/* This file was based on the modified setjmp.S performed by + * Joel Sherill (joel@OARcorp.com) which specified the use + * of the __USER_LABEL_PREFIX__ and __REGISTER_PREFIX__ macros. + ** + ** This file is distributed WITHOUT ANY WARRANTY; without even the implied + ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* These are predefined by new versions of GNU cpp. */ + +#ifndef __USER_LABEL_PREFIX__ +#define __USER_LABEL_PREFIX__ _ +#endif + +#define __REG_PREFIX__ % + +/* ANSI concatenation macros. */ + +#define CONCAT1(a, b) CONCAT2(a, b) +#define CONCAT2(a, b) a##b + +/* Use the right prefix for global labels. */ + +#define SYM(x) CONCAT1(__USER_LABEL_PREFIX__, x) + +/* Use the right prefix for registers. */ + +#define REG(x) CONCAT1(__REG_PREFIX__, x) + +#define eax REG(eax) +#define ebx REG(ebx) +#define ecx REG(ecx) +#define edx REG(edx) +#define esi REG(esi) +#define edi REG(edi) +#define ebp REG(ebp) +#define esp REG(esp) + +#define st0 REG(st) +#define st1 REG(st(1)) +#define st2 REG(st(2)) +#define st3 REG(st(3)) +#define st4 REG(st(4)) +#define st5 REG(st(5)) +#define st6 REG(st(6)) +#define st7 REG(st(7)) + +#define ax REG(ax) +#define bx REG(bx) +#define cx REG(cx) +#define dx REG(dx) + +#define ah REG(ah) +#define bh REG(bh) +#define ch REG(ch) +#define dh REG(dh) + +#define al REG(al) +#define bl REG(bl) +#define cl REG(cl) +#define dl REG(dl) + +#define mm1 REG(mm1) +#define mm2 REG(mm2) +#define mm3 REG(mm3) +#define mm4 REG(mm4) +#define mm5 REG(mm5) +#define mm6 REG(mm6) +#define mm7 REG(mm7) diff --git a/newlib/libc/machine/i386/memchr.S b/newlib/libc/machine/i386/memchr.S new file mode 100644 index 000000000..40e29af4f --- /dev/null +++ b/newlib/libc/machine/i386/memchr.S @@ -0,0 +1,41 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + + #include "i386mach.h" + + .global SYM (memchr) + +SYM (memchr): + pushl ebp + movl esp,ebp + pushl edi + movl 12(ebp),eax + movl 16(ebp),ecx + movl 8(ebp),edi + + xorl edx,edx + testl ecx,ecx + jz L1 + + cld + repnz + scasb + + setnz dl + decl edi + decl edx + andl edi,edx +L1: + movl edx,eax + + leal -4(ebp),esp + popl edi + leave + ret diff --git a/newlib/libc/machine/i386/memcmp.S b/newlib/libc/machine/i386/memcmp.S new file mode 100644 index 000000000..23419ddb8 --- /dev/null +++ b/newlib/libc/machine/i386/memcmp.S @@ -0,0 +1,75 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + + #include "i386mach.h" + + .global SYM (memcmp) + +SYM (memcmp): + + pushl ebp + movl esp,ebp + subl $16,esp + pushl ebx + pushl edi + pushl esi + movl 8(ebp),edi + movl 12(ebp),esi + movl 16(ebp),ecx + cld + +/* check if length is zero in which case just return 0 */ + + xorl eax,eax + testl ecx,ecx + jz L4 + +#ifndef __OPTIMIZE_SIZE__ + +/* if aligned on long boundary, compare doublewords at a time first */ + + movl edi,eax + orl esi,eax + testb $3,al + jne BYTECMP + movl ecx,ebx + shrl $2,ecx /* calculate number of long words to compare */ + repz + cmpsl + jz L5 + subl $4,esi + subl $4,edi + movl $4,ecx + jmp BYTECMP +L5: + andl $3,ebx /* calculate number of remaining bytes */ + movl ebx,ecx + +#endif /* not __OPTIMIZE_SIZE__ */ + +BYTECMP: /* compare any unaligned bytes or remainder bytes */ + repz + cmpsb + +/* set output to be < 0 if less than, 0 if equal, or > 0 if greater than */ +L3: + xorl edx,edx + movb -1(esi),dl + xorl eax,eax + movb -1(edi),al + subl edx,eax + +L4: + leal -28(ebp),esp + popl esi + popl edi + popl ebx + leave + ret diff --git a/newlib/libc/machine/i386/memcpy.S b/newlib/libc/machine/i386/memcpy.S new file mode 100644 index 000000000..c0fd8f27e --- /dev/null +++ b/newlib/libc/machine/i386/memcpy.S @@ -0,0 +1,73 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + + #include "i386mach.h" + + .global SYM (memcpy) + +SYM (memcpy): + + pushl ebp + movl esp,ebp + pushl esi + pushl edi + pushl ebx + movl 8(ebp),edi + movl 16(ebp),ecx + movl 12(ebp),esi + cld + +#ifndef __OPTIMIZE_SIZE__ + + cmpl $8,ecx + jbe .L3 + +/* move any preceding bytes until destination address is long word aligned */ + + movl edi,edx + movl ecx,ebx + andl $3,edx + jz .L11 + movl $4,ecx + subl edx,ecx + andl $3,ecx + subl ecx,ebx + rep + movsb + + mov ebx,ecx + +/* move bytes a long word at a time */ + +.L11: + shrl $2,ecx + .p2align 2 + rep + movsl + + movl ebx,ecx + andl $3,ecx + +#endif /* !__OPTIMIZE_SIZE__ */ + +/* handle any remaining bytes */ + +.L3: + rep + movsb +.L5: + movl 8(ebp),eax + + leal -12(ebp),esp + popl ebx + popl edi + popl esi + leave + ret diff --git a/newlib/libc/machine/i386/memmove.S b/newlib/libc/machine/i386/memmove.S new file mode 100644 index 000000000..a89a296f7 --- /dev/null +++ b/newlib/libc/machine/i386/memmove.S @@ -0,0 +1,145 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + + #include "i386mach.h" + + .global SYM (memmove) + +SYM (memmove): + + pushl ebp + movl esp,ebp + pushl esi + pushl edi + pushl ebx + movl 8(ebp),edi + movl 16(ebp),ecx + movl 12(ebp),esi + +/* check for destructive overlap (src < dst && dst < src + length) */ + + cld + cmpl edi,esi + jae .L2 + leal -1(ecx,esi),ebx + cmpl ebx,edi + ja .L2 + +/* IF: destructive overlap, must copy backwards */ + + addl ecx,esi + addl ecx,edi + std + +#ifndef __OPTIMIZE_SIZE__ + + cmpl $8,ecx + jbe .L13 +.L18: + +/* move trailing bytes in reverse until destination address is long word aligned */ + + movl edi,edx + movl ecx,ebx + andl $3,edx + jz .L21 + + movl edx,ecx + decl esi + decl edi + subl ecx,ebx + rep + movsb + + mov ebx,ecx + incl esi + incl edi + +.L21: + +/* move bytes in reverse, a long word at a time */ + + shrl $2,ecx + subl $4,esi + subl $4,edi + rep + movsl + + addl $4,esi + addl $4,edi + movl ebx,ecx + andl $3,ecx + +#endif /* !__OPTIMIZE_SIZE__ */ + +/* handle any remaining bytes not on a long word boundary */ + +.L13: + decl esi + decl edi + +.L15: + rep + movsb + jmp .L5 + .p2align 4,,7 + +/* ELSE: no destructive overlap so we copy forwards */ + +.L2: + +#ifndef __OPTIMIZE_SIZE__ + + cmpl $8,ecx + jbe .L3 + +/* move any preceding bytes until destination address is long word aligned */ + + movl edi,edx + movl ecx,ebx + andl $3,edx + jz .L11 + movl $4,ecx + subl edx,ecx + andl $3,ecx + subl ecx,ebx + rep + movsb + + mov ebx,ecx + +/* move bytes a long word at a time */ + +.L11: + shrl $2,ecx + .p2align 2 + rep + movsl + + movl ebx,ecx + andl $3,ecx + +#endif /* !__OPTIMIZE_SIZE__ */ + +/* handle any remaining bytes */ + +.L3: + rep + movsb +.L5: + movl 8(ebp),eax + cld + + leal -12(ebp),esp + popl ebx + popl edi + popl esi + leave + ret diff --git a/newlib/libc/machine/i386/memset.S b/newlib/libc/machine/i386/memset.S new file mode 100644 index 000000000..12e33e443 --- /dev/null +++ b/newlib/libc/machine/i386/memset.S @@ -0,0 +1,59 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + + #include "i386mach.h" + + .global SYM (memset) + +SYM (memset): + + pushl ebp + movl esp,ebp + pushl edi + pushl ebx + movl 8(ebp),edi + movl 12(ebp),eax + movl 16(ebp),ecx + cld + +#ifndef __OPTIMIZE_SIZE__ + andl $255,eax + movl ecx,ebx + testl $3,edi + jne .L19 + cmpl $16,ecx + jbe .L19 + + movl eax,edx + sall $8,eax + orl edx,eax + + movl eax,edx + sall $16,edx + orl edx,eax + + shrl $2,ecx + andl $3,ebx + rep + stosl + movl ebx,ecx +#endif /* not __OPTIMIZE_SIZE__ */ + +.L19: + rep + stosb + + movl 8(ebp),eax + + leal -8(ebp),esp + popl ebx + popl edi + leave + ret diff --git a/newlib/libc/machine/i386/setjmp.S b/newlib/libc/machine/i386/setjmp.S new file mode 100644 index 000000000..0f4b537b9 --- /dev/null +++ b/newlib/libc/machine/i386/setjmp.S @@ -0,0 +1,136 @@ +/* This is file is a merger of SETJMP.S and LONGJMP.S */ +/* + * This file was modified to use the __USER_LABEL_PREFIX__ and + * __REGISTER_PREFIX__ macros defined by later versions of GNU cpp by + * Joel Sherrill (joel@OARcorp.com) + * + ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 + ** + ** This file is distributed under the terms listed in the document + ** "copying.dj", available from DJ Delorie at the address above. + ** A copy of "copying.dj" should accompany this file; if not, a copy + ** should be available from where this file was obtained. This file + ** may not be distributed without a verbatim copy of "copying.dj". + ** + ** This file is distributed WITHOUT ANY WARRANTY; without even the implied + ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + + /* + ** jmp_buf: + ** eax ebx ecx edx esi edi ebp esp eip + ** 0 4 8 12 16 20 24 28 32 + */ + +/* These are predefined by new versions of GNU cpp. */ + +#ifndef __USER_LABEL_PREFIX__ +#define __USER_LABEL_PREFIX__ _ +#endif + +/***************************** TEMPORARY ****************************** + * + * It appears that the i386-coff configuration of gcc 2.6.2 does not + * do the __REGISTER_PREFIX__ correctly. Fix this when it does. + **********************************************************************/ +#define __REGISTER_PREFIX__ % +#ifndef __REGISTER_PREFIX__ +#define __REGISTER_PREFIX__ +#endif + +/* ANSI concatenation macros. */ + +#define CONCAT1(a, b) CONCAT2(a, b) +#define CONCAT2(a, b) a ## b + +/* Use the right prefix for global labels. */ + +#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) + +/* Use the right prefix for registers. */ + +#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x) + +#define eax REG (eax) +#define ebx REG (ebx) +#define ecx REG (ecx) +#define edx REG (edx) +#define esi REG (esi) +#define edi REG (edi) +#define ebp REG (ebp) +#define esp REG (esp) + +#define ax REG (ax) +#define bx REG (bx) +#define cx REG (cx) +#define dx REG (dx) + +#define ah REG (ah) +#define bh REG (bh) +#define ch REG (ch) +#define dh REG (dh) + +#define al REG (al) +#define bl REG (bl) +#define cl REG (cl) +#define dl REG (dl) + + .global SYM (setjmp) + .global SYM (longjmp) + +SYM (setjmp): + + pushl ebp + movl esp,ebp + + pushl edi + movl 8 (ebp),edi + + movl eax,0 (edi) + movl ebx,4 (edi) + movl ecx,8 (edi) + movl edx,12 (edi) + movl esi,16 (edi) + + movl -4 (ebp),eax + movl eax,20 (edi) + + movl 0 (ebp),eax + movl eax,24 (edi) + + movl esp,eax + addl $12,eax + movl eax,28 (edi) + + movl 4 (ebp),eax + movl eax,32 (edi) + + popl edi + movl $0,eax + leave + ret + +SYM (longjmp): + pushl ebp + movl esp,ebp + + movl 8(ebp),edi /* get jmp_buf */ + movl 12(ebp),eax /* store retval in j->eax */ + movl eax,0(edi) + + movl 24(edi),ebp + + cli + movl 28(edi),esp + + pushl 32(edi) + + movl 0(edi),eax + movl 4(edi),ebx + movl 8(edi),ecx + movl 12(edi),edx + movl 16(edi),esi + movl 20(edi),edi + sti + + ret diff --git a/newlib/libc/machine/i386/strchr.S b/newlib/libc/machine/i386/strchr.S new file mode 100644 index 000000000..f224f380c --- /dev/null +++ b/newlib/libc/machine/i386/strchr.S @@ -0,0 +1,84 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + + #include "i386mach.h" + + .global SYM (strchr) + +SYM (strchr): + + pushl ebp + movl esp,ebp + pushl edi + pushl ebx + xorl ebx,ebx + movl 8(ebp),edi + movb 12(ebp),bl + +#ifndef __OPTIMIZE_SIZE__ +/* check if string is aligned, if not do check one byte at a time */ + test $3,edi + jne L9 + +/* create 4 byte mask which is just the desired byte repeated 4 times */ + movl ebx,ecx + sall $8,ebx + subl $4,edi + orl ecx,ebx + movl ebx,edx + sall $16,ebx + orl edx,ebx + +/* loop performing 4 byte mask checking for 0 byte or desired byte */ + .p2align 4,,7 +L10: + addl $4,edi + movl (edi),ecx + leal -16843009(ecx),edx + movl ecx,eax + notl eax + andl eax,edx + testl $-2139062144,edx + jne L9 + + movl ebx,eax + xorl ecx,eax + leal -16843009(eax),edx + notl eax + andl eax,edx + testl $-2139062144,edx + je L10 +#endif /* not __OPTIMIZE_SIZE__ */ + +/* loop while (*s && *s++ != c) */ +L9: + leal -1(edi),eax + .p2align 4,,7 +L15: + incl eax + movb (eax),dl + testb dl,dl + je L14 + cmpb bl,dl + jne L15 + +L14: +/* if (*s == c) return address otherwise return NULL */ + cmpb bl,(eax) + je L19 + xorl eax,eax + +L19: + leal -8(ebp),esp + popl ebx + popl edi + leave + ret + diff --git a/newlib/libc/machine/i386/strlen.S b/newlib/libc/machine/i386/strlen.S new file mode 100644 index 000000000..cae390ace --- /dev/null +++ b/newlib/libc/machine/i386/strlen.S @@ -0,0 +1,34 @@ +/* + * ==================================================== + * Copyright (C) 1998 by Cygnus Solutions. All rights reserved. + * + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + + #include "i386mach.h" + + .global SYM (strlen) + +SYM (strlen): + + pushl ebp + movl esp,ebp + pushl edi + movl 8(ebp),edx + + cld + movl edx,edi + movl $4294967295,ecx + xor eax,eax + repnz + scasb + subl edx,edi + leal -1(edi),eax + + leal -4(ebp),esp + popl edi + leave + ret diff --git a/newlib/libc/machine/i960/Makefile.am b/newlib/libc/machine/i960/Makefile.am new file mode 100644 index 000000000..ec5ca63e2 --- /dev/null +++ b/newlib/libc/machine/i960/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/i960/Makefile.in b/newlib/libc/machine/i960/Makefile.in new file mode 100644 index 000000000..3a3f406f7 --- /dev/null +++ b/newlib/libc/machine/i960/Makefile.in @@ -0,0 +1,294 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/i960/aclocal.m4 b/newlib/libc/machine/i960/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/i960/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/i960/configure b/newlib/libc/machine/i960/configure new file mode 100755 index 000000000..159a80606 --- /dev/null +++ b/newlib/libc/machine/i960/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=memccpy_ca.S + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/i960/configure.in b/newlib/libc/machine/i960/configure.in new file mode 100644 index 000000000..365fe2038 --- /dev/null +++ b/newlib/libc/machine/i960/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/i960 configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(memccpy_ca.S) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/i960/memccpy.S b/newlib/libc/machine/i960/memccpy.S new file mode 100644 index 000000000..df1947228 --- /dev/null +++ b/newlib/libc/machine/i960/memccpy.S @@ -0,0 +1,143 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "memccpy.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1989,1993 Intel Corp., all rights reserved + */ +/* + procedure memccpy (optimized assembler version for the 80960K series) + + dest_addr = memccpy (dest_addr, src_addr, char, len) + + copy len bytes pointed to by src_addr to the space pointed to by + dest_addr, stopping if char is copied. If char is copied, + return address of byte after char in dest string; else null. + + + Undefined behavior will occur if the end of the source array is in + the last two words of the program's allocated memory space. This + is so because the routine fetches ahead. Disallowing the fetch + ahead would impose a severe performance penalty. + + Undefined behavior will also occur if the source and destination + strings overlap. + + Strategy: + + Fetch the source array by words and store them by words to the + destination array, until there are fewer than three bytes left + to copy. Then, using the last word of the source (the one that + contains the remaining 0, 1, 2, or 3 bytes to be copied), store + a byte at a time until Ldone. + + Tactics: + + 1) Do NOT try to fetch and store the words in a word aligned manner + because, in my judgement, the performance degradation experienced due + to non-aligned accesses does NOT outweigh the time and complexity added + by the preamble and convoluted body that would be necessary to assure + alignment. This is supported by the intuition that most source and + destination arrays (even more true of most big source arrays) will + be word aligned to begin with. + + 2) Rather than decrementing len to zero, + I calculate the address of the byte after the last byte of the + destination array, and quit when the destination byte pointer passes + that. + +*/ + + .globl _memccpy + .leafproc _memccpy, __memccpy + .align 2 +_memccpy: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__memccpy: + mov g14, g13 # preserve return address + cmpibge 0,g3,Lexit_char_not_found + + addo g3,g1,g3 # compute beyond end of src + ld (g1), g7 # fetch first word of source + lda 0xff,g5 # mask for char + and g5,g2,g2 # extract only char + shlo 8,g2,g6 + or g2,g6,g6 + shlo 16,g6,g4 + or g6,g4,g6 # word of char + b Lwloop_b + +Lwloop_a: + ld (g1), g7 # fetch ahead next word of source + st g4, (g0) # store word to dest + addo 4, g0, g0 # post-increment dest pointer +Lwloop_b: # word copying loop + addo 4, g1, g1 # pre-increment src pointer + cmpo g3, g1 # is len <= 3 ? + mov g7, g4 # keep a copy of the current word + bl Lcloop_setup # quit word loop if less than 4 bytes + scanbyte g6, g7 # check for char + bno Lwloop_a # continue word loop if char not found. + +Lcloop_setup: + subo 4, g1, g1 # back down src pointer + cmpobe g1, g3, Lexit_char_not_found + +Lcloop_a: # character copying loop (len < 3) + and g5,g4,g7 # check the byte against char + cmpo g7,g2 + stob g7,(g0) # store the byte + addo 1, g0, g0 + be Lexit_char_found + addo 1,g1,g1 + cmpo g1,g3 + shro 8,g4,g4 # position next byte + bne Lcloop_a + +Lexit_char_not_found: + mov 0, g0 +Lexit_char_found: + lda 0,g14 + bx (g13) # g0 = dest array address; g14 = 0 +Lrett: + ret + + +/* end of memccpy */ diff --git a/newlib/libc/machine/i960/memccpy_ca.S b/newlib/libc/machine/i960/memccpy_ca.S new file mode 100644 index 000000000..60c197b72 --- /dev/null +++ b/newlib/libc/machine/i960/memccpy_ca.S @@ -0,0 +1,245 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "mccpy_ca.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1989,1993 Intel Corp., all rights reserved + */ + +/* + procedure memccpy (optimized assembler version for the 80960CA) + + dest_addr = memccpy (dest_addr, src_addr, char, len) + + copy len bytes pointed to by src_addr to the space pointed to by + dest_addr, stopping if char is copied. If char is copied, + return address of byte after char in dest string; else null. + + Undefined behavior will occur if the end of the source array is in + the last two words of the program's allocated memory space. This + is so because the routine fetches ahead. Disallowing the fetch + ahead would impose a severe performance penalty. + + Undefined behavior will also occur if the source and destination + strings overlap. + + + This program handles five cases: + + 1) both arguments start on a word boundary + 2) neither are word aligned, but they are offset by the same amount + 3) source is word aligned, destination is not + 4) destination is word aligned, source is not + 5) neither is word aligned, and they are offset by differing amounts + + At the time of this writing, only g0 thru g7 and g13 are available + for use in this leafproc; other registers would have to be saved and + restored. These nine registers, plus tricky use of g14 are sufficient + to implement the routine. +*/ + +#if __i960_BIG_ENDIAN__ +#define MSW g6 +#define LSW g7 +#else +#define LSW g6 +#define MSW g7 +#endif + + .globl _memccpy + .leafproc _memccpy, __memccpy + .align 2 +_memccpy: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__memccpy: + notand g1,3,g5 # extract word addr of start of src + lda (g14),g13 # preserve return address + cmpibge.f 0,g3,Lexit_char_not_found # Lexit if # of bytes to move is <= 0 + cmpo g5,g1 # check alignment of src + ld (g5),LSW # fetch word containing at least first byte + notand g0,3,g4 # extract word addr of start of dest + lda 4(g5),g5 # advance src word addr + shlo 24,g2,g2 # reduce char to single byte + bne.f Lcase_245 # branch if src is NOT word aligned + +Lcase_13: + cmpobe.t g0,g4,Lcase_1_setup # branch if dest word aligned + +Lcase_3: # src is word aligned; dest is not + mov LSW,MSW # make copy of first word of src + addo 4,g4,g1 # move dest word ptr to first word boundary + lda 32,g14 # initialize shift count to zero + +Lcase_25: +Lcase_3_cloop_at_start: # character copying loop for start of dest str + cmpdeci 0,g3,g3 # is max_bytes exhausted? +#if __i960_BIG_ENDIAN__ + lda -8(g14),g14 # augment the shift counter +#else + lda 8(g14),g14 # augment the shift counter +#endif + be.f Lexit_char_not_found # Lexit if max_bytes is exhausted +#if __i960_BIG_ENDIAN__ + rotate 8,MSW,MSW # move next byte into position for extraction +#endif + shlo 24,MSW,g4 + stob MSW,(g0) # store the byte in dest + cmpo g4,g2 + lda 1(g0),g0 # post-increment dest ptr +#if ! __i960_BIG_ENDIAN__ + shro 8,MSW,MSW # move next byte into position for extraction +#endif + be.f Lexit_char_found # Lexit if char found + cmpobne.t g1,g0,Lcase_3_cloop_at_start # branch if reached word boundary + + ld (g5),MSW # fetch msw of operand for double shift + +Lcase_4: + shro 8,g2,g4 + or g4,g2,g1 + shro 16,g1,g4 + or g4,g1,g4 + +#if __i960_BIG_ENDIAN__ + cmpobne 0,g14,Lcase_3_wloop + +Lcase_3_wloop2: + cmpi g3,4 # less than four bytes to move? + lda 4(g5),g5 # post-increment src word addr + mov LSW,g1 # extract 4 bytes of src + bl.f Lcase_13_cloop_setup # branch if < four bytes left to move + scanbyte g4,g1 # branch if word has char in it + bo.f Lcase_13_cloop_setup + mov MSW,LSW # move msw to lsw + ld (g5),MSW # pre-fetch msw of operand for double shift + subi 4,g3,g3 # decrease max_byte count by the 4 bytes moved + st g1,(g0) # store 4 bytes to dest + addo 4,g0,g0 # post-increment dest ptr + b Lcase_3_wloop2 +#endif + +Lcase_3_wloop: + cmpi g3,4 # less than four bytes to move? + lda 4(g5),g5 # post-increment src word addr + eshro g14,g6,g1 # extract 4 bytes of src + bl.f Lcase_13_cloop_setup # branch if < four bytes left to move + scanbyte g4,g1 # branch if word has char in it + bo.f Lcase_13_cloop_setup + mov MSW,LSW # move msw to lsw + ld (g5),MSW # pre-fetch msw of operand for double shift + subi 4,g3,g3 # decrease max_byte count by the 4 bytes moved + st g1,(g0) # store 4 bytes to dest + addo 4,g0,g0 # post-increment dest ptr + b Lcase_3_wloop + +Lcase_1_setup: + subo 4,g0,g0 # store is pre-incrementing; back up dest addr + shro 8,g2,g4 + or g4,g2,MSW + shro 16,MSW,g4 + or g4,MSW,g4 + b Lcase_1 +Lcase_1_wloop: # word copying loop + subi 4,g3,g3 # decrease max_byte count by the 4 bytes moved + ld (g5),LSW # pre-fetch next word of src + addo 4,g5,g5 # post-increment src addr + st g1,(g0) # store word in dest string +Lcase_1: # src and dest are word aligned + cmpi g3,4 # check for fewer than four bytes to move + addo 4,g0,g0 # pre-increment dest addr + lda (LSW),g1 # keep a copy of the src word + bl.f Lcase_13_cloop_setup # branch if less than four bytes to copy + scanbyte LSW,g4 # branch if char is not in foursome + bno.t Lcase_1_wloop +Lcase_13_cloop_setup: + cmpibe.f 0,g3,Lexit_char_not_found # Lexit if max_bytes is exhausted + +Lcase_1_cloop: +#if __i960_BIG_ENDIAN__ + rotate 8,g1,g1 # move next byte into position for extraction +#endif + shlo 24,g1,g4 + stob g1,(g0) # store the byte in dest + cmpo g4,g2 + lda 1(g0),g0 # post-increment dest byte addr + subi 1,g3,g3 + be.f Lexit_char_found # Lexit if char reached + cmpi 0,g3 +#if ! __i960_BIG_ENDIAN__ + shro 8,g1,g1 # move next byte into position for extraction +#endif + bne.t Lcase_1_cloop # continue if len not exhausted + +Lexit_char_not_found: + mov 0,g0 +Lexit_char_found: + lda 0,g14 + bx (g13) # g0 = dest array address; g14 = 0 +Lrett: + ret + + +Lcase_245: + cmpo g0,g4 # check alignment of dest + ld (g5),MSW # pre-fetch second half + and 3,g1,g1 # compute shift count + shlo 3,g1,g14 +#if __i960_BIG_ENDIAN__ + subo g14,0,g14 # adjust shift count for big endian +#endif + be.t Lcase_4 # branch if dest is word aligned + or g4,g1,g1 # is src earlier in word, later, or sync w/ dst + cmpo g0,g1 # < indicates first word of dest has more bytes + /* than first word of source. */ + eshro g14,g6,g4 # extract four bytes + lda 4(g0),g1 # move dest word addr to first word boundary +#if __i960_BIG_ENDIAN__ + bge.f 1f +#else + bg.f 1f +#endif + mov MSW,LSW + lda 4(g5),g5 # move src word addr to second word boundary +1: + notand g1,3,g1 + mov g4,MSW + b Lcase_25 + +/* end of memccpy */ diff --git a/newlib/libc/machine/i960/memchr.S b/newlib/libc/machine/i960/memchr.S new file mode 100644 index 000000000..e9a4e426d --- /dev/null +++ b/newlib/libc/machine/i960/memchr.S @@ -0,0 +1,130 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "memchr.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ + +/* + procedure memchr (optimized assembler version for the 80960K series) + + src_addr = memchr (src_addr, char, max_bytes) + + searching from src_addr for a span of max_bytes bytes, return a + pointer to the first byte in the source array that contains the + indicated char. Return null if the char is not found. + + Undefined behavior will occur if the last byte of the source array + is in the last two words of the program's allocated memory space. + This is so because memchr fetches ahead. Disallowing the fetch + ahead would impose a severe performance penalty. + + Strategy: + + Fetch the source array by words and scanbyte the words for the + char until either a word with the byte is found or max_bytes is + exhausted. In the former case, move through the word to find the + matching byte and return its memory address. In the latter case, + return zero (null). + + Tactics: + + 1) Do NOT try to fetch the words in a word aligned manner because, + in my judgement, the performance degradation experienced due to + non-aligned accesses does NOT outweigh the time and complexity added + by the preamble that would be necessary to assure alignment. This + is supported by the intuition that most source arrays (even more + true of most big source arrays) will be word aligned to begin with. + + 2) Rather than decrementing max_bytes to zero, I calculate the + address of the byte after the last byte of the source array, and + quit when the source byte pointer passes that. Refining, actually + I calculate the address of the fifth byte after the last byte of + the source array, because the source byte pointer is ahead of the + actual examination point due to fetch ahead. +*/ + + .globl _memchr + .globl __memchr + .leafproc _memchr, __memchr + .align 2 +_memchr: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__memchr: + + mov g14,g13 # preserve return address + lda 0xff,g7 # byte extraction mask + and g1,g7,g1 # make char an 8-bit ordinal + mov 0,g14 # conform to register linkage standard + cmpibge 0,g2,Lnot_found # do nothing if max_bytes <= 0 + addo 4,g0,g6 # post-increment src word pointer + addo g2,g6,g2 # compute ending address from start and len + ld (g0),g4 # fetch first word + shlo 8,g1,g3 # broadcast the char to four bytes + or g1,g3,g3 + shlo 16,g3,g5 + or g3,g5,g3 + +Lsearch_for_word_with_char: + mov g4,g5 # keep a copy of word + scanbyte g3,g5 # check for byte with char + ld (g6),g4 # fetch next word of src + bo Lsearch_for_char # branch if null found + addo 4,g6,g6 # post-increment src word pointer + cmpobge g2,g6,Lsearch_for_word_with_char # branch if max_bytes > 3 + +Lnot_found: + mov 0,g0 # char not found. Return null + bx (g13) # g0 = addr of char in src (or null); g14 = 0 +Lrett: + ret + +Lsearch_for_char: + cmpobe.f g6,g2,Lnot_found # quit if max_bytes exhausted + and g5,g7,g0 # extract byte + cmpo g1,g0 # is it char? + addo 1,g6,g6 # bump src byte ptr + shro 8,g5,g5 # shift word to position next byte + bne.t Lsearch_for_char + subo 5,g6,g0 # back up the byte pointer + bx (g13) + +/* end of memchr */ diff --git a/newlib/libc/machine/i960/memchr_ca.S b/newlib/libc/machine/i960/memchr_ca.S new file mode 100644 index 000000000..ac80be71c --- /dev/null +++ b/newlib/libc/machine/i960/memchr_ca.S @@ -0,0 +1,153 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "memchr_ca.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ + +/* + procedure memchr (optimized assembler version for the CA) + + src_addr = memchr (src_addr, char, max_bytes) + + searching from src_addr for max_bytes bytes, return a pointer to the + first byte that contains the indicated byte in the source string. + Return null if the byte is not found. + + Undefined behavior will occur if the end of the source string (i.e. + the terminating null byte) is in the last two words of the program's + allocated memory space. This is so because, in several cases, memchr + will fetch ahead. Disallowing the fetch ahead would impose a severe + performance penalty. + + This program handles two cases: + + 1) the argument starts on a word boundary + 2) the argument doesn't start on a word boundary + + At the time of this writing, only g0 thru g7 and g13 are available + for use in this leafproc; other registers would have to be saved and + restored. These nine registers, plus tricky use of g14 are sufficient + to implement the routine. The registers are used as follows: + + g0 src ptr; upon return it is a pointer to the matching byte, or null + g1 char to seek + g2 maximum number of bytes to check + g3 char to seek, broadcast to all four bytes + g4 word of the source string + g5 copy of the word + g6 mask to avoid unimportant bytes in first word + g7 byte extraction mask + g13 return address + g14 +*/ + + .globl _memchr + .globl __memchr + .leafproc _memchr, __memchr + .align 2 +_memchr: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__memchr: + + mov g14,g13 # preserve return address + lda 0xff,g7 # byte extraction mask + and g1,g7,g1 # make char an 8-bit ordinal + lda 0,g14 # conform to register linkage standard + cmpibge.f 0,g2,Lnot_found # do nothing if max_bytes <= 0 + addo g0,g2,g2 # compute ending address from start and len + and g0,3,g6 # extract byte offset of src + notand g0,3,g0 # extract word addr of start of src + shlo 8,g1,g3 # broadcast the char to four bytes + ld (g0),g4 # fetch word containing at least first byte + or g1,g3,g3 + shlo 16,g3,g5 + cmpo g1,g7 # is char being sought 0xff? + or g5,g3,g3 + shlo 3,g6,g6 # get shift count for making mask for first word + subi 1,0,g5 # mask initially all ones +#if __i960_BIG_ENDIAN__ + shro g6,g5,g5 # get mask for bytes needed from first word +#else + shlo g6,g5,g5 # get mask for bytes needed from first word +#endif + notor g4,g5,g4 # set unneeded bytes to all ones + be.f Lsearch_for_0xff # branch if seeking 0xff + +Lsearch_for_word_with_char: + scanbyte g3,g4 # check for byte with char + lda 4(g0),g0 # pre-increment src word pointer + mov g4,g5 # keep a copy of word + ld (g0),g4 # fetch next word of src + bo.f Lsearch_for_char # branch if null found + cmpoble.t g0,g2,Lsearch_for_word_with_char # branch if not null + +Lnot_found: + mov 0,g0 # char not found. Return null +Lexit_code: + bx (g13) # g0 = addr of char in src (or null); g14 = 0 +Lrett: + ret + +Lsearch_for_char: + subo 4,g0,g0 # back up the byte pointer +Lsearch_for_char.a: + cmpobe.f g0,g2,Lnot_found # quit if max_bytes exhausted +#if __i960_BIG_ENDIAN__ + rotate 8,g5,g5 # shift word to position next byte +#endif + and g5,g7,g6 # extract byte + cmpo g1,g6 # is it char? + lda 1(g0),g0 # bump src byte ptr +#if ! __i960_BIG_ENDIAN__ + shro 8,g5,g5 # shift word to position next byte +#endif + bne.t Lsearch_for_char.a + subo 1,g0,g0 # back up the byte pointer + b Lexit_code + +Lsearch_for_0xff: + lda 0xf0f0f0f0,g6 # make first comparison mask for char=-1 case. + or g6,g5,g6 + and g4,g6,g4 # make unimportant bytes of first word 0x0f + b Lsearch_for_word_with_char + +/* end of memchr */ diff --git a/newlib/libc/machine/i960/memcmp.S b/newlib/libc/machine/i960/memcmp.S new file mode 100644 index 000000000..709eb2bdb --- /dev/null +++ b/newlib/libc/machine/i960/memcmp.S @@ -0,0 +1,128 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "memcmp.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ +/* + procedure memcmp (optimized assembler version for the 80960K series) + + result = memcmp (src1_addr, src2_addr, max_bytes) + + compare the byte array pointed to by src1_addr to the byte array + pointed to by src2_addr. Return 0 iff the arrays are equal, -1 iff + src1_addr is lexicographically less than src2_addr, and 1 iff it is + lexicographically greater. Do not compare more than max_bytes bytes. + + Undefined behavior will occur if the end of either source array + is in the last two words of the program's allocated memory space. + This is so because memcmp fetches ahead. Disallowing the fetch ahead + would impose a severe performance penalty. + + Strategy: + + Fetch the source strings by words and compare the words until either + a differing word is found or max_bytes is exhausted. In the former + case, move through the words to find the differing byte and return + plus or minus one, appropriately. In the latter case, return zero + (equality). + + Tactics: + + 1) Do NOT try to fetch the words in a word aligned manner because, + in my judgement, the performance degradation experienced due to + non-aligned accesses does NOT outweigh the time and complexity added + by the preamble that would be necessary to assure alignment. This + is supported by the intuition that most source arrays (even more + true of most big source arrays) will be word aligned to begin with. + + 2) Rather than decrementing max_bytes to zero, I calculate the + address of the byte after the last byte of the source_1 array, and + quit when the source byte pointer passes that. +*/ + + .globl _memcmp + .globl __memcmp + .leafproc _memcmp,__memcmp + .align 2 + +_memcmp: +#ifndef __PIC + lda .Lrett,g14 +#else + lda .Lrett-(.+8)(ip),g14 +#endif +__memcmp: + mov g14,g13 # preserve return address + ldconst 0,g14 # conform to register conventions + cmpibge 0,g2,Lequal_exit # quit if max_bytes <= 0 + addo g0,g2,g2 # calculate byte addr of byte after last in src1 + +.Lwloop: + cmpo g0,g2 + ld (g0), g5 # fetch word of source_1 + bge Lequal_exit # quit (equal) if max_bytes exhausted + ld (g1), g3 # fetch word of source_2 + addo 4,g0,g0 # post-increment source_1 byte ptr + addo 4,g1,g1 # post-increment source_2 byte ptr + cmpobe g5,g3,.Lwloop # branch if source words are equal + + ldconst 0xff,g4 # byte extraction mask + subo 4,g0,g0 # back up src1 pointer + +.Lcloop: and g4,g5,g7 # extract and compare individual bytes + and g4,g3,g6 + cmpobne g7,g6,.diff # branch if they are different + shlo 8,g4,g4 # position mask for next extraction + addo 1,g0,g0 + cmpobl g0,g2,.Lcloop # quit if max_bytes is exhausted + +Lequal_exit: + mov 0,g0 + bx (g13) +.Lrett: + ret + +.diff: bl .neg # arrays differ at current byte. + /* return 1 or -1 appropriately */ + mov 1,g0 + bx (g13) +.neg: subi 1,0,g0 +.Lexit: + bx (g13) + +/* end or memcmp */ diff --git a/newlib/libc/machine/i960/memcmp_ca.S b/newlib/libc/machine/i960/memcmp_ca.S new file mode 100644 index 000000000..317ea89bf --- /dev/null +++ b/newlib/libc/machine/i960/memcmp_ca.S @@ -0,0 +1,205 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "memcm_ca.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1992,1993 Intel Corp., all rights reserved + */ + +/* + procedure memcmp (optimized assembler version for the CA) + + result = memcmp (src1_addr, src2_addr, max_bytes) + + compare the byte array pointed to by src1_addr to the byte array + pointed to by src2_addr. Return 0 iff the arrays are equal, -1 if + src1_addr is lexicly less than src2_addr, and 1 if it is lexicly + greater. Do not compare more than max_bytes bytes. + + Undefined behavior will occur if the end of either source array + is in the last word of the program's allocated memory space. This + is so because, in several cases, memcmp will fetch ahead one word. + Disallowing the fetch ahead would impose a severe performance penalty. + + This program handles five cases: + + 1) both arguments start on a word boundary + 2) neither are word aligned, but they are offset by the same amount + 3) source1 is word aligned, source2 is not + 4) source2 is word aligned, source1 is not + 5) neither is word aligned, and they are offset by differing amounts + + At the time of this writing, only g0 thru g7 and g14 are available + for use in this leafproc; other registers would have to be saved and + restored. These nine registers are sufficient to implement the routine. + The registers are used as follows: + + g0 original src1 ptr; extracted word; return result + g1 src2 ptr; byt extraction mask + g2 maximum number of bytes to compare + g3 src2 word ptr + Little endian + g4 lsw of src1 + g5 msw of src1 + g6 src2 word + g7 src1 word ptr + Big endian + g4 msw of src1 + g5 lsw of src1 + g6 src1 word ptr + g7 src2 word + g13 return address + g14 shift count +*/ + +#if __i960_BIG_ENDIAN__ +#define MSW g4 +#define LSW g5 +#define SRC1 g6 +#define SRC2 g7 +#else +#define LSW g4 +#define MSW g5 +#define SRC2 g6 +#define SRC1 g7 +#endif + + .globl _memcmp + .globl __memcmp + .leafproc _memcmp, __memcmp + .align 2 +_memcmp: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__memcmp: +Lrestart: +#if __i960_BIG_ENDIAN__ + subo 1,g0,SRC1 + notand SRC1,3,SRC1 # extract word addr of start of src1 +#else + notand g0,3,SRC1 # extract word addr of start of src1 +#endif + lda (g14),g13 # preserve return address + cmpibge.f 0,g2,Lequal_exit # return equality if number bytes 0 + notand g1,3,g3 # extract word addr of start of src2 + ld (SRC1),LSW # fetch word with at least first byte of src1 + cmpo g3,g1 # check alignment of src2 + ld 4(SRC1),MSW # fetch second word of src1 + shlo 3,g0,g14 # compute shift count for src1 +#if __i960_BIG_ENDIAN__ + subo g14,0,g14 # adjust shift count for big endian. +#endif + ld (g3),SRC2 # fetch word with at least first byte of src2 + eshro g14,g4,LSW # extract word of src1 + lda 8(SRC1),SRC1 # advance src1 word addr + bne.f Lsrc2_unaligned # branch if src2 is NOT word aligned + + mov LSW,g0 # at least src2 is word aligned + + lda 0xff,g1 + +Lwloop: # word comparing loop + cmpo SRC2,g0 # compare src1 and src2 words + lda 4(g3),g3 # pre-increment src2 addr + mov MSW,LSW # move msw of src1 to lsw + ld (SRC1),MSW # pre-fetch next msw of src1 + subi 4,g2,g2 # decrement maximum byte count + bne.f Lcloop # branch if src1 and src2 unequal + cmpi 0,g2 + ld (g3),SRC2 # pre-fetch next word of src2 + eshro g14,g4,g0 # extract word of src1 + lda 4(SRC1),SRC1 # post-increment src1 addr + bl.t Lwloop # branch if max_bytes not reached yet + + b Lequal_exit # strings were equal up through max_bytes + +Lcloop_setup: # setup for coming from Lsrc2_unaligned + mov LSW,g0 # restore extracted src1 word + subo 4,g2,g2 # make up for later re-incrementing + lda 0xff,g1 # byte extraction mask + +Lcloop: # character comparing loop +#if __i960_BIG_ENDIAN__ + rotate 24,g1,g1 # shift mask for next byte +#endif + and SRC2,g1,g3 # extract next char of src2 + and g0,g1,LSW # extract next char of src1 + cmpobne.f LSW,g3,.diff # check for equality +#if ! __i960_BIG_ENDIAN__ + shlo 8,g1,g1 # shift mask for next byte +#endif + subi 1,g2,g2 # decrement character counter + b Lcloop # branch if null not reached + + +Lequal_exit: # words are equal up thru null byte + mov 0,g14 # conform to register conventions + lda 0,g0 # return zero, indicating equality + bx (g13) # return +Lrett: + ret + +.diff: + addo 4,g2,g2 # to make up for extra decrement in loop + lda 0,g14 + bl Lless_than_exit +Lgreater_than_exit: + cmpibge.f 0,g2,Lequal_exit # branch if difference is beyond max_bytes + mov 1,g0 + bx (g13) # g0 = 1 (src1 > src2) +Lless_than_exit: + cmpibge.f 0,g2,Lequal_exit # branch if difference is beyond max_bytes + subi 1,0,g0 + bx (g13) # g0 = -1 (src1 < src2) + +Lsrc2_unaligned: + notor g1,3,g14 # first step in computing new src1 ptr + ld 4(g3),SRC1 # fetch second word of src2 + shlo 3,g1,MSW # compute shift count for src2 +#if __i960_BIG_ENDIAN__ + subo MSW,0,MSW +#endif + eshro MSW,g6,SRC2 # extract word of src2 + cmpo LSW,SRC2 # compare src1 and src2 words + lda 4(g3),g1 # set new src2 ptr + bne.f Lcloop_setup # first four bytes differ + subo g14,g0,g0 # second (final) step in computing new src1 ptr + addi g14,g2,g2 # compute new max_bytes too + lda (g13),g14 # prepare return pointer for Lrestart + b Lrestart # continue with both string fetches shifted diff --git a/newlib/libc/machine/i960/memcpy.S b/newlib/libc/machine/i960/memcpy.S new file mode 100644 index 000000000..8465e474b --- /dev/null +++ b/newlib/libc/machine/i960/memcpy.S @@ -0,0 +1,160 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "memcpy.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ +/* + procedure memmove (optimized assembler version for the 80960K series) + procedure memcpy (optimized assembler version for the 80960K series) + + dest_addr = memmove (dest_addr, src_addr, len) + dest_addr = memcpy (dest_addr, src_addr, len) + + copy len bytes pointed to by src_addr to the space pointed to by + dest_addr. Return the original dest_addr. + + These routines will work even if the arrays overlap. The standard + requires this of memmove, but memcpy is allowed to fail if overlap + is present. Nevertheless, it is implemented the same as memmove + because the overhead is trifling. + + Undefined behavior will occur if the end of the source array is in + the last two words of the program's allocated memory space. This + is so because the routine fetches ahead. Disallowing the fetch + ahead would impose a severe performance penalty. + + Strategy: + + Fetch the source array by words and store them by words to the + destination array, until there are fewer than three bytes left + to copy. Then, using the last word of the source (the one that + contains the remaining 0, 1, 2, or 3 bytes to be copied), store + a byte at a time until Ldone. + + Tactics: + + 1) Do NOT try to fetch and store the words in a word aligned manner + because, in my judgement, the performance degradation experienced due + to non-aligned accesses does NOT outweigh the time and complexity added + by the preamble and convoluted body that would be necessary to assure + alignment. This is supported by the intuition that most source and + destination arrays (even more true of most big source arrays) will + be word aligned to begin with. + + 2) For non-overlapping arrays, rather than decrementing len to zero, + I calculate the address of the byte after the last byte of the + destination array, and quit when the destination byte pointer passes + that. + + 3) For overlapping arrays where the source starts at a lower address + than the destination the move is performed in reverse order. + + 4) Overlapping arrays where the source starts at a higher address + are treated like non-overlapping case. Where the two arrays exactly + coincide, the routine is short-circuited; no move is Ldone at all. + This costs only one cycle. +*/ + + .globl _memcpy, _memmove + .globl __memcpy, __memmove + .leafproc _memmove, __memmove + .leafproc _memcpy, __memcpy + .align 2 +_memmove: +_memcpy: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__memmove: +__memcpy: + mov g14, g13 # preserve return address + cmpibge 0,g2,Lexit # exit if number of bytes to move is <= zero. + cmpo g0,g1 # does start of dest overlap end of src? + addo g2,g1,g3 + be Lexit # no move necessary if src and dest are same + concmpo g3,g0 + addo g2, g0, g6 + bg Lbackwards # if overlap, then do move backwards + + ld (g1), g7 # fetch first word of source + mov g0, g5 + b Lwloop_b + +Lwloop_a: + ld (g1), g7 # fetch ahead next word of source + st g4, (g5) # store word to dest + addo 4, g5, g5 # post-increment dest pointer +Lwloop_b: # word copying loop + addo 4, g1, g1 # pre-increment src pointer + cmpo g3, g1 # is len <= 3 ? + mov g7, g4 # keep a copy of the current word + bge Lwloop_a # loop if more than 3 bytes to move + cmpobe g6, g5, Lexit # quit if no more bytes to move + +Lcloop_a: # character copying loop (len < 3) + stob g4, (g5) # store a byte + shro 8, g4, g4 # position next byte for storing + addo 1, g5, g5 + cmpobne g6, g5, Lcloop_a # quit if no more bytes to move + +Lexit: + mov 0, g14 + bx (g13) # g0 = dest array address; g14 = 0 +Lrett: + ret + +Lwloop.a: + subo 4, g6, g6 # pre-decrement dest pointer + st g7, (g6) # store word to dest +Lbackwards: # word copying loop + subo 4, g3, g3 # pre-decrement src pointer + cmpo g1, g3 # is len <= 3? + ld (g3), g7 # fetch ahead next word of source + ble Lwloop.a # loop if more than 3 bytes to move + cmpobe g6, g0, Lexit # quit if no more bytes to move + +Lcloop.a: + subo 1, g6, g6 + rotate 8, g7, g7 # position byte for storing + stob g7, (g6) # store byte + cmpobne g6, g0, Lcloop.a # quit if no more bytes to move + b Lexit + +/* end of memmove */ diff --git a/newlib/libc/machine/i960/memcpy_ca.S b/newlib/libc/machine/i960/memcpy_ca.S new file mode 100644 index 000000000..eebfa88a1 --- /dev/null +++ b/newlib/libc/machine/i960/memcpy_ca.S @@ -0,0 +1,353 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "memcp_ca.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1992,1993 Intel Corp., all rights reserved + */ + +/* + procedure memmove (optimized assembler version for the CA) + procedure memcpy (optimized assembler version for the CA) + + dest_addr = memmove (dest_addr, src_addr, len) + dest_addr = memcpy (dest_addr, src_addr, len) + + copy len bytes pointed to by src_addr to the space pointed to by + dest_addr. Return the original dest_addr. + + Memcpy will fail if the source and destination string overlap + (in particular, if the end of the source is overlapped by the + beginning of the destination). The behavior is undefined. + This is acceptable according to the draft C standard. + Memmove will not fail if overlap exists. + + Undefined behavior will also occur if the end of the source string + (i.e. the terminating null byte) is in the last word of the program's + allocated memory space. This is so because, in several cases, the + routine will fetch ahead one word. Disallowing the fetch ahead would + impose a severe performance penalty. + + This program handles five cases: + + 1) both arguments start on a word boundary + 2) neither are word aligned, but they are offset by the same amount + 3) source is word aligned, destination is not + 4) destination is word aligned, source is not + 5) neither is word aligned, and they are offset by differing amounts + + At the time of this writing, only g0 thru g7 and g13 are available + for use in this leafproc; other registers would have to be saved and + restored. These nine registers, plus tricky use of g14 are sufficient + to implement the routine. The registers are used as follows: + + g0 dest ptr; not modified, so that it may be returned + g1 src ptr; shift count + g2 len + g3 src ptr (word aligned) + g4 dest ptr (word aligned) + g5 -4 for Lbackwards move + Little endian + g6 lsw of double word for extraction of 4 bytes + g7 msw of double word for extraction of 4 bytes + Big endian + g6 msw of double word for extraction of 4 bytes + g7 lsw of double word for extraction of 4 bytes + g13 return address + g14 byte extracted. +*/ + +#if __i960_BIG_ENDIAN__ +#define MSW g6 +#define LSW g7 +#else +#define LSW g6 +#define MSW g7 +#endif + + .globl _memmove, _memcpy + .globl __memmove, __memcpy + .leafproc _memmove, __memmove + .leafproc _memcpy, __memcpy + .align 2 +_memcpy: +_memmove: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__memcpy: +__memmove: + cmpibge.f 0,g2,Lquick_exit # Lexit if number of bytes to move is <= zero. + cmpo g0,g1 # if dest starts earlier than src ... + lda (g14),g13 # preserve return address + addo g2,g1,g5 # compute addr of byte after last byte of src + be.f Lexit_code # no move necessary if src and dest are same + concmpo g5,g0 # ... or if dest starts after end of src ... + notand g1,3,g3 # extract word addr of start of src + bg.f Lbackwards # ... then drop thru, else do move backwards + cmpo g3,g1 # check alignment of src + ld (g3),LSW # fetch word containing at least first byte + notand g0,3,g4 # extract word addr of start of dest + lda 4(g3),g3 # advance src word addr + bne.f Lcase_245 # branch if src is NOT word aligned + +Lcase_13: + cmpo g0,g4 # check alignment of dest + subo 4,g4,g4 # store is pre-incrementing; back up dest addr + be.t Lcase_1 # branch if dest word aligned + +Lcase_3: # src is word aligned; dest is not + addo 8,g4,g4 # move dest word ptr to first word boundary + lda (g0),g1 # copy dest byte ptr + mov LSW,MSW # make copy of first word of src + lda 32,g14 # initialize shift count to zero (mod 32) + +Lcase_25: +Lcase_3_cloop_at_start: # character copying loop for start of dest str + cmpdeci 0,g2,g2 # is max_bytes exhausted? + be.f Lexit_code # Lexit if max_bytes is exhausted +#if __i960_BIG_ENDIAN__ + rotate 8,MSW,MSW # move next byte into position for extraction + subo 8,g14,g14 # augment the shift counter + stob MSW,(g1) # store the byte in dest +#else + addo 8,g14,g14 # augment the shift counter + stob MSW,(g1) # store the byte in dest + shro 8,MSW,MSW # move next byte into position for extraction +#endif + lda 1(g1),g1 # post-increment dest ptr + cmpobne.t g1,g4,Lcase_3_cloop_at_start # branch if reached word boundary + + ld (g3),MSW # fetch msw of operand for double shift + +Lcase_4: +Lcase_3_wloop: + cmpi g2,4 # less than four bytes to move? + lda 4(g3),g3 # post-increment src word addr + eshro g14,g6,g1 # extract 4 bytes of src + bl.f Lcase_3_cloop # branch if < four bytes left to move + mov MSW,LSW # move msw to lsw + ld (g3),MSW # pre-fetch msw of operand for double shift + subi 4,g2,g2 # decrease max_byte count by the 4 bytes moved + st g1,(g4) # store 4 bytes to dest + addo 4,g4,g4 # post-increment dest ptr + b Lcase_3_wloop + +Lcase_1_wloop: # word copying loop + subi 4,g2,g2 # decrease max_byte count by the 4 bytes moved + ld (g3),LSW # pre-fetch next word of src + addo 4,g3,g3 # post-increment src addr + st g1,(g4) # store word in dest string +Lcase_1: # src and dest are word aligned + cmpi g2,4 # check for fewer than four bytes to move + addo 4,g4,g4 # pre-increment dest addr + lda (LSW),g1 # keep a copy of the src word + bge.t Lcase_1_wloop # branch if at least four bytes to copy +Lcase_3_cloop: + cmpibe.f 0,g2,Lexit_code # Lexit if max_bytes is exhausted + +Lcase_1_cloop: +#if __i960_BIG_ENDIAN__ + rotate 8,g1,g1 # move next byte into position for extraction +#endif + subi 1,g2,g2 + stob g1,(g4) # store the byte in dest + cmpi 0,g2 + lda 1(g4),g4 # post-increment dest byte addr +#if ! __i960_BIG_ENDIAN__ + shro 8,g1,g1 # move next byte into position for extraction +#endif + bne.t Lcase_1_cloop # Lexit if max_bytes is exhausted + +Lexit_code: + mov 0,g14 # conform to register conventions + bx (g13) # g0 = addr of dest; g14 = 0 +Lrett: + ret + + +Lcase_245: + cmpo g0,g4 # check alignment of dest + ld (g3),MSW # pre-fetch second half + and 3,g1,g1 # compute shift count + shlo 3,g1,g14 +#if __i960_BIG_ENDIAN__ + subo g14,0,g14 # adjust shift count for big endian +#endif + be.t Lcase_4 # branch if dest is word aligned + or g4,g1,g1 # is src earlier in word, later, or sync w/ dst + cmpo g0,g1 # < indicates first word of dest has more bytes + lda 4(g4),g4 # move dest word addr to first word boundary + eshro g14,g6,g5 # extract four bytes + lda (g0),g1 +#if __i960_BIG_ENDIAN__ + bge.f 1f +#else + bg.f 1f +#endif + mov MSW,LSW + lda 4(g3),g3 # move src word addr to second word boundary +1: + mov g5,MSW + b Lcase_25 + + +Lbackwards: + notand g5,3,MSW # extract word addr of byte after end of src + cmpo MSW,g5 # check alignment of end of src + subo 4,MSW,g3 # retreat src word addr + addo g2,g0,g1 # compute addr of byte after end of dest + notand g1,3,g4 # extract word addr of start of dest + bne.f Lcase.245 # branch if src is NOT word aligned + +Lcase.13: + cmpo g1,g4 # check alignment of dest + ld (g3),MSW # fetch last word of src + subo 4,g3,g3 # retreat src word addr + be.t Lcase.1 # branch if dest word aligned + +Lcase.3: # src is word aligned; dest is not + mov MSW,LSW # make copy of first word of src + lda 32,g14 # initialize shift count to zero (mod 32) + +Lcase.25: +Lcase.3_cloop_at_start: # character copying loop for start of dest str + cmpdeci 0,g2,g2 # is max.bytes exhausted? + be.f Lexit_code # Lexit if max_bytes is exhausted +#if ! __i960_BIG_ENDIAN__ + rotate 8,LSW,LSW # move next byte into position for storing +#endif + lda -1(g1),g1 # pre-decrement dest ptr + cmpo g1,g4 # have we reached word boundary in dest yet? + stob LSW,(g1) # store the byte in dest +#if __i960_BIG_ENDIAN__ + shro 8,LSW,LSW # move next byte into position for storing + addo 8,g14,g14 # augment the shift counter +#else + subo 8,g14,g14 # augment the shift counter +#endif + bne.t Lcase.3_cloop_at_start # branch if reached word boundary? + + ld (g3),LSW # fetch lsw of operand for double shift + +#if __i960_BIG_ENDIAN__ + cmpobne 0,g14,Lcase.3_wloop +Lcase.3_wloop2: + cmpi g2,4 # less than four bytes to move? + lda -4(g3),g3 # post-decrement src word addr + mov MSW,g1 # extract 4 bytes of src + lda (LSW),MSW # move lsw to msw + subo 4,g4,g4 # pre-decrement dest ptr + bl.f Lcase.3_cloop # branch if < four bytes left to move + ld (g3),LSW # pre-fetch lsw of operand for double shift + subi 4,g2,g2 # decrease max.byte count by the 4 bytes moved + st g1,(g4) # store 4 bytes to dest + b Lcase.3_wloop2 +#endif + +Lcase.4: +Lcase.3_wloop: + cmpi g2,4 # less than four bytes to move? + lda -4(g3),g3 # post-decrement src word addr + eshro g14,g6,g1 # extract 4 bytes of src + lda (LSW),MSW # move lsw to msw + subo 4,g4,g4 # pre-decrement dest ptr + bl.f Lcase.3_cloop # branch if < four bytes left to move + ld (g3),LSW # pre-fetch lsw of operand for double shift + subi 4,g2,g2 # decrease max.byte count by the 4 bytes moved + st g1,(g4) # store 4 bytes to dest + b Lcase.3_wloop + +Lcase.1_wloop: # word copying loop + subi 4,g2,g2 # decrease max.byte count by the 4 bytes moved + ld (g3),MSW # pre-fetch next word of src + subo 4,g3,g3 # post-decrement src addr + st g1,(g4) # store word in dest string +Lcase.1: # src and dest are word aligned + cmpi g2,4 # check for fewer than four bytes to move + subo 4,g4,g4 # pre-decrement dest addr + lda (MSW),g1 # keep a copy of the src word + bge.t Lcase.1_wloop # branch if at least four bytes to copy +Lcase.3_cloop: + cmpibe.f 0,g2,Lexit_code # Lexit if max_bytes is exhausted +#if ! __i960_BIG_ENDIAN__ + rotate 8,g1,g1 # move next byte into position for storing +#endif + lda 4(g4),g4 # pre-decremented dest addr 4 too much + +Lcase.1_cloop: + subi 1,g4,g4 # pre-decrement dest byte addr + cmpi g4,g0 # has dest ptr reached beginning of dest? + stob g1,(g4) # store the byte in dest +#if __i960_BIG_ENDIAN__ + shro 8,g1,g1 # move next byte into position for storing +#else + rotate 8,g1,g1 # move next byte into position for storing +#endif + bne.t Lcase.1_cloop # Lexit if move is completed + b Lexit_code + +Lcase.245: + cmpo g1,g4 # check alignment of dest + ld (MSW),MSW # pre-fetch word with at least last byte + and 3,g5,g5 # compute shift count + ld (g3),LSW # pre-fetch second to last word + shlo 3,g5,g14 +#if __i960_BIG_ENDIAN__ + subo g14,0,g14 # adjust shift count for big endian +#endif + be.t Lcase.4 # branch if dest is word aligned + or g4,g5,g5 # is src earlier in word, later, or sync w/ dst + cmpo g1,g5 # < indicates last word of dest has less bytes + eshro g14,g6,g5 # extract four bytes + bl.t 1f + mov LSW,MSW +#if ! __i960_BIG_ENDIAN__ + be.t 1f +#endif + subo 4,g3,g3 # move src word addr to second word boundary +1: + mov g5,LSW + b Lcase.25 + + +Lquick_exit: + mov g14,g13 + b Lexit_code + +/* end of memmove */ diff --git a/newlib/libc/machine/i960/memset.S b/newlib/libc/machine/i960/memset.S new file mode 100644 index 000000000..9121d4524 --- /dev/null +++ b/newlib/libc/machine/i960/memset.S @@ -0,0 +1,121 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "memset.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1989,1993 Intel Corp., all rights reserved + */ + +/* + procedure memset (optimized assembler version: 80960K series, 80960CA) + + dest_addr = memset (dest_addr, char, len) + + Fill len bytes pointed to by dest_addr with the value of char. + Return the original address of dest_addr. + + This program avoids performing unaligned accesses. It stores + from zero to seven bytes, and then stores aligned longwords, + and then stores from zero to seven bytes, as necessary to + store len bytes starting at dest_addr. + + At the time of this writing, only g0 thru g7 and g13 are available + for use in this leafproc; other registers would have to be saved and + restored. These nine registers, plus tricky use of g14 are sufficient + to implement the routine. +*/ + + .globl _memset + .globl __memset + .leafproc _memset, __memset + .align 2 +_memset: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__memset: + cmpo 7,g2 # are there fewer than seven characters to move? + lda (g14),g13 # save return address + notand g0,7,g3 # test for non-aligned dest_ptr + lda 0,g14 # conform to register conventions + shlo 24,g1,g4 # prepare word of char + lda (g0),g6 # preserve dest_ptr for return + shro 8,g4,g5 + bge.f Lcloop_setup + cmpo g3,g0 # is dest longword aligned + lda 7(g3),g3 # bump dest_ptr to next longword boundary + or g4,g5,g4 + be.t Lwloop_setup + +Lbgn_cloop: + cmpo g6,g3 # Have we reached longword boundary? + stob g1,(g6) # store one byte of char + subo 1,g2,g2 # decrement len + lda 1(g6),g6 # increment dest_ptr + bne.t Lbgn_cloop # loop if more bytes to store before longword + + cmpobge.f 7,g2,Lcloop + +Lwloop_setup: + shro 16,g4,g5 + or g4,g5,g4 + mov g4,g5 # now have a longword of char + +Lwloop: + cmpo 15,g2 # Do we have to store more longwords? + stl g4,(g6) # Store longword of char + subo 8,g2,g2 # Decrement len + lda 8(g6),g6 # Increment dest_ptr + bl.t Lwloop # loop if more longwords to store + +Lcloop_setup: + cmpobge.t 0,g2,Lexit + +Lcloop: + cmpo 1,g2 # Is len exhausted? + stob g1,(g6) # Store byte + subo 1,g2,g2 # Decrement len + lda 1(g6),g6 # Increment dest_ptr + bne.t Lcloop # loop if more bytes to store + +Lexit: + bx (g13) +Lrett: + ret + +/* end of memset */ diff --git a/newlib/libc/machine/i960/setjmp.S b/newlib/libc/machine/i960/setjmp.S new file mode 100644 index 000000000..804df0e0f --- /dev/null +++ b/newlib/libc/machine/i960/setjmp.S @@ -0,0 +1,96 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + +/******************************************************************************/ +/* */ +/* setjmp(), longjmp() */ +/* */ +/******************************************************************************/ + .file "setjmp.as" + .text + /* .link_pix */ + + .align 4 + .globl _setjmp +_setjmp: + flushreg + andnot 0xf,pfp,g1 /* get pfp, mask out return status bits */ + st g1, 0x58(g0) /* save fp of caller*/ + /* save globals not killed by the calling convention */ + stq g8, 0x40(g0) /* save g8-g11*/ + st g12, 0x50(g0) /* save g12*/ + st g14, 0x54(g0) /* save g14*/ + /* save previous frame local registers */ + ldq (g1), g4 /* get previous frame pfp, sp, rip, r3 */ + stq g4, (g0) /* save pfp, sp, rip, r3 */ + ldq 0x10(g1), g4 /* get previous frame r4-r7 */ + stq g4, 0x10(g0) /* save r4-r7 */ + ldq 0x20(g1), g4 /* get previous frame r8-r11 */ + stq g4, 0x20(g0) /* save r8-r11 */ + ldq 0x30(g1), g4 /* get previous frame r12-r15 */ + stq g4, 0x30(g0) /* save r12-r15 */ + + mov 0, g0 /* return 0 */ + ret + + /* + * fake a return to the place that called the corresponding _setjmp + */ + .align 4 + .globl _longjmp +_longjmp: + call 0f /* ensure there is at least one stack frame */ + +0: + flushreg /* do this before swapping stack */ + ld 0x58(g0), pfp /* get fp of caller of setjmp */ + /* restore local registers + * the following code modifies the frame of the function which originally + * called setjmp. + */ + ldq (g0), g4 /* get pfp, sp, rip, r3 */ + stq g4, (pfp) /* restore pfp, sp, rip, r3 */ + ldq 0x10(g0), g4 /* get r4-r7 */ + stq g4, 0x10(pfp) /* restore r4-r7 */ + ldq 0x20(g0), g4 /* get r8-r11 */ + stq g4, 0x20(pfp) /* restore r8-r11 */ + ldq 0x30(g0), g4 /* get r12-r15 */ + stq g4, 0x30(pfp) /* restore r12-r15 */ + /* restore global registers */ + ldq 0x40(g0), g8 /* get old g8-g11 values */ + ld 0x50(g0), g12 /* get old g12 value */ + ld 0x54(g0), g14 /* get old g14 value */ + + mov g1, g0 /* get return value */ + cmpo g0, 0 /* make sure it is not zero */ + bne 0f + mov 1, g0 /* return 1 by default */ +0: + ret /* return to caller of _setjmp */ diff --git a/newlib/libc/machine/i960/strchr.S b/newlib/libc/machine/i960/strchr.S new file mode 100644 index 000000000..bc50c2c41 --- /dev/null +++ b/newlib/libc/machine/i960/strchr.S @@ -0,0 +1,123 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "strchr.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ + +/* + procedure strchr (optimized assembler version for the 80960K series) + + src_addr = strchr (src_addr, char) + + return a pointer to the first byte that contains the indicated + byte in the source string. Return null if the byte is not found. + + Undefined behavior will occur if the end of the source string (i.e. + the terminating null byte) is in the last two words of the program's + allocated memory space. This is so because strchr fetches ahead. + Disallowing the fetch ahead would impose a severe performance penalty. + + Strategy: + + Fetch the source string by words and scanbyte the words for the + char until either a word with the byte is found or the null byte is + encountered. In the former case, move through the word to find the + matching byte and return its memory address. In the latter case, + return zero (null). + + Tactics: + + 1) Do NOT try to fetch the words in a word aligned manner because, + in my judgement, the performance degradation experienced due to + non-aligned accesses does NOT outweigh the time and complexity added + by the preamble that would be necessary to assure alignment. This + is supported by the intuition that most source arrays (even more + true of most big source arrays) will be word aligned to begin with. +*/ + + .globl _strchr + .globl __strchr + .leafproc _strchr, __strchr + .align 2 +_strchr: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__strchr: + + ld (g0),g4 # fetch first word + lda 0xff,g7 # byte extraction mask + and g1,g7,g1 # make char an 8-bit ordinal + shlo 8,g1,g2 # broadcast the char to four bytes + or g1,g2,g2 + shlo 16,g2,g5 + or g2,g5,g3 + mov g14,g13 # preserve return address + addo 4,g0,g0 # post-increment src pointer + mov 0,g14 # conform to register linkage standard + +Lsearch_for_word_with_char_or_null: + mov g4,g5 # copy word + scanbyte g3,g5 # check for byte with char + ld (g0),g4 # fetch next word of src + bo Lsearch_for_char # branch if char found + scanbyte 0,g5 # check for null byte + addo 4,g0,g0 # post-increment src pointer + bno Lsearch_for_word_with_char_or_null # branch if not null + +Lnot_found: + mov 0,g0 # char not found. Return null +Lexit_code: + bx (g13) # g0 = addr of char in src (or null); g14 = 0 +Lrett: + ret + +Lsearch_for_char: + subo 5,g0,g0 # back up the byte pointer +Lsearch_for_char.a: + and g5,g7,g6 # extract byte + cmpo g1,g6 # is it char? + addo 1,g0,g0 # bump src byte ptr + shro 8,g5,g5 # shift word to position next byte + be Lexit_code + cmpobne 0,g6,Lsearch_for_char.a # quit if null comes before char + b Lnot_found + +/* end of strchr */ diff --git a/newlib/libc/machine/i960/strchr_ca.S b/newlib/libc/machine/i960/strchr_ca.S new file mode 100644 index 000000000..f52eae217 --- /dev/null +++ b/newlib/libc/machine/i960/strchr_ca.S @@ -0,0 +1,152 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "strch_ca.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ + +/* + procedure strchr (optimized assembler version for the CA) + + src_addr = strchr (src_addr, char) + + return a pointer to the first byte that contains the indicated + byte in the source string. Return null if the byte is not found. + + Undefined behavior will occur if the end of the source string (i.e. + the terminating null byte) is in the last two words of the program's + allocated memory space. This is so because, in several cases, strchr + will fetch ahead. Disallowing the fetch ahead would impose a severe + performance penalty. + + This program handles two cases: + + 1) the argument starts on a word boundary + 2) the argument doesn't start on a word boundary + + At the time of this writing, only g0 thru g7 and g13 are available + for use in this leafproc; other registers would have to be saved and + restored. These nine registers, plus tricky use of g14 are sufficient + to implement the routine. The registers are used as follows: + + g0 src ptr; upon return it is a pointer to the matching byte, or null + g1 char to seek + g2 mask to avoid unimportant bytes in first word + g3 char to seek, broadcast to all four bytes + g4 word of the source string + g5 copy of the word + g6 extracted character + g7 byte extraction mask + g13 return address + g14 +*/ + + .globl _strchr + .globl __strchr + .leafproc _strchr, __strchr + .align 2 +_strchr: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__strchr: + + lda 0xff,g7 # byte extraction mask + and g1,g7,g1 # make char an 8-bit ordinal + shlo 8,g1,g2 # broadcast the char to four bytes + or g1,g2,g2 + shlo 16,g2,g4 + cmpo g1,g7 # is char being sought 0xff? + or g4,g2,g3 + lda (g14),g13 # preserve return address + notand g0,3,g5 # extract word addr of start of src + lda 0,g14 # conform to register linkage standard + and g0,3,g6 # extract byte offset of src + ld (g5),g4 # fetch word containing at least first byte + shlo 3,g6,g6 # get shift count for making mask for first word + lda 4(g5),g0 # post-increment src word pointer + subi 1,0,g5 # mask initially all ones +#if __i960_BIG_ENDIAN__ + shro g6,g5,g5 # get mask for bytes needed from first word +#else + shlo g6,g5,g5 # get mask for bytes needed from first word +#endif + notor g4,g5,g4 # set unneeded bytes to all ones + be.f Lsearch_for_0xff # branch if seeking 0xff + +Lsearch_for_word_with_char_or_null: + scanbyte g3,g4 # check for byte with char + lda (g4),g5 # copy word + ld (g0),g4 # fetch next word of src + bo.f Lsearch_for_char # branch if null found + scanbyte 0,g5 # check for null byte + lda 4(g0),g0 # post-increment src word pointer + bno.t Lsearch_for_word_with_char_or_null # branch if not null + +Lnot_found: + mov 0,g0 # char not found. Return null +Lexit_code: + bx (g13) # g0 = addr of char in src (or null); g14 = 0 +Lrett: + ret + +Lsearch_for_char: + subo 5,g0,g0 # back up the byte pointer +Lsearch_for_char.a: +#if __i960_BIG_ENDIAN__ + rotate 8,g5,g5 # shift word to position next byte +#endif + and g5,g7,g6 # extract byte + cmpo g1,g6 # is it char? + lda 1(g0),g0 # bump src byte ptr +#if ! __i960_BIG_ENDIAN__ + shro 8,g5,g5 # shift word to position next byte +#endif + be.f Lexit_code + cmpobne.t 0,g6,Lsearch_for_char.a # quit if null comes before char + b Lnot_found + +Lsearch_for_0xff: + lda 0xf0f0f0f0,g2 # make first comparison mask for char=-1 case. + or g5,g2,g2 + and g4,g2,g4 # make unimportant bytes of first word 0x0f + b Lsearch_for_word_with_char_or_null + +/* end of strchr */ + diff --git a/newlib/libc/machine/i960/strcmp.S b/newlib/libc/machine/i960/strcmp.S new file mode 100644 index 000000000..c0cd4bd6f --- /dev/null +++ b/newlib/libc/machine/i960/strcmp.S @@ -0,0 +1,118 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "strcmp.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ +/* + procedure strcmp (optimized assembler version for the 80960K Series) + + result = strcmp (src1_addr, src2_addr) + + compare the null terminated string pointed to by src1_addr to + the string pointed to by src2_addr. Return 0 iff the strings + are equal, -1 if src1_addr is lexicographically less than src2_addr, + and 1 if it is lexicographically greater. + + Undefined behavior will occur if the end of either source string + (i.e. the terminating null byte) is in the last two words of the + program's allocated memory space. This is so because strcmp fetches + ahead. Disallowing the fetch ahead would impose a severe performance + penalty. + + Strategy: + + Fetch the source strings by words and compare the words until either + differing words are found or the null byte is encountered. In either + case, move through the word until either the differing byte if found, + in which case return -1 or 1 appropriately; or the null byte is + encountered, in which case, return zero (equality). + + Tactics: + + 1) Do NOT try to fetch the words in a word aligned manner because, + in my judgement, the performance degradation experienced due to + non-aligned accesses does NOT outweigh the time and complexity added + by the preamble and convoluted body that would be necessary to assure + alignment. This is supported by the intuition that many source + strings will be word aligned to begin with. +*/ + + .globl _strcmp + .globl __strcmp + .leafproc _strcmp,__strcmp + .align 2 + +_strcmp: +#ifndef __PIC + lda .Lrett,g14 +#else + lda .Lrett-(.+8)(ip),g14 +#endif +__strcmp: + ld (g0), g5 # fetch first word of source_1 + mov g14,g7 # preserve return address + ldconst 0,g14 # conform to register conventions + ldconst 0xff,g4 # byte extraction mask +.Lwloop: + addo 4,g0,g0 # post-increment source_1 byte ptr + ld (g1), g3 # fetch word of source_2 + scanbyte 0,g5 # does word have a null byte? + mov g5,g2 # save a copy of the source_1 word + be .Lcloop # branch if null byte encountered + cmpo g2,g3 # are the source words the same? + addo 4,g1,g1 # post-increment source_2 byte ptr + ld (g0), g5 # fetch ahead next word of source_1 + be .Lwloop # fall thru if words are unequal + +.Lcloop: and g4,g2,g5 # extract and compare individual bytes + and g4,g3,g6 + cmpobne g5,g6,.diff # if they differ, go return 1 or -1 + cmpo 0,g6 # they are the same. Are they null? + shlo 8,g4,g4 # position mask for next extraction + bne .Lcloop # loop if null not encountered + + mov 0,g0 # return equality + bx (g7) +.Lrett: + ret +.diff: bl .neg + mov 1,g0 + bx (g7) +.neg: subi 1,0,g0 +.Lexit: + bx (g7) diff --git a/newlib/libc/machine/i960/strcmp_ca.S b/newlib/libc/machine/i960/strcmp_ca.S new file mode 100644 index 000000000..0298ffa0d --- /dev/null +++ b/newlib/libc/machine/i960/strcmp_ca.S @@ -0,0 +1,246 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "strcm_ca.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ + +/* + procedure strcmp (optimized assembler version for the CA) + + result = strcmp (src1_addr, src2_addr) + + compare the null terminated string pointed to by src1_addr to + the string space pointed to by src2_addr. Return 0 iff the strings + are equal, -1 if src1_addr is lexicly less than src2_addr, and 1 + if it is lexicly greater. + + Undefined behavior will occur if the end of either source string + (i.e. the terminating null byte) is in the last word of the program's + allocated memory space. This is so because, in several cases, strcmp + will fetch ahead one word. Disallowing the fetch ahead would impose + a severe performance penalty. + + This program handles five cases: + + 1) both arguments start on a word boundary + 2) neither are word aligned, but they are offset by the same amount + 3) source1 is word aligned, source2 is not + 4) source2 is word aligned, source1 is not + 5) neither is word aligned, and they are offset by differing amounts + + At the time of this writing, only g0 thru g7 and g14 are available + for use in this leafproc; other registers would have to be saved and + restored. These nine registers are sufficient to implement the routine. + The registers are used as follows: + + g0 original src1 ptr; return result + g1 src2 ptr; 0xff -- byte extraction mask + g2 src1 word ptr + g3 src2 word ptr + Little endian: + g4 lsw of src1 + g5 msw of src1 + g6 src2 word + g7 extracted src1 + Big endian: + g4 msw of src1 + g5 lsw of src1 + g6 extracted src1 + g7 src2 word + g13 return address + g14 shift count +*/ + +#if __i960_BIG_ENDIAN__ +#define MSW g4 +#define LSW g5 +#define SRC1 g6 +#define SRC2 g7 +#else +#define LSW g4 +#define MSW g5 +#define SRC2 g6 +#define SRC1 g7 +#endif + + .globl _strcmp + .globl __strcmp + .leafproc _strcmp, __strcmp + .align 2 +_strcmp: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif + +__strcmp: +Lrestart: + notand g0,3,g2 # extract word addr of start of src1 + lda (g14),g13 # preserve return address +#if __i960_BIG_ENDIAN__ + cmpo g0,g2 # check alignment of src1 +#endif + ld (g2),LSW # fetch word with at least first byte of src1 + notand g1,3,g3 # extract word addr of start of src2 + ld 4(g2),MSW # fetch second word of src1 +#if __i960_BIG_ENDIAN__ + bne Lsrc1_unaligned # branch if src1 is unaligned + cmpo g3,g1 # check alignment of src2 + ld (g3),SRC2 # fetch word with at least first byte of src2 + mov LSW,SRC1 # extract word of src1 + lda 8(g2),g2 # advance src1 word addr + bne.f Lsrc2_unaligned # branch if src2 is NOT word aligned + + /* src2 is word aligned */ + +Lwloop2: # word comparing loop + cmpo SRC2,SRC1 # compare src1 and src2 words + lda 0xff000000,g1 # byte extraction mask + mov MSW,LSW # move msw of src1 to lsw + ld (g2),MSW # pre-fetch next msw of src1 + addo 4,g2,g2 # post-increment src1 addr + lda 4(g3),g3 # pre-increment src2 addr + bne.f Lcloop # branch if src1 and src2 unequal + scanbyte 0,SRC1 # check for null byte in src1 word + ld (g3),SRC2 # pre-fetch next word of src2 + mov LSW,SRC1 # extract word of src1 + lda 0,g0 # prepare to return zero, indicating equality + bno.t Lwloop2 # branch if null byte not encountered + + /* words were equal and contained null byte */ + + mov 0,g14 # conform to register conventions + bx (g13) # return + + +Lsrc1_unaligned: +#endif + cmpo g3,g1 # check alignment of src2 + ld (g3),SRC2 # fetch word with at least first byte of src2 + shlo 3,g0,g14 # compute shift count for src1 +#if __i960_BIG_ENDIAN__ + subo g14,0,g14 # 32 - shift count for big endian. +#endif + eshro g14,g4,SRC1 # extract word of src1 + lda 8(g2),g2 # advance src1 word addr + bne.f Lsrc2_unaligned # branch if src2 is NOT word aligned + + /* at least src2 is word aligned */ + +Lwloop: # word comparing loop + cmpo SRC2,SRC1 # compare src1 and src2 words +#if __i960_BIG_ENDIAN__ + lda 0xff000000,g1 # byte extraction mask +#else + lda 0xff,g1 # byte extraction mask +#endif + mov MSW,LSW # move msw of src1 to lsw + ld (g2),MSW # pre-fetch next msw of src1 + addo 4,g2,g2 # post-increment src1 addr + lda 4(g3),g3 # pre-increment src2 addr + bne.f Lcloop # branch if src1 and src2 unequal + scanbyte 0,SRC1 # check for null byte in src1 word + ld (g3),SRC2 # pre-fetch next word of src2 + eshro g14,g4,SRC1 # extract word of src1 + lda 0,g0 # prepare to return zero, indicating equality + bno.t Lwloop # branch if null byte not encountered + + /* words were equal and contained null byte */ + + mov 0,g14 # conform to register conventions + bx (g13) # return + +Lcloop_setup: # setup for coming from Lsrc2_unaligned + mov LSW,SRC1 # restore extracted src1 word +#if __i960_BIG_ENDIAN__ + lda 0xff000000,g1 # byte extraction mask +#else + lda 0xff,g1 # byte extraction mask +#endif + +Lcloop: # character comparing loop + and SRC2,g1,g3 # extract next char of src2 + and SRC1,g1,g0 # extract next char of src1 + cmpobne.f g0,g3,.diff # check for equality + cmpo 0,g0 # check for null byte +#if __i960_BIG_ENDIAN__ + shro 8,g1,g1 # shift mask for next byte +#else + shlo 8,g1,g1 # shift mask for next byte +#endif + bne.t Lcloop # branch if null not reached + + /* words are equal up thru null byte */ + + mov 0,g14 + bx (g13) # g0 = 0 (src1 == src2) +Lrett: + ret + +.diff: + mov 0,g14 + bl Lless_than_exit +Lgreater_than_exit: + mov 1,g0 + bx (g13) # g0 = 1 (src1 > src2) +Lless_than_exit: + subi 1,0,g0 + bx (g13) # g0 = -1 (src1 < src2) + +Lsrc2_unaligned: + mov SRC1,LSW # retain src1 extracted word + ld 4(g3),SRC1 # fetch second word of src2 + shlo 3,g1,MSW # compute shift count for src2 +#if __i960_BIG_ENDIAN__ + subo MSW,0,MSW # 32 - shift count for big endian. +#endif + eshro MSW,g6,SRC2 # extract word of src2 + cmpo LSW,SRC2 # compare src1 and src2 words + notor g1,3,MSW # first step in computing new src1 ptr + lda 4(g3),g1 # set new src2 ptr + bne.f Lcloop_setup # first four bytes differ + scanbyte 0,LSW # check for null byte + lda (g13),g14 # prepare return pointer for Lrestart + subo MSW,g0,g0 # second (final) step in computing new src1 ptr + bno.t Lrestart # if null byte not encountered, continue + /* with both string fetches shifted such that */ + /* src2 is now word aligned. */ + mov 0,g14 # conform to register conventions. + lda 0,g0 # return indicator of equality. + bx (g13) diff --git a/newlib/libc/machine/i960/strcpy.S b/newlib/libc/machine/i960/strcpy.S new file mode 100644 index 000000000..ed8bb7234 --- /dev/null +++ b/newlib/libc/machine/i960/strcpy.S @@ -0,0 +1,177 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "strcpy.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ +/* + procedure strcpy (optimized assembler version for the 80960K series) + procedure strcat (optimized assembler version for the 80960K series) + + dest_addr = strcpy (dest_addr, src_addr) + + copy the null terminated string pointed to by src_addr to + the string space pointed to by dest_addr. Return the original + dest_addr. + + This routine will fail if the source and destination string + overlap (in particular, if the end of the source is overlapped + by the beginning of the destination). The behavior is undefined. + This is acceptable according to the draft C standard. + + Undefined behavior will also occur if the end of the source string + (i.e. the terminating null byte) is in the last two words of the + program's allocated memory space. This is so because strcpy fetches + ahead. Disallowing the fetch ahead would impose a severe performance + penalty. + + Strategy: + + Fetch the source string and store the destination string by words + until the null byte is encountered. When the word with the null + byte is reached, store it by bytes up through the null byte only. + + Tactics: + + 1) Do NOT try to fetch and store the words in a word aligned manner + because, in my judgement, the performance degradation experienced due + to non-aligned accesses does NOT outweigh the time and complexity added + by the preamble and convoluted body that would be necessary to assure + alignment. This is supported by the intuition that most source and + destination strings will be word aligned to begin with. + + + procedure strcat + + dest_addr = strcat (dest_addr, src_addr) + + Appends the string pointed to by src_addr to the string pointed + to by dest_addr. The first character of the source string is + copied to the location initially occupied by the trailing null + byte of the destination string. Thereafter, characters are copied + from the source to the destination up thru the null byte that + trails the source string. + + See the strcpy routine, above, for its caveats, as they apply here too. + + Strategy: + + Skip to the end (null byte) of the destination string, and then drop + into the strcpy code. + + Tactics: + + Skipping to the null byte is Ldone by reading the destination string + in long-words and scanbyte'ing them, then examining the bytes of the + word that contains the null byte, until the address of the null byte is + known. Then we drop into the strcpy routine. It is probable (approx. + three out of four times) that the destination string as strcpy sees + it will NOT be word aligned (i.e. that the null byte won't be the + last byte of a word). But it is not worth the complication to that + routine to force word aligned memory accesses to be gaurenteed. +*/ + .globl _strcpy, _strcat + .globl __strcpy, __strcat + .leafproc _strcpy,__strcpy + .leafproc _strcat,__strcat + .align 2 +_strcat: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__strcat: + mov g14,g13 # preserve return address + ldl (g0),g4 # fetch first two words + addo 8,g0,g2 # post-increment src word pointer + lda 0xff,g3 # byte extraction mask + +Lsearch_for_word_with_null_byte: + scanbyte 0,g4 # check for null byte + mov g5,g7 # copy second word + bo.f Lsearch_for_null # branch if null found + scanbyte 0,g7 # check for null byte + ldl (g2),g4 # fetch next pair of word of src + addo 8,g2,g2 # post-increment src word pointer + bno Lsearch_for_word_with_null_byte # branch if null not found yet + + subo 4,g2,g2 # back up the byte pointer + mov g7,g4 # move word with null to search word +Lsearch_for_null: + subo 9,g2,g5 # back up the byte pointer +Lsearch_for_null.a: + and g4,g3,g6 # extract byte + cmpo 0,g6 # is it null? + addo 1,g5,g5 # bump src byte ptr + shro 8,g4,g4 # shift word to position next byte + bne Lsearch_for_null.a + b Lend_of_dest_found + +_strcpy: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__strcpy: + mov g0, g5 +Lend_of_dest_found: + ld (g1), g2 # fetch first word of source + mov g14,g6 # preserve return address + lda 0xff, g3 # byte extraction mask = 0xff; +Lwloop: # word copying loop + addo 4, g1, g1 # post-increment source ptr + scanbyte 0, g2 # does source word contain null byte? + mov g2, g4 # save a copy of the source word + be Lcloop # branch if null present + ld (g1), g2 # pre-fetch next word of source + st g4, (g5) # store current word + addo 4, g5, g5 # post-increment dest ptr + b Lwloop + +Lcloop: # character copying loop + and g3, g4, g14 # extract next char + shro 8, g4, g4 # position word for next byte extraction + cmpo 0, g14 # is it null? + stob g14, (g5) # store the byte + addo 1, g5, g5 # post-increment dest ptr + bne Lcloop # quit if null encountered + + bx (g6) # g0 = dest string address; g14 = 0 +Lrett: + ret diff --git a/newlib/libc/machine/i960/strcpy_ca.S b/newlib/libc/machine/i960/strcpy_ca.S new file mode 100644 index 000000000..dbb944455 --- /dev/null +++ b/newlib/libc/machine/i960/strcpy_ca.S @@ -0,0 +1,284 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "strcp_ca.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ + +/* + procedure strcpy (optimized assembler version for the CA) + + dest_addr = strcpy (dest_addr, src_addr) + + copy the null terminated string pointed to by src_addr to + the string space pointed to by dest_addr. Return the original + dest_addr. + + This routine will fail if the source and destination string + overlap (in particular, if the end of the source is overlapped + by the beginning of the destination). The behavior is undefined. + This is acceptable according to the draft C standard. + + Undefined behavior will also occur if the end of the source string + (i.e. the terminating null byte) is in the last word of the program's + allocated memory space. This is so because, in several cases, strcpy + will fetch ahead one word. Disallowing the fetch ahead would impose + a severe performance penalty. + + This program handles five cases: + + 1) both arguments start on a word boundary + 2) neither are word aligned, but they are offset by the same amount + 3) source is word aligned, destination is not + 4) destination is word aligned, source is not + 5) neither is word aligned, and they are offset by differing amounts + + At the time of this writing, only g0 thru g7 and g13 are available + for use in this leafproc; other registers would have to be saved and + restored. These nine registers, plus tricky use of g14 are sufficient + to implement the routine. The registers are used as follows: + + g0 original dest ptr; not modified, so that it may be returned. + g1 src ptr; shift count + g2 dest ptr; 4 bytes of src + g3 src ptr (word aligned) + g4 dest ptr (word aligned) + g5 0xff -- byte extraction mask + g6 lsw of double word for extraction of 4 bytes (little endian) + msw of double word for extraction of 4 bytes (big endian) + g7 msw of double word for extraction of 4 bytes (little endian) + lsw of double word for extraction of 4 bytes (big endian) + g13 return address + g14 byte extracted. When reaches null byte, which is zero, we will + be in conformance with register conventions, and can return to + the caller with a clear conscience. + + procedure strcat + + dest_addr = strcat (dest_addr, src_addr) + + Appends the string pointed to by src_addr to the string pointed + to by dest_addr. The first character of the source string is + copied to the location initially occupied by the trailing null + byte of the destination string. Thereafter, characters are copied + from the source to the destination up thru the null byte that + trails the source string. +*/ + +#if __i960_BIG_ENDIAN__ +#define MSW g6 +#define LSW g7 +#else +#define LSW g6 +#define MSW g7 +#endif + + .globl _strcpy, _strcat + .globl __strcpy, __strcat + .leafproc _strcpy, __strcpy + .leafproc _strcat, __strcat + .align 2 +_strcat: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__strcat: + notand g0,3,g4 # extract word addr of start of dest + lda (g14),g13 # preserve return address + and g0,3,LSW # extract byte offset of dest + ld (g4),MSW # fetch word containing at least first byte + shlo 3,LSW,g14 # get shift count for making mask for first word + subi 1,0,LSW # mask initially all ones +#if __i960_BIG_ENDIAN__ + shro g14,LSW,LSW # get mask for bytes needed from first word + lda 0xff000000,g5 # byte extraction mask +#else + shlo g14,LSW,LSW # get mask for bytes needed from first word + lda 0xff,g5 # byte extraction mask +#endif + notor MSW,LSW,MSW # set unneeded bytes to all ones +Lsearch_for_word_with_null: + scanbyte 0,MSW # check for null byte + lda 4(g4),g4 # post-increment dest word pointer + mov MSW,LSW # keep a copy of current word + ld (g4),MSW # fetch next word of dest + bno.t Lsearch_for_word_with_null # branch if null not found yet + and g5,LSW,g14 # extract byte + cmpo 0,g14 # branch if null is first byte of word + subo 4,g4,g4 # move dest word ptr back to word with null + notand g1,3,g3 # extract word addr of start of src + lda (g4),g2 # set dest byte ptr to 1st byte of word w/ null + be.f Lcase_14 +Lsearch_for_null: +#if __i960_BIG_ENDIAN__ + shro 8,g5,g5 # move mask down to next byte +#else + shlo 8,g5,g5 # move mask up to next byte +#endif + lda 1(g2),g2 # move dest byte ptr to next byte + and g5,LSW,g14 # extract byte + cmpobne.t 0,g14,Lsearch_for_null # branch if null is not yet found + lda 0xff,g5 # byte extraction mask + b Lcase_235.a + + +_strcpy: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__strcpy: + notand g0,3,g4 # extract word addr of start of dest + lda (g14),g13 # preserve return address + cmpo g0,g4 # check alignment of dest + lda 0xff,g5 # load mask for byte extraction + notand g1,3,g3 # extract word addr of start of src + bne.f Lcase_235 # branch if dest is NOT word aligned + +Lcase_14: + cmpo g3,g1 # check alignment of src + ld (g3),LSW # fetch word containing at least first byte + shlo 3,g1,g1 # compute shift count + lda 4(g3),g3 # advance src word addr +#if __i960_BIG_ENDIAN__ + lda 0xff,g5 # byte extraction mask +#endif + bne.f Lcase_4 # branch if src is NOT word aligned + +Lcase_1: # src and dest are word aligned + subo 4,g4,g4 # store is pre-incrementing; back up dest addr +Lcase_1_wloop: # word copying loop + scanbyte 0,LSW # check for null byte in src word + lda (LSW),g2 # keep a copy of the src word + addo 4,g4,g4 # pre-increment dest addr + ld (g3),LSW # pre-fetch next word of src + addo 4,g3,g3 # post-increment src addr + bo.f Lcase_1_cloop # branch if word contains null byte + st g2,(g4) # store word in dest string + b Lcase_1_wloop + +Lcase_3_cloop: +Lcase_1_cloop: # character copying loop +#if __i960_BIG_ENDIAN__ + rotate 8,g2,g2 # move next byte into position for extraction + and g5,g2,g14 # extract next char +#else + and g5,g2,g14 # extract next char + shro 8,g2,g2 # move next byte into position for extraction +#endif + cmpo 0,g14 # check for null byte + stob g14,(g4) # store the byte in dest + lda 1(g4),g4 # post-increment dest byte addr + bne.t Lcase_1_cloop # branch if null not reached + +Lexit_code: + bx (g13) # g0 = addr of dest; g14 = 0 +Lrett: + ret + +Lcase_3: # src is word aligned; dest is not + addo 4,g4,g4 # move dest word ptr to first word boundary + mov LSW,MSW # make copy of first word of src + lda 0,g1 # initialize shift count to zero + +Lcase_25: +Lcase_3_cloop_at_start: # character copying loop for start of dest str +#if __i960_BIG_ENDIAN__ + rotate 8,MSW,MSW # move next byte into position for extraction + and g5,MSW,g14 # extract next char +#else + and g5,MSW,g14 # extract next char + shro 8,MSW,MSW # move next byte into position for extraction +#endif + cmpo 0,g14 # check for null byte + stob g14,(g2) # store the byte in dest + lda 1(g2),g2 # post-increment dest ptr + be.f Lexit_code # branch if null byte reached + cmpo g2,g4 # have we reached word boundary in dest? + lda 8(g1),g1 # augment the shift counter + bne.t Lcase_3_cloop_at_start + +Lcase_4: + ld (g3),MSW # fetch msw of operand for double shift +#if __i960_BIG_ENDIAN__ + subo g1,0,g1 # Adjust shift count for big endian. +#endif + +Lcase_3_wloop: + eshro g1,g6,g2 # extract 4 bytes of src + lda 4(g3),g3 # post-increment src word addr + scanbyte 0,g2 # check for null byte + lda (MSW),LSW # move msw to lsw + ld (g3),MSW # pre-fetch msw of operand for double shift + bo.f Lcase_3_cloop # branch if word contains null byte + st g2,(g4) # store 4 bytes to dest + addo 4,g4,g4 # post-increment dest ptr + b Lcase_3_wloop + +Lcase_235: + lda (g0),g2 # copy dest ptr +Lcase_235.a: + cmpo g3,g1 # check alignment of src + ld (g3),LSW # fetch word containing at least first byte + and 3,g1,g14 # compute shift count + lda 4(g3),g3 # advance src word addr + shlo 3,g14,g1 + be.t Lcase_3 # branch if dest is word aligned + or g4,g14,g14 # is src earlier in word, later, or sync w/ dst + ld (g3),MSW # pre-fetch second half + cmpo g2,g14 # < indicates first word of dest has more bytes + lda 4(g4),g4 # move dest word addr to first word boundary + /* than first word of source. */ +#if __i960_BIG_ENDIAN__ + subo g1,0,g14 # Adjust shift count for big endian. + eshro g14,g6,g14 # extract four bytes + bge.f 1f +#else + eshro g1,g6,g14 # extract four bytes + bg.f 1f +#endif + mov MSW,LSW + lda 4(g3),g3 # move src word addr to second word boundary +1: + mov g14,MSW + b Lcase_25 + +/* end of strcpy */ + diff --git a/newlib/libc/machine/i960/strcspn.S b/newlib/libc/machine/i960/strcspn.S new file mode 100644 index 000000000..cd7b2e694 --- /dev/null +++ b/newlib/libc/machine/i960/strcspn.S @@ -0,0 +1,94 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "strcspn.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1989,1993 Intel Corp., all rights reserved + */ + +/* + procedure strcspn (optimized assembler version: 80960K series, 80960CA) + + len = strcspn (string, charset) + + Return the number of characters in the maximum leading segment + of string which consists solely of characters NOT from charset. + + At the time of this writing, only g0 thru g7 and g13 are available + for use in this leafproc; other registers would have to be saved and + restored. These nine registers, plus tricky use of g14 are sufficient + to implement the routine. +*/ + + .globl _strcspn + .globl __strcspn + .leafproc _strcspn, __strcspn + .align 2 + +_strcspn: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__strcspn: + mov g14,g13 # save return address + lda (g0),g3 # copy string pointer + mov 0,g14 # conform to register conventions + +Lnext_char: + ldob (g3),g7 # fetch next character of string + addo 1,g1,g2 # g2 will be the charset ptr + ldob (g1),g6 # fetch first character of charset + cmpobe.f 0,g7,Lexit # quit if at end of string +Lscan_set: + cmpo g6,g7 # is charset char same as string char? + ldob (g2),g5 # fetch next charset char + addo 1,g2,g2 # bump charset ptr + be.f Lexit + cmpo g6,0 # is charset exhausted? + lda (g5),g6 + bne.t Lscan_set # check next character of charset + addo 1,g3,g3 # check next character of string + b Lnext_char + +Lexit: + subo g0,g3,g0 # compute string length + bx (g13) +Lrett: + ret + +/* end of strcspn */ diff --git a/newlib/libc/machine/i960/strdup.S b/newlib/libc/machine/i960/strdup.S new file mode 100644 index 000000000..7e879ff0f --- /dev/null +++ b/newlib/libc/machine/i960/strdup.S @@ -0,0 +1,66 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "strdup.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif + +/* + * (c) copyright 1989,1993 Intel Corp., all rights reserved + */ + +/* + procedure strdup (optimized assembler version: 80960K series, 80960CA) + + dest_addr = strdup (src_addr) + + Allocate memory and copy thereto the string pointed to by src_addr. + Return the address of the copy, or null if unable to perform the + operation. +*/ + + .text + .align 2 + .globl _strdup +_strdup: + mov g0,r3 # Keep a copy of the original string addr + callj _strlen # Determine how much to allocate + addo 1,g0,g0 # Add one byte for the null byte at end + callj _malloc # Allocate the storage + cmpo 0,g0 + mov r3,g1 # Original string addr is now src for copy + bne.t _strcpy # Jump if allocation was successful + ret # Return the null ptr otherwise + +/* end of strdup */ diff --git a/newlib/libc/machine/i960/strlen.S b/newlib/libc/machine/i960/strlen.S new file mode 100644 index 000000000..dfbeec29d --- /dev/null +++ b/newlib/libc/machine/i960/strlen.S @@ -0,0 +1,117 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "strlen.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif + +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ + +/* + procedure strlen (optimized assembler version for the 80960K series) + + src_addr = strlen (src_addr) + + return the number of bytes that precede the null byte in the + string pointed to by src_addr. + + Undefined behavior will occur if the end of the source string (i.e. + the terminating null byte) is in the last four words of the program's + allocated memory space. This is so because strlen fetches ahead + several words. Disallowing the fetch ahead would impose a severe + performance penalty. + + Strategy: + + Fetch the source array by long-words and scanbyte the words for the + null byte until found. Examine the word in which the null byte is + found, to determine its actual position, and return the length. + + Tactics: + + 1) Do NOT try to fetch the words in a word aligned manner because, + in my judgement, the performance degradation experienced due to + non-aligned accesses does NOT outweigh the time and complexity added + by the preamble that would be necessary to assure alignment. This + is supported by the intuition that many source strings will be word + aligned to begin with. +*/ + + .globl _strlen + .globl __strlen + .leafproc _strlen, __strlen + .align 2 +_strlen: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__strlen: + + mov g14,g13 # preserve return address + ldl (g0),g4 # fetch first two words + addo 8,g0,g2 # post-increment src word pointer + lda 0xff,g3 # byte extraction mask + + +Lsearch_for_word_with_null_byte: + scanbyte 0,g4 # check for null byte + mov g5,g7 # copy second word + bo.f Lsearch_for_null # branch if null found + scanbyte 0,g7 # check for null byte + ldl (g2),g4 # fetch next pair of word of src + addo 8,g2,g2 # post-increment src word pointer + bno Lsearch_for_word_with_null_byte # branch if null not found yet + + subo 4,g2,g2 # back up the byte pointer + mov g7,g4 # move word with null to search word +Lsearch_for_null: + subo 9,g2,g2 # back up the byte pointer +Lsearch_for_null.a: + and g4,g3,g14 # extract byte + cmpo 0,g14 # is it null? + addo 1,g2,g2 # bump src byte ptr + shro 8,g4,g4 # shift word to position next byte + bne Lsearch_for_null.a + +Lexit_code: + subo g0,g2,g0 # calculate string length + bx (g13) # g0 = addr of src; g14 = 0 +Lrett: + ret + +/* end of strlen */ diff --git a/newlib/libc/machine/i960/strlen_ca.S b/newlib/libc/machine/i960/strlen_ca.S new file mode 100644 index 000000000..350423bf0 --- /dev/null +++ b/newlib/libc/machine/i960/strlen_ca.S @@ -0,0 +1,146 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "strle_ca.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ + +/* + procedure strlen (optimized assembler version for the CA) + + src_addr = strlen (src_addr) + + return the number of bytes that precede the null byte in the + string pointed to by src_addr. + + Undefined behavior will occur if the end of the source string (i.e. + the terminating null byte) is in the last four words of the program's + allocated memory space. This is so because, in several cases, strlen + will fetch ahead several words. Disallowing the fetch ahead would + impose a severe performance penalty. + + This program handles two cases: + + 1) the argument starts on a word boundary + 2) the argument doesn't start on a word boundary + + At the time of this writing, only g0 thru g7 and g13 are available + for use in this leafproc; other registers would have to be saved and + restored. These nine registers, plus tricky use of g14 are sufficient + to implement the routine. The registers are used as follows: + + g0 original src ptr; upon return it is the byte count. + g1 + g2 src ptr + g3 mask + g4 even word of the source string + g5 odd word of the source string + g6 copy of even word, shift count + g7 copy of odd word + g13 return address + g14 byte extracted. +*/ + + .globl _strlen + .globl __strlen + .leafproc _strlen, __strlen + .align 2 +_strlen: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__strlen: + + notand g0,3,g2 # extract word addr of start of src + lda (g14),g13 # preserve return address + and g0,3,g7 # extract byte offset of src + ld (g2),g5 # fetch word containing at least first byte + shlo 3,g7,g7 # get shift count for making mask for first word + lda 4(g2),g2 # post-increment src word pointer + subi 1,0,g3 # mask initially all ones + chkbit 2,g2 # are we on an even word boundary or an odd one? +#if __i960_BIG_ENDIAN__ + shro g7,g3,g3 # get mask for bytes needed from first word + notor g5,g3,g7 # set unneeded bytes to all ones + lda 0xff000000,g3 # byte extraction mask +#else + shlo g7,g3,g3 # get mask for bytes needed from first word + notor g5,g3,g7 # set unneeded bytes to all ones + lda 0xff,g3 # byte extraction mask +#endif + bno.f Lodd_word # branch if first word is odd + mov g7,g4 # move first word to copy thereof + ld (g2),g5 # load odd word + lda 4(g2),g2 # post-increment src word pointer + + +Leven_word: + scanbyte 0,g4 # check for null byte + movl g4,g6 # copy both words +Lodd_word: # trickery! if we branch here, following branch + /* instruction will fall thru, as we want, */ + /* effecting the load of g4 and g5 only. */ + ldl (g2),g4 # fetch next pair of word of src + bo.f Lsearch_for_null # branch if null found + scanbyte 0,g7 # check for null byte + lda 8(g2),g2 # post-increment src word pointer + bno.t Leven_word # branch if null not found yet + + subo 4,g2,g2 # back up the byte pointer + lda (g7),g6 # move odd word to search word +Lsearch_for_null: + subo 9,g2,g2 # back up the byte pointer +Lsearch_for_null.a: + and g6,g3,g14 # extract byte + cmpo 0,g14 # is it null? + lda 1(g2),g2 # bump src byte ptr +#if __i960_BIG_ENDIAN__ + shlo 8,g6,g6 # shift word to position next byte +#else + shro 8,g6,g6 # shift word to position next byte +#endif + bne.t Lsearch_for_null.a + +Lexit_code: + subo g0,g2,g0 # calculate string length + bx (g13) # g0 = addr of src; g14 = 0 +Lrett: + ret + +/* end of strlen */ diff --git a/newlib/libc/machine/i960/strncat.S b/newlib/libc/machine/i960/strncat.S new file mode 100644 index 000000000..a655824ea --- /dev/null +++ b/newlib/libc/machine/i960/strncat.S @@ -0,0 +1,155 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "strncat.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ +/* + procedure strncat (optimized assembler version for the 80960K Series) + + dest_addr = strncat (dest_addr, src_addr, max_bytes) + + append the null terminated string pointed to by src_addr to the null + terminated string pointed to by dest_addr. Return the original + dest_addr. If the source string is longer than max_bytes, then + append only max_bytes bytes, and tack on a null byte on the end. + + This routine will fail if the source and destination string + overlap (in particular, if the end of the source is overlapped + by the beginning of the destination). The behavior is undefined. + This is acceptable according to the draft C standard. + + Undefined behavior will also occur if the end of the source string + (i.e. the terminating null byte) is in the last two words of the + program's allocated memory space. This is so because strncat fetches + ahead. Disallowing the fetch ahead would impose a severe performance + penalty. + + Strategy: + + First, skip to the null byte in the destination string. Then + fetch the source string by words and store them by words to the + destination string, until there are fewer than three bytes left + to copy. Then, using the last word of the source (the one that + contains the remaining 0, 1, 2, or 3 bytes to be copied), store + a byte at a time until Ldone. + + If, before exhausting the max_byte count, the null byte is encountered + in the source string, then just copy up thru the null byte. + + Tactics: + + 1) Do NOT try to fetch and store the words in a word aligned manner + because, in my judgement, the performance degradation experienced due + to non-aligned accesses does NOT outweigh the time and complexity added + by the preamble and convoluted body that would be necessary to assure + alignment. +*/ + + .globl _strncat + .globl __strncat + .leafproc _strncat,__strncat + .align 2 +_strncat: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__strncat: + mov g14,g6 + cmpibge 0, g2, Lno_operation # Lexit early if max_bytes <= 0 + mov g0, g5 +Lskip_word_loop: + ld (g5), g7 # fetch word of dest string + addo 4, g5, g5 # post-increment dest ptr + scanbyte 0, g7 # does it contain null byte? + bno Lskip_word_loop # if not, loop + subo 5, g5, g5 # adjust dest ptr + lda 0xff, g3 # byte extraction mask = 0xff; +Lskip_byte_loop: + and g7, g3, g14 # extract byte of last word of dest string + cmpo 0, g14 # is it null? + addo 1, g5, g5 # adjust dest ptr + shro 8, g7, g7 # position next byte for extraction + bne Lskip_byte_loop # loop if null not found yet + + ld (g1), g7 # fetch first word of source string +Lwloop: # word copying loop + cmpo 4, g2 # max_bytes < 4 ? + addo 4, g1, g1 # post-increment source ptr + bge Lcloop.a # branch if less than 4 bytes to move + scanbyte 0, g7 # is null byte reached yet? + mov g7, g4 # keep a copy of the source word + be Lcloop # branch if null byte reached + ld (g1), g7 # pre-fetch next word of source + subo 4, g2, g2 # reduce max_byte counter + st g4, (g5) # store current word + addo 4, g5, g5 # post-increment destination ptr + b Lwloop + +Lcloop.b: + addo 1, g5, g5 # post-increment destination ptr + shro 8, g7, g7 # position next byte for extraction +Lcloop: # character copying loop (max_byte > 3) + and g3, g7, g4 # extract character + cmpo 0, g4 # is it null? + stob g4, (g5) # store it + bne Lcloop.b # loop if null not encountered yet + + bx (g6) # g0 = dest string address; g14 = 0 +Lrett: + ret + +Lcloop.c: + addo 1, g5, g5 # post-increment destination ptr + shro 8, g7, g7 # position next byte for extraction +Lcloop.a: # character copying loop (max_byte <= 3) + cmpdeco 0,g2,g2 # max_byte == 0? + and g3, g7, g4 # extract character + be Ldone # store null and Lexit if max_byte exhausted + cmpo 0, g4 # is it null? + stob g4, (g5) # store it + bne Lcloop.c # loop if null not encountered yet + +Ldone: stob g14, (g5) # store trailing null + bx (g6) # g0 = dest string address; g14 = 0 + +Lno_operation: mov 0, g14 # conform to register conventions + bx (g6) + +/* end of strncat */ diff --git a/newlib/libc/machine/i960/strncat_ca.S b/newlib/libc/machine/i960/strncat_ca.S new file mode 100644 index 000000000..45c5e171e --- /dev/null +++ b/newlib/libc/machine/i960/strncat_ca.S @@ -0,0 +1,300 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "sncat_ca.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ + +/* + procedure strncat (optimized assembler version for the CA) + + dest_addr = strncat (dest_addr, src_addr, max_bytes) + + append the null terminated string pointed to by src_addr to the null + terminated string pointed to by dest_addr. Return the original + dest_addr. If the source string is longer than max_bytes, then + append only max_bytes bytes, and tack on a null byte on the end + + This routine will fail if the source and destination string + overlap (in particular, if the end of the source is overlapped + by the beginning of the destination). The behavior is undefined. + This is acceptable according to the draft C standard. + + Undefined behavior will also occur if the end of the source string + (i.e. the terminating null byte) is in the last word of the program's + allocated memory space. This is so because, in several cases, strncat + will fetch ahead one word. Disallowing the fetch ahead would impose + a severe performance penalty. + + This program handles five cases: + + 1) both arguments start on a word boundary + 2) neither are word aligned, but they are offset by the same amount + 3) source is word aligned, destination is not + 4) destination is word aligned, source is not + 5) neither is word aligned, and they are offset by differing amounts + + At the time of this writing, only g0 thru g7 and g13 are available + for use in this leafproc; other registers would have to be saved and + restored. These nine registers, plus tricky use of g14 are sufficient + to implement the routine. The registers are used as follows: + + g0 original dest ptr; not modified, so that it may be returned. + g1 src ptr; shift count + g2 max_bytes + g3 src ptr (word aligned) + g4 dest ptr (word aligned) + g5 0xff -- byte extraction mask + Little endian: + g6 lsw of double word for extraction of 4 bytes + g7 msw of double word for extraction of 4 bytes + Big endian: + g6 msw of double word for extraction of 4 bytes + g7 lsw of double word for extraction of 4 bytes + g13 return address + g14 byte extracted. +*/ + +#if __i960_BIG_ENDIAN__ +#define MSW g6 +#define LSW g7 +#else +#define LSW g6 +#define MSW g7 +#endif + + .globl _strncat + .globl __strncat + .leafproc _strncat, __strncat + .align 2 +_strncat: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__strncat: + notand g0,3,g4 # extract word addr of start of dest + lda (g14),g13 # preserve return address + cmpibge.f 0,g2,Lexit_code # Lexit if number of bytes to move is <= zero. + and g0,3,LSW # extract byte offset of dest + ld (g4),MSW # fetch word containing at least first byte + shlo 3,LSW,g14 # get shift count for making mask for first word + subi 1,0,LSW # mask initially all ones +#if __i960_BIG_ENDIAN__ + shro g14,LSW,LSW # get mask for bytes needed from first word +#else + shlo g14,LSW,LSW # get mask for bytes needed from first word +#endif + notor MSW,LSW,MSW # set unneeded bytes to all ones + lda 0xff,g5 # byte extraction mask +Lsearch_for_word_with_null: + scanbyte 0,MSW # check for null byte + lda 4(g4),g4 # post-increment dest word pointer + mov MSW,LSW # keep a copy of current word + ld (g4),MSW # fetch next word of dest + bno.t Lsearch_for_word_with_null # branch if null not found yet +#if __i960_BIG_ENDIAN__ + shro 24,LSW,g14 # extract byte +#else + and g5,LSW,g14 # extract byte +#endif + cmpo 0,g14 # branch if null is first byte of word + subo 4,g4,g4 # move dest word ptr to word with null + notand g1,3,g3 # extract word addr of start of src + bne.t Lsearch_for_null + +Lcase_14: + cmpo g1,g3 # check alignment of source + ld (g3),LSW # fetch first word of source + shlo 3,g1,g14 # compute shift count + lda 4(g3),g3 # post-increment src addr + bne.f Lcase_4 # branch if source is unaligned +Lcase_1: +Lcase_1_wloop: # word copying loop + cmpi g2,4 # check for fewer than four bytes to move + lda (LSW),g1 # keep a copy of the src word + bl.f Lcase_1_cloop # branch if fewer than four bytes to copy + scanbyte 0,g1 # check for null byte in src word + ld (g3),LSW # pre-fetch next word of src + addo 4,g3,g3 # post-increment src addr + bo.f Lcase_1_cloop # branch if word contains null byte + subi 4,g2,g2 # decrease max_byte count by the 4 bytes moved + st g1,(g4) # store word in dest string + addo 4,g4,g4 # post-increment dest addr + b Lcase_1_wloop + +Lcase_3_cloop: +Lcase_1_cloop: # character copying loop (max_bytes <= 3) + cmpdeci 0,g2,g2 # is max_bytes exhausted? +#if __i960_BIG_ENDIAN__ + rotate 8,g1,g1 # move next byte into position for extraction +#endif + and g5,g1,g14 # extract next char + be.f Lstore_null # if max_bytes is exhausted, store null and quit + cmpo 0,g14 # check for null byte + stob g14,(g4) # store the byte in dest +#if ! __i960_BIG_ENDIAN__ + shro 8,g1,g1 # move next byte into position for extraction +#endif + lda 1(g4),g4 # post-increment dest byte addr + bne.t Lcase_1_cloop # branch if null not reached + bx (g13) # Lexit (g14 == 0) + +Lstore_null: + mov 0,g14 # store null, and set g14 to zero + stob g14,(g4) + bx (g13) + + +Lsearch_for_null: +#if __i960_BIG_ENDIAN__ + shlo 8,LSW,LSW # check next byte + shro 24,LSW,g14 +#else + shlo 8,g5,g5 # move mask up to next byte + and g5,LSW,g14 # extract byte +#endif + lda 1(g4),g4 # move dest byte ptr to next byte + cmpobne.t 0,g14,Lsearch_for_null # branch if null is not yet found + +Lcase_235: + cmpo g1,g3 # check alignment of src + ld (g3),LSW # pre-fetch word with start of src + and 3,g1,g1 # compute shift count + lda 0xff,g5 # load mask for byte extraction + shlo 3,g1,g14 + lda 4(g3),g3 # post-increment src word counter + be.t Lcase_3 # branch if src is word aligned + and g4,3,MSW # extract byte offset for dest string + cmpo MSW,g1 # < indicates first word of dest has more bytes + /* than first word of source. */ + ld (g3),MSW # fetch second word of src +#if __i960_BIG_ENDIAN__ + subo g14,0,g14 # adjust shift count for big endian +#endif + eshro g14,g6,g5 # extract four bytes +#if __i960_BIG_ENDIAN__ + bge.f 1f +#else + bg.f 1f +#endif + mov MSW,LSW + lda 4(g3),g3 # move src word addr to second word boundary +1: + mov g5,MSW + lda 0xff,g5 + b Lcase_25 + +Lcase_3: # src is word aligned; dest is not + mov LSW,MSW # make copy of first word of src + lda 32,g14 # initialize shift count to zero (mod 32) +Lcase_25: + +Lcase_3_cloop_at_start: # character copying loop for start of dest str + cmpdeci 0,g2,g2 # is max_bytes exhausted? +#if __i960_BIG_ENDIAN__ + shro 24,MSW,g5 # extract next char +#else + and g5,MSW,g5 # extract next char +#endif + be.f Lstore_null # Lexit if max_bytes is exhausted + cmpo 0,g5 # check for null byte + stob g5,(g4) # store the byte in dest + addo 1,g4,g4 # post-increment dest ptr + lda 0xff,g5 # re-initialize byte extraction mask + notand g4,3,g1 # extract word address + be.t Lexit_code # Lexit if null byte reached + cmpo g1,g4 # have we reached word boundary in dest yet? +#if __i960_BIG_ENDIAN__ + lda -8(g14),g14 # augment the shift counter + rotate 8,MSW,MSW # move next byte into position for extraction +#else + lda 8(g14),g14 # augment the shift counter + shro 8,MSW,MSW # move next byte into position for extraction +#endif + bne.t Lcase_3_cloop_at_start # branch if reached word boundary? + +#if __i960_BIG_ENDIAN__ + cmpo 0,g14 + ld (g3),MSW # fetch msw of operand for double shift + bne Lcase_3_wloop # branch if src is still unaligned. + +Lcase_3_wloop2: + cmpi g2,4 # less than four bytes to move? + mov LSW,g1 # extract 4 bytes of src + lda 4(g3),g3 # post-increment src word addr + bl.f Lcase_3_cloop # branch if < four bytes left to move + scanbyte 0,g1 # check for null byte + mov MSW,LSW # move msw to lsw + ld (g3),MSW # pre-fetch msw of operand for double shift + bo.f Lcase_3_cloop # branch if word contains null byte + subi 4,g2,g2 # decrease max_byte count by the 4 bytes moved + st g1,(g4) # store 4 bytes to dest + addo 4,g4,g4 # post-increment dest ptr + b Lcase_3_wloop2 +Lcase_4: + subo g14,0,g14 # adjust shift count for big endian +#else +Lcase_4: +#endif + + ld (g3),MSW # fetch msw of operand for double shift + +Lcase_3_wloop: + cmpi g2,4 # less than four bytes to move? + eshro g14,g6,g1 # extract 4 bytes of src + lda 4(g3),g3 # post-increment src word addr + bl.f Lcase_3_cloop # branch if < four bytes left to move + scanbyte 0,g1 # check for null byte + mov MSW,LSW # move msw to lsw + ld (g3),MSW # pre-fetch msw of operand for double shift + bo.f Lcase_3_cloop # branch if word contains null byte + subi 4,g2,g2 # decrease max_byte count by the 4 bytes moved + st g1,(g4) # store 4 bytes to dest + addo 4,g4,g4 # post-increment dest ptr + b Lcase_3_wloop + + +Lexit_code: + mov 0,g14 # conform to register conventions + bx (g13) # g0 = addr of dest; g14 = 0 +Lrett: + ret + +/* end of strncat */ + diff --git a/newlib/libc/machine/i960/strncmp.S b/newlib/libc/machine/i960/strncmp.S new file mode 100644 index 000000000..030b75084 --- /dev/null +++ b/newlib/libc/machine/i960/strncmp.S @@ -0,0 +1,129 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "strncmp.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ +/* + procedure strncmp (optimized assembler version for the 80960K Series) + + result = strncmp (src1_addr, src2_addr, max_bytes) + + compare the null terminated string pointed to by src1_addr to + the string pointed to by src2_addr. Return 0 iff the strings + are equal, -1 if src1_addr is lexicographically less than src2_addr, + and 1 if it is lexicographically greater. Do not compare more than + max_bytes bytes. + + Undefined behavior will occur if the end of either source string + (i.e. the terminating null byte) is in the last two words of the + program's allocated memory space. This is so because strncmp + will fetch ahead. Disallowing the fetch ahead would impose + a severe performance penalty. + + Strategy: + + Fetch and compare the strings by words and go to a character + comparison loop as soon as a pair of words differ. If the + words are equal up through either the exhaustion of max_bytes + or the presence of the null byte, return 0 (equality). Otherwise, + the character comparator will return -1 or 1 for inequality, or + 0 if the differing byte is after the null byte or after the + exhaustion of max_bytes. + + Tactics: + + 1) Do NOT try to fetch the words in a word aligned manner because, + in my judgement, the performance degradation experienced due to + non-aligned accesses does NOT outweigh the time and complexity added + by the preamble and convoluted body that would be necessary to assure + alignment. +*/ + + .globl _strncmp + .globl __strncmp + .leafproc _strncmp,__strncmp + .align 2 + +_strncmp: +#ifndef __PIC + lda .Lrett,g14 +#else + lda .Lrett-(.+8)(ip),g14 +#endif +__strncmp: + mov g14,g13 + ldconst 0,g14 + cmpibge 0,g2,Lequal_exit # Lexit early if max_bytes <= 0 + addo g2,g0,g2 +.Lwloop: + cmpo g0,g2 # are max_bytes exhausted? + ld (g0), g5 # fetch word of source_1 + bge Lequal_exit # Lexit (equality) if max_bytes exhausted + ld (g1), g3 # fetch word of source_2 + addo 4,g0,g0 # post-increment source_1 ptr + scanbyte 0,g5 # is a null byte present? + addo 4,g1,g1 # post-increment source_1 ptr + be .Lcloop.a # perform char comparator if null byte found + cmpobe g5,g3,.Lwloop # perform char comparator if words are unequal + +.Lcloop.a: subo 4,g0,g0 # adjust max_byte counter + ldconst 0xff,g4 # byte extraction mask + +.Lcloop: and g4,g5,g7 # compare individual bytes + and g4,g3,g6 + cmpobne g7,g6,.diff # if different, return -1 or 1 + cmpo 0,g6 # they are equal. are they null? + shlo 8,g4,g4 # position mask to extract next byte + be Lequal_exit # if they are null, Lexit (equality) + addo 1,g0,g0 # is max_bytes exhausted? + cmpobl g0,g2,.Lcloop # if not, loop. if so, Lexit (equality) + +Lequal_exit: + mov 0,g0 + bx (g13) +.Lrett: + ret +.diff: bl .neg + mov 1,g0 + bx (g13) + +.neg: subi 1,0,g0 +.Lexit: + bx (g13) + +/* end of strncmp */ diff --git a/newlib/libc/machine/i960/strncmp_ca.S b/newlib/libc/machine/i960/strncmp_ca.S new file mode 100644 index 000000000..0b1a8ff4b --- /dev/null +++ b/newlib/libc/machine/i960/strncmp_ca.S @@ -0,0 +1,253 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "sncmp_ca.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ + +/* + procedure strncmp (optimized assembler version for the CA) + + result = strncmp (src1_addr, src2_addr, max_bytes) + + compare the null terminated string pointed to by src1_addr to + the string space pointed to by src2_addr. Return 0 iff the strings + are equal, -1 if src1_addr is lexicly less than src2_addr, and 1 + if it is lexicly greater. Do not compare more than max_bytes bytes. + + Undefined behavior will occur if the end of either source string + (i.e. the terminating null byte) is in the last word of the program's + allocated memory space. This is so because, in several cases, strncmp + will fetch ahead one word. Disallowing the fetch ahead would impose + a severe performance penalty. + + This program handles five cases: + + 1) both arguments start on a word boundary + 2) neither are word aligned, but they are offset by the same amount + 3) source1 is word aligned, source2 is not + 4) source2 is word aligned, source1 is not + 5) neither is word aligned, and they are offset by differing amounts + + At the time of this writing, only g0 thru g7 and g14 are available + for use in this leafproc; other registers would have to be saved and + restored. These nine registers are sufficient to implement the routine. + The registers are used as follows: + + g0 original src1 ptr; extracted word; return result + g1 src2 ptr; 0xff -- byte extraction mask + g2 maximum number of bytes to compare + g3 src2 word ptr + Little endian: + g4 lsw of src1 + g5 msw of src1 + g6 src2 word + g7 src1 word ptr + Big endian: + g4 msw of src1 + g5 lsw of src1 + g6 src1 word ptr + g7 src2 word + g13 return address + g14 shift count +*/ + +#if __i960_BIG_ENDIAN__ +#define MSW g4 +#define LSW g5 +#define SRC1 g6 +#define SRC2 g7 +#else +#define LSW g4 +#define MSW g5 +#define SRC2 g6 +#define SRC1 g7 +#endif + + .globl _strncmp + .globl __strncmp + .leafproc _strncmp, __strncmp + .align 2 +_strncmp: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__strncmp: +Lrestart: + notand g0,3,SRC1 # extract word addr of start of src1 + lda (g14),g13 # preserve return address + cmpibge.f 0,g2,Lequal_exit # return equality if number of bytes to + /* compare is none. */ +#if __i960_BIG_ENDIAN__ + cmpo g0,SRC1 # check alignment of src1 +#endif + ld (SRC1),LSW # fetch word with at least first byte of src1 + notand g1,3,g3 # extract word addr of start of src2 + ld 4(SRC1),MSW # fetch second word of src1 +#if __i960_BIG_ENDIAN__ + bne Lsrc1_unaligned # branch if src1 is unaligned + cmpo g3,g1 # check alignment of src2 + ld (g3),SRC2 # fetch word with at least first byte of src2 + shlo 3,g0,g14 # compute shift count for src1 + subo g14,0,g14 # adjust shift count for big endian + lda 8(SRC1),SRC1 # advance src1 word addr + bne.f Lsrc2_unaligned # branch if src2 is NOT word aligned + + /* src2 is word aligned */ + + mov LSW,g0 + +Lwloop2: # word comparing loop + cmpo SRC2,g0 # compare src1 and src2 words + lda 0xff000000,g1 # byte extraction mask + mov MSW,LSW # move msw of src1 to lsw + ld (SRC1),MSW # pre-fetch next msw of src1 + addo 4,SRC1,SRC1 # post-increment src1 addr + lda 4(g3),g3 # pre-increment src2 addr + bne.f Lcloop # branch if src1 and src2 unequal + scanbyte 0,g0 # check for null byte in src1 word + ld (g3),SRC2 # pre-fetch next word of src2 + mov LSW,g0 # extract word of src1 + subi 4,g2,g2 # decrement maximum byte count + bo.f Lequal_exit # branch if null byte encountered + cmpibl.t 0,g2,Lwloop2 # branch if max_bytes not reached yet + + b Lequal_exit # strings were equal up through max_bytes + +Lsrc1_unaligned: +#endif + cmpo g3,g1 # check alignment of src2 + ld (g3),SRC2 # fetch word with at least first byte of src2 + shlo 3,g0,g14 # compute shift count for src1 +#if __i960_BIG_ENDIAN__ + subo g14,0,g14 # adjust shift count for big endian +#endif + eshro g14,g4,LSW # extract word of src1 + lda 8(SRC1),SRC1 # advance src1 word addr + bne.f Lsrc2_unaligned # branch if src2 is NOT word aligned + + /* at least src2 is word aligned */ + + mov LSW,g0 + +Lwloop: # word comparing loop + cmpo SRC2,g0 # compare src1 and src2 words +#if __i960_BIG_ENDIAN__ + lda 0xff000000,g1 # byte extraction mask +#else + lda 0xff,g1 # byte extraction mask +#endif + mov MSW,LSW # move msw of src1 to lsw + ld (SRC1),MSW # pre-fetch next msw of src1 + addo 4,SRC1,SRC1 # post-increment src1 addr + lda 4(g3),g3 # pre-increment src2 addr + bne.f Lcloop # branch if src1 and src2 unequal + scanbyte 0,g0 # check for null byte in src1 word + ld (g3),SRC2 # pre-fetch next word of src2 + eshro g14,g4,g0 # extract word of src1 + subi 4,g2,g2 # decrement maximum byte count + bo.f Lequal_exit # branch if null byte encountered + cmpibl.t 0,g2,Lwloop # branch if max_bytes not reached yet + + b Lequal_exit # strings were equal up through max_bytes + +Lcloop_setup: # setup for coming from Lsrc2_unaligned + mov LSW,g0 # restore extracted src1 word +#if __i960_BIG_ENDIAN__ + lda 0xff000000,g1 # byte extraction mask +#else + lda 0xff,g1 # byte extraction mask +#endif + +Lcloop: # character comparing loop + and SRC2,g1,g3 # extract next char of src2 + and g0,g1,LSW # extract next char of src1 + cmpobne.f LSW,g3,.diff # check for equality + cmpo 0,LSW # check for null byte +#if __i960_BIG_ENDIAN__ + shro 8,g1,g1 # shift mask for next byte +#else + shlo 8,g1,g1 # shift mask for next byte +#endif + subi 1,g2,g2 # decrement character counter + bne.t Lcloop # branch if null not reached + + /* words are equal up thru null byte */ + +Lequal_exit: + mov 0,g14 # conform to register conventions + lda 0,g0 # return zero, indicating equality + bx (g13) # return + +Lrett: + ret + +.diff: + mov 0,g14 + bl Lless_than_exit +Lgreater_than_exit: + cmpibge.f 0,g2,Lequal_exit # branch if difference is beyond max_bytes + mov 1,g0 + bx (g13) # g0 = 1 (src1 > src2) +Lless_than_exit: + cmpibge.f 0,g2,Lequal_exit # branch if difference is beyond max_bytes + subi 1,0,g0 + bx (g13) # g0 = -1 (src1 < src2) + +Lsrc2_unaligned: + notor g1,3,g14 # first step in computing new src1 ptr + ld 4(g3),SRC1 # fetch second word of src2 + shlo 3,g1,MSW # compute shift count for src2 +#if __i960_BIG_ENDIAN__ + subo MSW,0,MSW # adjust shift count for big endian +#endif + eshro MSW,g6,SRC2 # extract word of src2 + cmpo LSW,SRC2 # compare src1 and src2 words + lda 4(g3),g1 # set new src2 ptr + bne.f Lcloop_setup # first four bytes differ + scanbyte 0,LSW # check for null byte + subo g14,g0,g0 # second (final) step in computing new src1 ptr + addi g14,g2,g2 # compute new max_bytes too + lda (g13),g14 # prepare return pointer for Lrestart + bno.t Lrestart # if null byte not encountered, continue + /* with both string fetches shifted such that*/ + /* src2 is now word aligned.*/ + mov 0,g14 # conform to register conventions. + lda 0,g0 # return indicator of equality. + bx (g13) diff --git a/newlib/libc/machine/i960/strncpy.S b/newlib/libc/machine/i960/strncpy.S new file mode 100644 index 000000000..9f51b607c --- /dev/null +++ b/newlib/libc/machine/i960/strncpy.S @@ -0,0 +1,154 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "strncpy.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ +/* + procedure strncpy (optimized assembler version for the 80960K Series) + + dest_addr = strncpy (dest_addr, src_addr, max_bytes) + + copy the null terminated string pointed to by src_addr to the + string pointed to by dest_addr. Return the original dest_addr. + If the source string is shorter than max_bytes, then null-pad + the destination string. If it is longer than max_bytes, the + copy stops at max_bytes bytes (and no terminating null appears + in the destination string). + + This routine will fail if the source and destination string + overlap (in particular, if the end of the source is overlapped + by the beginning of the destination). The behavior is undefined. + This is acceptable according to the draft C standard. + + Undefined behavior will also occur if the end of the source string + (i.e. the terminating null byte) is in the last two words of the + program's allocated memory space. This is so because strncpy fetches + ahead. Disallowing the fetch ahead would impose a severe performance + penalty. + + Strategy: + + Fetch and store the strings by words and go to a character move loop + as soon as a null byte is encountered. If max_bytes is exhausted + first, then terminate after moving only max_bytes (with the last + 0, 1, 2, or 3 bytes moved as single bytes, not as a word). + Otherwise, the character move loop moves the last bytes or the + source string, and then null-pads the destination string until + max_bytes is exhausted. + + Tactics: + + 1) Do NOT try to fetch the words in a word aligned manner because, + in my judgement, the performance degradation experienced due to + non-aligned accesses does NOT outweigh the time and complexity added + by the preamble and convoluted body that would be necessary to assure + alignment. + + 2) When the null byte is encountered in a source word, null out the + higher-numbered bytes in that word, store the word in the destination, + and go to the word null-padder, which may eventually go to the byte + null-padder. +*/ + + .globl _strncpy + .globl __strncpy + .leafproc _strncpy,__strncpy + .align 2 +_strncpy: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__strncpy: + mov g14, g13 + cmpibge 0,g2,Lexit # quit early if max_bytes <= 0 + ld (g1), g7 # fetch the first word of the source + mov g0, g5 + lda 0xff, g3 # byte extraction mask + addo g1, g2, g6 + addo g2, g5, g2 +Lwloop: # word copying loop + addo 4, g1, g1 # post-increment source ptr + cmpo g6, g1 # max_bytes < 4 ? + mov g7, g4 # keep a copy of source word + bl Lcloop.a # if less than four bytes to go, go to char loop + scanbyte 0, g4 # null byte found? + ld (g1), g7 # pre-fetch next word of the source + be Lcloop.c # go to char loop if null encountered + st g4, (g5) # store current word + addo 4, g5, g5 # post-increment destination ptr + b Lwloop + +Lcloop.a: # character copying loop (max_bytes < 3) + and g3, g4, g14 # extract byte +Lcloop.b: + cmpo g2, g5 # max_bytes <= 0 ? + shro 8, g4, g4 # position word to extract next byte + be Lexit # exit if max_bytes exhausted + cmpo 0, g14 # is it null? + stob g14, (g5) # store it + addo 1, g5, g5 # post-increment dest ptr + bne Lcloop.a # branch if we are NOT null padding + b Lcloop.b # branch if we are null padding + +Lexit: + mov 0, g14 + bx (g13) # g0 = dest string address; g14 = 0 +Lrett: + ret + +Lcloop.c: # character copying loop + and g3, g4, g14 # extract byte + cmpo 0, g14 # is it null? + mov g3, g7 # save mask + shlo 8, g3, g3 # shift mask to next byte position + bne Lcloop.c # loop until null found + subo 1, g7, g3 # mask to null pad after null byte + and g3, g4, g4 # null-out stuff after null byte + st g4, (g5) # store last part of src and first of null-pad + subo 8,g2,g6 # adjust max_byte counter + +Lzwloop: + cmpo g5, g6 # max_bytes < 4 ? + addo 4, g5, g5 + bg Lcloop.b # if so, goto character loop + st g14, (g5) # store four null bytes + b Lzwloop + +/* end of strncpy */ diff --git a/newlib/libc/machine/i960/strncpy_ca.S b/newlib/libc/machine/i960/strncpy_ca.S new file mode 100644 index 000000000..1f90acf1c --- /dev/null +++ b/newlib/libc/machine/i960/strncpy_ca.S @@ -0,0 +1,289 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "sncpy_ca.s" +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ + +/* + procedure strncpy (optimized assembler version for the CA) + + dest_addr = strncpy (dest_addr, src_addr, max_bytes) + + copy the null terminated string pointed to by src_addr to + the string space pointed to by dest_addr. Return the original + dest_addr. If the source string is shorter than max_bytes, + then null-pad the destination string. + + This routine will fail if the source and destination string + overlap (in particular, if the end of the source is overlapped + by the beginning of the destination). The behavior is undefined. + This is acceptable according to the draft C standard. + + Undefined behavior will also occur if the end of the source string + (i.e. the terminating null byte) is in the last word of the program's + allocated memory space. This is so because, in several cases, strcpy + will fetch ahead one word. Disallowing the fetch ahead would impose + a severe performance penalty. + + This program handles five cases: + + 1) both arguments start on a word boundary + 2) neither are word aligned, but they are offset by the same amount + 3) source is word aligned, destination is not + 4) destination is word aligned, source is not + 5) neither is word aligned, and they are offset by differing amounts + + At the time of this writing, only g0 thru g7 and g13 are available + for use in this leafproc; other registers would have to be saved and + restored. These nine registers, plus tricky use of g14 are sufficient + to implement the routine. The registers are used as follows: + + g0 original dest ptr; not modified, so that it may be returned. + g1 src ptr; shift count + g2 max_bytes + g3 src ptr (word aligned) + g4 dest ptr (word aligned) + g5 0xff -- byte extraction mask + Little endian: + g6 lsw of double word for extraction of 4 bytes + g7 msw of double word for extraction of 4 bytes + Big endian: + g6 msw of double word for extraction of 4 bytes + g7 lsw of double word for extraction of 4 bytes + g13 return address + g14 byte extracted. +*/ + +#if __i960_BIG_ENDIAN__ +#define MSW g6 +#define LSW g7 +#else +#define LSW g6 +#define MSW g7 +#endif + + .globl _strncpy + .globl __strncpy + .leafproc _strncpy, __strncpy + .align 2 +_strncpy: +#ifndef __PIC + lda Lrett,g14 +#else + lda Lrett-(.+8)(ip),g14 +#endif +__strncpy: + notand g1,3,g3 # extract word addr of start of src + lda (g14),g13 # preserve return address + cmpibge.f 0,g2,Lexit_code # Lexit if number of bytes to move is <= zero. + cmpo g3,g1 # check alignment of src + ld (g3),LSW # fetch word containing at least first byte + notand g0,3,g4 # extract word addr of start of dest + lda 4(g3),g3 # advance src word addr + bne.f Lcase_245 # branch if src is NOT word aligned + +Lcase_13: + cmpo g0,g4 # check alignment of dest + lda 0xff,g5 # load mask for byte extraction + subo 4,g4,g4 # store is pre-incrementing; back up dest addr + bne.f Lcase_3 # branch if dest not word aligned + +Lcase_1: # src and dest are word aligned +Lcase_1_wloop: # word copying loop + cmpi g2,4 # check for fewer than four bytes to move + lda (LSW),g1 # keep a copy of the src word + addo 4,g4,g4 # pre-increment dest addr + bl.f Lcase_1_cloop.a # branch if fewer than four bytes to copy + scanbyte 0,g1 # check for null byte in src word + ld (g3),LSW # pre-fetch next word of src + subi 4,g2,g2 # decrease max_byte count by the 4 bytes moved + bo.f Lcase_1_cloop.c # branch if word contains null byte + addo 4,g3,g3 # post-increment src addr + st g1,(g4) # store word in dest string + b Lcase_1_wloop + +Lcase_3_cloop.a: +Lcase_1_cloop.a: # character copying loop (max_bytes <= 3) +#if __i960_BIG_ENDIAN__ + rotate 8,g1,g1 # move next byte into position for extraction +#endif + and g5,g1,g14 # extract next char +Lcase_1_cloop.b: + cmpdeci 0,g2,g2 # is max_bytes exhausted? + be.f Lexit_code # Lexit if max_bytes is exhausted + cmpo 0,g14 # check for null byte + stob g14,(g4) # store the byte in dest +#if ! __i960_BIG_ENDIAN__ + shro 8,g1,g1 # move next byte into position for extraction +#endif + lda 1(g4),g4 # post-increment dest byte addr + bne.t Lcase_1_cloop.a # branch if null not reached + b Lcase_1_cloop.b + +Lexit_code: + mov 0,g14 # conform to register conventions + bx (g13) # g0 = addr of dest; g14 = 0 +Lrett: + ret + +Lcase_1_cloop.c: +Lcase_3_cloop.c: +#if __i960_BIG_ENDIAN__ + rotate 24,g5,g5 # move mask into position for testing next byte +#endif + and g5,g1,g14 # extract next char + cmpo 0,g14 # check for null byte +#if ! __i960_BIG_ENDIAN__ + lda (g5),LSW # keep a copy of the current mask + shlo 8,g5,g5 # move mask into position for testing next byte +#endif + bne.t Lcase_1_cloop.c # branch if null not reached +#if __i960_BIG_ENDIAN__ + subo 1,g5,g5 # null pad. + andnot g5,g1,g1 # last bytes to copy, and null pad rest of word +#else + subo 1,LSW,g5 # mask to get last bytes to copy, and null pad + and g5,g1,g1 # last bytes to copy, and null pad rest of word +#endif + st g1,(g4) + +Lcase_1_zwloop: # zero word loop + cmpi g2,4 # check for fewer than four bytes to move + addo 4,g4,g4 # pre-increment dest addr + bl.f Lcase_1_cloop.b # branch if fewer than four bytes to copy + subo 4,g2,g2 # decrease max_byte count by the 4 bytes moved + st g14,(g4) # store word in dest string + b Lcase_1_zwloop + +Lcase_3: # src is word aligned; dest is not + addo 8,g4,g4 # move dest word ptr to first word boundary + lda (g0),g1 # copy dest byte ptr + mov LSW,MSW # make copy of first word of src + lda 32,g14 # initialize shift count to zero (mod 32) + +Lcase_25: +Lcase_3_cloop_at_start: # character copying loop for start of dest str + cmpdeci 0,g2,g2 # is max_bytes exhausted? +#if __i960_BIG_ENDIAN__ + shro 24,MSW,g5 # extract next char +#else + and g5,MSW,g5 # extract next char +#endif + be.f Lexit_code # Lexit if max_bytes is exhausted + cmpo 0,g5 # check for null byte + stob g5,(g1) # store the byte in dest + addo 1,g1,g1 # post-increment dest ptr + lda 0xff,g5 # re-initialize byte extraction mask + bne.t 1f # drop thru if null byte reached (to pad) + movl 0,g6 # blank out remainder of input buffer +1: + cmpo g1,g4 # have we reached word boundary in dest yet? +#if __i960_BIG_ENDIAN__ + lda -8(g14),g14 # augment the shift counter + rotate 8,MSW,MSW # move next byte into position for extraction +#else + lda 8(g14),g14 # augment the shift counter + shro 8,MSW,MSW # move next byte into position for extraction +#endif + bne.t Lcase_3_cloop_at_start # branch if reached word boundary? + + ld (g3),MSW # fetch msw of operand for double shift + +Lcase_4: + +#if __i960_BIG_ENDIAN__ + cmpobne 0,g14,Lcase_3_wloop # branch if src is still unaligned. + +Lcase_3_wloop2: + cmpi g2,4 # less than four bytes to move? + lda (LSW),g1 # extract 4 bytes of src + lda 4(g3),g3 # post-increment src word addr + bl.f Lcase_3_cloop.a # branch if < four bytes left to move + scanbyte 0,g1 # check for null byte + lda (MSW),LSW # move msw to lsw + subi 4,g2,g2 # decrease max_byte count by the 4 bytes moved + ld (g3),MSW # pre-fetch msw of operand for double shift + bo.f Lcase_3_cloop.c # branch if word contains null byte + st g1,(g4) # store 4 bytes to dest + addo 4,g4,g4 # post-increment dest ptr + b Lcase_3_wloop2 + +#endif + +Lcase_3_wloop: + cmpi g2,4 # less than four bytes to move? + eshro g14,g6,g1 # extract 4 bytes of src + lda 4(g3),g3 # post-increment src word addr + bl.f Lcase_3_cloop.a # branch if < four bytes left to move + scanbyte 0,g1 # check for null byte + lda (MSW),LSW # move msw to lsw + subi 4,g2,g2 # decrease max_byte count by the 4 bytes moved + ld (g3),MSW # pre-fetch msw of operand for double shift + bo.f Lcase_3_cloop.c # branch if word contains null byte + st g1,(g4) # store 4 bytes to dest + addo 4,g4,g4 # post-increment dest ptr + b Lcase_3_wloop + +Lcase_245: + cmpo g0,g4 # check alignment of dest + ld (g3),MSW # pre-fetch second half + and 3,g1,g1 # compute shift count + lda 0xff,g5 # load mask for byte extraction +#if __i960_BIG_ENDIAN__ + subo g1,4,g14 # adjust shift count for big endian. + shlo 3,g14,g14 +#else + shlo 3,g1,g14 +#endif + be.t Lcase_4 # branch if dest is word aligned + or g4,g1,g1 # is src earlier in word, later, or sync w/ dst + cmpo g0,g1 # < indicates first word of dest has more bytes + /* than first word of source. */ + lda 4(g4),g4 # move dest word addr to first word boundary + eshro g14,g6,g5 # extract four bytes + lda (g0),g1 + bg.f 1f + mov MSW,LSW + lda 4(g3),g3 # move src word addr to second word boundary +1: + mov g5,MSW + lda 0xff,g5 + b Lcase_25 + +/* end of strncpy */ + diff --git a/newlib/libc/machine/i960/strpbrk.S b/newlib/libc/machine/i960/strpbrk.S new file mode 100644 index 000000000..bae909f20 --- /dev/null +++ b/newlib/libc/machine/i960/strpbrk.S @@ -0,0 +1,100 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + +/* + * (c) copyright 1989,1993 Intel Corp., all rights reserved + */ + +/* + procedure strpbrk (optimized assembler version: 80960K series, 80960CA) + + char_addr = strpbrk (string, brkset_string) + + Return the address of the first character in string that is NOT + in the brkset_string. Return NULL if none exists. + + At the time of this writing, only g0 thru g7 and g13 are available + for use in this leafproc; other registers would have to be saved and + restored. These nine registers, plus tricky use of g14 are sufficient + to implement the routine. + + This routine stays out of g3 and g4 altogether. They may be used by + the strtok routine, which calls this routine in an incestuous way. +*/ +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif + + .file "strprk.s" + .globl _strpbrk + .globl __strpbrk + .leafproc _strpbrk, __strpbrk + .align 2 + +_strpbrk: +#ifdef __PIC + lda Lrett-(.+8)(ip),g14 + b __strpbrk +#else + lda Lrett,g14 + b __strpbrk +#endif + +Lrett: ret + +__strpbrk: + +Lnext_char_strpbrk: + addo 1,g1,g2 # g2 will be the brkset ptr + ldob (g0),g7 # fetch next character of string + ldob (g1),g6 # fetch first character of brkset + cmpobe.f 0,g7,Lexit_char_not_found # quit if at end of string +Lscan_set_strpbrk: + cmpo g6,g7 # is brkset char equal to string char? + ldob (g2),g5 # fetch next brkset char + addo 1,g2,g2 # bump brkset ptr + be.f Lexit_char_found + cmpo g6,0 # is brkset_string exhausted? + lda (g5),g6 + bne.t Lscan_set_strpbrk # check next character of brkset + addo 1,g0,g0 # check next character of string + b Lnext_char_strpbrk + +Lexit_char_not_found: + mov 0,g0 # return null if brkset char not found in string +Lexit_char_found: + mov g14,g13 # save return address + lda 0,g14 # conform to register conventions + bx (g13) + +/* end of strpbrk */ diff --git a/newlib/libc/machine/i960/strrchr.S b/newlib/libc/machine/i960/strrchr.S new file mode 100644 index 000000000..96fe5c269 --- /dev/null +++ b/newlib/libc/machine/i960/strrchr.S @@ -0,0 +1,137 @@ +/******************************************************************************* + * + * Copyright (c) 1993 Intel Corporation + * + * Intel hereby grants you permission to copy, modify, and distribute this + * software and its documentation. Intel grants this permission provided + * that the above copyright notice appears in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. In addition, Intel grants this permission provided that + * you prominently mark as "not part of the original" any modifications + * made to this software or documentation, and that the name of Intel + * Corporation not be used in advertising or publicity pertaining to + * distribution of the software or the documentation without specific, + * written prior permission. + * + * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR + * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY + * OR FITNESS FOR A PARTICULAR PURPOSE. Intel makes no guarantee or + * representations regarding the use of, or the results of the use of, + * the software and documentation in terms of correctness, accuracy, + * reliability, currentness, or otherwise; and you rely on the software, + * documentation and results solely at your own risk. + * + * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS, + * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES + * OF ANY KIND. IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM + * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER. + * + ******************************************************************************/ + + .file "strrchr.s" +#ifdef __i960_BIG_ENDIAN__ +#error "This does not work in big-endian" +#endif + +#ifdef __PIC + .pic +#endif +#ifdef __PID + .pid +#endif + +/* + * (c) copyright 1988,1993 Intel Corp., all rights reserved + */ + +/* + procedure strrchr (optimized assembler version for the 80960K series) + + src_addr = strrchr (src_addr, char) + + return a pointer to the last byte that contains the indicated + byte in the source string. Return null if the byte is not found. + + Undefined behavior will occur if the end of the source string (i.e. + the terminating null byte) is in the last two words of the program's + allocated memory space. This is so because strrchr fetches ahead. + Disallowing the fetch ahead would impose a severe performance penalty. + + Strategy: + + Fetch the source string by words and scanbyte the words for the + char until either a word with the byte is found or the null byte is + encountered. In the former case, move through the word to find the + matching byte and save its memory address, then continue the search. + In the latter case, return the saved address, or zero (null) if none + was ever found to save. + + Tactics: + + 1) Do NOT try to fetch the words in a word aligned manner because, + in my judgement, the performance degradation experienced due to + non-aligned accesses does NOT outweigh the time and complexity added + by the preamble that would be necessary to assure alignment. This + is supported by the intuition that most source arrays (even more + true of most big source arrays) will be word aligned to begin with. +*/ + + .globl _strrchr + .globl __strrchr + .leafproc _strrchr, __strrchr + .align 2 +_strrchr: +#ifdef __PIC + lda Lrett-(.+8)(ip),g14 +#else + lda Lrett,g14 +#endif +__strrchr: + + ld (g0),g4 # fetch first word + lda 0xff,g7 # byte extraction mask + and g1,g7,g1 # make char an 8-bit ordinal + shlo 8,g1,g2 # broadcast the char to four bytes + or g1,g2,g2 + shlo 16,g2,g5 + or g2,g5,g3 + mov g14,g13 # preserve return address + addo 4,g0,g2 # post-increment src pointer + mov 1,g0 # prepare to return null pointer + mov g3,g6 # prepare to return null pointer + +Lsearch_for_word_with_char_or_null: + mov g4,g5 # copy word + scanbyte 0,g5 # check for null byte + ld (g2),g4 # fetch next word of src + bo Lword_has_null # branch if null found + scanbyte g3,g5 # check for byte with char + addo 4,g2,g2 # post-increment src pointer + bno Lsearch_for_word_with_char_or_null # branch if no copy of char + mov g5,g6 # save word that has char in it (at least once) + subo 4,g2,g0 # save addr of byte after word with char + b Lsearch_for_word_with_char_or_null + +Lword_has_null: + subo 4,g2,g2 # move src pointer back to word with null +Lfind_null: + addo 1,g2,g2 # advance src pointer to byte after current + and g7,g5,g14 # extract next byte + cmpo g1,g14 # is current byte char? + shro 8,g5,g5 # position next byte for extraction + bne 1f # skip if not char sought after + mov g2,g0 # save addr of byte after char + mov g3,g6 # save word of all char to short circuit search +1: cmpobne 0,g14,Lfind_null # is current byte null? + +Lfind_last_char: + rotate 8,g6,g6 # position next highest byte + and g7,g6,g5 # extract byte + subo 1,g0,g0 # move pointer to that byte (or nullify) + cmpobne g5,g1,Lfind_last_char # branch if not at char + + bx (g13) # g0 = addr of char in src (or null); g14 = 0 +Lrett: + ret + +/* end of strrchr */ diff --git a/newlib/libc/machine/m32r/Makefile.am b/newlib/libc/machine/m32r/Makefile.am new file mode 100644 index 000000000..1c65b9ffe --- /dev/null +++ b/newlib/libc/machine/m32r/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/m32r/Makefile.in b/newlib/libc/machine/m32r/Makefile.in new file mode 100644 index 000000000..5414b185d --- /dev/null +++ b/newlib/libc/machine/m32r/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = setjmp.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/m32r/aclocal.m4 b/newlib/libc/machine/m32r/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/m32r/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/m32r/configure b/newlib/libc/machine/m32r/configure new file mode 100755 index 000000000..b39571b6a --- /dev/null +++ b/newlib/libc/machine/m32r/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=setjmp.S + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/m32r/configure.in b/newlib/libc/machine/m32r/configure.in new file mode 100644 index 000000000..e53227db5 --- /dev/null +++ b/newlib/libc/machine/m32r/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/m32r configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(setjmp.S) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/m32r/setjmp.S b/newlib/libc/machine/m32r/setjmp.S new file mode 100644 index 000000000..e6938efe3 --- /dev/null +++ b/newlib/libc/machine/m32r/setjmp.S @@ -0,0 +1,52 @@ +# setjmp/longjmp for m32r. The jmpbuf looks like this: +# +# Register jmpbuf offset +# reserved 0x00 +# R8 0x04 +# R9 0x08 +# R10 0x0c +# R11 0x10 +# R12 0x14 +# R13 (FP) 0x18 +# R14 (LR) 0x1c +# R15 (SP) 0x20 +# reserved 0x24 + + .text + .global setjmp +setjmp: + ;addi r0, #-4 ; commented out as first word is reserved + ;st r1, @+r0 + st r8, @+r0 + st r9, @+r0 + st r10, @+r0 + st r11, @+r0 + st r12, @+r0 + st r13, @+r0 + st r14, @+r0 + st r15, @+r0 + +# Return 0 to caller. + ldi r0, #0 + jmp lr + + .global longjmp +longjmp: + addi r0, #4 ; first word is reserved + ;ld r1, @r0+ + ld r8, @r0+ + ld r9, @r0+ + ld r10, @r0+ + ld r11, @r0+ + ld r12, @r0+ + ld r13, @r0+ + ld r2, @r0+ ; return address + ld r15, @r0+ + +# If caller attempted to return 0, return 1 instead. + + mv r0, r1 + bnez r0, .Lnonzero + ldi r0, #1 +.Lnonzero: + jmp r2 diff --git a/newlib/libc/machine/m68k/Makefile.am b/newlib/libc/machine/m68k/Makefile.am new file mode 100644 index 000000000..62a2ef897 --- /dev/null +++ b/newlib/libc/machine/m68k/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S strcpy.c strlen.c + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/m68k/Makefile.in b/newlib/libc/machine/m68k/Makefile.in new file mode 100644 index 000000000..d21c0c733 --- /dev/null +++ b/newlib/libc/machine/m68k/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S strcpy.c strlen.c + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = setjmp.o strcpy.o strlen.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/m68k/aclocal.m4 b/newlib/libc/machine/m68k/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/m68k/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/m68k/configure b/newlib/libc/machine/m68k/configure new file mode 100755 index 000000000..b39571b6a --- /dev/null +++ b/newlib/libc/machine/m68k/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=setjmp.S + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/m68k/configure.in b/newlib/libc/machine/m68k/configure.in new file mode 100644 index 000000000..628faed4d --- /dev/null +++ b/newlib/libc/machine/m68k/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/m68k configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(setjmp.S) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/m68k/setjmp.S b/newlib/libc/machine/m68k/setjmp.S new file mode 100644 index 000000000..02a02c4e1 --- /dev/null +++ b/newlib/libc/machine/m68k/setjmp.S @@ -0,0 +1,88 @@ +/* These are predefined by new versions of GNU cpp. */ + +#ifndef __USER_LABEL_PREFIX__ +#define __USER_LABEL_PREFIX__ _ +#endif + +#ifndef __REGISTER_PREFIX__ +#define __REGISTER_PREFIX__ +#endif + +/* ANSI concatenation macros. */ + +#define CONCAT1(a, b) CONCAT2(a, b) +#define CONCAT2(a, b) a ## b + +/* Use the right prefix for global labels. */ + +#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) + +/* Use the right prefix for registers. */ + +#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x) + +#define d0 REG (d0) +#define d1 REG (d1) +#define d2 REG (d2) +#define d3 REG (d3) +#define d4 REG (d4) +#define d5 REG (d5) +#define d6 REG (d6) +#define d7 REG (d7) +#define a0 REG (a0) +#define a1 REG (a1) +#define a2 REG (a2) +#define a3 REG (a3) +#define a4 REG (a4) +#define a5 REG (a5) +#define a6 REG (a6) +#define fp REG (fp) +#define sp REG (sp) + +.global SYM (setjmp) +.global SYM (longjmp) + +SYM (setjmp): + moveal sp@(4),a0 + movel sp@(0),a0@(12) + movel sp,a0@(8) + moveml d2-d7/a2-a6,a0@(20) + clrl d0 + rts + +SYM (longjmp): + moveal sp@(4),a0 + movel sp@(8),d0 + bne 1f + movel &1,d0 +1: + moveml a0@(20),d2-d7/a2-a6 + moveal a0@(8),sp + movel a0@(12),sp@ + rts + +#ifdef M68881 +.global SYM (setjmp_68881) +.global SYM (longjmp_68881) + +SYM (setjmp_68881): + moveal sp@(4),a0 + movel sp@(0),a0@(12) + movel sp,a0@(8) + moveml d2-d7/a2-a6,a0@(20) + fmovemx fp2-fp7,a0@(64) + clrl d0 + rts + +SYM (longjmp_68881): + moveal sp@(4),a0 + fmovemx a0@(64),fp2-fp7 + movel sp@(8),d0 + bne 1f + movel &1,d0 +1: + moveml a0@(20),d2-d7/a2-a6 + moveal a0@(8),sp + movel a0@(12),sp@ + rts +#endif diff --git a/newlib/libc/machine/m68k/strcpy.c b/newlib/libc/machine/m68k/strcpy.c new file mode 100644 index 000000000..ccc914193 --- /dev/null +++ b/newlib/libc/machine/m68k/strcpy.c @@ -0,0 +1,36 @@ +/* + * C library strcpy routine + * + * This routine has been optimized for the CPU32+. + * It should run on all 68k machines. + * + * W. Eric Norum + * Saskatchewan Accelerator Laboratory + * University of Saskatchewan + * Saskatoon, Saskatchewan, CANADA + * eric@skatter.usask.ca + */ + +#include + +/* + * Copy bytes using CPU32+ loop mode if possible + */ + +char * +strcpy (char *to, const char *from) +{ + char *pto = to; + unsigned int n = 0xFFFF; + + asm volatile ("1:\n" + "\tmove.b (%0)+,(%1)+\n" +#if defined(__mcpu32__) + "\tdbeq %2,1b\n" +#endif + "\tbne.b 1b\n" : + "=a" (from), "=a" (pto), "=d" (n) : + "0" (from), "1" (pto), "2" (n) : + "cc", "memory"); + return to; +} diff --git a/newlib/libc/machine/m68k/strlen.c b/newlib/libc/machine/m68k/strlen.c new file mode 100644 index 000000000..589a69751 --- /dev/null +++ b/newlib/libc/machine/m68k/strlen.c @@ -0,0 +1,35 @@ +/* + * C library strlen routine + * + * This routine has been optimized for the CPU32+. + * It should run on all 68k machines. + * + * W. Eric Norum + * Saskatchewan Accelerator Laboratory + * University of Saskatchewan + * Saskatoon, Saskatchewan, CANADA + * eric@skatter.usask.ca + */ + +#include + +/* + * Test bytes using CPU32+ loop mode if possible. + */ +size_t +strlen (const char *str) +{ + unsigned int n = ~0; + const char *cp = str; + + asm volatile ("1:\n" + "\ttst.b (%0)+\n" +#if defined(__mcpu32__) + "\tdbeq %1,1b\n" +#endif + "\tbne.b 1b\n" : + "=a" (cp), "=d" (n) : + "0" (cp), "1" (n) : + "cc"); + return (cp - str) - 1; +} diff --git a/newlib/libc/machine/m88k/Makefile.am b/newlib/libc/machine/m88k/Makefile.am new file mode 100644 index 000000000..1c65b9ffe --- /dev/null +++ b/newlib/libc/machine/m88k/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/m88k/Makefile.in b/newlib/libc/machine/m88k/Makefile.in new file mode 100644 index 000000000..5414b185d --- /dev/null +++ b/newlib/libc/machine/m88k/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = setjmp.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/m88k/aclocal.m4 b/newlib/libc/machine/m88k/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/m88k/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/m88k/configure b/newlib/libc/machine/m88k/configure new file mode 100755 index 000000000..b39571b6a --- /dev/null +++ b/newlib/libc/machine/m88k/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=setjmp.S + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/m88k/configure.in b/newlib/libc/machine/m88k/configure.in new file mode 100644 index 000000000..d78864a39 --- /dev/null +++ b/newlib/libc/machine/m88k/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/m88k configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(setjmp.S) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/m88k/setjmp.S b/newlib/libc/machine/m88k/setjmp.S new file mode 100644 index 000000000..24d44b6b1 --- /dev/null +++ b/newlib/libc/machine/m88k/setjmp.S @@ -0,0 +1,48 @@ +/* This is a simple version of setjmp and longjmp. + + Ian Lance Taylor, Cygnus Support, 15 July 1993. */ + +/* We need to save the address of the return instruction, which is in + r1, as well as general register r14 through r25. If we are + compiling for the 88110 with the extended register file, we also + need to save registers x22 through x29. The jmp_buf should be 52 + bytes long in the one case, 84 bytes in the other. */ + +/* int setjmp (jmp_buf); */ + globl _setjmp +_setjmp: + st r1,r2,0 + st.d r14,r2,4 + st.d r16,r2,12 + st.d r18,r2,20 + st.d r20,r2,28 + st.d r22,r2,36 + st.d r24,r2,44 +#ifdef __m88110__ + /* These instructions are just a guess, and gas doesn't + support them anyhow. */ + st.d x22,r2,52 + st.d x24,r2,60 + st.d x26,r2,68 + st.d x28,r2,76 +#endif + jmp r1 + + global _longjmp +_longjmp: + ld r1,r2,0 + ld.d r14,r2,4 + ld.d r16,r2,12 + ld.d r18,r2,20 + ld.d r20,r2,28 + ld.d r22,r2,36 + ld.d r24,r2,44 +#ifdef __m88110__ + /* These instructions are just a guess, and gas doesn't + support them anyhow. */ + ld.d x22,r2,52 + ld.d x24,r2,60 + ld.d x26,r2,68 + ld.d x28,r2,76 +#endif + jmp r1 diff --git a/newlib/libc/machine/mips/Makefile.am b/newlib/libc/machine/mips/Makefile.am new file mode 100644 index 000000000..1c65b9ffe --- /dev/null +++ b/newlib/libc/machine/mips/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/mips/Makefile.in b/newlib/libc/machine/mips/Makefile.in new file mode 100644 index 000000000..5414b185d --- /dev/null +++ b/newlib/libc/machine/mips/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = setjmp.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/mips/aclocal.m4 b/newlib/libc/machine/mips/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/mips/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/mips/configure b/newlib/libc/machine/mips/configure new file mode 100755 index 000000000..b39571b6a --- /dev/null +++ b/newlib/libc/machine/mips/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=setjmp.S + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/mips/configure.in b/newlib/libc/machine/mips/configure.in new file mode 100644 index 000000000..64d4855db --- /dev/null +++ b/newlib/libc/machine/mips/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/mips configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(setjmp.S) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/mips/machine/regdef.h b/newlib/libc/machine/mips/machine/regdef.h new file mode 100644 index 000000000..3906de6f4 --- /dev/null +++ b/newlib/libc/machine/mips/machine/regdef.h @@ -0,0 +1,38 @@ +/* regdef.h -- define MIPS register names. */ + +#ifndef mips_regdef_h + +#define zero $0 +#define v0 $2 +#define v1 $3 +#define a0 $4 +#define a1 $5 +#define a2 $6 +#define a3 $7 +#define t0 $8 +#define t1 $9 +#define t2 $10 +#define t3 $11 +#define t4 $12 +#define t5 $13 +#define t6 $14 +#define t7 $15 +#define s0 $16 +#define s1 $17 +#define s2 $18 +#define s3 $19 +#define s4 $20 +#define s5 $21 +#define s6 $22 +#define s7 $23 +#define t8 $24 +#define t9 $25 +#define k0 $26 +#define k1 $27 +#define gp $gp +#define sp $sp +#define s8 $30 +#define ra $31 +#define pc $pc + +#endif /* mips_regdef_h */ diff --git a/newlib/libc/machine/mips/setjmp.S b/newlib/libc/machine/mips/setjmp.S new file mode 100644 index 000000000..8ffda41a6 --- /dev/null +++ b/newlib/libc/machine/mips/setjmp.S @@ -0,0 +1,65 @@ +/* This is a simple version of setjmp and longjmp. + + This version does NOT save the floating point register, which is + wrong, but I don't know how to cleanly handle machines without a + floating point coprocessor. + + Ian Lance Taylor, Cygnus Support, 13 May 1993. */ + +#ifdef __mips16 +/* This file contains 32 bit assembly code. */ + .set nomips16 +#endif + +/* int setjmp (jmp_buf); */ + .globl setjmp + .ent setjmp +setjmp: + .frame $sp,0,$31 + + sw $16,0($4) /* $s0 */ + sw $17,4($4) /* $s1 */ + sw $18,8($4) /* $s2 */ + sw $19,12($4) /* $s3 */ + sw $20,16($4) /* $s4 */ + sw $21,20($4) /* $s5 */ + sw $22,24($4) /* $s6 */ + sw $23,28($4) /* $s7 */ + sw $30,32($4) /* $s8 */ + + sw $sp,36($4) + sw $31,40($4) + + move $2,$0 + + j $31 + + .end setjmp + +/* volatile void longjmp (jmp_buf, int); */ + .globl longjmp + .ent longjmp +longjmp: + .frame $sp,0,$31 + + lw $16,0($4) /* $s0 */ + lw $17,4($4) /* $s1 */ + lw $18,8($4) /* $s2 */ + lw $19,12($4) /* $s3 */ + lw $20,16($4) /* $s4 */ + lw $21,20($4) /* $s5 */ + lw $22,24($4) /* $s6 */ + lw $23,28($4) /* $s7 */ + lw $30,32($4) /* $s8 */ + + lw $sp,36($4) + lw $31,40($4) + + bne $5,$0,1f + li $5,1 +1: + move $2,$5 + + j $31 + + .end longjmp diff --git a/newlib/libc/machine/mn10200/Makefile.am b/newlib/libc/machine/mn10200/Makefile.am new file mode 100644 index 000000000..1c65b9ffe --- /dev/null +++ b/newlib/libc/machine/mn10200/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/mn10200/Makefile.in b/newlib/libc/machine/mn10200/Makefile.in new file mode 100644 index 000000000..5414b185d --- /dev/null +++ b/newlib/libc/machine/mn10200/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = setjmp.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/mn10200/aclocal.m4 b/newlib/libc/machine/mn10200/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/mn10200/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/mn10200/configure b/newlib/libc/machine/mn10200/configure new file mode 100755 index 000000000..b39571b6a --- /dev/null +++ b/newlib/libc/machine/mn10200/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=setjmp.S + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/mn10200/configure.in b/newlib/libc/machine/mn10200/configure.in new file mode 100644 index 000000000..a6ef29e09 --- /dev/null +++ b/newlib/libc/machine/mn10200/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/mn10200 configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(setjmp.S) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/mn10200/setjmp.S b/newlib/libc/machine/mn10200/setjmp.S new file mode 100644 index 000000000..f0036b120 --- /dev/null +++ b/newlib/libc/machine/mn10200/setjmp.S @@ -0,0 +1,33 @@ + .file "setjmp.S" + + .section .text + .align 1 + .global _setjmp +_setjmp: + mov d0,a0 + movx d2,(0,a0) + movx d3,(4,a0) + mov a1,(8,a0) + mov a2,(12,a0) + mov a3,(16,a0) + movx (0,a3),d0 + movx d0,(20,a0) + sub d0,d0 + rts + + .global _longjmp +_longjmp: + mov d0,a0 + movx (0,a0),d2 + movx (4,a0),d3 + mov (8,a0),a1 + mov (12,a0),a2 + mov (16,a0),a3 + movx (20,a0),d0 + movx d0,(0,a3) + cmp 0,d1 + bne L1 + mov 1,d1 +L1: + mov d1,d0 + rts diff --git a/newlib/libc/machine/mn10300/Makefile.am b/newlib/libc/machine/mn10300/Makefile.am new file mode 100644 index 000000000..cf04c3ab9 --- /dev/null +++ b/newlib/libc/machine/mn10300/Makefile.am @@ -0,0 +1,13 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S memchr.S memcmp.S memcpy.S memset.S strchr.S \ + strcmp.S strcpy.S strlen.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/mn10300/Makefile.in b/newlib/libc/machine/mn10300/Makefile.in new file mode 100644 index 000000000..40311b712 --- /dev/null +++ b/newlib/libc/machine/mn10300/Makefile.in @@ -0,0 +1,321 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S memchr.S memcmp.S memcpy.S memset.S strchr.S \ + strcmp.S strcpy.S strlen.S + + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = setjmp.o memchr.o memcmp.o memcpy.o memset.o strchr.o \ +strcmp.o strcpy.o strlen.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in \ + ../../../acinclude.m4 ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + -rm -f config.status + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ +check-am installcheck-am installcheck install-info-am install-info \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/mn10300/aclocal.m4 b/newlib/libc/machine/mn10300/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/mn10300/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/mn10300/configure b/newlib/libc/machine/mn10300/configure new file mode 100755 index 000000000..5377ef3aa --- /dev/null +++ b/newlib/libc/machine/mn10300/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=memchr.S + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/mn10300/configure.in b/newlib/libc/machine/mn10300/configure.in new file mode 100644 index 000000000..6db494158 --- /dev/null +++ b/newlib/libc/machine/mn10300/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/mn10300 configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(memchr.S) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/mn10300/memchr.S b/newlib/libc/machine/mn10300/memchr.S new file mode 100644 index 000000000..4a808f9c6 --- /dev/null +++ b/newlib/libc/machine/mn10300/memchr.S @@ -0,0 +1,76 @@ + .file "memchr.S" + + .section .text + .global _memchr + .type _memchr,@function +_memchr: + movm [d2,d3,a2,a3],(sp) + mov d0,a0 + mov d1,d2 + mov (28,sp),a1 +#ifndef __OPTIMIZE_SIZE__ + cmp 3,a1 + bls .L44 + mov a0,d3 + btst 3,d3 + bne .L44 + mov a0,a2 + mov 0,a3 + clr d1 +.L29: + setlb + mov a3,d0 + asl 8,d0 + mov d2,a3 + add d0,a3 + inc d1 + cmp 3,d1 + lls + cmp 3,a1 + bls .L48 +.L33: + mov (a2),d0 + mov a3,d3 + xor d3,d0 + mov d0,d1 + not d1 + add -16843009,d0 + and d1,d0 + btst -2139062144,d0 + beq .L34 + mov a2,a0 + clr d1 +.L38: + setlb + movbu (a0),d0 + cmp d2,d0 + beq .L47 + inc a0 + inc d1 + cmp 3,d1 + lls +.L34: + add -4,a1 + inc4 a2 + cmp 3,a1 + bhi .L33 +.L48: + mov a2,a0 +#endif +.L44: + cmp 0,a1 + beq .L50 +.L49: + setlb + movbu (a0),d0 + cmp d2,d0 + beq .L47 + inc a0 + sub 1,a1 + lne +.L50: + mov 0,a0 +.L47: + ret [d2,d3,a2,a3],16 +.Lfe1: + .size _memchr,.Lfe1-_memchr diff --git a/newlib/libc/machine/mn10300/memcmp.S b/newlib/libc/machine/mn10300/memcmp.S new file mode 100644 index 000000000..41774892b --- /dev/null +++ b/newlib/libc/machine/mn10300/memcmp.S @@ -0,0 +1,53 @@ + .file "memcmp.S" + + .section .text + .global _memcmp + .type _memcmp,@function +_memcmp: + movm [d2,d3,a2,a3],(sp) + mov d0,a0 + mov d1,a1 + mov (28,sp),a2 +#ifndef __OPTIMIZE_SIZE__ + cmp 3,a2 + bls .L22 + mov a1,d2 + or d2,d0 + btst 3,d0 + bne .L22 +.L17: + setlb + mov (a0),d1 + mov (a1),d0 + cmp d0,d1 + bne .L22 + inc4 a0 + inc4 a1 + add -4,a2 + cmp 3,a2 + lhi +#endif +.L22: + cmp 0,a2 + beq .L24 +.L18: + setlb + movbu (a0),d3 + movbu (a1),d2 + cmp d2,d3 + beq .L23 + mov d3,d0 + sub d2,d0 + jmp .L25 +.L23: + inc a0 + inc a1 +.L26: + sub 1,a2 + lne +.L24: + clr d0 +.L25: + ret [d2,d3,a2,a3],16 +.Lfe1: + .size _memcmp,.Lfe1-_memcmp diff --git a/newlib/libc/machine/mn10300/memcpy.S b/newlib/libc/machine/mn10300/memcpy.S new file mode 100644 index 000000000..da4a21e30 --- /dev/null +++ b/newlib/libc/machine/mn10300/memcpy.S @@ -0,0 +1,68 @@ + .file "memcpy.S" + + .section .text + .global _memcpy + .type _memcpy,@function +_memcpy: + movm [d2,d3,a2,a3],(sp) + mov d0,d2 + mov d1,a0 + mov d2,a1 + mov (28,sp),d1 +#ifndef __OPTIMIZE_SIZE__ + mov a0,d0 + or d2,d0 + btst 3,d0 + bne .L37 + cmp 15,d1 + bls .L34 +.L29: + setlb + mov (a0),d0 + mov d0,(a1) + inc4 a0 + inc4 a1 + mov (a0),d0 + mov d0,(a1) + inc4 a0 + inc4 a1 + mov (a0),d0 + mov d0,(a1) + inc4 a0 + inc4 a1 + mov (a0),d0 + mov d0,(a1) + inc4 a0 + inc4 a1 + add -16,d1 + cmp 15,d1 + lhi +.L34: + cmp 3,d1 + bls .L37 +.L33: + setlb + mov (a0),d0 + mov d0,(a1) + inc4 a0 + inc4 a1 + add -4,d1 + cmp 3,d1 + lhi +#endif +.L37: + cmp 0,d1 + beq .L36 +.L38: + setlb + movbu (a0),d0 + movbu d0,(a1) + inc a0 + inc a1 + sub 1,d1 + lne +.L36: + mov d2,a0 + ret [d2,d3,a2,a3],16 +.Lfe1: + .size _memcpy,.Lfe1-_memcpy diff --git a/newlib/libc/machine/mn10300/memset.S b/newlib/libc/machine/mn10300/memset.S new file mode 100644 index 000000000..65b2ff53b --- /dev/null +++ b/newlib/libc/machine/mn10300/memset.S @@ -0,0 +1,63 @@ + .file "memset.S" + + .section .text + .global _memset + .type _memset,@function +_memset: + movm [d2,d3,a2,a3],(sp) + mov d0,d3 + mov d1,d2 + mov (28,sp),a1 + mov d3,a0 +#ifndef __OPTIMIZE_SIZE__ + cmp 3,a1 + bls .L41 + btst 3,d3 + bne .L41 + extbu d2 + mov d2,d1 + asl 8,d1 + or d2,d1 + mov d1,d0 + asl 16,d0 + or d0,d1 + cmp 15,a1 + bls .L36 +.L33: + setlb + mov d1,(a0) + inc4 a0 + mov d1,(a0) + inc4 a0 + mov d1,(a0) + inc4 a0 + mov d1,(a0) + inc4 a0 + add -16,a1 + cmp 15,a1 + lhi +.L36: + cmp 3,a1 + bls .L41 +.L37: + setlb + mov d1,(a0) + inc4 a0 + add -4,a1 + cmp 3,a1 + lhi +#endif +.L41: + cmp 0,a1 + beq .L47 +.L46: + setlb + movbu d2,(a0) + inc a0 + sub 1,a1 + lne +.L47: + mov d3,a0 + ret [d2,d3,a2,a3],16 +.Lfe1: + .size _memset,.Lfe1-_memset diff --git a/newlib/libc/machine/mn10300/setjmp.S b/newlib/libc/machine/mn10300/setjmp.S new file mode 100644 index 000000000..006aa3e1c --- /dev/null +++ b/newlib/libc/machine/mn10300/setjmp.S @@ -0,0 +1,50 @@ + .file "setjmp.S" + + .section .text + .align 1 + .global _setjmp +#ifdef __AM33__ + .am33 +#endif +_setjmp: + mov d0,a0 + mov d2,(0,a0) + mov d3,(4,a0) + mov mdr,d1 + mov d1,(8,a0) + mov a2,(12,a0) + mov a3,(16,a0) + mov sp,a1 + mov a1,(20,a0) +#ifdef __AM33__ + mov r4,(24,a0) + mov r5,(28,a0) + mov r6,(32,a0) + mov r7,(36,a0) +#endif + sub d0,d0 + rets + + .global _longjmp +_longjmp: + mov d0,a0 + mov (8,a0),d2 + mov d2,mdr + mov (0,a0),d2 + mov (4,a0),d3 + mov (12,a0),a2 + mov (16,a0),a3 + mov (20,a0),a1 + mov a1,sp +#ifdef __AM33__ + mov (24,a0),r4 + mov (28,a0),r5 + mov (32,a0),r6 + mov (36,a0),r7 +#endif + cmp 0,d1 + bne L1 + mov 1,d1 +L1: + mov d1,d0 + retf [],0 diff --git a/newlib/libc/machine/mn10300/strchr.S b/newlib/libc/machine/mn10300/strchr.S new file mode 100644 index 000000000..aa4799091 --- /dev/null +++ b/newlib/libc/machine/mn10300/strchr.S @@ -0,0 +1,88 @@ + .file "strchr.S" + + .section .text + .global _strchr + .type _strchr,@function +_strchr: + movm [d2,d3,a2,a3],(sp) + add -12,sp + mov d0,a1 + movbu d1,(7,sp) +#ifndef __OPTIMIZE_SIZE__ + btst 3,d0 + bne .L20 + clr d0 +.L24: + setlb + mov sp,a2 + mov d0,d3 + add d3,a2 + mov a2,a0 + add 12,a0 + movbu (7,sp),d3 + movbu d3,(-4,a0) + inc d0 + cmp 3,d0 + lls + mov a1,a0 + mov -16843009,a1 + mov (a0),d2 + mov a1,d1 + add d2,d1 + mov d2,d0 + not d0 + and d0,d1 + mov -2139062144,d3 + mov d3,(0,sp) + btst -2139062144,d1 + bne .L27 + jmp .L38 +.L28: + inc4 a0 + mov (a0),d2 + mov a1,d1 + add d2,d1 + mov d2,d0 + not d0 + and d0,d1 + mov (0,sp),d3 + and d3,d1 + bne .L27 +.L38: + mov (8,sp),d0 + xor d2,d0 + mov a1,d1 + add d0,d1 + not d0 + and d0,d1 + and d3,d1 + beq .L28 +.L27: + mov a0,a1 +#endif +.L20: + movbu (a1),d0 + cmp 0,d0 + beq .L32 + movbu (7,sp),d1 +.L35: + setlb + cmp d1,d0 + beq .L36 + inc a1 + movbu (a1),d0 + cmp 0,d0 + lne +.L32: + movbu (7,sp),d0 + movbu (a1),d3 + cmp d0,d3 + beq .L36 + mov 0,a0 + jmp .L37 +.L36: + mov a1,a0 +.L37: + ret [d2,d3,a2,a3],28 +.Lfe1: + .size _strchr,.Lfe1-_strchr diff --git a/newlib/libc/machine/mn10300/strcmp.S b/newlib/libc/machine/mn10300/strcmp.S new file mode 100644 index 000000000..8aee9688a --- /dev/null +++ b/newlib/libc/machine/mn10300/strcmp.S @@ -0,0 +1,54 @@ + .file "strcmp.S" + + .section .text + .global _strcmp + .type _strcmp,@function +_strcmp: + movm [d2,d3,a2,a3],(sp) + mov d0,a0 + mov d1,a1 +#ifndef __OPTIMIZE_SIZE__ + or d1,d0 + btst 3,d0 + bne .L11 + mov (a0),d1 + mov (a1),d0 + cmp d0,d1 + bne .L11 + mov -16843009,d3 +.L5: + setlb + mov (a0),d0 + mov d3,d1 + add d0,d1 + not d0 + and d0,d1 + and -2139062144,d1 + beq .L6 + clr d0 + jmp .L13 +.L6: + inc4 a0 + inc4 a1 + mov (a0),d1 + mov (a1),d0 + cmp d0,d1 + leq +#endif +.L11: + setlb + movbu (a1),d2 + movbu (a0),d0 + cmp 0,d0 + beq .L9 + cmp d2,d0 + bne .L9 + inc a0 + inc a1 + lra +.L9: + sub d2,d0 +.L13: + ret [d2,d3,a2,a3],16 +.Lfe1: + .size _strcmp,.Lfe1-_strcmp diff --git a/newlib/libc/machine/mn10300/strcpy.S b/newlib/libc/machine/mn10300/strcpy.S new file mode 100644 index 000000000..d73d06f33 --- /dev/null +++ b/newlib/libc/machine/mn10300/strcpy.S @@ -0,0 +1,51 @@ + .file "strcpy.S" + + .section .text + .global _strcpy + .type _strcpy,@function +_strcpy: + movm [d2,d3,a2,a3],(sp) + mov d0,d3 + mov d1,a0 + mov d3,a1 + mov a0,d0 +#ifndef __OPTIMIZE_SIZE__ + or d3,d0 + btst 3,d0 + bne .L2 + mov (a0),d0 + mov -16843009,a2 + mov a2,d1 + add d0,d1 + not d0 + and d0,d1 + mov -2139062144,d2 + btst -2139062144,d1 + bne .L2 +.L5: + setlb + mov (a0),d0 + mov d0,(a1) + inc4 a0 + inc4 a1 + mov (a0),d0 + mov a2,d1 + add d0,d1 + not d0 + and d0,d1 + and d2,d1 + leq +#endif +.L2: +.L7: + setlb + movbu (a0),d0 + movbu d0,(a1) + inc a0 + inc a1 + cmp 0,d0 + lne + mov d3,a0 + ret [d2,d3,a2,a3],16 +.Lfe1: + .size _strcpy,.Lfe1-_strcpy diff --git a/newlib/libc/machine/mn10300/strlen.S b/newlib/libc/machine/mn10300/strlen.S new file mode 100644 index 000000000..91e88dd73 --- /dev/null +++ b/newlib/libc/machine/mn10300/strlen.S @@ -0,0 +1,44 @@ + .file "strlen.S" + + .section .text + .global _strlen + .type _strlen,@function +_strlen: + movm [d2,d3,a2,a3],(sp) + mov d0,a0 + mov a0,a2 +#ifndef __OPTIMIZE_SIZE__ + btst 3,d0 + bne .L21 + mov (a0),d0 + mov -16843009,a1 + mov a1,d1 + add d0,d1 + not d0 + and d0,d1 + mov -2139062144,d2 + btst -2139062144,d1 + bne .L21 +.L15: + setlb + inc4 a0 + mov (a0),d0 + mov a1,d1 + add d0,d1 + not d0 + and d0,d1 + and d2,d1 + leq + jmp .L21 +#endif +.L19: + inc a0 +.L21: + movbu (a0),d3 + cmp 0,d3 + bne .L19 + sub a2,a0 + mov a0,d0 + ret [d2,d3,a2,a3],16 +.Lfe1: + .size _strlen,.Lfe1-_strlen diff --git a/newlib/libc/machine/necv70/Makefile.am b/newlib/libc/machine/necv70/Makefile.am new file mode 100644 index 000000000..18cbcf706 --- /dev/null +++ b/newlib/libc/machine/necv70/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = fastmath.s setjmp.s + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/necv70/Makefile.in b/newlib/libc/machine/necv70/Makefile.in new file mode 100644 index 000000000..6c4cb6d4c --- /dev/null +++ b/newlib/libc/machine/necv70/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = fastmath.s setjmp.s + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = fastmath.o setjmp.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/necv70/aclocal.m4 b/newlib/libc/machine/necv70/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/necv70/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/necv70/configure b/newlib/libc/machine/necv70/configure new file mode 100755 index 000000000..7f8474fd1 --- /dev/null +++ b/newlib/libc/machine/necv70/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=fastmath.s + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/necv70/configure.in b/newlib/libc/machine/necv70/configure.in new file mode 100644 index 000000000..1374322ee --- /dev/null +++ b/newlib/libc/machine/necv70/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/necv70 configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(fastmath.s) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/necv70/fastmath.s b/newlib/libc/machine/necv70/fastmath.s new file mode 100644 index 000000000..bccb20f12 --- /dev/null +++ b/newlib/libc/machine/necv70/fastmath.s @@ -0,0 +1,251 @@ + .globl _fast_sin +_fast_sin: + fsin.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_sinf +_fast_sinf: + fsin.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + + .globl _fast_cos +_fast_cos: + fcos.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_cosf +_fast_cosf: + fcos.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + + .globl _fast_tan +_fast_tan: + ftan.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_tanf +_fast_tanf: + ftan.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + + + .globl _fast_fabs +_fast_fabs: + fabs.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_fabsf +_fast_fabsf: + fabs.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + + .globl _fast_sqrt +_fast_sqrt: + fsqrt.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_sqrtf +_fast_sqrtf: + fsqrt.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + + .globl _fast_acos +_fast_acos: + facos.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_acosf +_fast_acosf: + facos.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + + .globl _fast_asin +_fast_asin: + fasin.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_asinf +_fast_asinf: + fasin.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + + .globl _fast_atan +_fast_atan: + fatan.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_atanf +_fast_atanf: + fatan.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + + .globl _fast_cosh +_fast_cosh: + fcosh.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_coshf +_fast_coshf: + fcosh.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + + .globl _fast_sinh +_fast_sinh: + fsin.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_sinhf +_fast_sinhf: + fsin.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + + .globl _fast_tanh +_fast_tanh: + ftanh.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_tanhf +_fast_tanhf: + ftanh.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + + .globl _fast_atanh +_fast_atanh: + fatanh.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_atanhf +_fast_atanhf: + fatanh.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + .globl _fast_exp2 +_fast_exp2: + fexp2.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_exp2f +_fast_exp2f: + fexp2.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + + .globl _fast_exp10 +_fast_exp10: + fexp10.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_exp10f +_fast_exp10f: + fexp10.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + + .globl _fast_expe +_fast_expe: + fexpe.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_expef +_fast_expef: + fexpe.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + + .globl _fast_log2 +_fast_log2: + flog2.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_log2f +_fast_log2f: + flog2.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + .globl _fast_log10 +_fast_log10: + flog10.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_log10f +_fast_log10f: + flog10.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + + .globl _fast_loge +_fast_loge: + floge.l [ap],[ap] + mov.d [ap],r0 + ret #0 + + + .globl _fast_logef +_fast_logef: + floge.s [ap],[ap] + mov.w [ap],r0 + ret #0 + + diff --git a/newlib/libc/machine/necv70/machine/registers.h b/newlib/libc/machine/necv70/machine/registers.h new file mode 100644 index 000000000..9f02ed30c --- /dev/null +++ b/newlib/libc/machine/necv70/machine/registers.h @@ -0,0 +1,14 @@ + + +typedef struct +{ + int fp_rounding:2; /* fp rounding control */ + int integer_rounding:1; /* integer rounding */ + int rfu:1; /* reserved */ + int fp_trap:5; /* floating point trap bits */ + int otm:1; + int rfu2:3; + int att:3; + int rfu3:16; +} v60_tkcw_type; + diff --git a/newlib/libc/machine/necv70/necv70.tex b/newlib/libc/machine/necv70/necv70.tex new file mode 100644 index 000000000..be5397f44 --- /dev/null +++ b/newlib/libc/machine/necv70/necv70.tex @@ -0,0 +1,99 @@ +@node machine,,syscalls,Top +@chapter NEC V70 Specific Functions + +The NEC V70 has machine instructions for fast IEEE floating point, +including operations normally provided by the library. + +When you use the @file{/usr/include/fastmath.h} header file, the +names of several library math functions are redefined to call the +@code{fastmath} routine (using the corresponding V70 machine instructions) +whenever possible. + +For example, +@example + +#include + +double sqsin(x) +double x; +@{ + return sin(x*x); +@} + +@end example +expands into the code +@example + +@dots{} +double sqsin(x) +double x; +@{ + return fast_sin(x*x); +@} + +@end example + +The library has an entry @code{fast_sin} which uses the machine +instruction @code{fsin.l} to perform the operation. Note that the +built-in instructions cannot call @code{matherr} or set @code{errno} +in the same way that the C coded functions do. Refer to a V70 +instruction manual to see how errors are generated and handled. + +Also, the library provides true @code{float} entry points. The +@code{fast_sinf} entry point really performs a @code{fsin.s} +operation. Because of this, the instructions are only useful when +using code compiled with an ANSI C compiler. The prototypes +and definitions for the floating point versions of the math library +routines are only defined if compiling a module with an ANSI C +compiler. + +@page +@section Entry points +The functions provided by @file{fastmath.h} are +@example + + double fast_sin(double); /* fsin.l */ + double fast_cos(double); /* fcos.l */ + double fast_tan(double); /* ftan.l */ + double fast_asin(double); /* fasin.l */ + double fast_acos(double); /* facos.l */ + double fast_atan(double); /* fatan.l */ + double fast_sinh(double); /* fsinh.l */ + double fast_cosh(double); /* fcosh.l */ + double fast_tanh(double); /* ftanh.l */ + double fast_asinh(double); /* fasinh.l */ + double fast_acosh(double); /* facosh.l */ + double fast_atanh(double); /* fatanh.l */ + double fast_fabs(double); /* fabs.l */ + double fast_sqrt(double); /* fsqrt.l */ + double fast_exp2(double); /* fexp2.l */ + double fast_exp10(double); /* fexp10.l */ + double fast_expe(double); /* fexpe.l */ + double fast_log10(double); /* flog10.l */ + double fast_log2(double); /* flog2.l */ + double fast_loge(double); /* floge.l */ + + float fast_sinf(float); /* fsin.s */ + float fast_cosf(float); /* fcos.s */ + float fast_tanf(float); /* ftan.s */ + float fast_asinf(float); /* fasin.s */ + float fast_acosf(float); /* facos.s */ + float fast_atanf(float); /* fatan.s */ + float fast_sinhf(float); /* fsinh.s */ + float fast_coshf(float); /* fcosh.s */ + float fast_tanhf(float); /* ftanh.s */ + float fast_asinhf(float); /* fasinh.s */ + float fast_acoshf(float); /* facosh.s */ + float fast_atanhf(float); /* fatanh.s */ + float fast_fabsf(float); /* fabs.s */ + float fast_sqrtf(float); /* fsqrt.s */ + float fast_exp2f(float); /* fexp2.s */ + float fast_exp10f(float); /* fexp10.s */ + float fast_expef(float); /* fexpe.s */ + float fast_log10f(float); /* flog10.s */ + float fast_log2f(float); /* flog2.s */ + float fast_logef(float); /* floge.s */ + +@end example + + diff --git a/newlib/libc/machine/necv70/setjmp.s b/newlib/libc/machine/necv70/setjmp.s new file mode 100644 index 000000000..d8aca1dfb --- /dev/null +++ b/newlib/libc/machine/necv70/setjmp.s @@ -0,0 +1,33 @@ + .globl _setjmp +_setjmp: + mov.w [ap],r0 + mov.d r15,[r0+] + mov.d r17,[r0+] + mov.d r19,[r0+] + mov.d r21,[r0+] + mov.d r23,[r0+] + mov.w -0x4[ap],[r0+] + mov.w fp,[r0+] + mov.w ap,[r0+] + mov.w -0x8[ap],[r0] + xor.w r0,r0 + ret #0x0 + + .globl _longjmp +_longjmp: + mov.w 0x4[ap],r0 + mov.w [ap],r1 + mov.d [r1+],r15 + mov.d [r1+],r17 + mov.d [r1+],r19 + mov.d [r1+],r21 + mov.d [r1+],r23 + mov.d [r1+],ap + mov.w [r1+],sp + test.w r0 + jne noz + mov.w #0x1,r0 +noz: jmp [0x0[r1]] + + + diff --git a/newlib/libc/machine/powerpc/Makefile.am b/newlib/libc/machine/powerpc/Makefile.am new file mode 100644 index 000000000..1c65b9ffe --- /dev/null +++ b/newlib/libc/machine/powerpc/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/powerpc/Makefile.in b/newlib/libc/machine/powerpc/Makefile.in new file mode 100644 index 000000000..5414b185d --- /dev/null +++ b/newlib/libc/machine/powerpc/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = setjmp.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/powerpc/aclocal.m4 b/newlib/libc/machine/powerpc/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/powerpc/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/powerpc/configure b/newlib/libc/machine/powerpc/configure new file mode 100755 index 000000000..b39571b6a --- /dev/null +++ b/newlib/libc/machine/powerpc/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=setjmp.S + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/powerpc/configure.in b/newlib/libc/machine/powerpc/configure.in new file mode 100644 index 000000000..47b9eab78 --- /dev/null +++ b/newlib/libc/machine/powerpc/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/powerpc configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(setjmp.S) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/powerpc/setjmp.S b/newlib/libc/machine/powerpc/setjmp.S new file mode 100644 index 000000000..c1376912f --- /dev/null +++ b/newlib/libc/machine/powerpc/setjmp.S @@ -0,0 +1,118 @@ +/* This is a simple version of setjmp and longjmp for the PowerPC. + Ian Lance Taylor, Cygnus Support, 9 Feb 1994. */ + +#include "ppc-asm.h" + +FUNC_START(setjmp) + addi 3,3,7 # align to 8 byte boundary + rlwinm 3,3,0,0,28 + stw 1,0(3) # offset 0 + stwu 2,4(3) # offset 4 + stwu 13,4(3) # offset 8 + stwu 14,4(3) # offset 12 + stwu 15,4(3) # offset 16 + stwu 16,4(3) # offset 20 + stwu 17,4(3) # offset 24 + stwu 18,4(3) # offset 28 + stwu 19,4(3) # offset 32 + stwu 20,4(3) # offset 36 + stwu 21,4(3) # offset 40 + stwu 22,4(3) # offset 44 + stwu 23,4(3) # offset 48 + stwu 24,4(3) # offset 52 + stwu 25,4(3) # offset 56 + stwu 26,4(3) # offset 60 + stwu 27,4(3) # offset 64 + stwu 28,4(3) # offset 68 + stwu 29,4(3) # offset 72 + stwu 30,4(3) # offset 76 + stwu 31,4(3) # offset 80 + mflr 4 + stwu 4,4(3) # offset 84 + mfcr 4 + stwu 4,4(3) # offset 88 + # one word pad to get floating point aligned on 8 byte boundary +#ifndef _SOFT_FLOAT + stfdu 14,8(3) # offset 96 + stfdu 15,8(3) # offset 104 + stfdu 16,8(3) # offset 112 + stfdu 17,8(3) # offset 120 + stfdu 18,8(3) # offset 128 + stfdu 19,8(3) # offset 136 + stfdu 20,8(3) # offset 144 + stfdu 21,8(3) # offset 152 + stfdu 22,8(3) # offset 160 + stfdu 23,8(3) # offset 168 + stfdu 24,8(3) # offset 176 + stfdu 25,8(3) # offset 184 + stfdu 26,8(3) # offset 192 + stfdu 27,8(3) # offset 200 + stfdu 28,8(3) # offset 208 + stfdu 29,8(3) # offset 216 + stfdu 30,8(3) # offset 224 + stfdu 31,8(3) # offset 232 +#endif + + /* This requires a total of 21 * 4 + 18 * 8 + 4 + 4 + 4 + bytes == 60 * 4 bytes == 240 bytes. */ + + li 3,0 + blr +FUNC_END(setjmp) + + +FUNC_START(longjmp) + addi 3,3,7 # align to 8 byte boundary + rlwinm 3,3,0,0,28 + lwz 1,0(3) # offset 0 + lwzu 2,4(3) # offset 4 + lwzu 13,4(3) # offset 8 + lwzu 14,4(3) # offset 12 + lwzu 15,4(3) # offset 16 + lwzu 16,4(3) # offset 20 + lwzu 17,4(3) # offset 24 + lwzu 18,4(3) # offset 28 + lwzu 19,4(3) # offset 32 + lwzu 20,4(3) # offset 36 + lwzu 21,4(3) # offset 40 + lwzu 22,4(3) # offset 44 + lwzu 23,4(3) # offset 48 + lwzu 24,4(3) # offset 52 + lwzu 25,4(3) # offset 56 + lwzu 26,4(3) # offset 60 + lwzu 27,4(3) # offset 64 + lwzu 28,4(3) # offset 68 + lwzu 29,4(3) # offset 72 + lwzu 30,4(3) # offset 76 + lwzu 31,4(3) # offset 80 + lwzu 5,4(3) # offset 84 + mtlr 5 + lwzu 5,4(3) # offset 88 + mtcrf 255,5 + # one word pad to get floating point aligned on 8 byte boundary +#ifndef _SOFT_FLOAT + lfdu 14,8(3) # offset 96 + lfdu 15,8(3) # offset 104 + lfdu 16,8(3) # offset 112 + lfdu 17,8(3) # offset 120 + lfdu 18,8(3) # offset 128 + lfdu 19,8(3) # offset 136 + lfdu 20,8(3) # offset 144 + lfdu 21,8(3) # offset 152 + lfdu 22,8(3) # offset 160 + lfdu 23,8(3) # offset 168 + lfdu 24,8(3) # offset 176 + lfdu 25,8(3) # offset 184 + lfdu 26,8(3) # offset 192 + lfdu 27,8(3) # offset 200 + lfdu 28,8(3) # offset 208 + lfdu 29,8(3) # offset 216 + lfdu 30,8(3) # offset 224 + lfdu 31,8(3) # offset 232 +#endif + + mr. 3,4 + bclr+ 4,2 + li 3,1 + blr +FUNC_END(longjmp) diff --git a/newlib/libc/machine/sh/Makefile.am b/newlib/libc/machine/sh/Makefile.am new file mode 100644 index 000000000..1aab718dd --- /dev/null +++ b/newlib/libc/machine/sh/Makefile.am @@ -0,0 +1,18 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = memcpy.S memset.S setjmp.S strcpy.S strcmp.S + +memcpy.o: asm.h +memset.o: asm.h +setjmp.o: asm.h +strcpy.o: asm.h +strcmp.o: asm.h + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/sh/Makefile.in b/newlib/libc/machine/sh/Makefile.in new file mode 100644 index 000000000..97cf13653 --- /dev/null +++ b/newlib/libc/machine/sh/Makefile.in @@ -0,0 +1,303 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = memcpy.S memset.S setjmp.S strcpy.S strcmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = memcpy.o memset.o setjmp.o strcpy.o strcmp.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +memcpy.o: asm.h +memset.o: asm.h +setjmp.o: asm.h +strcpy.o: asm.h +strcmp.o: asm.h + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/sh/aclocal.m4 b/newlib/libc/machine/sh/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/sh/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/sh/asm.h b/newlib/libc/machine/sh/asm.h new file mode 100644 index 000000000..ed27fdb1e --- /dev/null +++ b/newlib/libc/machine/sh/asm.h @@ -0,0 +1,22 @@ +#ifdef __STDC__ +# define _C_LABEL(x) _ ## x +#else +# define _C_LABEL(x) _/**/x +#endif +#define _ASM_LABEL(x) x + +#define _ENTRY(name) \ + .text; .align 2; .globl name; name: + +#define ENTRY(name) \ + _ENTRY(_C_LABEL(name)) + +#if (defined (__sh2__) || defined (__sh3__) || defined (__SH3E__) \ + || defined (__SH4_SINGLE__) || defined (__SH4__)) || defined(__SH4_SINGLE_ONLY__) +#define DELAYED_BRANCHES +#define SL(branch, dest, in_slot, in_slot_arg2) \ + branch##.s dest; in_slot, in_slot_arg2 +#else +#define SL(branch, dest, in_slot, in_slot_arg2) \ + in_slot, in_slot_arg2; branch dest +#endif diff --git a/newlib/libc/machine/sh/configure b/newlib/libc/machine/sh/configure new file mode 100755 index 000000000..3b8068ab1 --- /dev/null +++ b/newlib/libc/machine/sh/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=asm.h + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/sh/configure.in b/newlib/libc/machine/sh/configure.in new file mode 100644 index 000000000..ffd27974d --- /dev/null +++ b/newlib/libc/machine/sh/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/sh configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(asm.h) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/sh/memcpy.S b/newlib/libc/machine/sh/memcpy.S new file mode 100644 index 000000000..4df72e371 --- /dev/null +++ b/newlib/libc/machine/sh/memcpy.S @@ -0,0 +1,221 @@ +! +! Fast SH memcpy +! +! by Toshiyasu Morita (tm@netcom.com) +! hacked by J"orn Rernnecke (amylaar@cygnus.co.uk) ("o for o-umlaut) +! +! Entry: r4: destination pointer +! r5: source pointer +! r6: byte count +! +! Exit: r0: destination pointer +! r1-r7: trashed +! +! Notes: Usually one wants to do small reads and write a longword, but +! unfortunately it is difficult in some cases to concatanate bytes +! into a longword on the SH, so this does a longword read and small +! writes. +! +! This implementation makes two assumptions about how it is called: +! +! 1.: If the byte count is nonzero, the address of the last byte to be +! copied is unsigned greater than the address of the first byte to +! be copied. This could be easily swapped for a signed comparison, +! but the algorithm used needs some comparison. +! +! 2.: When there are two or three bytes in the last word of an 11-or-bore +! bytes memory chunk to b copied, the rest of the word can be read +! without size effects. +! This could be easily changed by increasing the minumum size of +! a fast memcpy and the amount subtracted from r7 before L_2l_loop be 2, +! however, this would cost a few extra cyles on average. +! + +#include "asm.h" + +ENTRY(memcpy) +#ifdef __LITTLE_ENDIAN__ + ! Little endian version copies with increasing addresses. + mov r4,r3 ! Save return value + mov #11,r0 ! Check if small number of bytes + cmp/hs r0,r6 + ! r6 becomes src end address + SL(bf, L_small, add r5,r6) + mov #1,r1 + tst r1,r5 ! check if source even + SL(bt, L_even, mov r6,r7) + mov.b @r5+,r0 ! no, make it even. + mov.b r0,@r4 + add #1,r4 +L_even: tst r1,r4 ! check if destination is even + add #-3,r7 + SL(bf, L_odddst, mov #2,r1) + tst r1,r4 ! check if destination is 4-byte aligned + mov r4,r0 + SL(bt, L_al4dst, sub r5,r0) + mov.w @r5+,r2 + mov.w r2,@r4 + ! add #2,r4 r4 is dead here. +L_al4dst: + tst r1,r5 + bt L_al4both + mov.w @r5+,r1 + swap.w r1,r1 + add #-6,r0 + add #-6,r7 ! r7 := src end address minus 9. + .align 2 +L_2l_loop: + mov.l @r5+,r2 ! Read & write two longwords per iteration + xtrct r2,r1 + mov.l r1,@(r0,r5) + cmp/hs r7,r5 + mov.l @r5+,r1 + xtrct r1,r2 + mov.l r2,@(r0,r5) + bf L_2l_loop + add #-2,r5 + bra L_cleanup + add #5,r0 +L_al4both: + add #-4,r0 + .align 2 +L_al4both_loop: + mov.l @r5+,r4 ! Read longword, write longword per iteration + cmp/hs r7,r5 + SL(bf, L_al4both_loop, mov.l r4,@(r0,r5)) + + bra L_cleanup + add #3,r0 + +L_odddst: + tst r1,r5 + SL(bt, L_al4src, add #-1,r4) + mov.w @r5+,r0 + mov.b r0,@(1,r4) + shlr8 r0 + mov.b r0,@(2,r4) + add #2,r4 +L_al4src: + .align 2 +L_odd_loop: + mov.l @r5+,r0 ! Read longword, write byte, word, byte per iteration + cmp/hs r7,r5 + mov.b r0,@(1,r4) + shlr8 r0 + mov.w r0,@(2,r4) + shlr16 r0 + mov.b r0,@(4,r4) + SL(bf, L_odd_loop, add #4,r4) + .align 2 ! avoid nop in more frequently executed code. +L_cleanup2: + mov r4,r0 + sub r5,r0 +L_cleanup: + cmp/eq r6,r5 + bt L_ready + .align 2 +L_cleanup_loop: + mov.b @r5+,r1 + cmp/eq r6,r5 + mov.b r1,@(r0,r5) + bf L_cleanup_loop +L_ready: + rts + mov r3,r0 +L_small: + bra L_cleanup2 + add #-1,r4 +#else + ! Big endian version copies with decreasing addresses. + mov r4,r0 + add r6,r0 + sub r4,r5 + mov #11,r1 + cmp/hs r1,r6 + SL(bf, L_small, add #-1,r5) + mov r5,r3 + add r0,r3 + shlr r3 + SL(bt, L_even, + mov r4,r7) + mov.b @(r0,r5),r2 + add #-1,r3 + mov.b r2,@-r0 +L_even: + tst #1,r0 + add #-1,r5 + SL(bf, L_odddst, add #8,r7) + tst #2,r0 + bt L_al4dst + add #-1,r3 + mov.w @(r0,r5),r1 + mov.w r1,@-r0 +L_al4dst: + shlr r3 + bt L_al4both + mov.w @(r0,r5),r1 + swap.w r1,r1 + add #4,r7 + add #-4,r5 + .align 2 +L_2l_loop: + mov.l @(r0,r5),r2 + xtrct r2,r1 + mov.l r1,@-r0 + cmp/hs r7,r0 + mov.l @(r0,r5),r1 + xtrct r1,r2 + mov.l r2,@-r0 + bt L_2l_loop + bra L_cleanup + add #5,r5 + + nop ! avoid nop in executed code. +L_al4both: + add #-2,r5 + .align 2 +L_al4both_loop: + mov.l @(r0,r5),r1 + cmp/hs r7,r0 + SL(bt, L_al4both_loop, + mov.l r1,@-r0) + bra L_cleanup + add #3,r5 + + nop ! avoid nop in executed code. +L_odddst: + shlr r3 + bt L_al4src + mov.w @(r0,r5),r1 + mov.b r1,@-r0 + shlr8 r1 + mov.b r1,@-r0 +L_al4src: + add #-2,r5 + .align 2 +L_odd_loop: + mov.l @(r0,r5),r2 + cmp/hs r7,r0 + mov.b r2,@-r0 + shlr8 r2 + mov.w r2,@-r0 + shlr16 r2 + mov.b r2,@-r0 + bt L_odd_loop + + add #3,r5 +L_cleanup: +L_small: + cmp/eq r4,r0 + bt L_ready + add #1,r4 + .align 2 +L_cleanup_loop: + mov.b @(r0,r5),r2 + cmp/eq r4,r0 + mov.b r2,@-r0 + bf L_cleanup_loop +L_ready: + rts + nop +#endif diff --git a/newlib/libc/machine/sh/memset.S b/newlib/libc/machine/sh/memset.S new file mode 100644 index 000000000..7352b4141 --- /dev/null +++ b/newlib/libc/machine/sh/memset.S @@ -0,0 +1,64 @@ +! +! Fast SH memset +! +! by Toshiyasu Morita (tm@netcom.com) +! +! Entry: r4: destination pointer +! r5: fill value +! r6: byte count +! +! Exit: r0-r3: trashed +! + +! This assumes that the first four bytes of the address space (0..3) are +! reserved - usually by the linker script. Otherwise, we would had to check +! for the case of objects of the size 12..15 at address 0..3 . + +#include "asm.h" + +ENTRY(memset) + mov #12,r0 ! Check for small number of bytes + cmp/gt r6,r0 + mov r4,r0 + SL(bt, L_store_byte_loop_check0, add r4,r6) + + tst #3,r0 ! Align destination + SL(bt, L_dup_bytes, extu.b r5,r5) + .balignw 4,0x0009 +L_align_loop: + mov.b r5,@r0 + add #1,r0 + tst #3,r0 + bf L_align_loop + +L_dup_bytes: + swap.b r5,r2 ! Duplicate bytes across longword + or r2,r5 + swap.w r5,r2 + or r2,r5 + + add #-16,r6 + + .balignw 4,0x0009 +L_store_long_loop: + mov.l r5,@r0 ! Store double longs to memory + cmp/hs r6,r0 + mov.l r5,@(4,r0) + SL(bf, L_store_long_loop, add #8,r0) + + add #16,r6 + +L_store_byte_loop_check0: + cmp/eq r6,r0 + bt L_exit + .balignw 4,0x0009 +L_store_byte_loop: + mov.b r5,@r0 ! Store bytes to memory + add #1,r0 + cmp/eq r6,r0 + bf L_store_byte_loop + +L_exit: + rts + mov r4,r0 + diff --git a/newlib/libc/machine/sh/setjmp.S b/newlib/libc/machine/sh/setjmp.S new file mode 100644 index 000000000..363e8f23b --- /dev/null +++ b/newlib/libc/machine/sh/setjmp.S @@ -0,0 +1,57 @@ +#include "asm.h" + +ENTRY(setjmp) +#if defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) + add #(13*4),r4 +#else + add #(9*4),r4 +#endif + + sts.l pr,@-r4 + +#if defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) + fmov.s fr15,@-r4 ! call saved floating point registers + fmov.s fr14,@-r4 + fmov.s fr13,@-r4 + fmov.s fr12,@-r4 +#endif + + mov.l r15,@-r4 ! call saved integer registers + mov.l r14,@-r4 + mov.l r13,@-r4 + mov.l r12,@-r4 + + mov.l r11,@-r4 + mov.l r10,@-r4 + mov.l r9,@-r4 + mov.l r8,@-r4 + + rts + mov #0,r0 + +ENTRY(longjmp) + mov.l @r4+,r8 + mov.l @r4+,r9 + mov.l @r4+,r10 + mov.l @r4+,r11 + + mov.l @r4+,r12 + mov.l @r4+,r13 + mov.l @r4+,r14 + mov.l @r4+,r15 + +#if defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) + fmov.s @r4+,fr12 ! call saved floating point registers + fmov.s @r4+,fr13 + fmov.s @r4+,fr14 + fmov.s @r4+,fr15 +#endif + + lds.l @r4+,pr + + mov r5,r0 + tst r0,r0 + bf retr4 + movt r0 +retr4: rts + nop diff --git a/newlib/libc/machine/sh/strcmp.S b/newlib/libc/machine/sh/strcmp.S new file mode 100644 index 000000000..a112b13e0 --- /dev/null +++ b/newlib/libc/machine/sh/strcmp.S @@ -0,0 +1,66 @@ +! Entry: r4: destination +! r5: source +! Exit: r0: result +! r1-r2,r4-r5: clobbered + +#include "asm.h" + +ENTRY(strcmp) + mov r4,r0 + or r5,r0 + tst #3,r0 + bf L_setup_char_loop + mov #0,r0 +#ifdef DELAYED_BRANCHES + mov.l @r4+,r1 + .align 2 +Longword_loop: + mov.l @r5+,r2 + cmp/str r0,r1 + bt Longword_loop_end + cmp/eq r1,r2 + bt.s Longword_loop + mov.l @r4+,r1 + add #-4, r4 +Longword_loop_end: + add #-4, r4 + add #-4, r5 +L_setup_char_loop: + mov.b @r4+,r0 + .align 2 +L_char_loop: + mov.b @r5+,r1 + tst r0,r0 + bt L_return + cmp/eq r0,r1 + bt.s L_char_loop + mov.b @r4+,r0 + add #-2,r4 + mov.b @r4,r0 +#else /* ! DELAYED_BRANCHES */ + .align 2 +Longword_loop: + mov.l @r4+,r1 + mov.l @r5+,r2 + cmp/str r0,r1 + bt Longword_loop_end + cmp/eq r1,r2 + bt Longword_loop +Longword_loop_end: + add #-4, r4 + add #-4, r5 + .align 2 +L_setup_char_loop: +L_char_loop: + mov.b @r4+,r0 + mov.b @r5+,r1 + tst r0,r0 + bt L_return + cmp/eq r0,r1 + bt L_char_loop +#endif +L_return: + extu.b r0,r0 + extu.b r1,r1 + rts + sub r1,r0 diff --git a/newlib/libc/machine/sh/strcpy.S b/newlib/libc/machine/sh/strcpy.S new file mode 100644 index 000000000..63aa7e75b --- /dev/null +++ b/newlib/libc/machine/sh/strcpy.S @@ -0,0 +1,41 @@ +! Entry: r4: destination +! r5: source +! Exit: r0: destination +! r1-r2,r5: clobbered + +#include "asm.h" + +ENTRY(strcpy) + mov r4,r0 + or r5,r0 + tst #3,r0 + SL(bf, L_setup_char_loop, mov r4,r0) + mov.l @r5+,r1 + mov #0,r2 + cmp/str r2,r1 + SL(bt, Longword_loop_end, sub r5,r0) + .align 2 +Longword_loop: + mov.l r1,@(r0,r5) + mov.l @r5+,r1 + cmp/str r2,r1 + bt Longword_loop_end + mov.l r1,@(r0,r5) + mov.l @r5+,r1 + cmp/str r2,r1 + bf Longword_loop +Longword_loop_end: + add #-4,r5 + add #3,r0 + .align 2 +L_char_loop: + mov.b @r5+,r1 +L_char_loop_start: + tst r1,r1 + SL(bf, L_char_loop, mov.b r1,@(r0,r5)) + rts + mov r4,r0 +L_setup_char_loop: + mov.b @r5+,r1 + bra L_char_loop_start + sub r5,r0 diff --git a/newlib/libc/machine/sparc/Makefile.am b/newlib/libc/machine/sparc/Makefile.am new file mode 100644 index 000000000..a019f6558 --- /dev/null +++ b/newlib/libc/machine/sparc/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = scan.c shuffle.c setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/sparc/Makefile.in b/newlib/libc/machine/sparc/Makefile.in new file mode 100644 index 000000000..1083e457f --- /dev/null +++ b/newlib/libc/machine/sparc/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = scan.c shuffle.c setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = scan.o shuffle.o setjmp.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/sparc/aclocal.m4 b/newlib/libc/machine/sparc/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/sparc/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/sparc/configure b/newlib/libc/machine/sparc/configure new file mode 100755 index 000000000..8138057ee --- /dev/null +++ b/newlib/libc/machine/sparc/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=shuffle.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/sparc/configure.in b/newlib/libc/machine/sparc/configure.in new file mode 100644 index 000000000..b0e44c240 --- /dev/null +++ b/newlib/libc/machine/sparc/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/sparc configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(shuffle.c) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/sparc/machine/sparclet.h b/newlib/libc/machine/sparc/machine/sparclet.h new file mode 100644 index 000000000..34a0e82ff --- /dev/null +++ b/newlib/libc/machine/sparc/machine/sparclet.h @@ -0,0 +1,32 @@ +/* Various stuff for the sparclet processor. + + This file is in the public domain. */ + +#ifndef _MACHINE_SPARCLET_H_ +#define _MACHINE_SPARCLET_H_ + +#ifdef __sparclet__ + +/* sparclet scan instruction */ + +extern __inline__ int +scan (int a, int b) +{ + int res; + __asm__ ("scan %1,%2,%0" : "=r" (res) : "r" (a), "r" (b)); + return res; +} + +/* sparclet shuffle instruction */ + +extern __inline__ int +shuffle (int a, int b) +{ + int res; + __asm__ ("shuffle %1,%2,%0" : "=r" (res) : "r" (a), "r" (b)); + return res; +} + +#endif /* __sparclet__ */ + +#endif /* _MACHINE_SPARCLET_H_ */ diff --git a/newlib/libc/machine/sparc/scan.c b/newlib/libc/machine/sparc/scan.c new file mode 100644 index 000000000..d76c0b95f --- /dev/null +++ b/newlib/libc/machine/sparc/scan.c @@ -0,0 +1,15 @@ +/* Cover function to sparclet `scan' instruction. + + This file is in the public domain. */ + +#ifdef __sparclet__ + +int +scan (int a, int b) +{ + int res; + __asm__ ("scan %1,%2,%0" : "=r" (res) : "r" (a), "r" (b)); + return res; +} + +#endif diff --git a/newlib/libc/machine/sparc/setjmp.S b/newlib/libc/machine/sparc/setjmp.S new file mode 100644 index 000000000..00d668f91 --- /dev/null +++ b/newlib/libc/machine/sparc/setjmp.S @@ -0,0 +1,148 @@ +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Modified for incorporation into newlib by Joel Sherrill + * (joel@OARcorp.com), On-Line Applications Research, 1995. + * Did the following: + * + merged in DEFS.h + * + removed error check since it prevented using this setjmp + * to "context switch" + * + added the support for the "user label" and "register" prefix + * + * This software was developed by the Computer Systems Engineering group + * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and + * contributed to Berkeley. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: $Header$ + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)_setjmp.s 8.1 (Berkeley) 6/4/93" +#endif /* LIBC_SCCS and not lint */ + +/* + * Recent versions of GNU cpp define variables which indicate the + * need for underscores and percents. If not using GNU cpp or + * the version does not support this, then you will obviously + * have to define these as appropriate. + */ + +#ifndef __USER_LABEL_PREFIX__ +#define __USER_LABEL_PREFIX__ _ +#endif + +#ifndef __REGISTER_PREFIX__ +#define __REGISTER_PREFIX__ +#endif + +/* ANSI concatenation macros. */ + +#define CONCAT1(a, b) CONCAT2(a, b) +#define CONCAT2(a, b) a ## b + +/* Use the right prefix for global labels. */ + +#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) + +/********************************************************************* + ********************************************************************* + * Contents of DEFS.h * + ********************************************************************* + *********************************************************************/ + +#ifdef PROF +#define ENTRY(x) \ + .align 4; .globl SYM(x); .proc 1; SYM(x):; .data; .align 4; 1: .long 0; \ + .text; save %sp,-96,%sp; sethi %hi(1b),%o0; call mcount; \ + or %lo(1b),%o0,%o0; restore +#else +#define ENTRY(x) \ + .align 4; .globl SYM(x); .proc 1; SYM(x): +#endif + + + +/********************************************************************* + ********************************************************************* + * END of DEFS.h * + ********************************************************************* + *********************************************************************/ + + +/* + * C library -- _setjmp, _longjmp + * + * _longjmp(a,v) + * will generate a "return(v?v:1)" from + * the last call to + * _setjmp(a) + * by unwinding the call stack. + * The previous signal state is NOT restored. + */ + + +/* #include "DEFS.h" */ + +ENTRY(setjmp) +ENTRY(_setjmp) + st %sp, [%o0] /* caller's stack pointer */ + st %i7, [%o0+4] /* caller's return pc */ + st %fp, [%o0+8] /* store caller's frame pointer */ + st %o7, [%o0+12] + retl + clr %o0 ! return 0 + +ENTRY(longjmp) +ENTRY(_longjmp) + ta 0x03 /* flush registers */ + addcc %o1, %g0, %g6 ! compute v ? v : 1 in a global register + be,a 0f + mov 1, %g6 +0: + ld [%o0], %sp /* caller's stack pointer */ + + ldd [%sp], %l0 + ldd [%sp+8], %l2 + ldd [%sp+16], %l4 + ldd [%sp+24], %l6 + + ldd [%sp+32], %i0 + ldd [%sp+40], %i2 + ldd [%sp+48], %i4 + + ld [%o0+4], %i7 /* caller's return pc */ + ld [%o0+8], %fp /* caller's frame pointer */ + ld [%o0+12], %o7 + + jmp %o7 + 8 ! success, return %g6 + mov %g6, %o0 + diff --git a/newlib/libc/machine/sparc/shuffle.c b/newlib/libc/machine/sparc/shuffle.c new file mode 100644 index 000000000..2c2ec1cd2 --- /dev/null +++ b/newlib/libc/machine/sparc/shuffle.c @@ -0,0 +1,15 @@ +/* Cover function to sparclet `shuffle' instruction. + + This file is in the public domain. */ + +#ifdef __sparclet__ + +int +shuffle (int a, int b) +{ + int res; + __asm__ ("shuffle %1,%2,%0" : "=r" (res) : "r" (a), "r" (b)); + return res; +} + +#endif diff --git a/newlib/libc/machine/tic80/Makefile.am b/newlib/libc/machine/tic80/Makefile.am new file mode 100644 index 000000000..1c65b9ffe --- /dev/null +++ b/newlib/libc/machine/tic80/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/tic80/Makefile.in b/newlib/libc/machine/tic80/Makefile.in new file mode 100644 index 000000000..5414b185d --- /dev/null +++ b/newlib/libc/machine/tic80/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = setjmp.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/tic80/aclocal.m4 b/newlib/libc/machine/tic80/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/tic80/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/tic80/configure b/newlib/libc/machine/tic80/configure new file mode 100755 index 000000000..b39571b6a --- /dev/null +++ b/newlib/libc/machine/tic80/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=setjmp.S + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/tic80/configure.in b/newlib/libc/machine/tic80/configure.in new file mode 100644 index 000000000..c21c4a791 --- /dev/null +++ b/newlib/libc/machine/tic80/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/tic80 configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(setjmp.S) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/tic80/setjmp.S b/newlib/libc/machine/tic80/setjmp.S new file mode 100644 index 000000000..1946344a5 --- /dev/null +++ b/newlib/libc/machine/tic80/setjmp.S @@ -0,0 +1,50 @@ +/* These are predefined by new versions of GNU cpp. */ + +#ifndef __USER_LABEL_PREFIX__ +#define __USER_LABEL_PREFIX__ _ +#endif + +/* ANSI concatenation macros. */ + +#define CONCAT1(a, b) CONCAT2(a, b) +#define CONCAT2(a, b) a ## b + +/* Use the right prefix for global labels. */ + +#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) + + .global SYM (setjmp) + .global SYM (_setjmp) + .global SYM (longjmp) + + .section .text,"x" + .align 4 +SYM (_setjmp): +SYM (setjmp): + st.d 0(r2),r20 + st.d 8(r2),r22 + st.d 16(r2),r24 + st.d 24(r2),r26 + st.d 32(r2),r28 + st.d 40(r2),r30 + st 48(r2),r1 + jsr r31(r0),r0 + addu 0,r0,r2 + + .section .text,"x" + .align 4 +SYM (longjmp): + ld.d 0(r2),r20 + ld.d 8(r2),r22 + ld.d 16(r2),r24 + ld.d 24(r2),r26 + ld.d 32(r2),r28 + ld.d 40(r2),r30 + bcnd L1,r4,ne0.w + ld 48(r2),r1 + + jsr r31(r0),r0 + addu 1,r0,r2 +L1: + jsr r31(r0),r0 + addu r4,r0,r2 diff --git a/newlib/libc/machine/v850/Makefile.am b/newlib/libc/machine/v850/Makefile.am new file mode 100644 index 000000000..1c65b9ffe --- /dev/null +++ b/newlib/libc/machine/v850/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/v850/Makefile.in b/newlib/libc/machine/v850/Makefile.in new file mode 100644 index 000000000..5414b185d --- /dev/null +++ b/newlib/libc/machine/v850/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = setjmp.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/v850/aclocal.m4 b/newlib/libc/machine/v850/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/v850/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/v850/configure b/newlib/libc/machine/v850/configure new file mode 100755 index 000000000..b39571b6a --- /dev/null +++ b/newlib/libc/machine/v850/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=setjmp.S + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/v850/configure.in b/newlib/libc/machine/v850/configure.in new file mode 100644 index 000000000..605320d75 --- /dev/null +++ b/newlib/libc/machine/v850/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/v850 configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(setjmp.S) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/v850/setjmp.S b/newlib/libc/machine/v850/setjmp.S new file mode 100644 index 000000000..b0da8e88f --- /dev/null +++ b/newlib/libc/machine/v850/setjmp.S @@ -0,0 +1,42 @@ + .file "setjmp.S" + + .section .text + .align 1 + .global _setjmp +_setjmp: + st.w r0,0[r6] + st.w r3,4[r6] + st.w r4,8[r6] + st.w r20,12[r6] + st.w r21,16[r6] + st.w r22,20[r6] + st.w r23,24[r6] + st.w r24,28[r6] + st.w r25,32[r6] + st.w r26,36[r6] + st.w r27,40[r6] + st.w r28,44[r6] + st.w r29,48[r6] + st.w r30,52[r6] + st.w r31,56[r6] + jmp [r31] + + .global _longjmp +_longjmp: + ld.w 0[r6],r0 + ld.w 4[r6],r3 + ld.w 8[r6],r4 + ld.w 12[r6],r20 + ld.w 16[r6],r21 + ld.w 20[r6],r22 + ld.w 24[r6],r23 + ld.w 28[r6],r24 + ld.w 32[r6],r25 + ld.w 36[r6],r26 + ld.w 40[r6],r27 + ld.w 44[r6],r28 + ld.w 48[r6],r29 + ld.w 52[r6],r30 + ld.w 56[r6],r31 + mov 1,r10 + jmp [r31] diff --git a/newlib/libc/machine/w65/Makefile.am b/newlib/libc/machine/w65/Makefile.am new file mode 100644 index 000000000..dc3b02f97 --- /dev/null +++ b/newlib/libc/machine/w65/Makefile.am @@ -0,0 +1,13 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = udivhi3.s umodhi3.s smulhi3.s lshrhi.s sdivhi3.s mulsi3.c \ + divsi3.c cmpsi.c + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/w65/Makefile.in b/newlib/libc/machine/w65/Makefile.in new file mode 100644 index 000000000..49ddab90e --- /dev/null +++ b/newlib/libc/machine/w65/Makefile.in @@ -0,0 +1,299 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = udivhi3.s umodhi3.s smulhi3.s lshrhi.s sdivhi3.s mulsi3.c \ + divsi3.c cmpsi.c + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = udivhi3.o umodhi3.o smulhi3.o lshrhi.o sdivhi3.o \ +mulsi3.o divsi3.o cmpsi.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/w65/aclocal.m4 b/newlib/libc/machine/w65/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/w65/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/w65/cmpsi.c b/newlib/libc/machine/w65/cmpsi.c new file mode 100644 index 000000000..3773c9d2e --- /dev/null +++ b/newlib/libc/machine/w65/cmpsi.c @@ -0,0 +1,28 @@ + +union u { + struct { + short int msw; + unsigned short lsw; +} w; +long l; +}; + +int +__cmpsi2(long arga, + short int msw_b, unsigned short int lsw_b) +{ + union u u; + u.l = arga; + + if (u.w.msw != msw_b) + { + if (u.w.msw < msw_b) return 0; + return 2; + } + if (u.w.lsw != lsw_b) + { + if (u.w.lsw < lsw_b) return 0; + return 2; + } + return 1; +} diff --git a/newlib/libc/machine/w65/configure b/newlib/libc/machine/w65/configure new file mode 100755 index 000000000..d862b2247 --- /dev/null +++ b/newlib/libc/machine/w65/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=cmpsi.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/w65/configure.in b/newlib/libc/machine/w65/configure.in new file mode 100644 index 000000000..7d3d724d6 --- /dev/null +++ b/newlib/libc/machine/w65/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/w65 configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(cmpsi.c) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/w65/divsi3.c b/newlib/libc/machine/w65/divsi3.c new file mode 100644 index 000000000..bf749923c --- /dev/null +++ b/newlib/libc/machine/w65/divsi3.c @@ -0,0 +1,134 @@ + +#define divnorm(num, den, sign) \ +{ \ + if (num < 0) \ + { \ + num = -num; \ + sign = 1; \ + } \ + else \ + { \ + sign = 0; \ + } \ + \ + if (den < 0) \ + { \ + den = - den; \ + sign = 1 - sign; \ + } \ +} + + + + + +static unsigned long +divmodsi4(int modwanted, unsigned long num, unsigned long den) +{ + long int bit = 1; + long int res = 0; + long prevden; + while (den < num && bit && !(den & (1L<<31))) + { + den <<=1; + bit <<=1; + } + while (bit) + { + if (num >= den) + { + num -= den; + res |= bit; + } + bit >>=1; + den >>=1; + } + if (modwanted) return num; + return res; +} + + +#define exitdiv(sign, res) if (sign) { res = - res;} return res; + +long +__modsi3 (long numerator, long denominator) +{ + int sign = 0; + long dividend; + long modul; + + + if (numerator < 0) + { + numerator = -numerator; + sign = 1; + } + if (denominator < 0) + { + denominator = -denominator; + } + + modul = divmodsi4 (1, numerator, denominator); + if (sign) + return - modul; + return modul; +} + + +long +__divsi3 (long numerator, long denominator) +{ + int sign; + long dividend; + long modul; + divnorm (numerator, denominator, sign); + + dividend = divmodsi4 (0, numerator, denominator); + exitdiv (sign, dividend); +} + +long +__umodsi3 (unsigned long numerator, unsigned long denominator) +{ + long dividend; + long modul; + +modul= divmodsi4 (1, numerator, denominator); + return modul; +} + +long +__udivsi3 (unsigned long numerator, unsigned long denominator) +{ + int sign; + long dividend; + long modul; + dividend = divmodsi4 (0, numerator, denominator); + return dividend; +} + + + + + + +#ifdef TEST + + + +main () +{ + long int i, j, k, m; + for (i = -10000; i < 10000; i += 8) + { + for (j = -10000; j < 10000; j += 11) + { + k = i / j; + m = __divsi3 (i, j); + if (k != m) + printf ("fail %d %d %d %d\n", i, j, k, m); + } + } +} + +#endif diff --git a/newlib/libc/machine/w65/lshrhi.s b/newlib/libc/machine/w65/lshrhi.s new file mode 100644 index 000000000..564229f57 --- /dev/null +++ b/newlib/libc/machine/w65/lshrhi.s @@ -0,0 +1,48 @@ + + + .global ___lshrhi15 +___lshrhi15: + lsr a + + .global ___lshrhi14 +___lshrhi14: + lsr a + .global ___lshrhi13 +___lshrhi13: + lsr a + .global ___lshrhi12 +___lshrhi12: + lsr a + .global ___lshrhi11 +___lshrhi11: + lsr a + .global ___lshrhi10 +___lshrhi10: + lsr a + .global ___lshrhi9 +___lshrhi9: + lsr a + .global ___lshrhi8 +___lshrhi8: + lsr a + .global ___lshrhi7 +___lshrhi7: + lsr a + .global ___lshrhi6 +___lshrhi6: + lsr a + .global ___lshrhi5 +___lshrhi5: + lsr a + .global ___lshrhi4 +___lshrhi4: + lsr a + .global ___lshrhi3 +___lshrhi3: + lsr a + .global ___lshrhi2 +___lshrhi2: + lsr a + lsr a + rtl + diff --git a/newlib/libc/machine/w65/mulsi3.c b/newlib/libc/machine/w65/mulsi3.c new file mode 100644 index 000000000..b48fe97ac --- /dev/null +++ b/newlib/libc/machine/w65/mulsi3.c @@ -0,0 +1,17 @@ + + +long +__mulsi3(unsigned long a, unsigned long b) +{ + long res = 0; + while (a) + { + if (a & 1) + { + res += b; + } + b <<= 1; + a >>=1; + } + return res; +} diff --git a/newlib/libc/machine/w65/sdivhi3.s b/newlib/libc/machine/w65/sdivhi3.s new file mode 100644 index 000000000..7958f11e7 --- /dev/null +++ b/newlib/libc/machine/w65/sdivhi3.s @@ -0,0 +1,35 @@ + .global ___sdivhi3 + +___sdivhi3: + lda udv + ply + beq Lend !if positive result + + eor #0xFFFF !negate result + inc a + +Lend: sta ___udivhi3 + stx /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/z8k/aclocal.m4 b/newlib/libc/machine/z8k/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/machine/z8k/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/machine/z8k/args.h b/newlib/libc/machine/z8k/args.h new file mode 100644 index 000000000..3f6062483 --- /dev/null +++ b/newlib/libc/machine/z8k/args.h @@ -0,0 +1,13 @@ +#ifdef __Z8001__ + +segm +#define PARG_0 rr6 +#else +unsegm +#define PARG_0 r7 +#endif + +#define LARG_0 rr6 +#define ARG_0 r7 + +#define LARG_1 rr4 diff --git a/newlib/libc/machine/z8k/configure b/newlib/libc/machine/z8k/configure new file mode 100755 index 000000000..610b786b3 --- /dev/null +++ b/newlib/libc/machine/z8k/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=args.h + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/machine/z8k/configure.in b/newlib/libc/machine/z8k/configure.in new file mode 100644 index 000000000..d8c24dc8a --- /dev/null +++ b/newlib/libc/machine/z8k/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/machine/z8k configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(args.h) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/machine/z8k/setjmp.S b/newlib/libc/machine/z8k/setjmp.S new file mode 100644 index 000000000..6a7664112 --- /dev/null +++ b/newlib/libc/machine/z8k/setjmp.S @@ -0,0 +1,49 @@ + +#ifdef __Z8001__ + segm + + .global _setjmp +_setjmp: + ldl rr2,@rr14 ! fetch pc + ldl @rr6,rr2 ! save it + ldl rr6(4),rr10 + ldl rr6(8),rr12 ! and the other special regs + ldl rr6(12),rr14 + ldk r2,#0 + ret t + + .globl _longjmp + +_longjmp: + ld r2,r5 ! get return value + ldl rr4,rr6(0) + ldl rr10,rr6(4) + ldl rr12,rr6(8) + ldl rr14,rr6(12) + jp @rr4 +#else + unseg + + .global _setjmp +_setjmp: + ld r2,@r15 ! fetch pc + ld @r7,r2 ! save it + ldl r7(4),rr10 + ldl r7(8),rr12 ! and the other special regs + ldl r7(12),rr14 + ldk r2,#0 + ret t + + .globl _longjmp + +_longjmp: + ld r2,r6 ! get return value + ld r4,@r7 + ldl rr10,rr7(4) + ldl rr12,rr7(8) + ldl rr14,rr7(12) + jp @rr4 + +#endif + + diff --git a/newlib/libc/misc/Makefile.am b/newlib/libc/misc/Makefile.am new file mode 100644 index 000000000..c6788ba0c --- /dev/null +++ b/newlib/libc/misc/Makefile.am @@ -0,0 +1,26 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = dprintf.c unctrl.c ffs.c + +CHEWOUT_FILES = unctrl.def ffs.def + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +TARGETDOC = ../tmp.texi + +doc: $(CHEWOUT_FILES) + cat $(srcdir)/misc.tex >> $(TARGETDOC) + +CLEANFILES = $(CHEWOUT_FILES) *.ref diff --git a/newlib/libc/misc/Makefile.in b/newlib/libc/misc/Makefile.in new file mode 100644 index 000000000..0fa2ecf4f --- /dev/null +++ b/newlib/libc/misc/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +CRT0 = @CRT0@ +EXEEXT = @EXEEXT@ +LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@ +LIBC_POSIX_LIB = @LIBC_POSIX_LIB@ +LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@ +LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@ +LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ +LIBC_SYS_LIB = @LIBC_SYS_LIB@ +LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = dprintf.c unctrl.c ffs.c + +CHEWOUT_FILES = unctrl.def ffs.def + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +TARGETDOC = ../tmp.texi + +CLEANFILES = $(CHEWOUT_FILES) *.ref +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = dprintf.o unctrl.o ffs.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .def .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus misc/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = misc + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ +check-am installcheck-am installcheck install-info-am install-info \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +doc: $(CHEWOUT_FILES) + cat $(srcdir)/misc.tex >> $(TARGETDOC) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/misc/dprintf.c b/newlib/libc/misc/dprintf.c new file mode 100644 index 000000000..071d177ca --- /dev/null +++ b/newlib/libc/misc/dprintf.c @@ -0,0 +1,266 @@ +/* Debugging printf, for debugging the library itself. + + We don't assume stdio is working. + We do assume _write_r is working. +*/ + +#include "ctype.h" +#include "reent.h" +#include "string.h" +#include "unctrl.h" + +#ifdef __STDC__ +#include "stdarg.h" +#else +#include "varargs.h" +#endif + +static char *parse_number (); +static long get_number (); +static void print_number (); +static void write_char (); +static void write_string (); + +/* Non-zero for big-endian systems. */ +static int big_endian_p; + +/* For now hardcode 2 (stderr) as the console file descriptor. + May wish to let the caller pass in a file descriptor or some such but + this is only for debugging purposes anyway. */ +#define CONSOLE_FD 2 + +/* Standalone printf routine. + + The format string has been enhanced so that multiple values can be dumped + without having to have a %-field for each one (say if you want to dump + 20 words at a certain address). A modifier of `N' says the next argument + is a count, and the one after that is a pointer. + + Example: __dprintf (stderr, "%Nx\n", 20, p); /-* print 20 ints at `p' *-/ + + Supported formats are: c d u x s p. + + All ints are retrieved a byte at a time so alignment issues are not + a problem. + + This routine is used in situations where the only debugging capability + is console output and was written to aid debugging newlib itself. We don't + use printf ourselves as we may be debugging it. We do assume _write_r is + working. +*/ + +void +#ifdef __STDC__ +__dprintf (char *fmt, ...) +#else +__dprintf (fmt, va_alist) + char *fmt; + va_dcl +#endif +{ + va_list args; + + /* Which endian are we? */ + { + short tmp = 1; + big_endian_p = *(char *) &tmp == 0; + } + +#ifdef __STDC__ + va_start (args, fmt); +#else + va_start (args); +#endif + + while (*fmt) + { + char c, *p; + int count; + long l; + + if (*fmt != '%' || *++fmt == '%') + { + write_char (*fmt++); + continue; + } + + if (*fmt == 'N') + { + count = va_arg (args, int); + p = va_arg (args, char *); + ++fmt; + c = *fmt++; + + while (--count >= 0) + { + switch (c) + { + case 'c' : + write_string (unctrl (*p++)); + break; + case 'p' : + print_number (16, 1, get_number (p, sizeof (char *), 1)); + p += sizeof (char *); + break; + case 'd' : + case 'u' : + case 'x' : + print_number (c == 'x' ? 16 : 10, c != 'd', + get_number (p, sizeof (int), c != 'd')); + p += sizeof (int); + break; + case 's' : + write_string (*(char **) p); + p += sizeof (char *); + break; + } + if (count > 0) + write_char (' '); + } + } + else + { + switch (c = *fmt++) + { + case 'c' : + c = va_arg (args, int); + write_string (unctrl (c)); + break; + case 'p' : + l = (_POINTER_INT) va_arg (args, char *); + print_number (16, 1, l); + break; + case 'd' : + case 'u' : + case 'x' : + l = va_arg (args, int); + print_number (c == 'x' ? 16 : 10, c != 'd', l); + break; + case 's' : + p = va_arg (args, char *); + write_string (p); + break; + } + } + } + + va_end (args); +} + +/* Parse a positive decimal integer at S. + FIXME: Was used in earlier version, but not currently used. + Keep for now. */ + +static char * +parse_number (s, p) + char *s; + long *p; +{ + long x = 0; + + while (isdigit (*s)) + { + x = (x * 10) + (*s - '0'); + ++s; + } + + *p = x; + return s; +} + +/* Fetch the number at S of SIZE bytes. */ + +static long +get_number (s, size, unsigned_p) + char *s; + long size; + int unsigned_p; +{ + long x; + unsigned char *p = (unsigned char *) s; + + switch (size) + { + case 1 : + x = *p; + if (!unsigned_p) + x = (x ^ 0x80) - 0x80; + return x; + case 2 : + if (big_endian_p) + x = (p[0] << 8) | p[1]; + else + x = (p[1] << 8) | p[0]; + if (!unsigned_p) + x = (x ^ 0x8000) - 0x8000; + return x; + case 4 : + if (big_endian_p) + x = ((long)p[0] << 24) | ((long)p[1] << 16) | (p[2] << 8) | p[3]; + else + x = ((long)p[3] << 24) | ((long)p[2] << 16) | (p[1] << 8) | p[0]; + if (!unsigned_p) + x = (x ^ 0x80000000L) - 0x80000000L; + return x; +#if 0 /* FIXME: Is there a standard mechanism for knowing if + long longs exist? */ + case 8 : +#endif + default : + return 0; + } +} + +/* Print X in base BASE. */ + +static void +print_number (base, unsigned_p, n) + int base; + int unsigned_p; + long n; +{ + static char chars[16] = "0123456789abcdef"; + char *p, buf[32]; + unsigned long x; + + if (!unsigned_p && n < 0) + { + write_char ('-'); + x = -n; + } + else + x = n; + + p = buf + sizeof (buf); + *--p = '\0'; + do + { + *--p = chars[x % base]; + x /= base; + } + while (x != 0); + + write_string (p); +} + +/* Write C to the console. + We go through the file descriptor directly because we can't assume + stdio is working. */ + +static void +write_char (c) + char c; +{ + _write_r (_REENT, CONSOLE_FD, &c, 1); +} + +/* Write S to the console. + We go through the file descriptor directly because we can't assume + stdio is working. */ + +static void +write_string (s) + char *s; +{ + _write_r (_REENT, CONSOLE_FD, s, strlen (s)); +} diff --git a/newlib/libc/misc/ffs.c b/newlib/libc/misc/ffs.c new file mode 100644 index 000000000..e4afe7a41 --- /dev/null +++ b/newlib/libc/misc/ffs.c @@ -0,0 +1,42 @@ +/* +FUNCTION + <>---find first bit set in a word + +INDEX + ffs + +ANSI_SYNOPSIS + int ffs(int <[word]>); + +TRAD_SYNOPSIS + int ffs(<[word]>); + +DESCRIPTION + +<> returns the first bit set in a word. + +RETURNS +<> returns 0 if <[c]> is 0, 1 if <[c]> is odd, 2 if <[c]> is a multiple of +2, etc. + +PORTABILITY +<> is not ANSI C. + +No supporting OS subroutines are required. */ + +int +ffs (word) + int word; +{ + int i; + + if (!word) + return 0; + + i = 0; + for (;;) + { + if (((1 << i++) & word) != 0) + return i; + } +} diff --git a/newlib/libc/misc/misc.tex b/newlib/libc/misc/misc.tex new file mode 100644 index 000000000..ea5599d83 --- /dev/null +++ b/newlib/libc/misc/misc.tex @@ -0,0 +1,10 @@ +@node Misc +@chapter Miscellaneous Macros and Functions +This chapter describes miscellaneous routines not covered elsewhere. + +@menu +* unctrl:: Return printable representation of a character +@end menu + +@page +@include misc/unctrl.def diff --git a/newlib/libc/misc/unctrl.c b/newlib/libc/misc/unctrl.c new file mode 100644 index 000000000..e7350c657 --- /dev/null +++ b/newlib/libc/misc/unctrl.c @@ -0,0 +1,146 @@ +/* +FUNCTION + <>---translate characters to upper case + +INDEX + unctrl +INDEX + unctrllen + +ANSI_SYNOPSIS + #include + char *unctrl(int <[c]>); + int unctrllen(int <[c]>); + +TRAD_SYNOPSIS + #include + char *unctrl(<[c]>); + int unctrllen(<[c]>); + +DESCRIPTION +<> is a macro which returns the printable representation of <[c]> +as a string. +<> is a macro which returns the length of the printable +representation of <[c]>. + +RETURNS +<> returns a string of the printable representation of <[c]>. + +<> returns the length of the string which is the printable +representation of <[c]>. + +PORTABILITY +<> and <> are not ANSI C. + +No supporting OS subroutines are required. +*/ + +/* + * Copyright (c) 1981, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <_ansi.h> + +#ifndef lint +static char sccsid[] = "@(#)unctrl.c 8.1 (Berkeley) 6/4/93"; +#endif /* not lint */ + +_CONST char * _CONST __unctrl[256] = { + "^@", "^A", "^B", "^C", "^D", "^E", "^F", "^G", + "^H", "^I", "^J", "^K", "^L", "^M", "^N", "^O", + "^P", "^Q", "^R", "^S", "^T", "^U", "^V", "^W", + "^X", "^Y", "^Z", "^[", "^\\", "^]", "^~", "^_", + " ", "!", "\"", "#", "$", "%", "&", "'", + "(", ")", "*", "+", ",", "-", ".", "/", + "0", "1", "2", "3", "4", "5", "6", "7", + "8", "9", ":", ";", "<", "=", ">", "?", + "@", "A", "B", "C", "D", "E", "F", "G", + "H", "I", "J", "K", "L", "M", "N", "O", + "P", "Q", "R", "S", "T", "U", "V", "W", + "X", "Y", "Z", "[", "\\", "]", "^", "_", + "`", "a", "b", "c", "d", "e", "f", "g", + "h", "i", "j", "k", "l", "m", "n", "o", + "p", "q", "r", "s", "t", "u", "v", "w", + "x", "y", "z", "{", "|", "}", "~", "^?", + + "0x80", "0x81", "0x82", "0x83", "0x84", "0x85", "0x86", "0x87", + "0x88", "0x89", "0x8a", "0x8b", "0x8c", "0x8d", "0x8e", "0x8f", + "0x90", "0x91", "0x92", "0x93", "0x94", "0x95", "0x96", "0x97", + "0x98", "0x99", "0x9a", "0x9b", "0x9c", "0x9d", "0x9e", "0x9f", + "0xa0", "0xa1", "0xa2", "0xa3", "0xa4", "0xa5", "0xa6", "0xa7", + "0xa8", "0xa9", "0xaa", "0xab", "0xac", "0xad", "0xae", "0xaf", + "0xb0", "0xb1", "0xb2", "0xb3", "0xb4", "0xb5", "0xb6", "0xb7", + "0xb8", "0xb9", "0xba", "0xbb", "0xbc", "0xbd", "0xbe", "0xbf", + "0xc0", "0xc1", "0xc2", "0xc3", "0xc4", "0xc5", "0xc6", "0xc7", + "0xc8", "0xc9", "0xca", "0xcb", "0xcc", "0xcd", "0xce", "0xcf", + "0xd0", "0xd1", "0xd2", "0xd3", "0xd4", "0xd5", "0xd6", "0xd7", + "0xd8", "0xd9", "0xda", "0xdb", "0xdc", "0xdd", "0xde", "0xdf", + "0xe0", "0xe1", "0xe2", "0xe3", "0xe4", "0xe5", "0xe6", "0xe7", + "0xe8", "0xe9", "0xea", "0xeb", "0xec", "0xed", "0xee", "0xef", + "0xf0", "0xf1", "0xf2", "0xf3", "0xf4", "0xf5", "0xf6", "0xf7", + "0xf8", "0xf9", "0xfa", "0xfb", "0xfc", "0xfd", "0xfe", "0xff", +}; + +_CONST char __unctrllen[256] = { + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 2, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, +}; diff --git a/newlib/libc/posix/Makefile.am b/newlib/libc/posix/Makefile.am new file mode 100644 index 000000000..afb909762 --- /dev/null +++ b/newlib/libc/posix/Makefile.am @@ -0,0 +1,29 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + closedir.c opendir.c readdir.c rewinddir.c scandir.c seekdir.c \ + telldir.c execl.c execle.c execlp.c execv.c execve.c execvp.c \ + popen.c creat.c isatty.c + +CHEWOUT_FILES = + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +TARGETDOC = ../tmp.texi + +# No doc for posix. +doc: + +CLEANFILES = $(CHEWOUT_FILES) *.ref diff --git a/newlib/libc/posix/Makefile.in b/newlib/libc/posix/Makefile.in new file mode 100644 index 000000000..6b41087c7 --- /dev/null +++ b/newlib/libc/posix/Makefile.in @@ -0,0 +1,303 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +CRT0 = @CRT0@ +EXEEXT = @EXEEXT@ +LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@ +LIBC_POSIX_LIB = @LIBC_POSIX_LIB@ +LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@ +LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@ +LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ +LIBC_SYS_LIB = @LIBC_SYS_LIB@ +LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + closedir.c opendir.c readdir.c rewinddir.c scandir.c seekdir.c \ + telldir.c execl.c execle.c execlp.c execv.c execve.c execvp.c \ + popen.c creat.c isatty.c + + +CHEWOUT_FILES = + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +TARGETDOC = ../tmp.texi + +CLEANFILES = $(CHEWOUT_FILES) *.ref +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = closedir.o opendir.o readdir.o rewinddir.o scandir.o \ +seekdir.o telldir.o execl.o execle.o execlp.o execv.o execve.o execvp.o \ +popen.o creat.o isatty.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .def .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus posix/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = posix + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ +check-am installcheck-am installcheck install-info-am install-info \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +# No doc for posix. +doc: + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/posix/closedir.c b/newlib/libc/posix/closedir.c new file mode 100644 index 000000000..4ad6e4c97 --- /dev/null +++ b/newlib/libc/posix/closedir.c @@ -0,0 +1,62 @@ +#ifndef HAVE_OPENDIR + +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)closedir.c 5.9 (Berkeley) 2/23/91"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include + +/* + * close a directory. + */ +int +closedir(dirp) + register DIR *dirp; +{ + int fd; + + fd = dirp->dd_fd; + dirp->dd_fd = -1; + dirp->dd_loc = 0; + (void)free((void *)dirp->dd_buf); + (void)free((void *)dirp); + return(close(fd)); +} + +#endif /* ! HAVE_OPENDIR */ diff --git a/newlib/libc/posix/creat.c b/newlib/libc/posix/creat.c new file mode 100644 index 000000000..6b1116206 --- /dev/null +++ b/newlib/libc/posix/creat.c @@ -0,0 +1,11 @@ +/* creat() "system call" */ + +/* This is needed by f2c and therefore the SPEC benchmarks. */ + +#include + +int +creat (const char *path, mode_t mode) +{ + return open (path, O_WRONLY | O_CREAT | O_TRUNC, mode); +} diff --git a/newlib/libc/posix/execl.c b/newlib/libc/posix/execl.c new file mode 100644 index 000000000..075df8eba --- /dev/null +++ b/newlib/libc/posix/execl.c @@ -0,0 +1,42 @@ +/* execl.c */ + +/* This and the other exec*.c files in this directory require + the target to provide the _execve syscall. */ + +#include <_ansi.h> +#include + +#ifdef _HAVE_STDC + +#include + +int +execl (_CONST char *path, _CONST char *arg0, ...) + +#else + +#include + +int +execl (path, arg0, va_alist) + _CONST char *path; + _CONST char *arg0; + va_dcl + +#endif + +{ + int i; + va_list args; + _CONST char *argv[256]; + + va_start (args, arg0); + argv[0] = arg0; + i = 1; + do + argv[i] = va_arg (args, _CONST char *); + while (argv[i++] != NULL); + va_end (args); + + return _execve (path, (char * _CONST *) argv, environ); +} diff --git a/newlib/libc/posix/execle.c b/newlib/libc/posix/execle.c new file mode 100644 index 000000000..439437023 --- /dev/null +++ b/newlib/libc/posix/execle.c @@ -0,0 +1,44 @@ +/* execle.c */ + +/* This and the other exec*.c files in this directory require + the target to provide the _execve syscall. */ + +#include <_ansi.h> +#include + +#ifdef _HAVE_STDC + +#include + +int +execle (_CONST char *path, _CONST char *arg0, ...) + +#else + +#include + +int +execle (path, arg0, va_alist) + _CONST char *path; + _CONST char *arg0; + va_dcl + +#endif + +{ + int i; + va_list args; + _CONST char * _CONST *envp; + _CONST char *argv[256]; + + va_start (args, arg0); + argv[0] = arg0; + i = 1; + do + argv[i] = va_arg (args, _CONST char *); + while (argv[i++] != NULL); + envp = va_arg (args, _CONST char * _CONST *); + va_end (args); + + return _execve (path, (char * _CONST *) argv, (char * _CONST *) envp); +} diff --git a/newlib/libc/posix/execlp.c b/newlib/libc/posix/execlp.c new file mode 100644 index 000000000..dd04914bc --- /dev/null +++ b/newlib/libc/posix/execlp.c @@ -0,0 +1,42 @@ +/* execlp.c */ + +/* This and the other exec*.c files in this directory require + the target to provide the _execve syscall. */ + +#include <_ansi.h> +#include + +#ifdef _HAVE_STDC + +#include + +int +execlp (_CONST char *path, _CONST char *arg0, ...) + +#else + +#include + +int +execlp (path, arg0, va_alist) + _CONST char *path; + _CONST char *arg0; + va_dcl + +#endif + +{ + int i; + va_list args; + _CONST char *argv[256]; + + va_start (args, arg0); + argv[0] = arg0; + i = 1; + do + argv[i] = va_arg (args, _CONST char *); + while (argv[i++] != NULL); + va_end (args); + + return execvp (path, (char * _CONST *) argv); +} diff --git a/newlib/libc/posix/execv.c b/newlib/libc/posix/execv.c new file mode 100644 index 000000000..42a78cb52 --- /dev/null +++ b/newlib/libc/posix/execv.c @@ -0,0 +1,15 @@ +/* execv.c */ + +/* This and the other exec*.c files in this directory require + the target to provide the _execve syscall. */ + +#include <_ansi.h> +#include + +int +_DEFUN (execv, (path, argv), + const char *path _AND + char * const argv[]) +{ + return _execve (path, (char * _CONST *) argv, environ); +} diff --git a/newlib/libc/posix/execve.c b/newlib/libc/posix/execve.c new file mode 100644 index 000000000..416144e86 --- /dev/null +++ b/newlib/libc/posix/execve.c @@ -0,0 +1,10 @@ +/* execve.c */ + +/* This and the other exec*.c files in this directory require + the target to provide the _execve syscall. */ + +int +execve (const char *path, char * const argv[], char * const envp[]) +{ + return _execve (path, argv, envp); +} diff --git a/newlib/libc/posix/execvp.c b/newlib/libc/posix/execvp.c new file mode 100644 index 000000000..6957f61b2 --- /dev/null +++ b/newlib/libc/posix/execvp.c @@ -0,0 +1,88 @@ +/* execvp.c */ + +/* This and the other exec*.c files in this directory require + the target to provide the _execve syscall. */ + +#include <_ansi.h> +#include +#include +#include +#include + +#ifdef __CYGWIN32__ +static char path_delim; +#define PATH_DELIM path_delim +#else +#define PATH_DELIM ':' +#endif + +/* + * Copy string, until c or is encountered. + * NUL-terminate the destination string (s1). + */ + +static char * +_DEFUN (strccpy, (s1, s2, c), + char *s1 _AND + char *s2 _AND + char c) +{ + char *dest = s1; + + while (*s2 && *s2 != c) + *s1++ = *s2++; + *s1 = 0; + + return dest; +} + +int +_DEFUN (execvp, (file, argv), + _CONST char *file _AND + char * _CONST argv[]) +{ + char *path = getenv ("PATH"); + char buf[MAXNAMLEN]; + + /* If $PATH doesn't exist, just pass FILE on unchanged. */ + if (!path) + return execv (file, argv); + + /* If FILE contains a directory, don't search $PATH. */ + if (strchr (file, '/') +#ifdef __CYGWIN32__ + || strchr (file, '\\') +#endif + ) + return execv (file, argv); + +#ifdef __CYGWIN32__ + /* If a drive letter is passed, the path is still an absolute one. + Technically this isn't true, but Cygwin is currently defined so + that it is. */ + if ((isalpha (file[0]) && file[1] == ':') + || file[0] == '\\') + return execv (file, argv); +#endif + +#ifdef __CYGWIN32__ + path_delim = cygwin_posix_path_list_p (path) ? ':' : ';'; +#endif + + while (*path) + { + strccpy (buf, path, PATH_DELIM); + /* An empty entry means the current directory. */ + if (*buf != 0) + strcat (buf, "/"); + strcat (buf, file); + if (execv (buf, argv) == -1 && errno != ENOENT) + return -1; + while (*path && *path != PATH_DELIM) + path++; + if (*path == PATH_DELIM) + path++; /* skip over delim */ + } + + return -1; +} diff --git a/newlib/libc/posix/isatty.c b/newlib/libc/posix/isatty.c new file mode 100644 index 000000000..3c64647a9 --- /dev/null +++ b/newlib/libc/posix/isatty.c @@ -0,0 +1,17 @@ +/* isatty.c */ + +/* Dumb implementation so programs will at least run. */ + +#include + +int +isatty (int fd) +{ + struct stat buf; + + if (fstat (fd, &buf) < 0) + return 0; + if (S_ISCHR (buf.st_mode)) + return 1; + return 0; +} diff --git a/newlib/libc/posix/opendir.c b/newlib/libc/posix/opendir.c new file mode 100644 index 000000000..f924c0b52 --- /dev/null +++ b/newlib/libc/posix/opendir.c @@ -0,0 +1,84 @@ +#ifndef HAVE_OPENDIR + +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)opendir.c 5.11 (Berkeley) 2/23/91"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include + +/* + * open a directory. + */ +DIR * +opendir(name) + const char *name; +{ + register DIR *dirp; + register int fd; + + if ((fd = open(name, 0)) == -1) + return NULL; + if (fcntl(fd, F_SETFD, 1) == -1 || + (dirp = (DIR *)malloc(sizeof(DIR))) == NULL) { + close (fd); + return NULL; + } + /* + * If CLSIZE is an exact multiple of DIRBLKSIZ, use a CLSIZE + * buffer that it cluster boundary aligned. + * Hopefully this can be a big win someday by allowing page trades + * to user space to be done by getdirentries() + */ + dirp->dd_buf = malloc (512); + dirp->dd_len = 512; + + if (dirp->dd_buf == NULL) { + close (fd); + return NULL; + } + dirp->dd_fd = fd; + dirp->dd_loc = 0; + dirp->dd_seek = 0; + /* + * Set up seek point for rewinddir. + */ + return dirp; +} + +#endif /* ! HAVE_OPENDIR */ diff --git a/newlib/libc/posix/popen.c b/newlib/libc/posix/popen.c new file mode 100644 index 000000000..f6a7421ee --- /dev/null +++ b/newlib/libc/posix/popen.c @@ -0,0 +1,170 @@ +/* $NetBSD: popen.c,v 1.11 1995/06/16 07:05:33 jtc Exp $ */ + +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software written by Ken Arnold and + * published in UNIX Review, Vol. 6, No. 8. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 +static char sccsid[] = "@(#)popen.c 8.1 (Berkeley) 6/4/93"; +#else +static char rcsid[] = "$NetBSD: popen.c,v 1.11 1995/06/16 07:05:33 jtc Exp $"; +#endif +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +static struct pid { + struct pid *next; + FILE *fp; + pid_t pid; +} *pidlist; + +FILE * +popen(program, type) + const char *program; + const char *type; +{ + struct pid *cur; + FILE *iop; + int pdes[2], pid; + + if (*type != 'r' && *type != 'w' || type[1]) { + errno = EINVAL; + return (NULL); + } + + if ((cur = malloc(sizeof(struct pid))) == NULL) + return (NULL); + + if (pipe(pdes) < 0) { + free(cur); + return (NULL); + } + + switch (pid = vfork()) { + case -1: /* Error. */ + (void)close(pdes[0]); + (void)close(pdes[1]); + free(cur); + return (NULL); + /* NOTREACHED */ + case 0: /* Child. */ + if (*type == 'r') { + if (pdes[1] != STDOUT_FILENO) { + (void)dup2(pdes[1], STDOUT_FILENO); + (void)close(pdes[1]); + } + (void) close(pdes[0]); + } else { + if (pdes[0] != STDIN_FILENO) { + (void)dup2(pdes[0], STDIN_FILENO); + (void)close(pdes[0]); + } + (void)close(pdes[1]); + } + execl(_PATH_BSHELL, "sh", "-c", program, NULL); +#ifdef __CYGWIN32__ + /* On cygwin32, we may not have /bin/sh. In that + case, try to find sh on PATH. */ + execlp("sh", "sh", "-c", program, NULL); +#endif + _exit(127); + /* NOTREACHED */ + } + + /* Parent; assume fdopen can't fail. */ + if (*type == 'r') { + iop = fdopen(pdes[0], type); + (void)close(pdes[1]); + } else { + iop = fdopen(pdes[1], type); + (void)close(pdes[0]); + } + + /* Link into list of file descriptors. */ + cur->fp = iop; + cur->pid = pid; + cur->next = pidlist; + pidlist = cur; + + return (iop); +} + +/* + * pclose -- + * Pclose returns -1 if stream is not associated with a `popened' command, + * if already `pclosed', or waitpid returns an error. + */ +int +pclose(iop) + FILE *iop; +{ + register struct pid *cur, *last; + int pstat; + pid_t pid; + + (void)fclose(iop); + + /* Find the appropriate file pointer. */ + for (last = NULL, cur = pidlist; cur; last = cur, cur = cur->next) + if (cur->fp == iop) + break; + if (cur == NULL) + return (-1); + + do { + pid = waitpid(cur->pid, &pstat, 0); + } while (pid == -1 && errno == EINTR); + + /* Remove the entry from the linked list. */ + if (last == NULL) + pidlist = cur->next; + else + last->next = cur->next; + free(cur); + + return (pid == -1 ? -1 : pstat); +} diff --git a/newlib/libc/posix/readdir.c b/newlib/libc/posix/readdir.c new file mode 100644 index 000000000..308330cb0 --- /dev/null +++ b/newlib/libc/posix/readdir.c @@ -0,0 +1,76 @@ +#ifndef HAVE_OPENDIR + +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)readdir.c 5.7 (Berkeley) 6/1/90"; +#endif /* LIBC_SCCS and not lint */ + +#include + +/* + * get next entry in a directory. + */ +struct dirent * +readdir(dirp) +register DIR *dirp; { + register struct dirent *dp; + + for (;;) { + if (dirp->dd_loc == 0) { + dirp->dd_size = getdents (dirp->dd_fd, + dirp->dd_buf, + dirp->dd_len); + + if (dirp->dd_size <= 0) + return NULL; + } + if (dirp->dd_loc >= dirp->dd_size) { + dirp->dd_loc = 0; + continue; + } + dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc); + if ((int)dp & 03) /* bogus pointer check */ + return NULL; + if (dp->d_reclen <= 0 || + dp->d_reclen > dirp->dd_len + 1 - dirp->dd_loc) + return NULL; + dirp->dd_loc += dp->d_reclen; + if (dp->d_ino == 0) + continue; + return (dp); + } +} + +#endif /* ! HAVE_OPENDIR */ diff --git a/newlib/libc/posix/rewinddir.c b/newlib/libc/posix/rewinddir.c new file mode 100644 index 000000000..6a3814b55 --- /dev/null +++ b/newlib/libc/posix/rewinddir.c @@ -0,0 +1,50 @@ +#ifndef HAVE_OPENDIR + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rewinddir.c 5.1 (Berkeley) 5/25/90"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +void +rewinddir(dirp) + DIR *dirp; +{ + _seekdir((dirp), (off_t)0); +} + +#endif /* ! HAVE_OPENDIR */ diff --git a/newlib/libc/posix/scandir.c b/newlib/libc/posix/scandir.c new file mode 100644 index 000000000..895879bac --- /dev/null +++ b/newlib/libc/posix/scandir.c @@ -0,0 +1,142 @@ +#ifndef HAVE_OPENDIR + +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)scandir.c 5.10 (Berkeley) 2/23/91"; +#endif /* LIBC_SCCS and not lint */ + +/* + * Scan the directory dirname calling select to make a list of selected + * directory entries then sort using qsort and compare routine dcomp. + * Returns the number of entries and a pointer to a list of pointers to + * struct dirent (through namelist). Returns -1 if there were any errors. + */ + +#include +#include +#include +#include +#include + +/* + * The DIRSIZ macro gives the minimum record length which will hold + * the directory entry. This requires the amount of space in struct dirent + * without the d_name field, plus enough space for the name with a terminating + * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary. + */ +#undef DIRSIZ +#define DIRSIZ(dp) \ + ((sizeof (struct dirent) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3)) + +#ifndef __P +#define __P(args) () +#endif + +int +scandir(dirname, namelist, select, dcomp) + const char *dirname; + struct dirent ***namelist; + int (*select) __P((struct dirent *)); + int (*dcomp) __P((const void *, const void *)); +{ + register struct dirent *d, *p, **names; + register size_t nitems; + struct stat stb; + long arraysz; + DIR *dirp; + + if ((dirp = opendir(dirname)) == NULL) + return(-1); + if (fstat(dirp->dd_fd, &stb) < 0) + return(-1); + + /* + * estimate the array size by taking the size of the directory file + * and dividing it by a multiple of the minimum size entry. + */ + arraysz = (stb.st_size / 24); + names = (struct dirent **)malloc(arraysz * sizeof(struct dirent *)); + if (names == NULL) + return(-1); + + nitems = 0; + while ((d = readdir(dirp)) != NULL) { + if (select != NULL && !(*select)(d)) + continue; /* just selected names */ + /* + * Make a minimum size copy of the data + */ + p = (struct dirent *)malloc(DIRSIZ(d)); + if (p == NULL) + return(-1); + p->d_ino = d->d_ino; + p->d_reclen = d->d_reclen; + p->d_namlen = d->d_namlen; + bcopy(d->d_name, p->d_name, p->d_namlen + 1); + /* + * Check to make sure the array has space left and + * realloc the maximum size. + */ + if (++nitems >= arraysz) { + if (fstat(dirp->dd_fd, &stb) < 0) + return(-1); /* just might have grown */ + arraysz = stb.st_size / 12; + names = (struct dirent **)realloc((char *)names, + arraysz * sizeof(struct dirent *)); + if (names == NULL) + return(-1); + } + names[nitems-1] = p; + } + closedir(dirp); + if (nitems && dcomp != NULL) + qsort(names, nitems, sizeof(struct dirent *), dcomp); + *namelist = names; + return(nitems); +} + +/* + * Alphabetic order comparison routine for those who want it. + */ +int +alphasort(d1, d2) + const void *d1; + const void *d2; +{ + return(strcmp((*(struct dirent **)d1)->d_name, + (*(struct dirent **)d2)->d_name)); +} + +#endif /* ! HAVE_OPENDIR */ diff --git a/newlib/libc/posix/seekdir.c b/newlib/libc/posix/seekdir.c new file mode 100644 index 000000000..dab3bfb24 --- /dev/null +++ b/newlib/libc/posix/seekdir.c @@ -0,0 +1,56 @@ +#ifndef HAVE_OPENDIR + +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)seekdir.c 5.7 (Berkeley) 6/1/90"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +/* + * Seek to an entry in a directory. + * _seekdir is in telldir.c so that it can share opaque data structures. + */ +void +seekdir(dirp, loc) + DIR *dirp; + long loc; +{ + + _seekdir(dirp, loc); +} + +#endif /* ! HAVE_OPENDIR */ diff --git a/newlib/libc/posix/telldir.c b/newlib/libc/posix/telldir.c new file mode 100644 index 000000000..90b12f99c --- /dev/null +++ b/newlib/libc/posix/telldir.c @@ -0,0 +1,133 @@ +#ifndef HAVE_OPENDIR + +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)telldir.c 5.9 (Berkeley) 2/23/91"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include + +/* + * The option SINGLEUSE may be defined to say that a telldir + * cookie may be used only once before it is freed. This option + * is used to avoid having memory usage grow without bound. + */ +#define SINGLEUSE + +/* + * One of these structures is malloced to describe the current directory + * position each time telldir is called. It records the current magic + * cookie returned by getdirentries and the offset within the buffer + * associated with that return value. + */ +struct ddloc { + struct ddloc *loc_next;/* next structure in list */ + long loc_index; /* key associated with structure */ + long loc_seek; /* magic cookie returned by getdirentries */ + long loc_loc; /* offset of entry in buffer */ +}; + +#define NDIRHASH 32 /* Num of hash lists, must be a power of 2 */ +#define LOCHASH(i) ((i)&(NDIRHASH-1)) + +static long dd_loccnt; /* Index of entry for sequential readdir's */ +static struct ddloc *dd_hash[NDIRHASH]; /* Hash list heads for ddlocs */ + +/* + * return a pointer into a directory + */ +long +telldir(dirp) + const DIR *dirp; +{ + register int index; + register struct ddloc *lp; + + if ((lp = (struct ddloc *)malloc(sizeof(struct ddloc))) == NULL) + return (-1); + index = dd_loccnt++; + lp->loc_index = index; + lp->loc_seek = dirp->dd_seek; + lp->loc_loc = dirp->dd_loc; + lp->loc_next = dd_hash[LOCHASH(index)]; + dd_hash[LOCHASH(index)] = lp; + return (index); +} + +/* + * seek to an entry in a directory. + * Only values returned by "telldir" should be passed to seekdir. + */ +void +_seekdir(dirp, loc) + register DIR *dirp; + long loc; +{ + register struct ddloc *lp; + register struct ddloc **prevlp; + struct dirent *dp; + extern long lseek(); + + prevlp = &dd_hash[LOCHASH(loc)]; + lp = *prevlp; + while (lp != NULL) { + if (lp->loc_index == loc) + break; + prevlp = &lp->loc_next; + lp = lp->loc_next; + } + if (lp == NULL) + return; + if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek) + goto found; + (void) lseek(dirp->dd_fd, lp->loc_seek, 0); + dirp->dd_seek = lp->loc_seek; + dirp->dd_loc = 0; + while (dirp->dd_loc < lp->loc_loc) { + dp = readdir(dirp); + if (dp == NULL) + break; + } +found: +#ifdef SINGLEUSE + *prevlp = lp->loc_next; + free((caddr_t)lp); +#endif +} + +#endif /* ! HAVE_OPENDIR */ diff --git a/newlib/libc/reent/Makefile.am b/newlib/libc/reent/Makefile.am new file mode 100644 index 000000000..20baf3f24 --- /dev/null +++ b/newlib/libc/reent/Makefile.am @@ -0,0 +1,55 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + closer.c \ + reent.c \ + impure.c \ + execr.c \ + fstatr.c \ + linkr.c \ + lseekr.c \ + openr.c \ + readr.c \ + signalr.c \ + sbrkr.c \ + statr.c \ + timer.c \ + writer.c + +CHEWOUT_FILES = \ + closer.def \ + reent.def \ + execr.def \ + fstatr.def \ + linkr.def \ + lseekr.def \ + openr.def \ + readr.def \ + signalr.def \ + sbrkr.def \ + statr.def \ + timer.def \ + writer.def + +SUFFIXES = .def .h + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +TARGETDOC = ../tmp.texi + +doc: $(CHEWOUT_FILES) + cat $(srcdir)/reent.tex >> $(TARGETDOC) + +impure.o: $(srcdir)/impure.c $(srcdir)/../include/sys/reent.h + +CLEANFILES = $(CHEWOUT_FILES) *.ref diff --git a/newlib/libc/reent/Makefile.in b/newlib/libc/reent/Makefile.in new file mode 100644 index 000000000..ad174b184 --- /dev/null +++ b/newlib/libc/reent/Makefile.in @@ -0,0 +1,329 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +CRT0 = @CRT0@ +EXEEXT = @EXEEXT@ +LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@ +LIBC_POSIX_LIB = @LIBC_POSIX_LIB@ +LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@ +LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@ +LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ +LIBC_SYS_LIB = @LIBC_SYS_LIB@ +LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + closer.c \ + reent.c \ + impure.c \ + execr.c \ + fstatr.c \ + linkr.c \ + lseekr.c \ + openr.c \ + readr.c \ + signalr.c \ + sbrkr.c \ + statr.c \ + timer.c \ + writer.c + + +CHEWOUT_FILES = \ + closer.def \ + reent.def \ + execr.def \ + fstatr.def \ + linkr.def \ + lseekr.def \ + openr.def \ + readr.def \ + signalr.def \ + sbrkr.def \ + statr.def \ + timer.def \ + writer.def + + +SUFFIXES = .def .h + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +TARGETDOC = ../tmp.texi + +CLEANFILES = $(CHEWOUT_FILES) *.ref +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = closer.o reent.o impure.o execr.o fstatr.o linkr.o \ +lseekr.o openr.o readr.o signalr.o sbrkr.o statr.o timer.o writer.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .def .h .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus reent/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = reent + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ +check-am installcheck-am installcheck install-info-am install-info \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +doc: $(CHEWOUT_FILES) + cat $(srcdir)/reent.tex >> $(TARGETDOC) + +impure.o: $(srcdir)/impure.c $(srcdir)/../include/sys/reent.h + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/reent/closer.c b/newlib/libc/reent/closer.c new file mode 100644 index 000000000..aeacebd6c --- /dev/null +++ b/newlib/libc/reent/closer.c @@ -0,0 +1,58 @@ +/* Reentrant version of close system call. */ + +#include +#include +#include <_syslist.h> + +/* Some targets provides their own versions of this functions. Those + targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */ + +#ifdef _REENT_ONLY +#ifndef REENTRANT_SYSCALLS_PROVIDED +#define REENTRANT_SYSCALLS_PROVIDED +#endif +#endif + +#ifndef REENTRANT_SYSCALLS_PROVIDED + +/* We use the errno variable used by the system dependent layer. */ +#undef errno +extern int errno; + +/* +FUNCTION + <<_close_r>>---Reentrant version of close + +INDEX + _close_r + +ANSI_SYNOPSIS + #include + int _close_r(struct _reent *<[ptr]>, int <[fd]>); + +TRAD_SYNOPSIS + #include + int _close_r(<[ptr]>, <[fd]>) + struct _reent *<[ptr]>; + int <[fd]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. +*/ + +int +_close_r (ptr, fd) + struct _reent *ptr; + int fd; +{ + int ret; + + errno = 0; + if ((ret = _close (fd)) == -1 && errno != 0) + ptr->_errno = errno; + return ret; +} + +#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */ diff --git a/newlib/libc/reent/execr.c b/newlib/libc/reent/execr.c new file mode 100644 index 000000000..9e8f75a65 --- /dev/null +++ b/newlib/libc/reent/execr.c @@ -0,0 +1,144 @@ +/* Reentrant versions of execution system calls. These + implementations just call the usual system calls. */ + +#include +#include +#include <_syslist.h> + +/* Some targets provides their own versions of these functions. Those + targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */ + +#ifdef _REENT_ONLY +#ifndef REENTRANT_SYSCALLS_PROVIDED +#define REENTRANT_SYSCALLS_PROVIDED +#endif +#endif + +/* If NO_EXEC is defined, we don't need these functions. */ + +#if defined (REENTRANT_SYSCALLS_PROVIDED) || defined (NO_EXEC) + +int _dummy_exec_syscalls = 1; + +#else + +/* We use the errno variable used by the system dependent layer. */ +#undef errno +extern int errno; + +/* +FUNCTION + <<_execve_r>>---Reentrant version of execve +INDEX + _execve_r + +ANSI_SYNOPSIS + #include + int _execve_r(struct _reent *<[ptr]>, char *<[name]>, + char **<[argv]>, char **<[env]>); + +TRAD_SYNOPSIS + #include + int _execve_r(<[ptr]>, <[name]>, <[argv]>, <[env]>) + struct _reent *<[ptr]>; + char *<[name]>; + char **<[argv]>; + char **<[env]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. +*/ + +int +_execve_r (ptr, name, argv, env) + struct _reent *ptr; + char *name; + char **argv; + char **env; +{ + int ret; + + errno = 0; + if ((ret = _execve (name, argv, env)) == -1 && errno != 0) + ptr->_errno = errno; + return ret; +} + + +/* +FUNCTION + <<_fork_r>>---Reentrant version of fork + +INDEX + _fork_r + +ANSI_SYNOPSIS + #include + int _fork_r(struct _reent *<[ptr]>); + +TRAD_SYNOPSIS + #include + int _fork_r(<[ptr]>) + struct _reent *<[ptr]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. +*/ + +#ifndef NO_FORK + +int +_fork_r (ptr) + struct _reent *ptr; +{ + int ret; + + errno = 0; + if ((ret = _fork ()) == -1 && errno != 0) + ptr->_errno = errno; + return ret; +} + +#endif + +/* +FUNCTION + <<_wait_r>>---Reentrant version of wait + +INDEX + _wait_r + +ANSI_SYNOPSIS + #include + int _wait_r(struct _reent *<[ptr]>, int *<[status]>); + +TRAD_SYNOPSIS + #include + int _wait_r(<[ptr]>, <[status]>) + struct _reent *<[ptr]>; + int *<[status]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. +*/ + +int +_wait_r (ptr, status) + struct _reent *ptr; + int *status; +{ + int ret; + + errno = 0; + if ((ret = _wait (status)) == -1 && errno != 0) + ptr->_errno = errno; + return ret; +} + +#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */ diff --git a/newlib/libc/reent/fstatr.c b/newlib/libc/reent/fstatr.c new file mode 100644 index 000000000..df132d799 --- /dev/null +++ b/newlib/libc/reent/fstatr.c @@ -0,0 +1,66 @@ +/* Reentrant versions of fstat system call. This implementation just + calls the fstat system call. */ + +#include +#include +#include <_syslist.h> + +/* Some targets provides their own versions of these functions. Those + targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */ + +#ifdef _REENT_ONLY +#ifndef REENTRANT_SYSCALLS_PROVIDED +#define REENTRANT_SYSCALLS_PROVIDED +#endif +#endif + +#ifdef REENTRANT_SYSCALLS_PROVIDED + +int _dummy_fstat_syscalls = 1; + +#else + +/* We use the errno variable used by the system dependent layer. */ +#undef errno +extern int errno; + +/* +FUNCTION + <<_fstat_r>>---Reentrant version of fstat + +INDEX + _fstat_r + +ANSI_SYNOPSIS + #include + int _fstat_r(struct _reent *<[ptr]>, + int <[fd]>, struct stat *<[pstat]>); + +TRAD_SYNOPSIS + #include + int _fstat_r(<[ptr]>, <[fd]>, <[pstat]>) + struct _reent *<[ptr]>; + int <[fd]>; + struct stat *<[pstat]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. +*/ + +int +_fstat_r (ptr, fd, pstat) + struct _reent *ptr; + int fd; + struct stat *pstat; +{ + int ret; + + errno = 0; + if ((ret = _fstat (fd, pstat)) == -1 && errno != 0) + ptr->_errno = errno; + return ret; +} + +#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */ diff --git a/newlib/libc/reent/impure.c b/newlib/libc/reent/impure.c new file mode 100644 index 000000000..a14f5c3cd --- /dev/null +++ b/newlib/libc/reent/impure.c @@ -0,0 +1,13 @@ +#include + +/* Note that there is a copy of this in sys/reent.h. */ +#ifndef __ATTRIBUTE_IMPURE_PTR__ +#define __ATTRIBUTE_IMPURE_PTR__ +#endif + +#ifndef __ATTRIBUTE_IMPURE_DATA__ +#define __ATTRIBUTE_IMPURE_DATA__ +#endif + +static struct _reent __ATTRIBUTE_IMPURE_DATA__ impure_data = _REENT_INIT (impure_data); +struct _reent *__ATTRIBUTE_IMPURE_PTR__ _impure_ptr = &impure_data; diff --git a/newlib/libc/reent/linkr.c b/newlib/libc/reent/linkr.c new file mode 100644 index 000000000..a15d2238c --- /dev/null +++ b/newlib/libc/reent/linkr.c @@ -0,0 +1,102 @@ +/* Reentrant versions of file system calls. These implementations + just call the usual system calls. */ + +#include +#include +#include <_syslist.h> + +/* Some targets provides their own versions of these functions. Those + targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */ + +#ifdef _REENT_ONLY +#ifndef REENTRANT_SYSCALLS_PROVIDED +#define REENTRANT_SYSCALLS_PROVIDED +#endif +#endif + +#ifdef REENTRANT_SYSCALLS_PROVIDED + +int _dummy_link_syscalls = 1; + +#else + +/* We use the errno variable used by the system dependent layer. */ +#undef errno +extern int errno; + +/* +FUNCTION + <<_link_r>>---Reentrant version of link + +INDEX + _link_r + +ANSI_SYNOPSIS + #include + int _link_r(struct _reent *<[ptr]>, + const char *<[old]>, const char *<[new]>); + +TRAD_SYNOPSIS + #include + int _link_r(<[ptr]>, <[old]>, <[new]>) + struct _reent *<[ptr]>; + char *<[old]>; + char *<[new]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. +*/ + +int +_link_r (ptr, old, new) + struct _reent *ptr; + _CONST char *old; + _CONST char *new; +{ + int ret; + + errno = 0; + if ((ret = _link (old, new)) == -1 && errno != 0) + ptr->_errno = errno; + return ret; +} + +/* +FUNCTION + <<_unlink_r>>---Reentrant version of unlink + +INDEX + _unlink_r + +ANSI_SYNOPSIS + #include + int _unlink_r(struct _reent *<[ptr]>, const char *<[file]>); + +TRAD_SYNOPSIS + #include + int _unlink_r(<[ptr]>, <[file]>) + struct _reent *<[ptr]>; + char *<[file]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. +*/ + +int +_unlink_r (ptr, file) + struct _reent *ptr; + _CONST char *file; +{ + int ret; + + errno = 0; + if ((ret = _unlink (file)) == -1 && errno != 0) + ptr->_errno = errno; + return ret; +} + +#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */ diff --git a/newlib/libc/reent/lseekr.c b/newlib/libc/reent/lseekr.c new file mode 100644 index 000000000..ed8ba13ed --- /dev/null +++ b/newlib/libc/reent/lseekr.c @@ -0,0 +1,63 @@ +/* Reentrant versions of lseek system call. */ + +#include +#include +#include <_syslist.h> + +/* Some targets provides their own versions of this functions. Those + targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */ + +#ifdef _REENT_ONLY +#ifndef REENTRANT_SYSCALLS_PROVIDED +#define REENTRANT_SYSCALLS_PROVIDED +#endif +#endif + +#ifndef REENTRANT_SYSCALLS_PROVIDED + +/* We use the errno variable used by the system dependent layer. */ +#undef errno +extern int errno; + +/* +FUNCTION + <<_lseek_r>>---Reentrant version of lseek + +INDEX + _lseek_r + +ANSI_SYNOPSIS + #include + off_t _lseek_r(struct _reent *<[ptr]>, + int <[fd]>, off_t <[pos]>, int <[whence]>); + +TRAD_SYNOPSIS + #include + off_t _lseek_r(<[ptr]>, <[fd]>, <[pos]>, <[whence]>) + struct _reent *<[ptr]>; + int <[fd]>; + off_t <[pos]>; + int <[whence]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. +*/ + +off_t +_lseek_r (ptr, fd, pos, whence) + struct _reent *ptr; + int fd; + off_t pos; + int whence; +{ + off_t ret; + + errno = 0; + if ((ret = _lseek (fd, pos, whence)) == (off_t) -1 && errno != 0) + ptr->_errno = errno; + return ret; +} + +#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */ diff --git a/newlib/libc/reent/openr.c b/newlib/libc/reent/openr.c new file mode 100644 index 000000000..2e3b608d7 --- /dev/null +++ b/newlib/libc/reent/openr.c @@ -0,0 +1,64 @@ +/* Reentrant versions of open system call. */ + +#include +#include +#include <_syslist.h> + +/* Some targets provides their own versions of this functions. Those + targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */ + +#ifdef _REENT_ONLY +#ifndef REENTRANT_SYSCALLS_PROVIDED +#define REENTRANT_SYSCALLS_PROVIDED +#endif +#endif + +#ifndef REENTRANT_SYSCALLS_PROVIDED + +/* We use the errno variable used by the system dependent layer. */ +#undef errno +extern int errno; + +/* +FUNCTION + <<_open_r>>---Reentrant version of open + +INDEX + _open_r + +ANSI_SYNOPSIS + #include + int _open_r(struct _reent *<[ptr]>, + const char *<[file]>, int <[flags]>, int <[mode]>); + +TRAD_SYNOPSIS + #include + int _open_r(<[ptr]>, <[file]>, <[flags]>, <[mode]>) + struct _reent *<[ptr]>; + char *<[file]>; + int <[flags]>; + int <[mode]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. +*/ + +int +_open_r (ptr, file, flags, mode) + struct _reent *ptr; + _CONST char *file; + int flags; + int mode; +{ + int ret; + + errno = 0; + if ((ret = _open (file, flags, mode)) == -1 && errno != 0) + ptr->_errno = errno; + return ret; +} + + +#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */ diff --git a/newlib/libc/reent/readr.c b/newlib/libc/reent/readr.c new file mode 100644 index 000000000..e3deca9a7 --- /dev/null +++ b/newlib/libc/reent/readr.c @@ -0,0 +1,63 @@ +/* Reentrant versions of read system call. */ + +#include +#include +#include <_syslist.h> + +/* Some targets provides their own versions of this functions. Those + targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */ + +#ifdef _REENT_ONLY +#ifndef REENTRANT_SYSCALLS_PROVIDED +#define REENTRANT_SYSCALLS_PROVIDED +#endif +#endif + +#ifndef REENTRANT_SYSCALLS_PROVIDED + +/* We use the errno variable used by the system dependent layer. */ +#undef errno +extern int errno; + +/* +FUNCTION + <<_read_r>>---Reentrant version of read + +INDEX + _read_r + +ANSI_SYNOPSIS + #include + long _read_r(struct _reent *<[ptr]>, + int <[fd]>, void *<[buf]>, size_t <[cnt]>); + +TRAD_SYNOPSIS + #include + long _read_r(<[ptr]>, <[fd]>, <[buf]>, <[cnt]>) + struct _reent *<[ptr]>; + int <[fd]>; + char *<[buf]>; + size_t <[cnt]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. +*/ + +long +_read_r (ptr, fd, buf, cnt) + struct _reent *ptr; + int fd; + _PTR buf; + size_t cnt; +{ + long ret; + + errno = 0; + if ((ret = _read (fd, buf, cnt)) == -1 && errno != 0) + ptr->_errno = errno; + return ret; +} + +#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */ diff --git a/newlib/libc/reent/reent.c b/newlib/libc/reent/reent.c new file mode 100644 index 000000000..93b3e86c8 --- /dev/null +++ b/newlib/libc/reent/reent.c @@ -0,0 +1,107 @@ +/* +FUNCTION + <>---definition of impure data. + +INDEX + reent + +DESCRIPTION + This module defines the impure data area used by the + non-rentrant functions, such as strtok. +*/ + +#include + +/* Interim cleanup code */ + +void +cleanup_glue (ptr, glue) + struct _reent *ptr; + struct _glue *glue; +{ + /* Have to reclaim these in reverse order: */ + if (glue->_next) + cleanup_glue (ptr, glue->_next); + + _free_r (ptr, glue); +} + +void +_reclaim_reent (ptr) + struct _reent *ptr; +{ + if (ptr != _impure_ptr) + { + /* used by mprec routines. */ + if (ptr->_freelist) + { + int i; + for (i = 0; i < 15 /* _Kmax */; i++) + { + struct _Bigint *thisone, *nextone; + + nextone = ptr->_freelist[i]; + while (nextone) + { + thisone = nextone; + nextone = nextone->_next; + _free_r (ptr, thisone); + } + } + + _free_r (ptr, ptr->_freelist); + } + + /* atexit stuff */ + if ((ptr->_atexit) && (ptr->_atexit != &ptr->_atexit0)) + { + struct _atexit *p, *q; + for (p = ptr->_atexit; p != &ptr->_atexit0;) + { + q = p; + p = p->_next; + _free_r (ptr, q); + } + } + + if (ptr->_cvtbuf) + _free_r (ptr, ptr->_cvtbuf); + + if (ptr->__sdidinit) + { + /* cleanup won't reclaim memory 'coz usually it's run + before the program exits, and who wants to wait for that? */ + ptr->__cleanup (ptr); + + if (ptr->__sglue._next) + cleanup_glue (ptr, ptr->__sglue._next); + } + + /* Malloc memory not reclaimed; no good way to return memory anyway. */ + + } +} + +/* + * Do atexit() processing and cleanup + * + * NOTE: This is to be executed at task exit. It does not tear anything + * down which is used on a global basis. + */ + +void +_wrapup_reent(struct _reent *ptr) +{ + register struct _atexit *p; + register int n; + + if (ptr == 0) + ptr = _REENT; + + for (p = ptr->_atexit; p; p = p->_next) + for (n = p->_ind; --n >= 0;) + (*p->_fns[n]) (); + if (ptr->__cleanup) + (*ptr->__cleanup) (ptr); +} + diff --git a/newlib/libc/reent/reent.tex b/newlib/libc/reent/reent.tex new file mode 100644 index 000000000..71a0a0dcd --- /dev/null +++ b/newlib/libc/reent/reent.tex @@ -0,0 +1,108 @@ +@node Reentrancy +@chapter Reentrancy + +@cindex reentrancy +Reentrancy is a characteristic of library functions which allows multiple +processes to use the same address space with assurance that the values stored +in those spaces will remain constant between calls. Cygnus's implementation +of the library functions ensures that +whenever possible, these library functions are reentrant. However, +there are some functions that can not be trivially made reentrant. +Hooks have been provided to allow you to use these functions in a fully +reentrant fashion. + +@findex _reent +@findex reent.h +@cindex reentrancy structure +These hooks use the structure @code{_reent} defined in @file{reent.h}. +A variable defined as @samp{struct _reent} is called a @dfn{reentrancy +structure}. All functions which must manipulate global information are +available in two versions. The first version has the usual name, and +uses a single global instance of the reentrancy structure. The second +has a different name, normally formed by prepending @samp{_} and +appending @samp{_r}, and takes a pointer to the particular reentrancy +structure to use. + +For example, the function @code{fopen} takes two arguments, @var{file} +and @var{mode}, and uses the global reentrancy structure. The function +@code{_fopen_r} takes the arguments, @var{struct_reent}, which is a +pointer to an instance of the reentrancy structure, @var{file} +and @var{mode}. + +@cindex global reentrancy structure +@findex _impure_ptr +Each function which uses the global reentrancy structure uses the global +variable @code{_impure_ptr}, which points to a reentrancy structure. + +This means that you have two ways to achieve reentrancy. Both require +that each thread of execution control initialize a unique global +variable of type @samp{struct _reent}: + +@enumerate +@item +@cindex extra argument, reentrant fns +Use the reentrant versions of the library functions, after initializing +a global reentrancy structure for each process. Use the pointer to this +structure as the extra argument for all library functions. + +@item +Ensure that each thread of execution control has a pointer to its own +unique reentrancy structure in the global variable @code{_impure_ptr}, +and call the standard library subroutines. +@end enumerate + +@cindex list of reentrant functions +@cindex reentrant function list +The following functions are provided in both reentrant +and non-reentrant versions. + +@example +@exdent @emph{Equivalent for errno variable:} +_errno_r + +@exdent @emph{Locale functions:} +_localeconv_r _setlocale_r + +@exdent @emph{Equivalents for stdio variables:} +_stdin_r _stdout_r _stderr_r + +@page +@exdent @emph{Stdio functions:} +_fdopen_r _perror_r _tempnam_r +_fopen_r _putchar_r _tmpnam_r +_getchar_r _puts_r _tmpfile_r +_gets_r _remove_r _vfprintf_r +_iprintf_r _rename_r _vsnprintf_r +_mkstemp_r _snprintf_r _vsprintf_r +_mktemp_t _sprintf_r + +@exdent @emph{Signal functions:} +_init_signal_r _signal_r +_kill_r __sigtramp_r +_raise_r + +@exdent @emph{Stdlib functions:} +_calloc_r _mblen_r _setenv_r +_dtoa_r _mbstowcs_r _srand_r +_free_r _mbtowc_r _strtod_r +_getenv_r _memalign_r _strtol_r +_mallinfo_r _mstats_r _strtoul_r +_malloc_r _putenv_r _system_r +_malloc_r _rand_r _wcstombs_r +_malloc_stats_r _realloc_r _wctomb_r + +@exdent @emph{String functions:} +_strdup_r _strtok_r + +@exdent @emph{System functions:} +_close_r _link_r _unlink_r +_execve_r _lseek_r _wait_r +_fcntl_r _open_r _write_r +_fork_r _read_r +_fstat_r _sbrk_r +_gettimeofday_r _stat_r +_getpid_r _times_r + +@exdent @emph{Time function:} +_asctime_r +@end example diff --git a/newlib/libc/reent/sbrkr.c b/newlib/libc/reent/sbrkr.c new file mode 100644 index 000000000..7f6930ead --- /dev/null +++ b/newlib/libc/reent/sbrkr.c @@ -0,0 +1,66 @@ +/* Reentrant versions of sbrk system call. This implementation just + calls the stat system call. */ + +#include +#include +#include <_syslist.h> + +/* Some targets provides their own versions of these functions. Those + targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */ + +#ifdef _REENT_ONLY +#ifndef REENTRANT_SYSCALLS_PROVIDED +#define REENTRANT_SYSCALLS_PROVIDED +#endif +#endif + +/* If MALLOC_PROVIDED is defined, we don't need this function. */ + +#if defined (REENTRANT_SYSCALLS_PROVIDED) || defined (MALLOC_PROVIDED) + +int _dummy_sbrk_syscalls = 1; + +#else + +/* We use the errno variable used by the system dependent layer. */ +#undef errno +int errno; + +/* +FUNCTION + <<_sbrk_r>>---Reentrant version of sbrk + +INDEX + _sbrk_r + +ANSI_SYNOPSIS + #include + void *_sbrk_r(struct _reent *<[ptr]>, size_t <[incr]>); + +TRAD_SYNOPSIS + #include + void *_sbrk_r(<[ptr]>, <[incr]>) + struct _reent *<[ptr]>; + size_t <[incr]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. +*/ + +void * +_sbrk_r (ptr, incr) + struct _reent *ptr; + size_t incr; +{ + char *ret; + void *_sbrk(size_t); + + errno = 0; + if ((ret = (char *)(_sbrk (incr))) == (void *) -1 && errno != 0) + ptr->_errno = errno; + return ret; +} + +#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */ diff --git a/newlib/libc/reent/signalr.c b/newlib/libc/reent/signalr.c new file mode 100644 index 000000000..7c85af142 --- /dev/null +++ b/newlib/libc/reent/signalr.c @@ -0,0 +1,98 @@ +/* Reentrant versions of syscalls need to support signal/raise. + These implementations just call the usual system calls. */ + +#include +#include <_syslist.h> + +/* Some targets provides their own versions of these functions. Those + targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */ + +#ifdef _REENT_ONLY +#ifndef REENTRANT_SYSCALLS_PROVIDED +#define REENTRANT_SYSCALLS_PROVIDED +#endif +#endif + +#ifdef REENTRANT_SYSCALLS_PROVIDED + +int _dummy_link_syscalls = 1; + +#else + +/* We use the errno variable used by the system dependent layer. */ +#undef errno +extern int errno; + +/* +FUNCTION + <<_kill_r>>---Reentrant version of kill + +INDEX + _kill_r + +ANSI_SYNOPSIS + #include + int _kill_r(struct _reent *<[ptr]>, int <[pid]>, int <[sig]>); + +TRAD_SYNOPSIS + #include + int _kill_r(<[ptr]>, <[pid]>, <[sig]>) + struct _reent *<[ptr]>; + int <[pid]>; + int <[sig]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. +*/ + +int +_kill_r (ptr, pid, sig) + struct _reent *ptr; + int pid; + int sig; +{ + int ret; + + errno = 0; + if ((ret = _kill (pid, sig)) == -1 && errno != 0) + ptr->_errno = errno; + return ret; +} + +/* +FUNCTION + <<_getpid_r>>---Reentrant version of getpid + +INDEX + _getpid_r + +ANSI_SYNOPSIS + #include + int _getpid_r(struct _reent *<[ptr]>); + +TRAD_SYNOPSIS + #include + int _getpid_r(<[ptr]>) + struct _reent *<[ptr]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. + + We never need <>, of course, but for consistency we + still must have the reentrant pointer argument. +*/ + +int +_getpid_r (ptr) + struct _reent *ptr; +{ + int ret; + ret = _getpid (); + return ret; +} + +#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */ diff --git a/newlib/libc/reent/statr.c b/newlib/libc/reent/statr.c new file mode 100644 index 000000000..55d29bdb8 --- /dev/null +++ b/newlib/libc/reent/statr.c @@ -0,0 +1,67 @@ +/* Reentrant versions of stat system call. This implementation just + calls the stat system call. */ + +#include +#include +#include <_syslist.h> + +/* Some targets provides their own versions of these functions. Those + targets should define REENTRANT_SYSCALLS_PROVIDED in + TARGET_CFLAGS. */ + +#ifdef _REENT_ONLY +#ifndef REENTRANT_SYSCALLS_PROVIDED +#define REENTRANT_SYSCALLS_PROVIDED +#endif +#endif + +#ifdef REENTRANT_SYSCALLS_PROVIDED + +int _dummy_stat_syscalls = 1; + +#else + +/* We use the errno variable used by the system dependent layer. */ +#undef errno +extern int errno; + +/* +FUNCTION + <<_stat_r>>---Reentrant version of stat + +INDEX + _stat_r + +ANSI_SYNOPSIS + #include + int _stat_r(struct _reent *<[ptr]>, + const char *<[file]>, struct stat *<[pstat]>); + +TRAD_SYNOPSIS + #include + int _stat_r(<[ptr]>, <[file]>, <[pstat]>) + struct _reent *<[ptr]>; + char *<[file]>; + struct stat *<[pstat]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. +*/ + +int +_stat_r (ptr, file, pstat) + struct _reent *ptr; + _CONST char *file; + struct stat *pstat; +{ + int ret; + + errno = 0; + if ((ret = _stat (file, pstat)) == -1 && errno != 0) + ptr->_errno = errno; + return ret; +} + +#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */ diff --git a/newlib/libc/reent/timer.c b/newlib/libc/reent/timer.c new file mode 100644 index 000000000..526b4d135 --- /dev/null +++ b/newlib/libc/reent/timer.c @@ -0,0 +1,112 @@ +/* Reentrant versions of times and gettimeofday system calls for the + clock and time ANSI C routines. + This implementation just calls the times/gettimeofday system calls. + Gettimeofday may not be available on all targets. It's presence + here is dubious. Consider it for internal use only. */ + +#include +#include +#include +#include <_syslist.h> + +/* Some targets provides their own versions of these functions. Those + targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */ + +#ifdef _REENT_ONLY +#ifndef REENTRANT_SYSCALLS_PROVIDED +#define REENTRANT_SYSCALLS_PROVIDED +#endif +#endif + +#ifdef REENTRANT_SYSCALLS_PROVIDED + +int _dummy_time_syscalls = 1; + +#else + +/* We use the errno variable used by the system dependent layer. */ +#undef errno +extern int errno; + +/* +FUNCTION + <<_times_r>>---Reentrant version of times + +INDEX + _times_r + +ANSI_SYNOPSIS + #include + #include + clock_t _times_r(struct _reent *<[ptr]>, struct tms *<[ptms]>); + +TRAD_SYNOPSIS + #include + #include + clock_t _times_r(<[ptr]>, <[ptms]>) + struct _reent *<[ptr]>; + struct tms *<[ptms]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. +*/ + +clock_t +_times_r (ptr, ptms) + struct _reent *ptr; + struct tms *ptms; +{ + clock_t ret; + + ret = _times (ptms); + return ret; +} + +/* +FUNCTION + <<_gettimeofday_r>>---Reentrant version of gettimeofday + +INDEX + _gettimeofday_r + +ANSI_SYNOPSIS + #include + #include + int _gettimeofday_r(struct _reent *<[ptr]>, + struct timeval *<[ptimeval]>, + struct timezone *<[ptimezone]>); + +TRAD_SYNOPSIS + #include + #include + int _gettimeofday_r(<[ptr]>, <[ptimeval]>, <[ptimezone]>) + struct _reent *<[ptr]>; + struct timeval *<[ptimeval]>; + struct timezone *<[ptimezone]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. + + This function is only available for a few targets. + Check libc.a to see if its available on yours. +*/ + +int +_gettimeofday_r (ptr, ptimeval, ptimezone) + struct _reent *ptr; + struct timeval *ptimeval; + struct timezone *ptimezone; +{ + int ret; + + errno = 0; + if ((ret = _gettimeofday (ptimeval, ptimezone)) == -1 && errno != 0) + ptr->_errno = errno; + return ret; +} + +#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */ diff --git a/newlib/libc/reent/writer.c b/newlib/libc/reent/writer.c new file mode 100644 index 000000000..ac10286e8 --- /dev/null +++ b/newlib/libc/reent/writer.c @@ -0,0 +1,63 @@ +/* Reentrant versions of write system call. */ + +#include +#include +#include <_syslist.h> + +/* Some targets provides their own versions of this functions. Those + targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */ + +#ifdef _REENT_ONLY +#ifndef REENTRANT_SYSCALLS_PROVIDED +#define REENTRANT_SYSCALLS_PROVIDED +#endif +#endif + +#ifndef REENTRANT_SYSCALLS_PROVIDED + +/* We use the errno variable used by the system dependent layer. */ +#undef errno +extern int errno; + +/* +FUNCTION + <<_write_r>>---Reentrant version of write + +INDEX + _write_r + +ANSI_SYNOPSIS + #include + long _write_r(struct _reent *<[ptr]>, + int <[fd]>, const void *<[buf]>, size_t <[cnt]>); + +TRAD_SYNOPSIS + #include + long _write_r(<[ptr]>, <[fd]>, <[buf]>, <[cnt]>) + struct _reent *<[ptr]>; + int <[fd]>; + char *<[buf]>; + size_t <[cnt]>; + +DESCRIPTION + This is a reentrant version of <>. It + takes a pointer to the global data block, which holds + <>. +*/ + +long +_write_r (ptr, fd, buf, cnt) + struct _reent *ptr; + int fd; + _CONST _PTR buf; + size_t cnt; +{ + long ret; + + errno = 0; + if ((ret = _write (fd, buf, cnt)) == -1 && errno != 0) + ptr->_errno = errno; + return ret; +} + +#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */ diff --git a/newlib/libc/saber b/newlib/libc/saber new file mode 100644 index 000000000..4f16f976e --- /dev/null +++ b/newlib/libc/saber @@ -0,0 +1,185 @@ +setopt sys_load_flags -L/lib -L/usr/lib -I/limbo/unsupported/packages/CenterLine/general/unsupported/sparc +setopt load_flags -I./include -I./machine/sparc -I./sys/sun4 + + +load signal/raise.c +load signal/signal.c +load stdio/clearerr.c +load stdio/cvt.c +load stdio/dcvt.c +load stdio/fclose.c +load stdio/feof.c +load stdio/ferror.c +load stdio/fflush.c +load stdio/fgetc.c +load stdio/fgetpos.c +load stdio/fgets.c +load stdio/findfp.c +load stdio/flags.c +load stdio/fopen.c + +load stdio/fputc.c +load stdio/fputs.c +load stdio/fread.c +load stdio/freopen.c +load stdio/fscanf.c +load stdio/fseek.c +load stdio/fsetpos.c +load stdio/ftell.c +load stdio/fvwrite.c +load stdio/fwalk.c +load stdio/fwrite.c +load stdio/getc.c +load stdio/getchar.c +load stdio/gets.c +load stdio/iprintf.c +load stdio/makebuf.c +load stdio/perror.c +load stdio/printf.c +load stdio/putc.c +load stdio/putchar.c +load stdio/puts.c +load stdio/refill.c +load stdio/remove.c +load stdio/rename.c +load stdio/rewind.c +load stdio/rget.c +load stdio/scanf.c +load stdio/setbuf.c +load stdio/setvbuf.c +load stdio/sprintf.c +load stdio/sscanf.c +load stdio/stdio.c +load stdio/tmpfile.c +load stdio/tmpnam.c +load stdio/ungetc.c +load stdio/vfiprintf.c +load stdio/vfprintf.c +load stdio/vfscanf.c +load stdio/vprintf.c +load stdio/vsprintf.c +load stdio/wbuf.c +load stdio/wsetup.c +load stdlib/__adjust.c +load stdlib/__exp10.c +load stdlib/__ten_mu.c +load stdlib/abort.c +load stdlib/abs.c +load stdlib/assert.c +load stdlib/atexit.c +load stdlib/atof.c +load stdlib/atoi.c +load stdlib/atol.c +load stdlib/bsearch.c +load stdlib/calloc.c +load stdlib/div.c +load stdlib/efgcvt.c +load stdlib/exit.c +load stdlib/getenv.c +load stdlib/labs.c +load stdlib/ldiv.c +load stdlib/malloc.c +load stdlib/mbtowc.c +load stdlib/qsort.c +load stdlib/rand.c +load stdlib/strtod.c +load stdlib/strtol.c +load stdlib/strtoul.c +load stdlib/system.c +load stdlib/wctomb.c +load string/bcmp.c +load string/bcopy.c +load string/bzero.c +load string/index.c +load string/memchr.c +load string/memcmp.c +load string/memcpy.c +load string/memmove.c +load string/memset.c +load string/rindex.c +load string/strcat.c +load string/strchr.c +load string/strcmp.c +load string/strcoll.c +load string/strcpy.c +load string/strcspn.c +load string/strerror.c +load string/strlen.c +load string/strncat.c +load string/strncmp.c +load string/strncpy.c +load string/strpbrk.c +load string/strrchr.c +load string/strspn.c +load string/strstr.c +load string/strtok.c +load string/strxfrm.c +time/asctime.c +time/clock.c +time/ctime.c +time/difftime.c +time/gmtime.c +time/localtime.c +time/mktime.c +time/strftime.c + + +load stdio/fiprintf.c +load stdio/fprintf.c +load ctype/ctype_.c +load ctype/isalnum.c +load ctype/isalpha.c +load ctype/isascii.c +load ctype/iscntrl.c +load ctype/isdigit.c +load ctype/islower.c +load ctype/isprint.c +load ctype/ispunct.c +load ctype/isspace.c +load ctype/isupper.c +load ctype/isxdigit.c +load ctype/toascii.c +load ctype/tolower.c +load ctype/toupper.c +load errno/errno.c +/*load ieeefp/fpmask.c +load ieeefp/fpround.c +load ieeefp/fpsticky.c +load ieeefp/infinity.c +load ieeefp/isnan.c +load locale/locale.c +load math/acos.c +load math/acosh.c +load math/asin.c +load math/asinh.c +load math/atan.c +load math/atan2.c +load math/atanh.c +load math/bessel.c +load math/copysign.c +load math/cosh.c +load math/erf.c +load math/error.c +load math/exp.c +load math/fabs.c +load math/floor.c +load math/fmod.c +load math/frexp.c +load math/gamma.c +load math/hypot.c +load math/ldexp.c +load math/log.c +load math/log10.c +load math/log1p.c +load math/log2.c +load math/log__L.c +load math/matherr.c +load math/modf.c +load math/pow.c +load math/scalb.c +load math/sincos.c +load math/sinh.c +load math/sqrt.c +load math/tan.c +load math/tanh.c +*/ diff --git a/newlib/libc/signal/Makefile.am b/newlib/libc/signal/Makefile.am new file mode 100644 index 000000000..038948b6d --- /dev/null +++ b/newlib/libc/signal/Makefile.am @@ -0,0 +1,26 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = raise.c signal.c + +CHEWOUT_FILES = raise.def signal.def + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +TARGETDOC = ../tmp.texi + +doc: $(CHEWOUT_FILES) + cat $(srcdir)/signal.tex >> $(TARGETDOC) + +CLEANFILES = $(CHEWOUT_FILES) *.ref diff --git a/newlib/libc/signal/Makefile.in b/newlib/libc/signal/Makefile.in new file mode 100644 index 000000000..9d2cb1ee5 --- /dev/null +++ b/newlib/libc/signal/Makefile.in @@ -0,0 +1,297 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +CRT0 = @CRT0@ +EXEEXT = @EXEEXT@ +LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@ +LIBC_POSIX_LIB = @LIBC_POSIX_LIB@ +LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@ +LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@ +LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ +LIBC_SYS_LIB = @LIBC_SYS_LIB@ +LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = raise.c signal.c + +CHEWOUT_FILES = raise.def signal.def + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +TARGETDOC = ../tmp.texi + +CLEANFILES = $(CHEWOUT_FILES) *.ref +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = raise.o signal.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .def .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus signal/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = signal + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ +check-am installcheck-am installcheck install-info-am install-info \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +doc: $(CHEWOUT_FILES) + cat $(srcdir)/signal.tex >> $(TARGETDOC) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/signal/raise.c b/newlib/libc/signal/raise.c new file mode 100644 index 000000000..bc47864e8 --- /dev/null +++ b/newlib/libc/signal/raise.c @@ -0,0 +1,80 @@ +/* Embedded systems may want the simulated signals if no other form exists, + but UNIX versions will want to use the host facilities. + Define SIMULATED_SIGNALS when you want to use the simulated versions. +*/ + +/* +FUNCTION +<>---send a signal + +INDEX + raise +INDEX + _raise_r + +ANSI_SYNOPSIS + #include + int raise(int <[sig]>); + + int _raise_r(void *<[reent]>, int <[sig]>); + +TRAD_SYNOPSIS + #include + int raise(<[sig]>) + int <[sig]>; + + int _raise_r(<[reent]>, <[sig]>) + char *<[reent]>; + int <[sig]>; + +DESCRIPTION +Send the signal <[sig]> (one of the macros from `<>'). +This interrupts your program's normal flow of execution, and allows a signal +handler (if you've defined one, using <>) to take control. + +The alternate function <<_raise_r>> is a reentrant version. The extra +argument <[reent]> is a pointer to a reentrancy structure. + +RETURNS +The result is <<0>> if <[sig]> was successfully raised, <<1>> +otherwise. However, the return value (since it depends on the normal +flow of execution) may not be visible, unless the signal handler for +<[sig]> terminates with a <> or unless <> is in +effect for this signal. + +PORTABILITY +ANSI C requires <>, but allows the full set of signal numbers +to vary from one implementation to another. + +Required OS subroutines: <>, <>. +*/ + +#ifndef SIGNAL_PROVIDED + +int _dummy_raise; + +#else + +#include +#include + +#ifndef _REENT_ONLY + +int +_DEFUN (raise, (sig), + int sig) +{ + return _raise_r (_REENT, sig); +} + +#endif + +int +_DEFUN (_raise_r, (reent, sig), + struct _reent *reent _AND + int sig) +{ + return _kill_r (reent, _getpid_r (reent), sig); +} + +#endif /* SIGNAL_PROVIDED */ diff --git a/newlib/libc/signal/signal.c b/newlib/libc/signal/signal.c new file mode 100644 index 000000000..fc52bbab5 --- /dev/null +++ b/newlib/libc/signal/signal.c @@ -0,0 +1,269 @@ +/* +FUNCTION +<>---specify handler subroutine for a signal + +INDEX + signal +INDEX + _signal_r +INDEX + raise +INDEX + _raise_r + +ANSI_SYNOPSIS + #include + void ( * signal(int <[sig]>, void(*<[func]>)(int)) )(int); + + void ( * _signal_r(void *<[reent]>, + int <[sig]>, void(*<[func]>)(int)) )(int); + + int raise (int <[sig]>); + + int _raise_r (void *<[reent]>, int <[sig]>); + +TRAD_SYNOPSIS + #include + char ( * signal(<[sig]>, <[func]>) )() + int <[sig]>; + char ( * <[func]> )(); + + char ( * _signal_r(<[reent]>, <[sig]>, <[func]>) )() + char *<[reent]>; + int <[sig]>; + char ( * <[func]> )(); + + int raise (<[sig]>)() + int <[sig]>; + + int _raise_r (<[reent]>, <[sig]>)() + char *<[reent]>; + int <[sig]>; + +DESCRIPTION +<> provide a simple signal/raise implementation for embedded +targets. + +<> allows you to request changed treatment for a particular +signal <[sig]>. You can use one of the predefined macros <> +(select system default handling) or <> (ignore this signal) +as the value of <[func]>; otherwise, <[func]> is a function pointer +that identifies a subroutine in your program as the handler for this signal. + +Some of the execution environment for signal handlers is +unpredictable; notably, the only library function required to work +correctly from within a signal handler is @code{signal} itself, and +only when used to redefine the handler for the current signal value. + +Static storage is likewise unreliable for signal handlers, with one +exception: if you declare a static storage location as `<>', then you may use that location in a signal handler to +store signal values. + +If your signal handler terminates using <> (or implicit +return), your program's execution continues at the point +where it was when the signal was raised (whether by your program +itself, or by an external event). Signal handlers can also +use functions such as <> and <> to avoid returning. + +<> sends the signal sig to the executing program. It returns zero if +successful, non-zero if unsuccessful. + +The alternate functions <<_signal_r, _raise_r>> are the reentrant versions. +The extra argument <[reent]> is a pointer to a reentrancy structure. + + +@c FIXME: do we have setjmp.h and assoc fns? + +RETURNS +If your request for a signal handler cannot be honored, the result is +<>; a specific error number is also recorded in <>. + +Otherwise, the result is the previous handler (a function pointer or +one of the predefined macros). + +PORTABILITY +ANSI C requires <>, <>. + +No supporting OS subroutines are required to link with <>, but +it will not have any useful effects, except for software generated signals, +without an operating system that can actually raise exceptions. +*/ + +/* + * signal.c + * Original Author: G. Haley + * + * signal associates the function pointed to by func with the signal sig. When + * a signal occurs, the value of func determines the action taken as follows: + * if func is SIG_DFL, the default handling for that signal will occur; if func + * is SIG_IGN, the signal will be ignored; otherwise, the default handling for + * the signal is restored (SIG_DFL), and the function func is called with sig + * as its argument. Returns the value of func for the previous call to signal + * for the signal sig, or SIG_ERR if the request fails. + */ + +/* _init_signal initialises the signal handlers for each signal. This function + is called by crt0 at program startup. */ + +#ifdef SIGNAL_PROVIDED + +int _dummy_simulated_signal; + +#else + +#include +#include +#include +#include +#include +#include <_syslist.h> + +int +_DEFUN (_init_signal_r, (ptr), + struct _reent *ptr) +{ + int i; + + if (ptr->_sig_func == NULL) + { + ptr->_sig_func = (_sig_func_ptr *)_malloc_r (ptr, sizeof (_sig_func_ptr) * NSIG); + if (ptr->_sig_func == NULL) + return -1; + + for (i = 0; i < NSIG; i++) + ptr->_sig_func[i] = SIG_DFL; + } + + return 0; +} + +_sig_func_ptr +_DEFUN (_signal_r, (ptr, sig, func), + struct _reent *ptr _AND + int sig _AND + _sig_func_ptr func) +{ + _sig_func_ptr old_func, *temp; + + if (sig < 0 || sig >= NSIG) + { + ptr->_errno = EINVAL; + return SIG_ERR; + } + + if (ptr->_sig_func == NULL && _init_signal_r (ptr) != 0) + return SIG_ERR; + + old_func = ptr->_sig_func[sig]; + ptr->_sig_func[sig] = func; + + return old_func; +} + +int +_raise_r (ptr, sig) + struct _reent *ptr; + int sig; +{ + _sig_func_ptr func; + int result = 0; + + if (sig < 0 || sig >= NSIG) + { + ptr->_errno = EINVAL; + return -1; + } + + if (ptr->_sig_func == NULL && _init_signal_r (ptr) != 0) + return -1; + + switch ((_POINTER_INT) ptr->_sig_func[sig]) + { + case SIG_DFL: + return _kill_r (ptr, _getpid_r (ptr), sig); + + case SIG_IGN: + break; + + case SIG_ERR: + ptr->_errno = EINVAL; + result = 1; + break; + + default: + func = ptr->_sig_func[sig]; + ptr->_sig_func[sig] = SIG_DFL; + func (sig); + break; + } + + return result; +} + +int +__sigtramp_r (ptr, sig) + struct _reent *ptr; + int sig; +{ + _sig_func_ptr func; + + if (sig < 0 || sig >= NSIG) + { + return -1; + } + + if (ptr->_sig_func == NULL && _init_signal_r (ptr) != 0) + return -1; + + switch ((_POINTER_INT) ptr->_sig_func[sig]) + { + case SIG_DFL: + return 1; + + case SIG_ERR: + return 2; + + case SIG_IGN: + return 3; + + default: + func = ptr->_sig_func[sig]; + ptr->_sig_func[sig] = SIG_DFL; + func (sig); + return 0; + } +} + +#ifndef _REENT_ONLY + +int +raise (sig) + int sig; +{ + return _raise_r (_REENT, sig); +} + +_sig_func_ptr +_DEFUN (signal, (sig, func), + int sig _AND + _sig_func_ptr func) +{ + return _signal_r (_REENT, sig, func); +} + +int +_init_signal () +{ + return _init_signal_r (_REENT); +} + +int +__sigtramp (int sig) +{ + return __sigtramp_r (_REENT, sig); +} + +#endif + +#endif /* !SIGNAL_PROVIDED */ diff --git a/newlib/libc/signal/signal.tex b/newlib/libc/signal/signal.tex new file mode 100644 index 000000000..08c15bed8 --- /dev/null +++ b/newlib/libc/signal/signal.tex @@ -0,0 +1,70 @@ +@node Signals +@chapter Signal Handling (@file{signal.h}) + +A @dfn{signal} is an event that interrupts the normal flow of control +in your program. Your operating environment normally defines the full +set of signals available (see @file{sys/signal.h}), as well as the +default means of dealing with them---typically, either printing an +error message and aborting your program, or ignoring the signal. + +All systems support at least the following signals: +@table @code +@item SIGABRT +Abnormal termination of a program; raised by the <> function. + +@item SIGFPE +A domain error in arithmetic, such as overflow, or division by zero. + +@item SIGILL +Attempt to execute as a function data that is not executable. + +@item SIGINT +Interrupt; an interactive attention signal. + +@item SIGSEGV +An attempt to access a memory location that is not available. + +@item SIGTERM +A request that your program end execution. +@end table + +Two functions are available for dealing with asynchronous +signals---one to allow your program to send signals to itself (this is +called @dfn{raising} a signal), and one to specify subroutines (called +@dfn{handlers} to handle particular signals that you anticipate may +occur---whether raised by your own program or the operating environment. + +To support these functions, @file{signal.h} defines three macros: + +@table @code +@item SIG_DFL +Used with the @code{signal} function in place of a pointer to a +handler subroutine, to select the operating environment's default +handling of a signal. + +@item SIG_IGN +Used with the @code{signal} function in place of a pointer to a +handler, to ignore a particular signal. + +@item SIG_ERR +Returned by the @code{signal} function in place of a pointer to a +handler, to indicate that your request to set up a handler could not +be honored for some reason. +@end table + +@file{signal.h} also defines an integral type, @code{sig_atomic_t}. +This type is not used in any function declarations; it exists only to +allow your signal handlers to declare a static storage location where +they may store a signal value. (Static storage is not otherwise +reliable from signal handlers.) + +@menu +* raise:: Send a signal +* signal:: Specify handler subroutine for a signal +@end menu + +@page +@include signal/raise.def + +@page +@include signal/signal.def diff --git a/newlib/libc/stdio/Makefile.am b/newlib/libc/stdio/Makefile.am new file mode 100644 index 000000000..234da49b6 --- /dev/null +++ b/newlib/libc/stdio/Makefile.am @@ -0,0 +1,161 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + clearerr.c \ + fclose.c \ + fdopen.c \ + feof.c \ + ferror.c \ + fflush.c \ + fgetc.c \ + fgetpos.c \ + fgets.c \ + fileno.c \ + findfp.c \ + fiprintf.c \ + flags.c \ + fopen.c \ + fprintf.c \ + fputc.c \ + fputs.c \ + fread.c \ + freopen.c \ + fscanf.c \ + fseek.c \ + fsetpos.c \ + ftell.c \ + fvwrite.c \ + fwalk.c \ + fwrite.c \ + getc.c \ + getchar.c \ + gets.c \ + iprintf.c \ + makebuf.c \ + mktemp.c \ + perror.c \ + printf.c \ + putc.c \ + putchar.c \ + puts.c \ + refill.c \ + remove.c \ + rename.c \ + rewind.c \ + rget.c \ + scanf.c \ + setbuf.c \ + setvbuf.c \ + siprintf.c \ + snprintf.c \ + sprintf.c \ + sscanf.c \ + stdio.c \ + tmpfile.c \ + tmpnam.c \ + ungetc.c \ + vfprintf.c \ + vfscanf.c \ + vprintf.c \ + vsnprintf.c \ + vsprintf.c \ + wbuf.c \ + wsetup.c + +lib_a_LIBADD = vfiprintf.o + +vfiprintf.o: vfprintf.c + $(COMPILE) -DINTEGER_ONLY -c $(srcdir)/vfprintf.c -o $@ + +CHEWOUT_FILES = \ + clearerr.def \ + fclose.def \ + fdopen.def \ + feof.def \ + ferror.def \ + fflush.def \ + fgetc.def \ + fgetpos.def \ + fgets.def \ + fileno.def \ + fiprintf.def \ + fopen.def \ + fputc.def \ + fputs.def \ + fread.def \ + freopen.def \ + fseek.def \ + fsetpos.def \ + ftell.def \ + fwrite.def \ + getc.def \ + getchar.def \ + gets.def \ + iprintf.def \ + mktemp.def \ + perror.def \ + putc.def \ + putchar.def \ + puts.def \ + remove.def \ + rename.def \ + rewind.def \ + setbuf.def \ + setvbuf.def \ + siprintf.def \ + sprintf.def \ + sscanf.def \ + tmpfile.def \ + tmpnam.def \ + vfprintf.def + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +TARGETDOC = ../tmp.texi + +doc: $(CHEWOUT_FILES) + cat $(srcdir)/stdio.tex >> $(TARGETDOC) + +CLEANFILES = $(CHEWOUT_FILES) *.ref + +fclose.o: local.h +fdopen.o: local.h +fflush.o: local.h +findfp.o: local.h +fopen.o: local.h +fputs.o: fvwrite.h +fread.o: local.h +freopen.o: local.h +fseek.o: local.h +ftell.o: local.h +fvwrite.o: local.h fvwrite.h +fwalk.o: local.h +fwrite.o: local.h fvwrite.h +makebuf.o: local.h +puts.o: fvwrite.h +refill.o: local.h +scanf.o: local.h +setbuf.o: local.h +setvbuf.o: local.h +siprintf.o: local.h +sprintf.o: local.h +sscanf.o: local.h +stdio.o: local.h +ungetc.o: local.h +vfiprintf.o: local.h +vfprintf.o: local.h +vfscanf.o: local.h floatio.h +wbuf.o: local.h fvwrite.h +wsetup.o: local.h diff --git a/newlib/libc/stdio/Makefile.in b/newlib/libc/stdio/Makefile.in new file mode 100644 index 000000000..ff2a83845 --- /dev/null +++ b/newlib/libc/stdio/Makefile.in @@ -0,0 +1,441 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +CRT0 = @CRT0@ +EXEEXT = @EXEEXT@ +LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@ +LIBC_POSIX_LIB = @LIBC_POSIX_LIB@ +LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@ +LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@ +LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ +LIBC_SYS_LIB = @LIBC_SYS_LIB@ +LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + clearerr.c \ + fclose.c \ + fdopen.c \ + feof.c \ + ferror.c \ + fflush.c \ + fgetc.c \ + fgetpos.c \ + fgets.c \ + fileno.c \ + findfp.c \ + fiprintf.c \ + flags.c \ + fopen.c \ + fprintf.c \ + fputc.c \ + fputs.c \ + fread.c \ + freopen.c \ + fscanf.c \ + fseek.c \ + fsetpos.c \ + ftell.c \ + fvwrite.c \ + fwalk.c \ + fwrite.c \ + getc.c \ + getchar.c \ + gets.c \ + iprintf.c \ + makebuf.c \ + mktemp.c \ + perror.c \ + printf.c \ + putc.c \ + putchar.c \ + puts.c \ + refill.c \ + remove.c \ + rename.c \ + rewind.c \ + rget.c \ + scanf.c \ + setbuf.c \ + setvbuf.c \ + siprintf.c \ + snprintf.c \ + sprintf.c \ + sscanf.c \ + stdio.c \ + tmpfile.c \ + tmpnam.c \ + ungetc.c \ + vfprintf.c \ + vfscanf.c \ + vprintf.c \ + vsnprintf.c \ + vsprintf.c \ + wbuf.c \ + wsetup.c + + +lib_a_LIBADD = vfiprintf.o + +CHEWOUT_FILES = \ + clearerr.def \ + fclose.def \ + fdopen.def \ + feof.def \ + ferror.def \ + fflush.def \ + fgetc.def \ + fgetpos.def \ + fgets.def \ + fileno.def \ + fiprintf.def \ + fopen.def \ + fputc.def \ + fputs.def \ + fread.def \ + freopen.def \ + fseek.def \ + fsetpos.def \ + ftell.def \ + fwrite.def \ + getc.def \ + getchar.def \ + gets.def \ + iprintf.def \ + mktemp.def \ + perror.def \ + putc.def \ + putchar.def \ + puts.def \ + remove.def \ + rename.def \ + rewind.def \ + setbuf.def \ + setvbuf.def \ + siprintf.def \ + sprintf.def \ + sscanf.def \ + tmpfile.def \ + tmpnam.def \ + vfprintf.def + + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +TARGETDOC = ../tmp.texi + +CLEANFILES = $(CHEWOUT_FILES) *.ref +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_DEPENDENCIES = vfiprintf.o +lib_a_OBJECTS = clearerr.o fclose.o fdopen.o feof.o ferror.o fflush.o \ +fgetc.o fgetpos.o fgets.o fileno.o findfp.o fiprintf.o flags.o fopen.o \ +fprintf.o fputc.o fputs.o fread.o freopen.o fscanf.o fseek.o fsetpos.o \ +ftell.o fvwrite.o fwalk.o fwrite.o getc.o getchar.o gets.o iprintf.o \ +makebuf.o mktemp.o perror.o printf.o putc.o putchar.o puts.o refill.o \ +remove.o rename.o rewind.o rget.o scanf.o setbuf.o setvbuf.o siprintf.o \ +snprintf.o sprintf.o sscanf.o stdio.o tmpfile.o tmpnam.o ungetc.o \ +vfprintf.o vfscanf.o vprintf.o vsnprintf.o vsprintf.o wbuf.o wsetup.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .def .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus stdio/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = stdio + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ +check-am installcheck-am installcheck install-info-am install-info \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +vfiprintf.o: vfprintf.c + $(COMPILE) -DINTEGER_ONLY -c $(srcdir)/vfprintf.c -o $@ + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +doc: $(CHEWOUT_FILES) + cat $(srcdir)/stdio.tex >> $(TARGETDOC) + +fclose.o: local.h +fdopen.o: local.h +fflush.o: local.h +findfp.o: local.h +fopen.o: local.h +fputs.o: fvwrite.h +fread.o: local.h +freopen.o: local.h +fseek.o: local.h +ftell.o: local.h +fvwrite.o: local.h fvwrite.h +fwalk.o: local.h +fwrite.o: local.h fvwrite.h +makebuf.o: local.h +puts.o: fvwrite.h +refill.o: local.h +scanf.o: local.h +setbuf.o: local.h +setvbuf.o: local.h +siprintf.o: local.h +sprintf.o: local.h +sscanf.o: local.h +stdio.o: local.h +ungetc.o: local.h +vfiprintf.o: local.h +vfprintf.o: local.h +vfscanf.o: local.h floatio.h +wbuf.o: local.h fvwrite.h +wsetup.o: local.h + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/stdio/clearerr.c b/newlib/libc/stdio/clearerr.c new file mode 100644 index 000000000..861d9a211 --- /dev/null +++ b/newlib/libc/stdio/clearerr.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---clear file or stream error indicator + +INDEX + clearerr + +ANSI_SYNOPSIS + #include + void clearerr(FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + void clearerr(<[fp]>) + FILE *<[fp]>; + +DESCRIPTION +The <> functions maintain an error indicator with each file +pointer <[fp]>, to record whether any read or write errors have +occurred on the associated file or stream. Similarly, it maintains an +end-of-file indicator to record whether there is no more data in the +file. + +Use <> to reset both of these indicators. + +See <> and <> to query the two indicators. + + +RETURNS +<> does not return a result. + +PORTABILITY +ANSI C requires <>. + +No supporting OS subroutines are required. +*/ + +#include +#undef clearerr + +_VOID +_DEFUN (clearerr, (fp), + FILE * fp) +{ + __sclearerr (fp); +} diff --git a/newlib/libc/stdio/fclose.c b/newlib/libc/stdio/fclose.c new file mode 100644 index 000000000..3266d8a55 --- /dev/null +++ b/newlib/libc/stdio/fclose.c @@ -0,0 +1,82 @@ +/* +FUNCTION +<>---close a file + +INDEX + fclose + +ANSI_SYNOPSIS + #include + int fclose(FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + int fclose(<[fp]>) + FILE *<[fp]>; + +DESCRIPTION +If the file or stream identified by <[fp]> is open, <> closes +it, after first ensuring that any pending data is written (by calling +<)>>). + +RETURNS +<> returns <<0>> if successful (including when <[fp]> is +<> or not an open file); otherwise, it returns <>. + +PORTABILITY +<> is required by ANSI C. + +Required OS subroutines: <>, <>, <>, <>, +<>, <>, <>. +*/ + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include +#include +#include "local.h" + +/* + * Close a file. + */ + +int +_DEFUN (fclose, (fp), + register FILE * fp) +{ + int r; + + if (fp == NULL) + return (0); /* on NULL */ + + CHECK_INIT (fp); + + if (fp->_flags == 0) /* not open! */ + return (0); + r = fp->_flags & __SWR ? fflush (fp) : 0; + if (fp->_close != NULL && (*fp->_close) (fp->_cookie) < 0) + r = EOF; + if (fp->_flags & __SMBF) + _free_r (fp->_data, (char *) fp->_bf._base); + if (HASUB (fp)) + FREEUB (fp); + if (HASLB (fp)) + FREELB (fp); + fp->_flags = 0; /* release this FILE for reuse */ + return (r); +} diff --git a/newlib/libc/stdio/fdopen.c b/newlib/libc/stdio/fdopen.c new file mode 100644 index 000000000..50698cbf6 --- /dev/null +++ b/newlib/libc/stdio/fdopen.c @@ -0,0 +1,116 @@ +/* +FUNCTION +<>---turn open file into a stream + +INDEX + fdopen +INDEX + _fdopen_r + +ANSI_SYNOPSIS + #include + FILE *fdopen(int <[fd]>, const char *<[mode]>); + FILE *_fdopen_r(void *<[reent]>, + int <[fd]>, const char *<[mode]>); + +TRAD_SYNOPSIS + #include + FILE *fdopen(<[fd]>, <[mode]>) + int <[fd]>; + char *<[mode]>; + + FILE *_fdopen_r(<[reent]>, <[fd]>, <[mode]>) + char *<[reent]>; + int <[fd]>; + char *<[mode]>); + +DESCRIPTION +<> produces a file descriptor of type <>, from a +descriptor for an already-open file (returned, for example, by the +system subroutine <> rather than by <>). +The <[mode]> argument has the same meanings as in <>. + +RETURNS +File pointer or <>, as for <>. + +PORTABILITY +<> is ANSI. +*/ + +#include +#include + +#include +#include +#include "local.h" +#include <_syslist.h> + +extern int __sflags (); + +FILE * +_DEFUN (_fdopen_r, (ptr, fd, mode), + struct _reent *ptr _AND + int fd _AND + _CONST char *mode) +{ + register FILE *fp; + int flags, oflags; +#ifdef F_GETFL + int fdflags, fdmode; +#endif + + if ((flags = __sflags (ptr, mode, &oflags)) == 0) + return 0; + + /* make sure the mode the user wants is a subset of the actual mode */ +#ifdef F_GETFL + if ((fdflags = _fcntl (fd, F_GETFL, 0)) < 0) + return 0; + fdmode = fdflags & O_ACCMODE; + if (fdmode != O_RDWR && (fdmode != (oflags & O_ACCMODE))) + { + ptr->_errno = EBADF; + return 0; + } +#endif + + if ((fp = __sfp (ptr)) == 0) + return 0; + fp->_flags = flags; + /* + * If opened for appending, but underlying descriptor + * does not have O_APPEND bit set, assert __SAPP so that + * __swrite() will lseek to end before each write. + */ + if ((oflags & O_APPEND) +#ifdef F_GETFL + && !(fdflags & O_APPEND) +#endif + ) + fp->_flags |= __SAPP; + fp->_file = fd; + fp->_cookie = (_PTR) fp; + +#undef _read +#undef _write +#undef _seek +#undef _close + + fp->_read = __sread; + fp->_write = __swrite; + fp->_seek = __sseek; + fp->_close = __sclose; + return fp; +} + +#ifndef _REENT_ONLY + +FILE * +_DEFUN (fdopen, (fd, mode), + int fd _AND + _CONST char *mode) +{ + return _fdopen_r (_REENT, fd, mode); +} + +#endif diff --git a/newlib/libc/stdio/feof.c b/newlib/libc/stdio/feof.c new file mode 100644 index 000000000..55f151bd4 --- /dev/null +++ b/newlib/libc/stdio/feof.c @@ -0,0 +1,40 @@ +/* +FUNCTION +<>---test for end of file + +INDEX + feof + +ANSI_SYNOPSIS + #include + int feof(FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + int feof(<[fp]>) + FILE *<[fp]>; + +DESCRIPTION +<> tests whether or not the end of the file identified by <[fp]> +has been reached. + +RETURNS +<> returns <<0>> if the end of file has not yet been reached; if +at end of file, the result is nonzero. + +PORTABILITY +<> is required by ANSI C. + +No supporting OS subroutines are required. +*/ + +#include + +#undef feof + +int +_DEFUN (feof, (fp), + FILE * fp) +{ + return __sfeof (fp); +} diff --git a/newlib/libc/stdio/ferror.c b/newlib/libc/stdio/ferror.c new file mode 100644 index 000000000..19fa78d14 --- /dev/null +++ b/newlib/libc/stdio/ferror.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---test whether read/write error has occurred + +INDEX + ferror + +ANSI_SYNOPSIS + #include + int ferror(FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + int ferror(<[fp]>) + FILE *<[fp]>; + +DESCRIPTION +The <> functions maintain an error indicator with each file +pointer <[fp]>, to record whether any read or write errors have +occurred on the associated file or stream. +Use <> to query this indicator. + +See <> to reset the error indicator. + +RETURNS +<> returns <<0>> if no errors have occurred; it returns a +nonzero value otherwise. + +PORTABILITY +ANSI C requires <>. + +No supporting OS subroutines are required. +*/ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "%W% (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ + +#include + +/* A subroutine version of the macro ferror. */ + +#undef ferror + +int +_DEFUN (ferror, (fp), + FILE * fp) +{ + return __sferror (fp); +} diff --git a/newlib/libc/stdio/fflush.c b/newlib/libc/stdio/fflush.c new file mode 100644 index 000000000..635e5a738 --- /dev/null +++ b/newlib/libc/stdio/fflush.c @@ -0,0 +1,99 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---flush buffered file output + +INDEX + fflush + +ANSI_SYNOPSIS + #include + int fflush(FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + int fflush(<[fp]>) + FILE *<[fp]>; + +DESCRIPTION +The <> output functions can buffer output before delivering it +to the host system, in order to minimize the overhead of system calls. + +Use <> to deliver any such pending output (for the file +or stream identified by <[fp]>) to the host system. + +If <[fp]> is <>, <> delivers pending output from all +open files. + +RETURNS +<> returns <<0>> unless it encounters a write error; in that +situation, it returns <>. + +PORTABILITY +ANSI C requires <>. + +No supporting OS subroutines are required. +*/ + +#include +#include "local.h" + +/* Flush a single file, or (if fp is NULL) all files. */ + +int +_DEFUN (fflush, (fp), + register FILE * fp) +{ + register unsigned char *p; + register int n, t; + + + + + if (fp == NULL) + return _fwalk (_REENT, fflush); + + CHECK_INIT (fp); + + t = fp->_flags; + if ((t & __SWR) == 0 || (p = fp->_bf._base) == NULL) + return 0; + n = fp->_p - p; /* write this much */ + + /* + * Set these immediately to avoid problems with longjmp + * and to allow exchange buffering (via setvbuf) in user + * write function. + */ + fp->_p = p; + fp->_w = t & (__SLBF | __SNBF) ? 0 : fp->_bf._size; + + while (n > 0) + { + t = (*fp->_write) (fp->_cookie, (char *) p, n); + if (t <= 0) + { + fp->_flags |= __SERR; + return EOF; + } + p += t; + n -= t; + } + return 0; +} diff --git a/newlib/libc/stdio/fgetc.c b/newlib/libc/stdio/fgetc.c new file mode 100644 index 000000000..3d3d2c4ed --- /dev/null +++ b/newlib/libc/stdio/fgetc.c @@ -0,0 +1,46 @@ +/* +FUNCTION +<>---get a character from a file or stream + +INDEX + fgetc + +ANSI_SYNOPSIS + #include + int fgetc(FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + int fgetc(<[fp]>) + FILE *<[fp]>; + +DESCRIPTION +Use <> to get the next single character from the file or stream +identified by <[fp]>. As a side effect, <> advances the file's +current position indicator. + +For a macro version of this function, see <>. + +RETURNS +The next character (read as an <>, and cast to +<>), unless there is no more data, or the host system reports a +read error; in either of these situations, <> returns <>. + +You can distinguish the two situations that cause an <> result by +using the <> and <> functions. + +PORTABILITY +ANSI C requires <>. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include + +int +_DEFUN (fgetc, (fp), + FILE * fp) +{ + return __sgetc (fp); +} diff --git a/newlib/libc/stdio/fgetpos.c b/newlib/libc/stdio/fgetpos.c new file mode 100644 index 000000000..214021a84 --- /dev/null +++ b/newlib/libc/stdio/fgetpos.c @@ -0,0 +1,61 @@ +/* +FUNCTION +<>---record position in a stream or file + +INDEX + fgetpos + +ANSI_SYNOPSIS + #include + int fgetpos(FILE *<[fp]>, fpos_t *<[pos]>); + +TRAD_SYNOPSIS + #include + int fgetpos(<[fp]>, <[pos]>) + FILE *<[fp]>; + fpos_t *<[pos]>; + +DESCRIPTION +Objects of type <> can have a ``position'' that records how much +of the file your program has already read. Many of the <> functions +depend on this position, and many change it as a side effect. + +You can use <> to report on the current position for a file +identified by <[fp]>; <> will write a value +representing that position at <<*<[pos]>>>. Later, you can +use this value with <> to return the file to this +position. + +In the current implementation, <> simply uses a character +count to represent the file position; this is the same number that +would be returned by <>. + +RETURNS +<> returns <<0>> when successful. If <> fails, the +result is <<1>>. Failure occurs on streams that do not support +positioning; the global <> indicates this condition with the +value <>. + +PORTABILITY +<> is required by the ANSI C standard, but the meaning of the +value it records is not specified beyond requiring that it be +acceptable as an argument to <>. In particular, other +conforming C implementations may return a different result from +<> than what <> writes at <<*<[pos]>>>. + +No supporting OS subroutines are required. +*/ + +#include + +int +_DEFUN (fgetpos, (fp, pos), + FILE * fp _AND + fpos_t * pos) +{ + *pos = ftell (fp); + + if (*pos != -1) + return 0; + return 1; +} diff --git a/newlib/libc/stdio/fgets.c b/newlib/libc/stdio/fgets.c new file mode 100644 index 000000000..abc2bb97c --- /dev/null +++ b/newlib/libc/stdio/fgets.c @@ -0,0 +1,127 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* + +FUNCTION + <>---get character string from a file or stream +INDEX + fgets + +ANSI_SYNOPSIS + #include + char *fgets(char *<[buf]>, int <[n]>, FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + char *fgets(<[buf]>,<[n]>,<[fp]>) + char *<[buf]>; + int <[n]>; + FILE *<[fp]>; + +DESCRIPTION + Reads at most <[n-1]> characters from <[fp]> until a newline + is found. The characters including to the newline are stored + in <[buf]>. The buffer is terminated with a 0. + + +RETURNS + <> returns the buffer passed to it, with the data + filled in. If end of file occurs with some data already + accumulated, the data is returned with no other indication. If + no data are read, NULL is returned instead. + +PORTABILITY + <> should replace all uses of <>. Note however + that <> returns all of the data, while <> removes + the trailing newline (with no indication that it has done so.) + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include +#include + +extern int __srefill (); + +/* + * Read at most n-1 characters from the given file. + * Stop when a newline has been read, or the count runs out. + * Return first argument, or NULL if no characters were read. + */ + +char * +_DEFUN (fgets, (buf, n, fp), + char *buf _AND + int n _AND + FILE * fp) +{ + size_t len; + char *s; + unsigned char *p, *t; + + if (n < 2) /* sanity check */ + return 0; + + s = buf; + n--; /* leave space for NUL */ + do + { + /* + * If the buffer is empty, refill it. + */ + if ((len = fp->_r) <= 0) + { + if (__srefill (fp)) + { + /* EOF: stop with partial or no line */ + if (s == buf) + return 0; + break; + } + len = fp->_r; + } + p = fp->_p; + + /* + * Scan through at most n bytes of the current buffer, + * looking for '\n'. If found, copy up to and including + * newline, and stop. Otherwise, copy entire chunk + * and loop. + */ + if (len > n) + len = n; + t = (unsigned char *) memchr ((_PTR) p, '\n', len); + if (t != 0) + { + len = ++t - p; + fp->_r -= len; + fp->_p = t; + (void) memcpy ((_PTR) s, (_PTR) p, len); + s[len] = 0; + return (buf); + } + fp->_r -= len; + fp->_p += len; + (void) memcpy ((_PTR) s, (_PTR) p, len); + s += len; + } + while ((n -= len) != 0); + *s = 0; + return buf; +} diff --git a/newlib/libc/stdio/fileno.c b/newlib/libc/stdio/fileno.c new file mode 100644 index 000000000..d578c3ede --- /dev/null +++ b/newlib/libc/stdio/fileno.c @@ -0,0 +1,40 @@ +/* +FUNCTION +<>---return file descriptor associated with stream + +INDEX + fileno + +ANSI_SYNOPSIS + #include + int fileno(FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + int fileno(<[fp]>) + FILE *<[fp]>; + +DESCRIPTION +You can use <> to return the file descriptor identified by <[fp]>. + +RETURNS +<> returns a non-negative integer when successful. +If <[fp]> is not an open stream, <> returns -1. + +PORTABILITY +<> is not part of ANSI C. +POSIX requires <>. + +Supporting OS subroutines required: none. +*/ + +#include +#include "local.h" + +int +_DEFUN (fileno, (f), + FILE * f) +{ + CHECK_INIT (f); + return __sfileno (f); +} diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c new file mode 100644 index 000000000..650c638e6 --- /dev/null +++ b/newlib/libc/stdio/findfp.c @@ -0,0 +1,153 @@ +/* No user fns here. Pesch 15apr92. */ + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include +#include +#include +#include +#include "local.h" + +static void +std (ptr, flags, file, data) + FILE *ptr; + struct _reent *data; +{ + ptr->_p = 0; + ptr->_r = 0; + ptr->_w = 0; + ptr->_flags = flags; + ptr->_file = file; + ptr->_bf._base = 0; + ptr->_bf._size = 0; + ptr->_lbfsize = 0; + ptr->_cookie = ptr; + ptr->_read = __sread; + ptr->_write = __swrite; + ptr->_seek = __sseek; + ptr->_close = __sclose; + ptr->_data = data; +} + +struct _glue * +__sfmoreglue (d, n) + struct _reent *d; + register int n; +{ + struct _glue *g; + FILE *p; + + g = (struct _glue *) _malloc_r (d, sizeof (*g) + n * sizeof (FILE)); + if (g == NULL) + return NULL; + p = (FILE *) (g + 1); + g->_next = NULL; + g->_niobs = n; + g->_iobs = p; + memset (p, 0, n * sizeof (FILE)); + return g; +} + +/* + * Find a free FILE for fopen et al. + */ + +FILE * +__sfp (d) + struct _reent *d; +{ + FILE *fp; + int n; + struct _glue *g; + + if (!d->__sdidinit) + __sinit (d); + for (g = &d->__sglue;; g = g->_next) + { + for (fp = g->_iobs, n = g->_niobs; --n >= 0; fp++) + if (fp->_flags == 0) + goto found; + if (g->_next == NULL && + (g->_next = __sfmoreglue (d, NDYNAMIC)) == NULL) + break; + } + d->_errno = ENOMEM; + return NULL; + +found: + fp->_flags = 1; /* reserve this slot; caller sets real flags */ + fp->_p = NULL; /* no current pointer */ + fp->_w = 0; /* nothing to read or write */ + fp->_r = 0; + fp->_bf._base = NULL; /* no buffer */ + fp->_bf._size = 0; + fp->_lbfsize = 0; /* not line buffered */ + fp->_file = -1; /* no file */ + /* fp->_cookie = ; */ /* caller sets cookie, _read/_write etc */ + fp->_ub._base = NULL; /* no ungetc buffer */ + fp->_ub._size = 0; + fp->_lb._base = NULL; /* no line buffer */ + fp->_lb._size = 0; + fp->_data = d; + return fp; +} + +/* + * exit() calls _cleanup() through *__cleanup, set whenever we + * open or buffer a file. This chicanery is done so that programs + * that do not use stdio need not link it all in. + * + * The name `_cleanup' is, alas, fairly well known outside stdio. + */ + +void +_cleanup_r (ptr) + struct _reent *ptr; +{ + /* (void) _fwalk(fclose); */ + (void) _fwalk (ptr, fflush); /* `cheating' */ +} + +#ifndef _REENT_ONLY +void +_cleanup () +{ + _cleanup_r (_REENT); +} +#endif + +/* + * __sinit() is called whenever stdio's internal variables must be set up. + */ + +void +__sinit (s) + struct _reent *s; +{ + /* make sure we clean up on exit */ + s->__cleanup = _cleanup_r; /* conservative */ + s->__sdidinit = 1; + + std (s->__sf + 0, __SRD, 0, s); + std (s->__sf + 1, __SWR | __SLBF, 1, s); + std (s->__sf + 2, __SWR | __SNBF, 2, s); + + s->__sglue._next = NULL; + s->__sglue._niobs = 3; + s->__sglue._iobs = &s->__sf[0]; +} diff --git a/newlib/libc/stdio/fiprintf.c b/newlib/libc/stdio/fiprintf.c new file mode 100644 index 000000000..d490ef403 --- /dev/null +++ b/newlib/libc/stdio/fiprintf.c @@ -0,0 +1,77 @@ +/* +FUNCTION + <>---format output to file (integer only) +INDEX + fiprintf + +ANSI_SYNOPSIS + #include + + int fiprintf(FILE *<[fd]>, const char *<[format]>, ...); + +TRAD_SYNOPSIS + #include + + int fiprintf(<[fd]>, <[format]> [, <[arg]>, ...]); + FILE *<[fd]>; + char *<[format]>; + +DESCRIPTION +<> is a restricted version of <>: it has the same +arguments and behavior, save that it cannot perform any floating-point +formatting---the <>, <>, <>, <>, and <> type specifiers +are not recognized. + +RETURNS + <> returns the number of bytes in the output string, + save that the concluding <> is not counted. + <> returns when the end of the format string is + encountered. If an error occurs, <> + returns <>. + +PORTABILITY +<> is not required by ANSI C. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include <_ansi.h> +#include + +#ifdef _HAVE_STDC + +#include + +int +fiprintf (FILE * fp, const char *fmt,...) +{ + int ret; + va_list ap; + + va_start (ap, fmt); + ret = vfiprintf (fp, fmt, ap); + va_end (ap); + return ret; +} + +#else + +#include + +int +fiprintf (fp, fmt, va_alist) + FILE *fp; + char *fmt; + va_dcl +{ + int ret; + va_list ap; + + va_start (ap); + ret = vfiprintf (fp, fmt, ap); + va_end (ap); + return ret; +} + +#endif diff --git a/newlib/libc/stdio/flags.c b/newlib/libc/stdio/flags.c new file mode 100644 index 000000000..6d62bd5bc --- /dev/null +++ b/newlib/libc/stdio/flags.c @@ -0,0 +1,87 @@ +/* No user fns here. Pesch 15apr92 */ + +/* + * Copyright (c) 1990 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include +#include +#include + +#include +#include + +/* + * Return the (stdio) flags for a given mode. Store the flags + * to be passed to an open() syscall through *optr. + * Return 0 on error. + */ + +int +__sflags (ptr, mode, optr) + struct _reent *ptr; + register char *mode; + int *optr; +{ + register int ret, m, o; + + switch (mode[0]) + { + case 'r': /* open for reading */ + ret = __SRD; + m = O_RDONLY; + o = 0; + break; + + case 'w': /* open for writing */ + ret = __SWR; + m = O_WRONLY; + o = O_CREAT | O_TRUNC; + break; + + case 'a': /* open for appending */ + ret = __SWR | __SAPP; + m = O_WRONLY; + o = O_CREAT | O_APPEND; + break; + default: /* illegal mode */ + ptr->_errno = EINVAL; + return (0); + } + if (mode[1] == '+' || mode[2] == '+') + { + ret = __SRW; + m = O_RDWR; + } + if (mode[1] == 'b' || mode[2] == 'b') + { +#ifdef O_BINARY + m |= O_BINARY; +#endif + } +#ifdef __CYGWIN__ + else if (mode[1] == 't' || mode[2] == 't') +#else + else +#endif + { +#ifdef O_TEXT + m |= O_TEXT; +#endif + } + *optr = m | o; + return ret; +} diff --git a/newlib/libc/stdio/floatio.h b/newlib/libc/stdio/floatio.h new file mode 100644 index 000000000..d9577b2b2 --- /dev/null +++ b/newlib/libc/stdio/floatio.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * %W% (Berkeley) %G% + */ + +/* + * Floating point scanf/printf (input/output) definitions. + */ + +/* 11-bit exponent (VAX G floating point) is 308 decimal digits */ +#define MAXEXP 308 +/* 128 bit fraction takes up 39 decimal digits; max reasonable precision */ +#define MAXFRACT 39 diff --git a/newlib/libc/stdio/fopen.c b/newlib/libc/stdio/fopen.c new file mode 100644 index 000000000..30aa54e04 --- /dev/null +++ b/newlib/libc/stdio/fopen.c @@ -0,0 +1,165 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---open a file + +INDEX + fopen +INDEX + _fopen_r + +ANSI_SYNOPSIS + #include + FILE *fopen(const char *<[file]>, const char *<[mode]>); + + FILE *_fopen_r(void *<[reent]>, + const char *<[file]>, const char *<[mode]>); + +TRAD_SYNOPSIS + #include + FILE *fopen(<[file]>, <[mode]>) + char *<[file]>; + char *<[mode]>; + + FILE *_fopen_r(<[reent]>, <[file]>, <[mode]>) + char *<[reent]>; + char *<[file]>; + char *<[mode]>; + +DESCRIPTION +<> initializes the data structures needed to read or write a +file. Specify the file's name as the string at <[file]>, and the kind +of access you need to the file with the string at <[mode]>. + +The alternate function <<_fopen_r>> is a reentrant version. +The extra argument <[reent]> is a pointer to a reentrancy structure. + +Three fundamental kinds of access are available: read, write, and append. +<<*<[mode]>>> must begin with one of the three characters `<>', +`<>', or `<>', to select one of these: + +o+ +o r +Open the file for reading; the operation will fail if the file does +not exist, or if the host system does not permit you to read it. + +o w +Open the file for writing @emph{from the beginning} of the file: +effectively, this always creates a new file. If the file whose name you +specified already existed, its old contents are discarded. + +o a +Open the file for appending data, that is writing from the end of +file. When you open a file this way, all data always goes to the +current end of file; you cannot change this using <>. +o- + +Some host systems distinguish between ``binary'' and ``text'' files. +Such systems may perform data transformations on data written to, or +read from, files opened as ``text''. +If your system is one of these, then you can append a `<>' to any +of the three modes above, to specify that you are opening the file as +a binary file (the default is to open the file as a text file). + +`<>', then, means ``read binary''; `<>', ``write binary''; and +`<>', ``append binary''. + +To make C programs more portable, the `<>' is accepted on all +systems, whether or not it makes a difference. + +Finally, you might need to both read and write from the same file. +You can also append a `<<+>>' to any of the three modes, to permit +this. (If you want to append both `<>' and `<<+>>', you can do it +in either order: for example, <<"rb+">> means the same thing as +<<"r+b">> when used as a mode string.) + +Use <<"r+">> (or <<"rb+">>) to permit reading and writing anywhere in +an existing file, without discarding any data; <<"w+">> (or <<"wb+">>) +to create a new file (or begin by discarding all data from an old one) +that permits reading and writing anywhere in it; and <<"a+">> (or +<<"ab+">>) to permit reading anywhere in an existing file, but writing +only at the end. + +RETURNS +<> returns a file pointer which you can use for other file +operations, unless the file you requested could not be opened; in that +situation, the result is <>. If the reason for failure was an +invalid string at <[mode]>, <> is set to <>. + +PORTABILITY +<> is required by ANSI C. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>, <>. +*/ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "%W% (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include "local.h" + +FILE * +_DEFUN (_fopen_r, (ptr, file, mode), + struct _reent *ptr _AND + _CONST char *file _AND + _CONST char *mode) +{ + register FILE *fp; + register int f; + int flags, oflags; + + if ((flags = __sflags (ptr, mode, &oflags)) == 0) + return NULL; + if ((fp = __sfp (ptr)) == NULL) + return NULL; + + if ((f = _open_r (fp->_data, file, oflags, 0666)) < 0) + { + fp->_flags = 0; /* release */ + return NULL; + } + + fp->_file = f; + fp->_flags = flags; + fp->_cookie = (_PTR) fp; + fp->_read = __sread; + fp->_write = __swrite; + fp->_seek = __sseek; + fp->_close = __sclose; + + if (fp->_flags & __SAPP) + fseek (fp, 0, SEEK_END); + + return fp; +} + +#ifndef _REENT_ONLY + +FILE * +_DEFUN (fopen, (file, mode), + _CONST char *file _AND + _CONST char *mode) +{ + return _fopen_r (_REENT, file, mode); +} + +#endif diff --git a/newlib/libc/stdio/fprintf.c b/newlib/libc/stdio/fprintf.c new file mode 100644 index 000000000..de036605f --- /dev/null +++ b/newlib/libc/stdio/fprintf.c @@ -0,0 +1,56 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include <_ansi.h> +#include + +#ifdef _HAVE_STDC + +#include + +int +fprintf (FILE * fp, const char *fmt,...) +{ + int ret; + va_list ap; + + va_start (ap, fmt); + ret = vfprintf (fp, fmt, ap); + va_end (ap); + return ret; +} + +#else + +#include + +int +fprintf (fp, fmt, va_alist) + FILE *fp; + char *fmt; + va_dcl +{ + int ret; + va_list ap; + + va_start (ap); + ret = vfprintf (fp, fmt, ap); + va_end (ap); + return ret; +} + +#endif diff --git a/newlib/libc/stdio/fputc.c b/newlib/libc/stdio/fputc.c new file mode 100644 index 000000000..966a0dbf7 --- /dev/null +++ b/newlib/libc/stdio/fputc.c @@ -0,0 +1,51 @@ +/* +FUNCTION +<>---write a character on a stream or file + +INDEX + fputc + +ANSI_SYNOPSIS + #include + int fputc(int <[ch]>, FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + int fputc(<[ch]>, <[fp]>) + int <[ch]>; + FILE *<[fp]>; + +DESCRIPTION +<> converts the argument <[ch]> from an <> to an +<>, then writes it to the file or stream identified by +<[fp]>. + +If the file was opened with append mode (or if the stream cannot +support positioning), then the new character goes at the end of the +file or stream. Otherwise, the new character is written at the +current value of the position indicator, and the position indicator +oadvances by one. + +For a macro version of this function, see <>. + +RETURNS +If successful, <> returns its argument <[ch]>. If an error +intervenes, the result is <>. You can use `<)>>' to +query for errors. + +PORTABILITY +<> is required by ANSI C. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include + +int +_DEFUN (fputc, (ch, file), + int ch _AND + FILE * file) +{ + return putc (ch, file); +} diff --git a/newlib/libc/stdio/fputs.c b/newlib/libc/stdio/fputs.c new file mode 100644 index 000000000..62ce98fb7 --- /dev/null +++ b/newlib/libc/stdio/fputs.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---write a character string in a file or stream + +INDEX + fputs + +ANSI_SYNOPSIS + #include + int fputs(const char *<[s]>, FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + int fputs(<[s]>, <[fp]>) + char *<[s]>; + FILE *<[fp]>; + +DESCRIPTION +<> writes the string at <[s]> (but without the trailing null) +to the file or stream identified by <[fp]>. + +RETURNS +If successful, the result is <<0>>; otherwise, the result is <>. + +PORTABILITY +ANSI C requires <>, but does not specify that the result on +success must be <<0>>; any non-negative value is permitted. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include +#include +#include "fvwrite.h" + +/* + * Write the given string to the given file. + */ + +int +_DEFUN (fputs, (s, fp), + char _CONST * s _AND + FILE * fp) +{ + struct __suio uio; + struct __siov iov; + + iov.iov_base = s; + iov.iov_len = uio.uio_resid = strlen (s); + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + return __sfvwrite (fp, &uio); +} diff --git a/newlib/libc/stdio/fread.c b/newlib/libc/stdio/fread.c new file mode 100644 index 000000000..4de7ce290 --- /dev/null +++ b/newlib/libc/stdio/fread.c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---read array elements from a file + +INDEX + fread + +ANSI_SYNOPSIS + #include + size_t fread(void *<[buf]>, size_t <[size]>, size_t <[count]>, + FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + size_t fread(<[buf]>, <[size]>, <[count]>, <[fp]>) + char *<[buf]>; + size_t <[size]>; + size_t <[count]>; + FILE *<[fp]>; + +DESCRIPTION +<> attempts to copy, from the file or stream identified by +<[fp]>, <[count]> elements (each of size <[size]>) into memory, +starting at <[buf]>. <> may copy fewer elements than +<[count]> if an error, or end of file, intervenes. + +<> also advances the file position indicator (if any) for +<[fp]> by the number of @emph{characters} actually read. + +RETURNS +The result of <> is the number of elements it succeeded in +reading. + +PORTABILITY +ANSI C requires <>. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include +#include +#include "local.h" + +size_t +_DEFUN (fread, (buf, size, count, fp), + _PTR buf _AND + size_t size _AND + size_t count _AND + FILE * fp) +{ + register size_t resid; + register char *p; + register int r; + size_t total; + + if ((resid = count * size) == 0) + return 0; + if (fp->_r < 0) + fp->_r = 0; + total = resid; + p = buf; + while (resid > (r = fp->_r)) + { + (void) memcpy ((void *) p, (void *) fp->_p, (size_t) r); + fp->_p += r; + /* fp->_r = 0 ... done in __srefill */ + p += r; + resid -= r; + if (__srefill (fp)) + { + /* no more input: return partial result */ + return (total - resid) / size; + } + } + (void) memcpy ((void *) p, (void *) fp->_p, resid); + fp->_r -= resid; + fp->_p += resid; + return count; +} diff --git a/newlib/libc/stdio/freopen.c b/newlib/libc/stdio/freopen.c new file mode 100644 index 000000000..a4ab965e9 --- /dev/null +++ b/newlib/libc/stdio/freopen.c @@ -0,0 +1,151 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---open a file using an existing file descriptor + +INDEX + freopen + +ANSI_SYNOPSIS + #include + FILE *freopen(const char *<[file]>, const char *<[mode]>, + FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + FILE *freopen(<[file]>, <[mode]>, <[fp]>) + char *<[file]>; + char *<[mode]>; + FILE *<[fp]>; + +DESCRIPTION +Use this variant of <> if you wish to specify a particular file +descriptor <[fp]> (notably <>, <>, or <>) for +the file. + +If <[fp]> was associated with another file or stream, <> +closes that other file or stream (but ignores any errors while closing +it). + +<[file]> and <[mode]> are used just as in <>. + +RETURNS +If successful, the result is the same as the argument <[fp]>. If the +file cannot be opened as specified, the result is <>. + +PORTABILITY +ANSI C requires <>. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>, <>. +*/ + +#include +#include +#include +#include +#include "local.h" + +/* + * Re-direct an existing, open (probably) file to some other file. + */ + +FILE * +_DEFUN (freopen, (file, mode, fp), + _CONST char *file _AND + _CONST char *mode _AND + register FILE *fp) +{ + register int f; + int flags, oflags, e; + struct _reent *ptr; + + CHECK_INIT (fp); + ptr = fp->_data; + + if ((flags = __sflags (ptr, mode, &oflags)) == 0) + { + (void) fclose (fp); + return NULL; + } + + /* + * Remember whether the stream was open to begin with, and + * which file descriptor (if any) was associated with it. + * If it was attached to a descriptor, defer closing it, + * so that, e.g., freopen("/dev/stdin", "r", stdin) works. + * This is unnecessary if it was not a Unix file. + */ + + if (fp->_flags == 0) + fp->_flags = __SEOF; /* hold on to it */ + else + { + if (fp->_flags & __SWR) + (void) fflush (fp); + /* if close is NULL, closing is a no-op, hence pointless */ + if (fp->_close != NULL) + (void) (*fp->_close) (fp->_cookie); + } + + /* + * Now get a new descriptor to refer to the new file. + */ + + f = _open_r (ptr, (char *) file, oflags, 0666); + e = ptr->_errno; + + /* + * Finish closing fp. Even if the open succeeded above, + * we cannot keep fp->_base: it may be the wrong size. + * This loses the effect of any setbuffer calls, + * but stdio has always done this before. + */ + + if (fp->_flags & __SMBF) + _free_r (ptr, (char *) fp->_bf._base); + fp->_w = 0; + fp->_r = 0; + fp->_p = NULL; + fp->_bf._base = NULL; + fp->_bf._size = 0; + fp->_lbfsize = 0; + if (HASUB (fp)) + FREEUB (fp); + fp->_ub._size = 0; + if (HASLB (fp)) + FREELB (fp); + fp->_lb._size = 0; + + if (f < 0) + { /* did not get it after all */ + fp->_flags = 0; /* set it free */ + ptr->_errno = e; /* restore in case _close clobbered */ + return NULL; + } + + fp->_flags = flags; + fp->_file = f; + fp->_cookie = (_PTR) fp; + fp->_read = __sread; + fp->_write = __swrite; + fp->_seek = __sseek; + fp->_close = __sclose; + return fp; +} diff --git a/newlib/libc/stdio/fscanf.c b/newlib/libc/stdio/fscanf.c new file mode 100644 index 000000000..8980410d3 --- /dev/null +++ b/newlib/libc/stdio/fscanf.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include <_ansi.h> +#include + +#ifdef _HAVE_STDC + +#include + +extern int __svfscanf (); + +int +fscanf (FILE * fp, const char *fmt, ...) +{ + int ret; + va_list ap; + + va_start (ap, fmt); + ret = __svfscanf (fp, fmt, ap); + va_end (ap); + return ret; +} + +#else + +#include + +extern int __svfscanf (); + +int +fscanf (fp, fmt, va_alist) + FILE *fp; + char *fmt; + va_dcl +{ + int ret; + va_list ap; + + va_start (ap); + ret = __svfscanf (fp, fmt, ap); + va_end (ap); + return ret; +} + +#endif diff --git a/newlib/libc/stdio/fseek.c b/newlib/libc/stdio/fseek.c new file mode 100644 index 000000000..d22292e97 --- /dev/null +++ b/newlib/libc/stdio/fseek.c @@ -0,0 +1,310 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---set file position + +INDEX + fseek + +ANSI_SYNOPSIS + #include + int fseek(FILE *<[fp]>, long <[offset]>, int <[whence]>) + +TRAD_SYNOPSIS + #include + int fseek(<[fp]>, <[offset]>, <[whence]>) + FILE *<[fp]>; + long <[offset]>; + int <[whence]>; + +DESCRIPTION +Objects of type <> can have a ``position'' that records how much +of the file your program has already read. Many of the <> functions +depend on this position, and many change it as a side effect. + +You can use <> to set the position for the file identified by +<[fp]>. The value of <[offset]> determines the new position, in one +of three ways selected by the value of <[whence]> (defined as macros +in `<>'): + +<>---<[offset]> is the absolute file position (an offset +from the beginning of the file) desired. <[offset]> must be positive. + +<>---<[offset]> is relative to the current file position. +<[offset]> can meaningfully be either positive or negative. + +<>---<[offset]> is relative to the current end of file. +<[offset]> can meaningfully be either positive (to increase the size +of the file) or negative. + +See <> to determine the current file position. + +RETURNS +<> returns <<0>> when successful. If <> fails, the +result is <>. The reason for failure is indicated in <>: +either <> (the stream identified by <[fp]> doesn't support +repositioning) or <> (invalid file position). + +PORTABILITY +ANSI C requires <>. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include +#include +#include +#include +#include +#include +#include "local.h" + +#define POS_ERR (-(fpos_t)1) + +/* + * Seek the given file to the given offset. + * `Whence' must be one of the three SEEK_* macros. + */ + +int +fseek (fp, offset, whence) + register FILE *fp; + long offset; + int whence; +{ + struct _reent *ptr; + fpos_t _EXFUN ((*seekfn), (void *, fpos_t, int)); + fpos_t target, curoff; + size_t n; + struct stat st; + int havepos; + + /* Make sure stdio is set up. */ + + CHECK_INIT (fp); + ptr = fp->_data; + + /* If we've been doing some writing, and we're in append mode + then we don't really know where the filepos is. */ + + if (fp->_flags & __SAPP && fp->_flags & __SWR) + { + /* So flush the buffer and seek to the end. */ + fflush (fp); + } + + /* Have to be able to seek. */ + + if ((seekfn = fp->_seek) == NULL) + { + ptr->_errno = ESPIPE; /* ??? */ + return EOF; + } + + /* + * Change any SEEK_CUR to SEEK_SET, and check `whence' argument. + * After this, whence is either SEEK_SET or SEEK_END. + */ + + switch (whence) + { + case SEEK_CUR: + /* + * In order to seek relative to the current stream offset, + * we have to first find the current stream offset a la + * ftell (see ftell for details). + */ + fflush(fp); /* may adjust seek offset on append stream */ + if (fp->_flags & __SOFF) + curoff = fp->_offset; + else + { + curoff = (*seekfn) (fp->_cookie, (fpos_t) 0, SEEK_CUR); + if (curoff == -1L) + return EOF; + } + if (fp->_flags & __SRD) + { + curoff -= fp->_r; + if (HASUB (fp)) + curoff -= fp->_ur; + } + else if (fp->_flags & __SWR && fp->_p != NULL) + curoff += fp->_p - fp->_bf._base; + + offset += curoff; + whence = SEEK_SET; + havepos = 1; + break; + + case SEEK_SET: + case SEEK_END: + havepos = 0; + break; + + default: + ptr->_errno = EINVAL; + return (EOF); + } + + /* + * Can only optimise if: + * reading (and not reading-and-writing); + * not unbuffered; and + * this is a `regular' Unix file (and hence seekfn==__sseek). + * We must check __NBF first, because it is possible to have __NBF + * and __SOPT both set. + */ + + if (fp->_bf._base == NULL) + __smakebuf (fp); + if (fp->_flags & (__SWR | __SRW | __SNBF | __SNPT)) + goto dumb; + if ((fp->_flags & __SOPT) == 0) + { + if (seekfn != __sseek + || fp->_file < 0 + || _fstat_r (ptr, fp->_file, &st) + || (st.st_mode & S_IFMT) != S_IFREG) + { + fp->_flags |= __SNPT; + goto dumb; + } +#ifdef HAVE_BLKSIZE + fp->_blksize = st.st_blksize; +#else + fp->_blksize = 1024; +#endif + fp->_flags |= __SOPT; + } + + /* + * We are reading; we can try to optimise. + * Figure out where we are going and where we are now. + */ + + if (whence == SEEK_SET) + target = offset; + else + { + if (_fstat_r (ptr, fp->_file, &st)) + goto dumb; + target = st.st_size + offset; + } + + if (!havepos) + { + if (fp->_flags & __SOFF) + curoff = fp->_offset; + else + { + curoff = (*seekfn) (fp->_cookie, 0L, SEEK_CUR); + if (curoff == POS_ERR) + goto dumb; + } + curoff -= fp->_r; + if (HASUB (fp)) + curoff -= fp->_ur; + } + + /* + * Compute the number of bytes in the input buffer (pretending + * that any ungetc() input has been discarded). Adjust current + * offset backwards by this count so that it represents the + * file offset for the first byte in the current input buffer. + */ + + if (HASUB (fp)) + { + curoff += fp->_r; /* kill off ungetc */ + n = fp->_up - fp->_bf._base; + curoff -= n; + n += fp->_ur; + } + else + { + n = fp->_p - fp->_bf._base; + curoff -= n; + n += fp->_r; + } + + /* + * If the target offset is within the current buffer, + * simply adjust the pointers, clear EOF, undo ungetc(), + * and return. (If the buffer was modified, we have to + * skip this; see fgetline.c.) + */ + + if ((fp->_flags & __SMOD) == 0 && + target >= curoff && target < curoff + n) + { + register int o = target - curoff; + + fp->_p = fp->_bf._base + o; + fp->_r = n - o; + if (HASUB (fp)) + FREEUB (fp); + fp->_flags &= ~__SEOF; + return 0; + } + + /* + * The place we want to get to is not within the current buffer, + * but we can still be kind to the kernel copyout mechanism. + * By aligning the file offset to a block boundary, we can let + * the kernel use the VM hardware to map pages instead of + * copying bytes laboriously. Using a block boundary also + * ensures that we only read one block, rather than two. + */ + + curoff = target & ~(fp->_blksize - 1); + if ((*seekfn) (fp->_cookie, curoff, SEEK_SET) == POS_ERR) + goto dumb; + fp->_r = 0; + if (HASUB (fp)) + FREEUB (fp); + fp->_flags &= ~__SEOF; + n = target - curoff; + if (n) + { + if (__srefill (fp) || fp->_r < n) + goto dumb; + fp->_p += n; + fp->_r -= n; + } + return 0; + + /* + * We get here if we cannot optimise the seek ... just + * do it. Allow the seek function to change fp->_bf._base. + */ + +dumb: + if (fflush (fp) || (*seekfn) (fp->_cookie, offset, whence) == POS_ERR) + return EOF; + /* success: clear EOF indicator and discard ungetc() data */ + if (HASUB (fp)) + FREEUB (fp); + fp->_p = fp->_bf._base; + fp->_r = 0; + /* fp->_w = 0; *//* unnecessary (I think...) */ + fp->_flags &= ~__SEOF; + return 0; +} diff --git a/newlib/libc/stdio/fsetpos.c b/newlib/libc/stdio/fsetpos.c new file mode 100644 index 000000000..28cd69ead --- /dev/null +++ b/newlib/libc/stdio/fsetpos.c @@ -0,0 +1,54 @@ +/* +FUNCTION +<>---restore position of a stream or file + +INDEX + fsetpos + +ANSI_SYNOPSIS + #include + int fsetpos(FILE *<[fp]>, const fpos_t *<[pos]>); + +TRAD_SYNOPSIS + #include + int fsetpos(<[fp]>, <[pos]>) + FILE *<[fp]>; + fpos_t *<[pos]>; + +DESCRIPTION +Objects of type <> can have a ``position'' that records how much +of the file your program has already read. Many of the <> functions +depend on this position, and many change it as a side effect. + +You can use <> to return the file identified by <[fp]> to a previous +position <<*<[pos]>>> (after first recording it with <>). + +See <> for a similar facility. + +RETURNS +<> returns <<0>> when successful. If <> fails, the +result is <<1>>. The reason for failure is indicated in <>: +either <> (the stream identified by <[fp]> doesn't support +repositioning) or <> (invalid file position). + +PORTABILITY +ANSI C requires <>, but does not specify the nature of +<<*<[pos]>>> beyond identifying it as written by <>. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include + +int +_DEFUN (fsetpos, (iop, pos), + FILE * iop _AND + _CONST fpos_t * pos) +{ + int x = fseek (iop, *pos, SEEK_SET); + + if (x != 0) + return 1; + return 0; +} diff --git a/newlib/libc/stdio/ftell.c b/newlib/libc/stdio/ftell.c new file mode 100644 index 000000000..6a8061816 --- /dev/null +++ b/newlib/libc/stdio/ftell.c @@ -0,0 +1,126 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---return position in a stream or file + +INDEX + ftell + +ANSI_SYNOPSIS + #include + long ftell(FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + long ftell(<[fp]>) + FILE *<[fp]>; + +DESCRIPTION +Objects of type <> can have a ``position'' that records how much +of the file your program has already read. Many of the <> functions +depend on this position, and many change it as a side effect. + +The result of <> is the current position for a file +identified by <[fp]>. If you record this result, you can later +use it with <> to return the file to this +position. + +In the current implementation, <> simply uses a character +count to represent the file position; this is the same number that +would be recorded by <>. + +RETURNS +<> returns the file position, if possible. If it cannot do +this, it returns <<-1L>>. Failure occurs on streams that do not support +positioning; the global <> indicates this condition with the +value <>. + +PORTABILITY +<> is required by the ANSI C standard, but the meaning of its +result (when successful) is not specified beyond requiring that it be +acceptable as an argument to <>. In particular, other +conforming C implementations may return a different result from +<> than what <> records. + +No supporting OS subroutines are required. +*/ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "%W% (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ + +/* + * ftell: return current offset. + */ + +#include +#include + +#include "local.h" + +long +_DEFUN (ftell, (fp), + register FILE * fp) +{ + fpos_t pos; + + /* Ensure stdio is set up. */ + + CHECK_INIT (fp); + + if (fp->_seek == NULL) + { + fp->_data->_errno = ESPIPE; + return -1L; + } + + /* Find offset of underlying I/O object, then + adjust for buffered bytes. */ + fflush(fp); /* may adjust seek offset on append stream */ + if (fp->_flags & __SOFF) + pos = fp->_offset; + else + { + pos = (*fp->_seek) (fp->_cookie, (fpos_t) 0, SEEK_CUR); + if (pos == -1L) + return pos; + } + if (fp->_flags & __SRD) + { + /* + * Reading. Any unread characters (including + * those from ungetc) cause the position to be + * smaller than that in the underlying object. + */ + pos -= fp->_r; + if (HASUB (fp)) + pos -= fp->_ur; + } + else if (fp->_flags & __SWR && fp->_p != NULL) + { + /* + * Writing. Any buffered characters cause the + * position to be greater than that in the + * underlying object. + */ + pos += fp->_p - fp->_bf._base; + } + + return pos; +} diff --git a/newlib/libc/stdio/fvwrite.c b/newlib/libc/stdio/fvwrite.c new file mode 100644 index 000000000..00e758a47 --- /dev/null +++ b/newlib/libc/stdio/fvwrite.c @@ -0,0 +1,195 @@ +/* No user fns here. Pesch 15apr92. */ + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include +#include +#include "local.h" +#include "fvwrite.h" + +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define COPY(n) (void) memmove((void *) fp->_p, (void *) p, (size_t) (n)) + +#define GETIOV(extra_work) \ + while (len == 0) \ + { \ + extra_work; \ + p = iov->iov_base; \ + len = iov->iov_len; \ + iov++; \ + } + +/* + * Write some memory regions. Return zero on success, EOF on error. + * + * This routine is large and unsightly, but most of the ugliness due + * to the three different kinds of output buffering is handled here. + */ + +int +__sfvwrite (fp, uio) + register FILE *fp; + register struct __suio *uio; +{ + register size_t len; + register _CONST char *p; + register struct __siov *iov; + register int w, s; + char *nl; + int nlknown, nldist; + + if ((len = uio->uio_resid) == 0) + return 0; + + /* make sure we can write */ + if (cantwrite (fp)) + return EOF; + + iov = uio->uio_iov; + len = 0; + if (fp->_flags & __SNBF) + { + /* + * Unbuffered: write up to BUFSIZ bytes at a time. + */ + do + { + GETIOV (;); + w = (*fp->_write) (fp->_cookie, p, MIN (len, BUFSIZ)); + if (w <= 0) + goto err; + p += w; + len -= w; + } + while ((uio->uio_resid -= w) != 0); + } + else if ((fp->_flags & __SLBF) == 0) + { + /* + * Fully buffered: fill partially full buffer, if any, + * and then flush. If there is no partial buffer, write + * one _bf._size byte chunk directly (without copying). + * + * String output is a special case: write as many bytes + * as fit, but pretend we wrote everything. This makes + * snprintf() return the number of bytes needed, rather + * than the number used, and avoids its write function + * (so that the write function can be invalid). + */ + do + { + GETIOV (;); + w = fp->_w; + if (fp->_flags & __SSTR) + { + if (len < w) + w = len; + COPY (w); /* copy MIN(fp->_w,len), */ + fp->_w -= w; + fp->_p += w; + w = len; /* but pretend copied all */ + } + else if (fp->_p > fp->_bf._base && len > w) + { + /* fill and flush */ + COPY (w); + /* fp->_w -= w; *//* unneeded */ + fp->_p += w; + if (fflush (fp)) + goto err; + } + else if (len >= (w = fp->_bf._size)) + { + /* write directly */ + w = (*fp->_write) (fp->_cookie, p, w); + if (w <= 0) + goto err; + } + else + { + /* fill and done */ + w = len; + COPY (w); + fp->_w -= w; + fp->_p += w; + } + p += w; + len -= w; + } + while ((uio->uio_resid -= w) != 0); + } + else + { + /* + * Line buffered: like fully buffered, but we + * must check for newlines. Compute the distance + * to the first newline (including the newline), + * or `infinity' if there is none, then pretend + * that the amount to write is MIN(len,nldist). + */ + nlknown = 0; + do + { + GETIOV (nlknown = 0); + if (!nlknown) + { + nl = memchr ((void *) p, '\n', len); + nldist = nl ? nl + 1 - p : len + 1; + nlknown = 1; + } + s = MIN (len, nldist); + w = fp->_w + fp->_bf._size; + if (fp->_p > fp->_bf._base && s > w) + { + COPY (w); + /* fp->_w -= w; */ + fp->_p += w; + if (fflush (fp)) + goto err; + } + else if (s >= (w = fp->_bf._size)) + { + w = (*fp->_write) (fp->_cookie, p, w); + if (w <= 0) + goto err; + } + else + { + w = s; + COPY (w); + fp->_w -= w; + fp->_p += w; + } + if ((nldist -= w) == 0) + { + /* copied the newline: flush and forget */ + if (fflush (fp)) + goto err; + nlknown = 0; + } + p += w; + len -= w; + } + while ((uio->uio_resid -= w) != 0); + } + return 0; + +err: + fp->_flags |= __SERR; + return EOF; +} diff --git a/newlib/libc/stdio/fvwrite.h b/newlib/libc/stdio/fvwrite.h new file mode 100644 index 000000000..f27abdf81 --- /dev/null +++ b/newlib/libc/stdio/fvwrite.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* %W% (Berkeley) %G% */ +#include <_ansi.h> + +/* + * I/O descriptors for __sfvwrite(). + */ +struct __siov { + _CONST _PTR iov_base; + size_t iov_len; +}; +struct __suio { + struct __siov *uio_iov; + int uio_iovcnt; + int uio_resid; +}; + + +extern int _EXFUN(__sfvwrite,(FILE *, struct __suio *)); +extern int _EXFUN(__swsetup,(FILE *)); + + diff --git a/newlib/libc/stdio/fwalk.c b/newlib/libc/stdio/fwalk.c new file mode 100644 index 000000000..516283466 --- /dev/null +++ b/newlib/libc/stdio/fwalk.c @@ -0,0 +1,43 @@ +/* No user fns here. Pesch 15apr92. */ + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "%W% (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include "local.h" + +int +_fwalk (ptr, function) + struct _reent *ptr; + register int (*function) (); +{ + register FILE *fp; + register int n, ret = 0; + register struct _glue *g; + + for (g = &ptr->__sglue; g != NULL; g = g->_next) + for (fp = g->_iobs, n = g->_niobs; --n >= 0; fp++) + if (fp->_flags != 0) + ret |= (*function) (fp); + return ret; +} diff --git a/newlib/libc/stdio/fwrite.c b/newlib/libc/stdio/fwrite.c new file mode 100644 index 000000000..642fb274f --- /dev/null +++ b/newlib/libc/stdio/fwrite.c @@ -0,0 +1,104 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---write array elements + +INDEX + fwrite + +ANSI_SYNOPSIS + #include + size_t fwrite(const void *<[buf]>, size_t <[size]>, + size_t <[count]>, FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + size_t fwrite(<[buf]>, <[size]>, <[count]>, <[fp]>) + char *<[buf]>; + size_t <[size]>; + size_t <[count]>; + FILE *<[fp]>; + +DESCRIPTION +<> attempts to copy, starting from the memory location +<[buf]>, <[count]> elements (each of size <[size]>) into the file or +stream identified by <[fp]>. <> may copy fewer elements than +<[count]> if an error intervenes. + +<> also advances the file position indicator (if any) for +<[fp]> by the number of @emph{characters} actually written. + +RETURNS +If <> succeeds in writing all the elements you specify, the +result is the same as the argument <[count]>. In any event, the +result is the number of complete elements that <> copied to +the file. + +PORTABILITY +ANSI C requires <>. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "%W% (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#if 0 +#include +#endif +#include "local.h" +#if 1 +#include "fvwrite.h" +#endif + +/* + * Write `count' objects (each size `size') from memory to the given file. + * Return the number of whole objects written. + */ + +size_t +_DEFUN (fwrite, (buf, size, count, fp), + _CONST _PTR buf _AND + size_t size _AND + size_t count _AND + FILE * fp) +{ + size_t n; + struct __suio uio; + struct __siov iov; + + iov.iov_base = buf; + uio.uio_resid = iov.iov_len = n = count * size; + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + + /* + * The usual case is success (__sfvwrite returns 0); + * skip the divide if this happens, since divides are + * generally slow and since this occurs whenever size==0. + */ + + if (__sfvwrite (fp, &uio) == 0) + return count; + return (n - uio.uio_resid) / size; +} diff --git a/newlib/libc/stdio/getc.c b/newlib/libc/stdio/getc.c new file mode 100644 index 000000000..4b2509737 --- /dev/null +++ b/newlib/libc/stdio/getc.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---read a character (macro) + +INDEX + getc + +ANSI_SYNOPSIS + #include + int getc(FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + int getc(<[fp]>) + FILE *<[fp]>; + +DESCRIPTION +<> is a macro, defined in <>. You can use <> +to get the next single character from the file or stream +identified by <[fp]>. As a side effect, <> advances the file's +current position indicator. + +For a subroutine version of this macro, see <>. + +RETURNS +The next character (read as an <>, and cast to +<>), unless there is no more data, or the host system reports a +read error; in either of these situations, <> returns <>. + +You can distinguish the two situations that cause an <> result by +using the <> and <> functions. + +PORTABILITY +ANSI C requires <>; it suggests, but does not require, that +<> be implemented as a macro. The standard explicitly permits +macro implementations of <> to use the argument more than once; +therefore, in a portable program, you should not use an expression +with side effects as the <> argument. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "%W% (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ + +#include + +/* + * A subroutine version of the macro getc. + */ + +#undef getc + +int +getc (fp) + register FILE *fp; +{ + /* CHECK_INIT is called (eventually) by __srefill. */ + + return __sgetc (fp); +} diff --git a/newlib/libc/stdio/getchar.c b/newlib/libc/stdio/getchar.c new file mode 100644 index 000000000..475cd138b --- /dev/null +++ b/newlib/libc/stdio/getchar.c @@ -0,0 +1,96 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---read a character (macro) + +INDEX + getchar +INDEX + _getchar_r + +ANSI_SYNOPSIS + #include + int getchar(void); + + int _getchar_r(void *<[reent]>); + +TRAD_SYNOPSIS + #include + int getchar(); + + int _getchar_r(<[reent]>) + char * <[reent]>; + +DESCRIPTION +<> is a macro, defined in <>. You can use <> +to get the next single character from the standard input stream. +As a side effect, <> advances the standard input's +current position indicator. + +The alternate function <<_getchar_r>> is a reentrant version. The +extra argument <[reent]> is a pointer to a reentrancy structure. + + +RETURNS +The next character (read as an <>, and cast to +<>), unless there is no more data, or the host system reports a +read error; in either of these situations, <> returns <>. + +You can distinguish the two situations that cause an <> result by +using `<>' and `<>'. + +PORTABILITY +ANSI C requires <>; it suggests, but does not require, that +<> be implemented as a macro. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "%W% (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ + +/* + * A subroutine version of the macro getchar. + */ + +#include +#include + +#undef getchar + +int +_getchar_r (f) + struct _reent *f; +{ + return getc (_stdin_r (f)); +} + +#ifndef _REENT_ONLY + +int +getchar () +{ + /* CHECK_INIT is called (eventually) by __srefill. */ + + return _getchar_r (_REENT); +} + +#endif diff --git a/newlib/libc/stdio/gets.c b/newlib/libc/stdio/gets.c new file mode 100644 index 000000000..796100e32 --- /dev/null +++ b/newlib/libc/stdio/gets.c @@ -0,0 +1,102 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + + +/* + +FUNCTION + <>---get character string (obsolete, use <> instead) +INDEX + gets +INDEX + _gets_r + +ANSI_SYNOPSIS + #include + + char *gets(char *<[buf]>); + + char *_gets_r(void *<[reent]>, char *<[buf]>); + +TRAD_SYNOPSIS + #include + + char *gets(<[buf]>) + char *<[buf]>; + + char *_gets_r(<[reent]>, <[buf]>) + char *<[reent]>; + char *<[buf]>; + +DESCRIPTION + Reads characters from standard input until a newline is found. + The characters up to the newline are stored in <[buf]>. The + newline is discarded, and the buffer is terminated with a 0. + + This is a @emph{dangerous} function, as it has no way of checking + the amount of space available in <[buf]>. One of the attacks + used by the Internet Worm of 1988 used this to overrun a + buffer allocated on the stack of the finger daemon and + overwrite the return address, causing the daemon to execute + code downloaded into it over the connection. + + The alternate function <<_gets_r>> is a reentrant version. The extra + argument <[reent]> is a pointer to a reentrancy structure. + + +RETURNS + <> returns the buffer passed to it, with the data filled + in. If end of file occurs with some data already accumulated, + the data is returned with no other indication. If end of file + occurs with no data in the buffer, NULL is returned. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include + +char * +_gets_r (ptr, buf) + struct _reent *ptr; + char *buf; +{ + register int c; + register char *s = buf; + + while ((c = _getchar_r (ptr)) != '\n') + if (c == EOF) + if (s == buf) + return NULL; + else + break; + else + *s++ = c; + *s = 0; + return buf; +} + +#ifndef _REENT_ONLY + +char * +gets (buf) + char *buf; +{ + return _gets_r (_REENT, buf); +} + +#endif diff --git a/newlib/libc/stdio/iprintf.c b/newlib/libc/stdio/iprintf.c new file mode 100644 index 000000000..f05404302 --- /dev/null +++ b/newlib/libc/stdio/iprintf.c @@ -0,0 +1,118 @@ +/* +FUNCTION + <>---write formatted output (integer only) +INDEX + iprintf + +ANSI_SYNOPSIS + #include + + int iprintf(const char *<[format]>, ...); + +TRAD_SYNOPSIS + #include + + int iprintf(<[format]> [, <[arg]>, ...]) + char *<[format]>; + +DESCRIPTION +<> is a restricted version of <>: it has the same +arguments and behavior, save that it cannot perform any floating-point +formatting: the <>, <>, <>, <>, and <> type specifiers +are not recognized. + +RETURNS + <> returns the number of bytes in the output string, + save that the concluding <> is not counted. + <> returns when the end of the format string is + encountered. If an error occurs, <> + returns <>. + +PORTABILITY +<> is not required by ANSI C. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include <_ansi.h> +#include + +#ifndef _REENT_ONLY + +#ifdef _HAVE_STDC + +#include + +int +iprintf (const char *fmt,...) +{ + int ret; + va_list ap; + + va_start (ap, fmt); + _stdout_r (_REENT)->_data = _REENT; + ret = vfiprintf (stdout, fmt, ap); + va_end (ap); + return ret; +} + +#else + +#include + +int +iprintf (fmt, va_alist) + char *fmt; + va_dcl +{ + int ret; + va_list ap; + + va_start (ap); + _stdout_r (_REENT)->_data = _REENT; + ret = vfiprintf (stdout, fmt, ap); + va_end (ap); + return ret; +} + +#endif /* ! _HAVE_STDC */ +#endif /* ! _REENT_ONLY */ + +#ifdef _HAVE_STDC + +#include + +int +_iprintf_r (struct _reent *ptr, const char *fmt, ...) +{ + int ret; + va_list ap; + + va_start (ap, fmt); + ret = vfiprintf (_stdout_r (ptr), fmt, ap); + va_end (ap); + return ret; +} + +#else + +#include + +int +_iprintf_r (data, fmt, va_alist) + char *data; + char *fmt; + va_dcl +{ + int ret; + struct _reent *ptr = data; + va_list ap; + + va_start (ap); + ret = vfiprintf (_stdout_r (ptr), fmt, ap); + va_end (ap); + return ret; +} + +#endif diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h new file mode 100644 index 000000000..71e80cc09 --- /dev/null +++ b/newlib/libc/stdio/local.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * %W% (UofMD/Berkeley) %G% + */ + +/* + * Information local to this implementation of stdio, + * in particular, macros and private variables. + */ + +#include <_ansi.h> +#include +#include +#include + +extern int _EXFUN(__svfscanf,(FILE *, _CONST char *,va_list)); +extern FILE *_EXFUN(__sfp,(struct _reent *)); +extern int _EXFUN(__sflags,(struct _reent *,_CONST char*, int*)); +extern int _EXFUN(__srefill,(FILE *)); +extern int _EXFUN(__sread,(void *, char *, int)); +extern int _EXFUN(__swrite,(void *, char const *, int)); +extern fpos_t _EXFUN(__sseek,(void *, fpos_t, int)); +extern int _EXFUN(__sclose,(void *)); +extern void _EXFUN(__sinit,(struct _reent *)); +extern void _EXFUN(_cleanup_r,(struct _reent *)); +extern void _EXFUN(__smakebuf,(FILE *)); +extern int _EXFUN(_fwalk,(struct _reent *, int (*)(FILE *))); +struct _glue * _EXFUN(__sfmoreglue,(struct _reent *,int n)); +extern int _EXFUN(__srefill,(FILE *fp)); + +/* Called by the main entry point fns to ensure stdio has been initialized. */ + +#define CHECK_INIT(fp) \ + do \ + { \ + if ((fp)->_data == 0) \ + (fp)->_data = _REENT; \ + if (!(fp)->_data->__sdidinit) \ + __sinit ((fp)->_data); \ + } \ + while (0) + +/* Return true iff the given FILE cannot be written now. */ + +#define cantwrite(fp) \ + ((((fp)->_flags & __SWR) == 0 || (fp)->_bf._base == NULL) && \ + __swsetup(fp)) + +/* Test whether the given stdio file has an active ungetc buffer; + release such a buffer, without restoring ordinary unread data. */ + +#define HASUB(fp) ((fp)->_ub._base != NULL) +#define FREEUB(fp) { \ + if ((fp)->_ub._base != (fp)->_ubuf) \ + _free_r(fp->_data, (char *)(fp)->_ub._base); \ + (fp)->_ub._base = NULL; \ +} + +/* Test for an fgetline() buffer. */ + +#define HASLB(fp) ((fp)->_lb._base != NULL) +#define FREELB(fp) { _free_r(fp->_data,(char *)(fp)->_lb._base); (fp)->_lb._base = NULL; } + +/* WARNING: _dcvt is defined in the stdlib directory, not here! */ + +char *_EXFUN(_dcvt,(struct _reent *, char *, double, int, int, char, int)); +char *_EXFUN(_sicvt,(char *, short, char)); +char *_EXFUN(_icvt,(char *, int, char)); +char *_EXFUN(_licvt,(char *, long, char)); +#ifdef __GNUC__ +char *_EXFUN(_llicvt,(char *, long long, char)); +#endif + +#define CVT_BUF_SIZE 128 + +#define NDYNAMIC 4 /* add four more whenever necessary */ diff --git a/newlib/libc/stdio/makebuf.c b/newlib/libc/stdio/makebuf.c new file mode 100644 index 000000000..4a09c4d50 --- /dev/null +++ b/newlib/libc/stdio/makebuf.c @@ -0,0 +1,96 @@ +/* No user fns here. Pesch 15apr92. */ + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include +#include +#include +#include +#include + +#include "local.h" + +/* + * Allocate a file buffer, or switch to unbuffered I/O. + * Per the ANSI C standard, ALL tty devices default to line buffered. + * + * As a side effect, we set __SOPT or __SNPT (en/dis-able fseek + * optimization) right after the _fstat() that finds the buffer size. + */ + +void +__smakebuf (fp) + register FILE *fp; +{ + register size_t size, couldbetty; + register _PTR p; + struct stat st; + + if (fp->_flags & __SNBF) + { + fp->_bf._base = fp->_p = fp->_nbuf; + fp->_bf._size = 1; + return; + } + if (fp->_file < 0 || _fstat_r (fp->_data, fp->_file, &st) < 0) + { + couldbetty = 0; + size = BUFSIZ; + /* do not try to optimise fseek() */ + fp->_flags |= __SNPT; + } + else + { + couldbetty = (st.st_mode & S_IFMT) == S_IFCHR; +#ifdef HAVE_BLKSIZE + size = st.st_blksize <= 0 ? BUFSIZ : st.st_blksize; +#else + size = BUFSIZ; +#endif + /* + * Optimize fseek() only if it is a regular file. + * (The test for __sseek is mainly paranoia.) + */ + if ((st.st_mode & S_IFMT) == S_IFREG && fp->_seek == __sseek) + { + fp->_flags |= __SOPT; +#ifdef HAVE_BLKSIZE + fp->_blksize = st.st_blksize; +#else + fp->_blksize = 1024; +#endif + } + else + fp->_flags |= __SNPT; + } + if ((p = _malloc_r (fp->_data, size)) == NULL) + { + fp->_flags |= __SNBF; + fp->_bf._base = fp->_p = fp->_nbuf; + fp->_bf._size = 1; + } + else + { + fp->_data->__cleanup = _cleanup_r; + fp->_flags |= __SMBF; + fp->_bf._base = fp->_p = (unsigned char *) p; + fp->_bf._size = size; + if (couldbetty && isatty (fp->_file)) + fp->_flags |= __SLBF; + } +} diff --git a/newlib/libc/stdio/mktemp.c b/newlib/libc/stdio/mktemp.c new file mode 100644 index 000000000..f6a6b688f --- /dev/null +++ b/newlib/libc/stdio/mktemp.c @@ -0,0 +1,219 @@ +/* This is file MKTEMP.C */ +/* This file may have been modified by DJ Delorie (Jan 1991). If so, +** these modifications are Coyright (C) 1991 DJ Delorie, 24 Kirsten Ave, +** Rochester NH, 03867-2954, USA. +*/ + +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that: (1) source distributions retain this entire copyright + * notice and comment, and (2) distributions including binaries display + * the following acknowledgement: ``This product includes software + * developed by the University of California, Berkeley and its contributors'' + * in the documentation or other materials provided with the distribution + * and in all advertising materials mentioning features or use of this + * software. Neither the name of the University nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>, <>---generate unused file name + +INDEX + mktemp +INDEX + mkstemp +INDEX + _mktemp_r +INDEX + _mkstemp_r + +ANSI_SYNOPSIS + #include + char *mktemp(char *<[path]>); + int mkstemp(char *<[path]>); + + char *_mktemp_r(void *<[reent]>, char *<[path]>); + int *_mkstemp_r(void *<[reent]>, char *<[path]>); + +TRAD_SYNOPSIS + #include + char *mktemp(<[path]>) + char *<[path]>; + + int mkstemp(<[path]>) + char *<[path]>; + + char *_mktemp_r(<[reent]>, <[path]>) + char *<[reent]>; + char *<[path]>; + + int _mkstemp_r(<[reent]>, <[path]>) + char *<[reent]>; + char *<[path]>; + +DESCRIPTION +<> and <> attempt to generate a file name that is not +yet in use for any existing file. <> creates the file and +opens it for reading and writing; <> simply generates the file name. + +You supply a simple pattern for the generated file name, as the string +at <[path]>. The pattern should be a valid filename (including path +information if you wish) ending with some number of `<>' +characters. The generated filename will match the leading part of the +name you supply, with the trailing `<>' characters replaced by some +combination of digits and letters. + +The alternate functions <<_mktemp_r>> and <<_mkstemp_r>> are reentrant +versions. The extra argument <[reent]> is a pointer to a reentrancy +structure. + +RETURNS +<> returns the pointer <[path]> to the modified string +representing an unused filename, unless it could not generate one, or +the pattern you provided is not suitable for a filename; in that case, +it returns <>. + +<> returns a file descriptor to the newly created file, +unless it could not generate an unused filename, or the pattern you +provided is not suitable for a filename; in that case, it returns +<<-1>>. + +PORTABILITY +ANSI C does not require either <> or <>; the System +V Interface Definition requires <> as of Issue 2. + +Supporting OS subroutines required: <>, <>, <>. +*/ + +#include +#include +#include +#include +#include +#include +#include + +static +_DEFUN (_gettemp, (ptr, path, doopen), + struct _reent *ptr _AND + char *path _AND + register int *doopen) +{ + register char *start, *trv; + struct stat sbuf; + unsigned int pid; + + pid = _getpid_r (ptr); + for (trv = path; *trv; ++trv) /* extra X's get set to 0's */ + continue; + while (*--trv == 'X') + { + *trv = (pid % 10) + '0'; + pid /= 10; + } + + /* + * Check the target directory; if you have six X's and it + * doesn't exist this runs for a *very* long time. + */ + + for (start = trv + 1;; --trv) + { + if (trv <= path) + break; + if (*trv == '/') + { + *trv = '\0'; + if (_stat_r (ptr, path, &sbuf)) + return (0); + if (!(sbuf.st_mode & S_IFDIR)) + { + ptr->_errno = ENOTDIR; + return (0); + } + *trv = '/'; + break; + } + } + + for (;;) + { + if (doopen) + { + if ((*doopen = _open_r (ptr, path, O_CREAT | O_EXCL | O_RDWR, 0600)) + >= 0) + return 1; +#if defined(__CYGWIN32__) || defined(__CYGWIN__) + if (ptr->_errno != EEXIST && ptr->_errno != EACCES) +#else + if (ptr->_errno != EEXIST) +#endif + return 0; + } + else if (_stat_r (ptr, path, &sbuf)) + return (ptr->_errno == ENOENT ? 1 : 0); + + /* tricky little algorithm for backward compatibility */ + for (trv = start;;) + { + if (!*trv) + return 0; + if (*trv == 'z') + *trv++ = 'a'; + else + { + if (isdigit (*trv)) + *trv = 'a'; + else + ++ * trv; + break; + } + } + } + /*NOTREACHED*/ +} + +_DEFUN (_mkstemp_r, (ptr, path), + struct _reent *ptr _AND + char *path) +{ + int fd; + + return (_gettemp (ptr, path, &fd) ? fd : -1); +} + +char * +_DEFUN (_mktemp_r, (ptr, path), + struct _reent *ptr _AND + char *path) +{ + return (_gettemp (ptr, path, (int *) NULL) ? path : (char *) NULL); +} + +#ifndef _REENT_ONLY + +_DEFUN (mkstemp, (path), + char *path) +{ + int fd; + + return (_gettemp (_REENT, path, &fd) ? fd : -1); +} + +char * +_DEFUN (mktemp, (path), + char *path) +{ + return (_gettemp (_REENT, path, (int *) NULL) ? path : (char *) NULL); +} + +#endif /* ! defined (_REENT_ONLY) */ diff --git a/newlib/libc/stdio/perror.c b/newlib/libc/stdio/perror.c new file mode 100644 index 000000000..abb595ba9 --- /dev/null +++ b/newlib/libc/stdio/perror.c @@ -0,0 +1,80 @@ +/* +FUNCTION +<>---print an error message on standard error + +INDEX + perror +INDEX + _perror_r + +ANSI_SYNOPSIS + #include + void perror(char *<[prefix]>); + + void _perror_r(void *<[reent]>, char *<[prefix]>); + +TRAD_SYNOPSIS + #include + void perror(<[prefix]>) + char *<[prefix]>; + + void _perror_r(<[reent]>, <[prefix]>) + char *<[reent]>; + char *<[prefix]>; + +DESCRIPTION +Use <> to print (on standard error) an error message +corresponding to the current value of the global variable <>. +Unless you use <> as the value of the argument <[prefix]>, the +error message will begin with the string at <[prefix]>, followed by a +colon and a space (<<: >>). The remainder of the error message is one +of the strings described for <>. + +The alternate function <<_perror_r>> is a reentrant version. The +extra argument <[reent]> is a pointer to a reentrancy structure. + + +RETURNS +<> returns no result. + +PORTABILITY +ANSI C requires <>, but the strings issued vary from one +implementation to another. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include +#include +#include + +void +_DEFUN (_perror_r, (ptr, s), + struct _reent *ptr _AND + _CONST char *s) +{ + char *error; + + if (s != NULL && *s != '\0') + { + fputs (s, _stderr_r (ptr)); + fputs (": ", _stderr_r (ptr)); + } + + if ((error = strerror (ptr->_errno)) != NULL) + fputs (error, _stderr_r (ptr)); + + fputc ('\n', _stderr_r (ptr)); +} + +#ifndef _REENT_ONLY + +void +_DEFUN (perror, (s), + _CONST char *s) +{ + _perror_r (_REENT, s); +} + +#endif diff --git a/newlib/libc/stdio/printf.c b/newlib/libc/stdio/printf.c new file mode 100644 index 000000000..81fb8a2cb --- /dev/null +++ b/newlib/libc/stdio/printf.c @@ -0,0 +1,83 @@ + +#include <_ansi.h> +#include + +#ifdef _HAVE_STDC + +#include + +int +_printf_r (struct _reent *ptr, const char *fmt, ...) +{ + int ret; + va_list ap; + + va_start (ap, fmt); + ret = _vfprintf_r (ptr, _stdout_r (ptr), fmt, ap); + va_end (ap); + return ret; +} + +#else + +#include + +int +_printf_r (ptr, fmt, va_alist) + struct _reent *ptr; + char *fmt; + va_dcl +{ + int ret; + va_list ap; + + va_start (ap); + ret = _vfprintf_r (ptr, _stdout_r (ptr), fmt, ap); + va_end (ap); + return ret; +} + +#endif + + +#ifndef _REENT_ONLY + +#ifdef _HAVE_STDC + +#include + +int +printf (const char *fmt, ...) +{ + int ret; + va_list ap; + + va_start (ap, fmt); + _stdout_r (_REENT)->_data = _REENT; + ret = vfprintf (_stdout_r (_REENT), fmt, ap); + va_end (ap); + return ret; +} + +#else + +#include + +int +printf (fmt, va_alist) + char *fmt; + va_dcl +{ + int ret; + va_list ap; + + va_start (ap); + _stdout_r (_REENT)->_data = _REENT; + ret = vfprintf (_stdout_r (_REENT), fmt, ap); + va_end (ap); + return ret; +} + +#endif /* ! _HAVE_STDC */ + +#endif /* ! _REENT_ONLY */ diff --git a/newlib/libc/stdio/putc.c b/newlib/libc/stdio/putc.c new file mode 100644 index 000000000..27a7a4280 --- /dev/null +++ b/newlib/libc/stdio/putc.c @@ -0,0 +1,84 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---write a character (macro) + +INDEX + putc + +ANSI_SYNOPSIS + #include + int putc(int <[ch]>, FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + int putc(<[ch]>, <[fp]>) + int <[ch]>; + FILE *<[fp]>; + +DESCRIPTION +<> is a macro, defined in <>. <> +writes the argument <[ch]> to the file or stream identified by +<[fp]>, after converting it from an <> to an <>. + +If the file was opened with append mode (or if the stream cannot +support positioning), then the new character goes at the end of the +file or stream. Otherwise, the new character is written at the +current value of the position indicator, and the position indicator +advances by one. + +For a subroutine version of this macro, see <>. + +RETURNS +If successful, <> returns its argument <[ch]>. If an error +intervenes, the result is <>. You can use `<)>>' to +query for errors. + +PORTABILITY +ANSI C requires <>; it suggests, but does not require, that +<> be implemented as a macro. The standard explicitly permits +macro implementations of <> to use the <[fp]> argument more than once; +therefore, in a portable program, you should not use an expression +with side effects as this argument. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "%W% (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ + +#include + +/* + * A subroutine version of the macro putc. + */ + +#undef putc + +int +putc (c, fp) + int c; + register FILE *fp; +{ + /* CHECK_INIT is (eventually) called by __swbuf. */ + + return __sputc (c, fp); +} diff --git a/newlib/libc/stdio/putchar.c b/newlib/libc/stdio/putchar.c new file mode 100644 index 000000000..7f7c442e4 --- /dev/null +++ b/newlib/libc/stdio/putchar.c @@ -0,0 +1,94 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---write a character (macro) + +INDEX + putchar +INDEX + _putchar_r + +ANSI_SYNOPSIS + #include + int putchar(int <[ch]>); + + int _putchar_r(void *<[reent]>, int <[ch]>); + +TRAD_SYNOPSIS + #include + int putchar(<[ch]>) + int <[ch]>; + + int _putchar_r(<[reent]>, <[ch]>) + char *<[reent]>; + int <[ch]>; + +DESCRIPTION +<> is a macro, defined in <>. <> +writes its argument to the standard output stream, +after converting it from an <> to an <>. + +The alternate function <<_putchar_r>> is a reentrant version. The +extra argument <[reent]> is a pointer to a reentrancy structure. + +RETURNS +If successful, <> returns its argument <[ch]>. If an error +intervenes, the result is <>. You can use `<>' to +query for errors. + +PORTABILITY +ANSI C requires <>; it suggests, but does not require, that +<> be implemented as a macro. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "%W% (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ + +/* + * A subroutine version of the macro putchar + */ + +#include + +#undef putchar + +int +_putchar_r (ptr, c) + struct _reent *ptr; + int c; +{ + return __sputc (c, _stdout_r (ptr)); +} + +#ifndef _REENT_ONLY + +int +putchar (c) + int c; +{ + /* CHECK_INIT is (eventually) called by __swbuf. */ + + _putchar_r (_REENT, c); +} + +#endif diff --git a/newlib/libc/stdio/puts.c b/newlib/libc/stdio/puts.c new file mode 100644 index 000000000..44f17cc91 --- /dev/null +++ b/newlib/libc/stdio/puts.c @@ -0,0 +1,101 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---write a character string + +INDEX + puts +INDEX + _puts_r + +ANSI_SYNOPSIS + #include + int puts(const char *<[s]>); + + int _puts_r(void *<[reent]>, const char *<[s]>); + +TRAD_SYNOPSIS + #include + int puts(<[s]>) + char *<[s]>; + + int _puts_r(<[reent]>, <[s]>) + char *<[reent]>; + char *<[s]>; + +DESCRIPTION +<> writes the string at <[s]> (followed by a newline, instead of +the trailing null) to the standard output stream. + +The alternate function <<_puts_r>> is a reentrant version. The extra +argument <[reent]> is a pointer to a reentrancy structure. + +RETURNS +If successful, the result is a nonnegative integer; otherwise, the +result is <>. + +PORTABILITY +ANSI C requires <>, but does not specify that the result on +success must be <<0>>; any non-negative value is permitted. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "%W% (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include "fvwrite.h" + +/* + * Write the given string to stdout, appending a newline. + */ + +int +_DEFUN (_puts_r, (ptr, s), + struct _reent *ptr _AND + _CONST char * s) +{ + size_t c = strlen (s); + struct __suio uio; + struct __siov iov[2]; + + iov[0].iov_base = s; + iov[0].iov_len = c; + iov[1].iov_base = "\n"; + iov[1].iov_len = 1; + uio.uio_resid = c + 1; + uio.uio_iov = &iov[0]; + uio.uio_iovcnt = 2; + + return (__sfvwrite (_stdout_r (ptr), &uio) ? EOF : '\n'); +} + +#ifndef _REENT_ONLY + +int +_DEFUN (puts, (s), + char _CONST * s) +{ + return _puts_r (_REENT, s); +} + +#endif diff --git a/newlib/libc/stdio/refill.c b/newlib/libc/stdio/refill.c new file mode 100644 index 000000000..bc3b83047 --- /dev/null +++ b/newlib/libc/stdio/refill.c @@ -0,0 +1,113 @@ +/* No user fns here. Pesch 15apr92. */ + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include +#include "local.h" +#include + +static int +lflush (fp) + FILE *fp; +{ + if ((fp->_flags & (__SLBF | __SWR)) == __SLBF | __SWR) + return fflush (fp); + return 0; +} + +/* + * Refill a stdio buffer. + * Return EOF on eof or error, 0 otherwise. + */ + +int +_DEFUN (__srefill, (fp), + register FILE * fp) +{ + /* make sure stdio is set up */ + + CHECK_INIT (fp); + + fp->_r = 0; /* largely a convenience for callers */ + + /* SysV does not make this test; take it out for compatibility */ + if (fp->_flags & __SEOF) + return EOF; + + /* if not already reading, have to be reading and writing */ + if ((fp->_flags & __SRD) == 0) + { + if ((fp->_flags & __SRW) == 0) + return EOF; + /* switch to reading */ + if (fp->_flags & __SWR) + { + if (fflush (fp)) + return EOF; + fp->_flags &= ~__SWR; + fp->_w = 0; + fp->_lbfsize = 0; + } + fp->_flags |= __SRD; + } + else + { + /* + * We were reading. If there is an ungetc buffer, + * we must have been reading from that. Drop it, + * restoring the previous buffer (if any). If there + * is anything in that buffer, return. + */ + if (HASUB (fp)) + { + FREEUB (fp); + if ((fp->_r = fp->_ur) != 0) + { + fp->_p = fp->_up; + return 0; + } + } + } + + if (fp->_bf._base == NULL) + __smakebuf (fp); + + /* + * Before reading from a line buffered or unbuffered file, + * flush all line buffered output files, per the ANSI C + * standard. + */ + + if (fp->_flags & (__SLBF | __SNBF)) + (void) _fwalk (fp->_data, lflush); + fp->_p = fp->_bf._base; + fp->_r = (*fp->_read) (fp->_cookie, (char *) fp->_p, fp->_bf._size); + fp->_flags &= ~__SMOD; /* buffer contents are again pristine */ + if (fp->_r <= 0) + { + if (fp->_r == 0) + fp->_flags |= __SEOF; + else + { + fp->_r = 0; + fp->_flags |= __SERR; + } + return EOF; + } + return 0; +} diff --git a/newlib/libc/stdio/remove.c b/newlib/libc/stdio/remove.c new file mode 100644 index 000000000..074dd9ac8 --- /dev/null +++ b/newlib/libc/stdio/remove.c @@ -0,0 +1,69 @@ +/* +FUNCTION +<>---delete a file's name + +INDEX + remove + +ANSI_SYNOPSIS + #include + int remove(char *<[filename]>); + + int _remove_r(void *<[reent]>, char *<[filename]>); + +TRAD_SYNOPSIS + #include + int remove(<[filename]>) + char *<[filename]>; + + int _remove_r(<[reent]>, <[filename]>) + char *<[reent]>; + char *<[filename]>; + +DESCRIPTION +Use <> to dissolve the association between a particular +filename (the string at <[filename]>) and the file it represents. +After calling <> with a particular filename, you will no +longer be able to open the file by that name. + +In this implementation, you may use <> on an open file without +error; existing file descriptors for the file will continue to access +the file's data until the program using them closes the file. + +The alternate function <<_remove_r>> is a reentrant version. The +extra argument <[reent]> is a pointer to a reentrancy structure. + +RETURNS +<> returns <<0>> if it succeeds, <<-1>> if it fails. + +PORTABILITY +ANSI C requires <>, but only specifies that the result on +failure be nonzero. The behavior of <> when you call it on an +open file may vary among implementations. + +Supporting OS subroutine required: <>. +*/ + +#include + +int +_remove_r (ptr, filename) + struct _reent *ptr; + _CONST char *filename; +{ + if (_unlink_r (ptr, filename) == -1) + return -1; + + return 0; +} + +#ifndef _REENT_ONLY + +int +remove (filename) + _CONST char *filename; +{ + return _remove_r (_REENT, filename); +} + +#endif diff --git a/newlib/libc/stdio/rename.c b/newlib/libc/stdio/rename.c new file mode 100644 index 000000000..19a6afdd3 --- /dev/null +++ b/newlib/libc/stdio/rename.c @@ -0,0 +1,86 @@ +/* +FUNCTION +<>---rename a file + +INDEX + rename +INDEX + _rename_r + +ANSI_SYNOPSIS + #include + int rename(const char *<[old]>, const char *<[new]>); + + int _rename_r(void *<[reent]>, + const char *<[old]>, const char *<[new]>); + +TRAD_SYNOPSIS + #include + int rename(<[old]>, <[new]>) + char *<[old]>; + char *<[new]>; + + int _rename_r(<[reent]>, <[old]>, <[new]>) + char *<[reent]>; + char *<[old]>; + char *<[new]>; + +DESCRIPTION +Use <> to establish a new name (the string at <[new]>) for a +file now known by the string at <[old]>. After a successful +<>, the file is no longer accessible by the string at <[old]>. + +If <> fails, the file named <<*<[old]>>> is unaffected. The +conditions for failure depend on the host operating system. + +The alternate function <<_rename_r>> is a reentrant version. The +extra argument <[reent]> is a pointer to a reentrancy structure. + +RETURNS +The result is either <<0>> (when successful) or <<-1>> (when the file +could not be renamed). + +PORTABILITY +ANSI C requires <>, but only specifies that the result on +failure be nonzero. The effects of using the name of an existing file +as <<*<[new]>>> may vary from one implementation to another. + +Supporting OS subroutines required: <>, <>, or <>. +*/ + +#include +#include +#include + +int +_rename_r (ptr, old, new) + struct _reent *ptr; + _CONST char *old; + _CONST char *new; +{ +#ifdef HAVE_RENAME + return _rename (old,new); +#else + if (_link_r (ptr, old, new) == -1) + return -1; + + if (_unlink_r (ptr, old) == -1) + { + /* ??? Should we unlink new? (rhetorical question) */ + return -1; + } +#endif + return 0; +} + +#ifndef _REENT_ONLY + +int +rename (old, new) + _CONST char *old; + _CONST char *new; +{ + return _rename_r (_REENT, old, new); +} + +#endif diff --git a/newlib/libc/stdio/rewind.c b/newlib/libc/stdio/rewind.c new file mode 100644 index 000000000..905275741 --- /dev/null +++ b/newlib/libc/stdio/rewind.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---reinitialize a file or stream + +INDEX + rewind + +ANSI_SYNOPSIS + #include + void rewind(FILE *<[fp]>); + +TRAD_SYNOPSIS + #include + void rewind(<[fp]>) + FILE *<[fp]>; + +DESCRIPTION +<> returns the file position indicator (if any) for the file +or stream identified by <[fp]> to the beginning of the file. It also +clears any error indicator and flushes any pending output. + +RETURNS +<> does not return a result. + +PORTABILITY +ANSI C requires <>. + +No supporting OS subroutines are required. +*/ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "%W% (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ + +#include + +void +_DEFUN (rewind, (fp), + register FILE * fp) +{ + (void) fseek(fp, 0L, SEEK_SET); + clearerr(fp); +} diff --git a/newlib/libc/stdio/rget.c b/newlib/libc/stdio/rget.c new file mode 100644 index 000000000..ea29c2bce --- /dev/null +++ b/newlib/libc/stdio/rget.c @@ -0,0 +1,43 @@ +/* No user fns here. Pesch 15apr92. */ + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "%W% (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include "local.h" + +/* + * Handle getc() when the buffer ran out: + * Refill, then return the first character + * in the newly-filled buffer. + */ + +int +__srget (fp) + register FILE *fp; +{ + if (__srefill (fp) == 0) + { + fp->_r--; + return *fp->_p++; + } + return EOF; +} diff --git a/newlib/libc/stdio/scanf.c b/newlib/libc/stdio/scanf.c new file mode 100644 index 000000000..0a4818934 --- /dev/null +++ b/newlib/libc/stdio/scanf.c @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include <_ansi.h> +#include +#include "local.h" + +#ifdef _HAVE_STDC +#include +#else +#include +#endif + +#ifndef _REENT_ONLY + +int +#ifdef _HAVE_STDC +scanf (const char *fmt, ...) +#else +scanf (fmt, va_alist) + char *fmt; + va_dcl +#endif +{ + int ret; + va_list ap; + +#ifdef _HAVE_STDC + va_start (ap, fmt); +#else + va_start (ap); +#endif + ret = __svfscanf (_stdin_r (_REENT), fmt, ap); + va_end (ap); + return ret; +} + +#endif + +int +#ifdef _HAVE_STDC +_scanf_r (struct _reent *ptr, const char *fmt, ...) +#else +_scanf_r (ptr, fmt, va_alist) + struct _reent *ptr; + char *fmt; + va_dcl +#endif +{ + int ret; + va_list ap; + +#ifdef _HAVE_STDC + va_start (ap, fmt); +#else + va_start (ap); +#endif + ret = __svfscanf (_stdin_r (ptr), fmt, ap); + va_end (ap); + return (ret); +} diff --git a/newlib/libc/stdio/setbuf.c b/newlib/libc/stdio/setbuf.c new file mode 100644 index 000000000..15d09e0f3 --- /dev/null +++ b/newlib/libc/stdio/setbuf.c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---specify full buffering for a file or stream + +INDEX + setbuf + +ANSI_SYNOPSIS + #include + void setbuf(FILE *<[fp]>, char *<[buf]>); + +TRAD_SYNOPSIS + #include + void setbuf(<[fp]>, <[buf]>) + FILE *<[fp]>; + char *<[buf]>; + +DESCRIPTION +<> specifies that output to the file or stream identified by <[fp]> +should be fully buffered. All output for this file will go to a +buffer (of size <>, specified in `<>'). Output will +be passed on to the host system only when the buffer is full, or when +an input operation intervenes. + +You may, if you wish, supply your own buffer by passing a pointer to +it as the argument <[buf]>. It must have size <>. You can +also use <> as the value of <[buf]>, to signal that the +<> function is to allocate the buffer. + +WARNINGS +You may only use <> before performing any file operation other +than opening the file. + +If you supply a non-null <[buf]>, you must ensure that the associated +storage continues to be available until you close the stream +identified by <[fp]>. + +RETURNS +<> does not return a result. + +PORTABILITY +Both ANSI C and the System V Interface Definition (Issue 2) require +<>. However, they differ on the meaning of a <> buffer +pointer: the SVID issue 2 specification says that a <> buffer +pointer requests unbuffered output. For maximum portability, avoid +<> buffer pointers. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include <_ansi.h> +#include +#include "local.h" + +void +_DEFUN (setbuf, (fp, buf), + FILE * fp _AND + char *buf) +{ + (void) setvbuf (fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ); +} diff --git a/newlib/libc/stdio/setvbuf.c b/newlib/libc/stdio/setvbuf.c new file mode 100644 index 000000000..357ea5142 --- /dev/null +++ b/newlib/libc/stdio/setvbuf.c @@ -0,0 +1,190 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* +FUNCTION +<>---specify file or stream buffering + +INDEX + setvbuf + +ANSI_SYNOPSIS + #include + int setvbuf(FILE *<[fp]>, char *<[buf]>, + int <[mode]>, size_t <[size]>); + +TRAD_SYNOPSIS + #include + int setvbuf(<[fp]>, <[buf]>, <[mode]>, <[size]>) + FILE *<[fp]>; + char *<[buf]>; + int <[mode]>; + size_t <[size]>; + +DESCRIPTION +Use <> to specify what kind of buffering you want for the +file or stream identified by <[fp]>, by using one of the following +values (from <>) as the <[mode]> argument: + +o+ +o _IONBF +Do not use a buffer: send output directly to the host system for the +file or stream identified by <[fp]>. + +o _IOFBF +Use full output buffering: output will be passed on to the host system +only when the buffer is full, or when an input operation intervenes. + +o _IOLBF +Use line buffering: pass on output to the host system at every +newline, as well as when the buffer is full, or when an input +operation intervenes. +o- + +Use the <[size]> argument to specify how large a buffer you wish. You +can supply the buffer itself, if you wish, by passing a pointer to a +suitable area of memory as <[buf]>. Otherwise, you may pass <> +as the <[buf]> argument, and <> will allocate the buffer. + +WARNINGS +You may only use <> before performing any file operation other +than opening the file. + +If you supply a non-null <[buf]>, you must ensure that the associated +storage continues to be available until you close the stream +identified by <[fp]>. + +RETURNS +A <<0>> result indicates success, <> failure (invalid <[mode]> or +<[size]> can cause failure). + +PORTABILITY +Both ANSI C and the System V Interface Definition (Issue 2) require +<>. However, they differ on the meaning of a <> buffer +pointer: the SVID issue 2 specification says that a <> buffer +pointer requests unbuffered output. For maximum portability, avoid +<> buffer pointers. + +Both specifications describe the result on failure only as a +nonzero value. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include <_ansi.h> +#include +#include +#include "local.h" + +/* + * Set one of the three kinds of buffering, optionally including a buffer. + */ + +int +_DEFUN (setvbuf, (fp, buf, mode, size), + register FILE * fp _AND + char *buf _AND + register int mode _AND + register size_t size) +{ + int ret = 0; + CHECK_INIT (fp); + + /* + * Verify arguments. The `int' limit on `size' is due to this + * particular implementation. + */ + + if ((mode != _IOFBF && mode != _IOLBF && mode != _IONBF) || (int)(_POINTER_INT) size < 0) + return (EOF); + + /* + * Write current buffer, if any; drop read count, if any. + * Make sure putc() will not think fp is line buffered. + * Free old buffer if it was from malloc(). Clear line and + * non buffer flags, and clear malloc flag. + */ + + (void) fflush (fp); + fp->_r = 0; + fp->_lbfsize = 0; + if (fp->_flags & __SMBF) + _free_r (fp->_data, (void *) fp->_bf._base); + fp->_flags &= ~(__SLBF | __SNBF | __SMBF); + + if (mode == _IONBF) + goto nbf; + + /* + * Allocate buffer if needed. */ + if (buf == NULL) + { + /* we need this here because malloc() may return a pointer + even if size == 0 */ + if (!size) size = BUFSIZ; + if ((buf = malloc (size)) == NULL) + { + ret = EOF; + /* Try another size... */ + buf = malloc (BUFSIZ); + size = BUFSIZ; + } + if (buf == NULL) + { + /* Can't allocate it, let's try another approach */ +nbf: + fp->_flags |= __SNBF; + fp->_w = 0; + fp->_bf._base = fp->_p = fp->_nbuf; + fp->_bf._size = 1; + return (ret); + } + fp->_flags |= __SMBF; + } + /* + * Now put back whichever flag is needed, and fix _lbfsize + * if line buffered. Ensure output flush on exit if the + * stream will be buffered at all. + * If buf is NULL then make _lbfsize 0 to force the buffer + * to be flushed and hence malloced on first use + */ + + switch (mode) + { + case _IOLBF: + fp->_flags |= __SLBF; + fp->_lbfsize = buf ? -size : 0; + /* FALLTHROUGH */ + + case _IOFBF: + /* no flag */ + fp->_data->__cleanup = _cleanup_r; + fp->_bf._base = fp->_p = (unsigned char *) buf; + fp->_bf._size = size; + break; + } + + /* + * Patch up write count if necessary. + */ + + if (fp->_flags & __SWR) + fp->_w = fp->_flags & (__SLBF | __SNBF) ? 0 : size; + + return 0; +} diff --git a/newlib/libc/stdio/siprintf.c b/newlib/libc/stdio/siprintf.c new file mode 100644 index 000000000..40bd01696 --- /dev/null +++ b/newlib/libc/stdio/siprintf.c @@ -0,0 +1,70 @@ +/* +FUNCTION + <>---write formatted output (integer only) +INDEX + siprintf + +ANSI_SYNOPSIS + #include + + int siprintf(char *<[str]>, const char *<[format]> [, <[arg]>, ...]); + + +DESCRIPTION +<> is a restricted version of <>: it has the same +arguments and behavior, save that it cannot perform any floating-point +formatting: the <>, <>, <>, <>, and <> type specifiers +are not recognized. + +RETURNS + <> returns the number of bytes in the output string, + save that the concluding <> is not counted. + <> returns when the end of the format string is + encountered. + +PORTABILITY +<> is not required by ANSI C. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include +#ifdef _HAVE_STDC +#include +#else +#include +#endif +#include +#include <_ansi.h> +#include +#include "local.h" + +int +#ifdef _HAVE_STDC +_DEFUN (siprintf, (str, fmt), char *str _AND _CONST char *fmt _DOTS) +#else +siprintf (str, fmt, va_alist) + char *str; + _CONST char *fmt; + va_dcl +#endif +{ + int ret; + va_list ap; + FILE f; + + f._flags = __SWR | __SSTR; + f._bf._base = f._p = (unsigned char *) str; + f._bf._size = f._w = INT_MAX; + f._data = _REENT; +#ifdef _HAVE_STDC + va_start (ap, fmt); +#else + va_start (ap); +#endif + ret = vfiprintf (&f, fmt, ap); + va_end (ap); + *f._p = 0; + return (ret); +} diff --git a/newlib/libc/stdio/snprintf.c b/newlib/libc/stdio/snprintf.c new file mode 100644 index 000000000..333e808e4 --- /dev/null +++ b/newlib/libc/stdio/snprintf.c @@ -0,0 +1,95 @@ +/* doc in sprintf.c */ + +/* This code created by modifying sprintf.c so copyright inherited. */ + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include +#ifdef _HAVE_STDC +#include +#else +#include +#endif +#include +#include <_ansi.h> +#include "local.h" + +int +#ifdef _HAVE_STDC +_DEFUN (_snprintf_r, (ptr, str, size, fmt), struct _reent *ptr _AND char *str _AND size_t size _AND _CONST char *fmt _DOTS) +#else +_snprintf_r (ptr, str, size, fmt, va_alist) + struct _reent *ptr; + char *str; + size_t size; + _CONST char *fmt; + va_dcl +#endif +{ + int ret; + va_list ap; + FILE f; + + f._flags = __SWR | __SSTR; + f._bf._base = f._p = (unsigned char *) str; + f._bf._size = f._w = size; + f._data = ptr; +#ifdef _HAVE_STDC + va_start (ap, fmt); +#else + va_start (ap); +#endif + ret = vfprintf (&f, fmt, ap); + va_end (ap); + *f._p = 0; + return (ret); +} + +#ifndef _REENT_ONLY + +int +#ifdef _HAVE_STDC +_DEFUN (snprintf, (str, size, fmt), char *str _AND size_t size _AND _CONST char *fmt _DOTS) +#else +snprintf (str, size, fmt, va_alist) + char *str; + size_t size; + _CONST char *fmt; + va_dcl +#endif +{ + int ret; + va_list ap; + FILE f; + + f._flags = __SWR | __SSTR; + f._bf._base = f._p = (unsigned char *) str; + f._bf._size = f._w = size; + f._data = _REENT; +#ifdef _HAVE_STDC + va_start (ap, fmt); +#else + va_start (ap); +#endif + ret = vfprintf (&f, fmt, ap); + va_end (ap); + *f._p = 0; + return (ret); +} + +#endif diff --git a/newlib/libc/stdio/sprintf.c b/newlib/libc/stdio/sprintf.c new file mode 100644 index 000000000..b5376327e --- /dev/null +++ b/newlib/libc/stdio/sprintf.c @@ -0,0 +1,360 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* + +FUNCTION + <>, <>, <>, <>---format output +INDEX + fprintf +INDEX + printf +INDEX + sprintf +INDEX + snprintf + +ANSI_SYNOPSIS + #include + + int printf(const char *<[format]> [, <[arg]>, ...]); + int fprintf(FILE *<[fd]>, const char *<[format]> [, <[arg]>, ...]); + int sprintf(char *<[str]>, const char *<[format]> [, <[arg]>, ...]); + int snprintf(char *<[str]>, size_t <[size]>, const char *<[format]> [, <[arg]>, ...]); + +TRAD_SYNOPSIS + #include + + int printf(<[format]> [, <[arg]>, ...]) + char *<[format]>; + + int fprintf(<[fd]>, <[format]> [, <[arg]>, ...]); + FILE *<[fd]>; + char *<[format]>; + + int sprintf(<[str]>, <[format]> [, <[arg]>, ...]); + char *<[str]>; + char *<[format]>; + + int snprintf(<[str]>, size_t <[size]>, <[format]> [, <[arg]>, ...]); + char *<[str]>; + size_t <[size]>; + char *<[format]>; + +DESCRIPTION + <> accepts a series of arguments, applies to each a + format specifier from <<*<[format]>>>, and writes the + formatted data to <>, terminated with a null character. + The behavior of <> is undefined if there are not enough + arguments for the format. + <> returns when it reaches the end of the format string. + If there are more arguments than the format requires, excess + arguments are ignored. + + <>, <> and <> are identical to <>, + other than the destination of the formatted output: <> sends + the output to a specified file <[fd]>, while <> stores the + output in the specified char array <[str]> and <> limits + number of characters written to <[str]> to at most <[size]> (including + terminating <<0>>). For <> and <>, the behavior is + also undefined if the output <<*<[str]>>> overlaps with one of the + arguments. <[format]> is a pointer to a charater string containing + two types of objects: ordinary characters (other than <<%>>), which + are copied unchanged to the output, and conversion + specifications, each of which is introduced by <<%>>. + (To include <<%>> in the output, use <<%%>> in the format string.) + A conversion specification has the following form: + +. %[<[flags]>][<[width]>][.<[prec]>][<[size]>][<[type]>] + + The fields of the conversion specification have the following meanings: + + O+ + o <[flags]> + + an optional sequence of characters which control + output justification, numeric signs, decimal points, + trailing zeroes, and octal and hex prefixes. + The flag characters are minus (<<->>), plus (<<+>>), + space ( ), zero (<<0>>), and sharp (<<#>>). They can + appear in any combination. + + o+ + o - + The result of the conversion is left justified, and the right is + padded with blanks. If you do not use this flag, the result is right + justified, and padded on the left. + + o + + The result of a signed conversion (as determined by <[type]>) + will always begin with a plus or minus sign. (If you do not use + this flag, positive values do not begin with a plus sign.) + + o " " (space) + If the first character of a signed conversion specification + is not a sign, or if a signed conversion results in no + characters, the result will begin with a space. If the + space ( ) flag and the plus (<<+>>) flag both appear, + the space flag is ignored. + + o 0 + If the <[type]> character is <>, <>, <>, <>, + <>, <>, <>, <>, <>, <>, or <>: leading zeroes, + are used to pad the field width (following any indication of sign or + base); no spaces are used for padding. If the zero (<<0>>) and + minus (<<->>) flags both appear, the zero (<<0>>) flag will + be ignored. For <>, <>, <>, <>, <>, and <> + conversions, if a precision <[prec]> is specified, the zero (<<0>>) + flag is ignored. + + Note that <<0>> is interpreted as a flag, not as the beginning + of a field width. + + o # + The result is to be converted to an alternative form, according + to the next character: + + o+ + o 0 + increases precision to force the first digit + of the result to be a zero. + + o x + a non-zero result will have a <<0x>> prefix. + + o X + a non-zero result will have a <<0X>> prefix. + + o e, E or f + The result will always contain a decimal point + even if no digits follow the point. + (Normally, a decimal point appears only if a + digit follows it.) Trailing zeroes are removed. + + o g or G + same as <> or <>, but trailing zeroes + are not removed. + + o all others + undefined. + + o- + o- + + o <[width]> + + <[width]> is an optional minimum field width. You can either + specify it directly as a decimal integer, or indirectly by + using instead an asterisk (<<*>>), in which case an <> + argument is used as the field width. Negative field widths + are not supported; if you attempt to specify a negative field + width, it is interpreted as a minus (<<->>) flag followed by a + positive field width. + + o <[prec]> + + an optional field; if present, it is introduced with `<<.>>' + (a period). This field gives the maximum number of + characters to print in a conversion; the minimum number of + digits of an integer to print, for conversions with <[type]> + <>, <>, <>, <>, <>, and <>; the maximum number of + significant digits, for the <> and <> conversions; + or the number of digits to print after the decimal + point, for <>, <>, and <> conversions. You can specify + the precision either directly as a decimal integer or + indirectly by using an asterisk (<<*>>), in which case + an <> argument is used as the precision. Supplying a negative + precision is equivalent to omitting the precision. + If only a period is specified the precision is zero. + If a precision appears with any other conversion <[type]> + than those listed here, the behavior is undefined. + + o <[size]> + + <>, <>, and <> are optional size characters which + override the default way that <> interprets the + data type of the corresponding argument. <> forces + the following <>, <>, <>, <>, <> or <> conversion + <[type]> to apply to a <> or <>. <> also + forces a following <> <[type]> to apply to + a pointer to a <>. Similarily, an + <> forces the following <>, <>, <>, <>, + <> or <> conversion <[type]> to apply to a <> or + <>. <> also forces a following <> <[type]> to + apply to a pointer to a <>. If an <> + or an <> appears with another conversion + specifier, the behavior is undefined. <> forces a + following <>, <>, <>, <> or <> conversion <[type]> to + apply to a <> argument. If <> appears with + any other conversion <[type]>, the behavior is undefined. + + o <[type]> + + <[type]> specifies what kind of conversion <> performs. + Here is a table of these: + + o+ + o % + prints the percent character (<<%>>) + + o c + prints <[arg]> as single character + + o s + prints characters until precision is reached or a null terminator + is encountered; takes a string pointer + + o d + prints a signed decimal integer; takes an <> (same as <>) + + o i + prints a signed decimal integer; takes an <> (same as <>) + + o o + prints a signed octal integer; takes an <> + + o u + prints an unsigned decimal integer; takes an <> + + o x + prints an unsigned hexadecimal integer (using <> as + digits beyond <<9>>); takes an <> + + o X + prints an unsigned hexadecimal integer (using <> as + digits beyond <<9>>); takes an <> + + o f + prints a signed value of the form <<[-]9999.9999>>; takes + a floating point number + + o e + prints a signed value of the form <<[-]9.9999e[+|-]999>>; takes a + floating point number + + o E + prints the same way as <>, but using <> to introduce the + exponent; takes a floating point number + + o g + prints a signed value in either <> or <> form, based on given + value and precision---trailing zeros and the decimal point are + printed only if necessary; takes a floating point number + + o G + prints the same way as <>, but using <> for the exponent if an + exponent is needed; takes a floating point number + + o n + stores (in the same object) a count of the characters written; + takes a pointer to <> + + o p + prints a pointer in an implementation-defined format. + This implementation treats the pointer as an + <> (same as <>). + o- +O- + + +RETURNS +<> returns the number of bytes in the output string, +save that the concluding <> is not counted. +<> and <> return the number of characters transmitted. +If an error occurs, <> and <> return <>. No +error returns occur for <>. + +PORTABILITY + The ANSI C standard specifies that implementations must + support at least formatted output of up to 509 characters. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include +#ifdef _HAVE_STDC +#include +#else +#include +#endif +#include +#include <_ansi.h> +#include "local.h" + +int +#ifdef _HAVE_STDC +_DEFUN (_sprintf_r, (ptr, str, fmt), struct _reent *ptr _AND char *str _AND _CONST char *fmt _DOTS) +#else +_sprintf_r (ptr, str, fmt, va_alist) + struct _reent *ptr; + char *str; + _CONST char *fmt; + va_dcl +#endif +{ + int ret; + va_list ap; + FILE f; + + f._flags = __SWR | __SSTR; + f._bf._base = f._p = (unsigned char *) str; + f._bf._size = f._w = INT_MAX; + f._data = ptr; +#ifdef _HAVE_STDC + va_start (ap, fmt); +#else + va_start (ap); +#endif + ret = vfprintf (&f, fmt, ap); + va_end (ap); + *f._p = 0; + return (ret); +} + +#ifndef _REENT_ONLY + +int +#ifdef _HAVE_STDC +_DEFUN (sprintf, (str, fmt), char *str _AND _CONST char *fmt _DOTS) +#else +sprintf (str, fmt, va_alist) + char *str; + _CONST char *fmt; + va_dcl +#endif +{ + int ret; + va_list ap; + FILE f; + + f._flags = __SWR | __SSTR; + f._bf._base = f._p = (unsigned char *) str; + f._bf._size = f._w = INT_MAX; + f._data = _REENT; +#ifdef _HAVE_STDC + va_start (ap, fmt); +#else + va_start (ap); +#endif + ret = vfprintf (&f, fmt, ap); + va_end (ap); + *f._p = 0; + return (ret); +} + +#endif diff --git a/newlib/libc/stdio/sscanf.c b/newlib/libc/stdio/sscanf.c new file mode 100644 index 000000000..eb344238d --- /dev/null +++ b/newlib/libc/stdio/sscanf.c @@ -0,0 +1,386 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* + +FUNCTION + <>, <>, <>---scan and format input + +INDEX + scanf +INDEX + fscanf +INDEX + sscanf + +ANSI_SYNOPSIS + #include + + int scanf(const char *<[format]> [, <[arg]>, ...]); + int fscanf(FILE *<[fd]>, const char *<[format]> [, <[arg]>, ...]); + int sscanf(const char *<[str]>, const char *<[format]> + [, <[arg]>, ...]); + + +TRAD_SYNOPSIS + #include + + int scanf(<[format]> [, <[arg]>, ...]) + char *<[format]>; + + int fscanf(<[fd]>, <[format]> [, <[arg]>, ...]); + FILE *<[fd]>; + char *<[format]>; + + int sscanf(<[str]>, <[format]> [, <[arg]>, ...]); + char *<[str]>; + char *<[format]>; + + +DESCRIPTION + <> scans a series of input fields from standard input, + one character at a time. Each field is interpreted according to + a format specifier passed to <> in the format string at + <<*<[format]>>>. <> stores the interpreted input from + each field at the address passed to it as the corresponding argument + following <[format]>. You must supply the same number of + format specifiers and address arguments as there are input fields. + + There must be sufficient address arguments for the given format + specifiers; if not the results are unpredictable and likely + disasterous. Excess address arguments are merely ignored. + + <> often produces unexpected results if the input diverges from + an expected pattern. Since the combination of <> or <> + followed by <> is safe and easy, that is the preferred way + to be certain that a program is synchronized with input at the end + of a line. + + <> and <> are identical to <>, other than the + source of input: <> reads from a file, and <> + from a string. + + The string at <<*<[format]>>> is a character sequence composed + of zero or more directives. Directives are composed of + one or more whitespace characters, non-whitespace characters, + and format specifications. + + Whitespace characters are blank (<< >>), tab (<<\t>>), or + newline (<<\n>>). + When <> encounters a whitespace character in the format string + it will read (but not store) all consecutive whitespace characters + up to the next non-whitespace character in the input. + + Non-whitespace characters are all other ASCII characters except the + percent sign (<<%>>). When <> encounters a non-whitespace + character in the format string it will read, but not store + a matching non-whitespace character. + + Format specifications tell <> to read and convert characters + from the input field into specific types of values, and store then + in the locations specified by the address arguments. + + Trailing whitespace is left unread unless explicitly + matched in the format string. + + The format specifiers must begin with a percent sign (<<%>>) + and have the following form: + +. %[*][<[width]>][<[size]>]<[type]> + + Each format specification begins with the percent character (<<%>>). + The other fields are: + o+ + o * + an optional marker; if present, it suppresses interpretation and + assignment of this input field. + + o <[width]> + an optional maximum field width: a decimal integer, + which controls the maximum number of characters that + will be read before converting the current input field. If the + input field has fewer than <[width]> characters, <> + reads all the characters in the field, and then + proceeds with the next field and its format specification. + + If a whitespace or a non-convertable character occurs + before <[width]> character are read, the characters up + to that character are read, converted, and stored. + Then <> proceeds to the next format specification. + + o size + <>, <>, and <> are optional size characters which + override the default way that <> interprets the + data type of the corresponding argument. + + +.Modifier Type(s) +. h d, i, o, u, x convert input to short, +. store in short object +. +. h D, I, O, U, X no effect +. e, f, c, s, n, p +. +. l d, i, o, u, x convert input to long, +. store in long object +. +. l e, f, g convert input to double +. store in a double object +. +. l D, I, O, U, X no effect +. c, s, n, p +. +. L d, i, o, u, x convert to long double, +. store in long double +. +. L all others no effect + + + o <[type]> + + A character to specify what kind of conversion + <> performs. Here is a table of the conversion + characters: + + o+ + o % + No conversion is done; the percent character (<<%>>) is stored. + + o c + Scans one character. Corresponding <[arg]>: <<(char *arg)>>. + + o s + Reads a character string into the array supplied. + Corresponding <[arg]>: <<(char arg[])>>. + + o [<[pattern]>] + Reads a non-empty character string into memory + starting at <[arg]>. This area must be large + enough to accept the sequence and a + terminating null character which will be added + automatically. (<[pattern]> is discussed in the paragraph following + this table). Corresponding <[arg]>: <<(char *arg)>>. + + o d + Reads a decimal integer into the corresponding <[arg]>: <<(int *arg)>>. + + o D + Reads a decimal integer into the corresponding + <[arg]>: <<(long *arg)>>. + + o o + Reads an octal integer into the corresponding <[arg]>: <<(int *arg)>>. + + o O + Reads an octal integer into the corresponding <[arg]>: <<(long *arg)>>. + + o u + Reads an unsigned decimal integer into the corresponding + <[arg]>: <<(unsigned int *arg)>>. + + + o U + Reads an unsigned decimal integer into the corresponding <[arg]>: + <<(unsigned long *arg)>>. + + o x,X + Read a hexadecimal integer into the corresponding <[arg]>: + <<(int *arg)>>. + + o e, f, g + Read a floating point number into the corresponding <[arg]>: + <<(float *arg)>>. + + o E, F, G + Read a floating point number into the corresponding <[arg]>: + <<(double *arg)>>. + + o i + Reads a decimal, octal or hexadecimal integer into the + corresponding <[arg]>: <<(int *arg)>>. + + o I + Reads a decimal, octal or hexadecimal integer into the + corresponding <[arg]>: <<(long *arg)>>. + + o n + Stores the number of characters read in the corresponding + <[arg]>: <<(int *arg)>>. + + o p + Stores a scanned pointer. ANSI C leaves the details + to each implementation; this implementation treats + <<%p>> exactly the same as <<%U>>. Corresponding + <[arg]>: <<(void **arg)>>. + o- + + A <[pattern]> of characters surrounded by square brackets can be used + instead of the <> type character. <[pattern]> is a set of + characters which define a search set of possible characters making up + the <> input field. If the first character in the brackets is a + caret (<<^>>), the search set is inverted to include all ASCII characters + except those between the brackets. There is also a range facility + which you can use as a shortcut. <<%[0-9] >> matches all decimal digits. + The hyphen must not be the first or last character in the set. + The character prior to the hyphen must be lexically less than the + character after it. + + Here are some <[pattern]> examples: + o+ + o %[abcd] + matches strings containing only <>, <>, <>, and <>. + + o %[^abcd] + matches strings containing any characters except <>, <>, + <>, or <> + + o %[A-DW-Z] + matches strings containing <>, <>, <>, <>, <>, + <>, <>, <> + + o %[z-a] + matches the characters <>, <<->>, and <> + o- + + Floating point numbers (for field types <>, <>, <>, <>, + <>, <>) must correspond to the following general form: + +. [+/-] ddddd[.]ddd [E|e[+|-]ddd] + + where objects inclosed in square brackets are optional, and <> + represents decimal, octal, or hexadecimal digits. + o- + +RETURNS + <> returns the number of input fields successfully + scanned, converted and stored; the return value does + not include scanned fields which were not stored. + + If <> attempts to read at end-of-file, the return + value is <>. + + If no fields were stored, the return value is <<0>>. + + <> might stop scanning a particular field before + reaching the normal field end character, or may + terminate entirely. + + <> stops scanning and storing the current field + and moves to the next input field (if any) + in any of the following situations: + + O+ + o The assignment suppressing character (<<*>>) appears + after the <<%>> in the format specification; the current + input field is scanned but not stored. + + o <[width]> characters have been read (<[width]> is a + width specification, a positive decimal integer). + + o The next character read cannot be converted + under the the current format (for example, + if a <> is read when the format is decimal). + + o The next character in the input field does not appear + in the search set (or does appear in the inverted search set). + O- + + When <> stops scanning the current input field for one of + these reasons, the next character is considered unread and + used as the first character of the following input field, or the + first character in a subsequent read operation on the input. + + <> will terminate under the following circumstances: + + O+ + o The next character in the input field conflicts + with a corresponding non-whitespace character in the + format string. + + o The next character in the input field is <>. + + o The format string has been exhausted. + O- + + When the format string contains a character sequence that is + not part of a format specification, the same character + sequence must appear in the input; <> will + scan but not store the matched characters. If a + conflict occurs, the first conflicting character remains in the input + as if it had never been read. + +PORTABILITY +<> is ANSI C. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include <_ansi.h> +#include +#include +#include +#ifdef _HAVE_STDC +#include +#else +#include +#endif +#include "local.h" + +/* | ARGSUSED */ +/*SUPPRESS 590*/ +static +int +eofread (cookie, buf, len) + _PTR cookie; + char *buf; + int len; +{ + return 0; +} + +#ifdef _HAVE_STDC +int +_DEFUN (sscanf, (str, fmt), _CONST char *str _AND _CONST char *fmt _DOTS) +#else +int +sscanf (str, fmt, va_alist) + _CONST char *str; + _CONST char *fmt; + va_dcl +#endif +{ + int ret; + va_list ap; + FILE f; + + f._flags = __SRD; + f._bf._base = f._p = (unsigned char *) str; + f._bf._size = f._r = strlen (str); + f._read = eofread; + f._ub._base = NULL; + f._lb._base = NULL; + f._data = _REENT; +#ifdef _HAVE_STDC + va_start (ap, fmt); +#else + va_start (ap); +#endif + ret = __svfscanf (&f, fmt, ap); + va_end (ap); + return ret; +} diff --git a/newlib/libc/stdio/stdio.c b/newlib/libc/stdio/stdio.c new file mode 100644 index 000000000..c06f51aa0 --- /dev/null +++ b/newlib/libc/stdio/stdio.c @@ -0,0 +1,92 @@ +/* No user fns here. Pesch 15apr92. */ + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include +#include +#include +#include +#include "local.h" + +/* + * Small standard I/O/seek/close functions. + * These maintain the `known seek offset' for seek optimisation. + */ + +int +__sread (cookie, buf, n) + _PTR cookie; + char *buf; + int n; +{ + register FILE *fp = (FILE *) cookie; + register int ret; + + ret = _read_r (fp->_data, fp->_file, buf, n); + + /* If the read succeeded, update the current offset. */ + + if (ret >= 0) + fp->_offset += ret; + else + fp->_flags &= ~__SOFF; /* paranoia */ + return ret; +} + +int +__swrite (cookie, buf, n) + _PTR cookie; + char _CONST *buf; + int n; +{ + register FILE *fp = (FILE *) cookie; + + if (fp->_flags & __SAPP) + (void) _lseek_r (fp->_data, fp->_file, (off_t) 0, SEEK_END); + fp->_flags &= ~__SOFF; /* in case O_APPEND mode is set */ + return _write_r (fp->_data, fp->_file, buf, n); +} + +fpos_t +__sseek (cookie, offset, whence) + _PTR cookie; + fpos_t offset; + int whence; +{ + register FILE *fp = (FILE *) cookie; + register off_t ret; + + ret = _lseek_r (fp->_data, fp->_file, (off_t) offset, whence); + if (ret == -1L) + fp->_flags &= ~__SOFF; + else + { + fp->_flags |= __SOFF; + fp->_offset = ret; + } + return ret; +} + +int +__sclose (cookie) + _PTR cookie; +{ + FILE *fp = (FILE *) cookie; + + return _close_r (fp->_data, fp->_file); +} diff --git a/newlib/libc/stdio/stdio.tex b/newlib/libc/stdio/stdio.tex new file mode 100644 index 000000000..466e1f0db --- /dev/null +++ b/newlib/libc/stdio/stdio.tex @@ -0,0 +1,183 @@ +@node Stdio +@chapter Input and Output (@file{stdio.h}) + +This chapter comprises functions to manage files +or other input/output streams. Among these functions are subroutines +to generate or scan strings according to specifications from a format string. + +The underlying facilities for input and output depend on the host +system, but these functions provide a uniform interface. + +The corresponding declarations are in @file{stdio.h}. + +The reentrant versions of these functions use macros + +@example +_stdin_r(@var{reent}) +_stdout_r(@var{reent}) +_stderr_r(@var{reent}) +@end example + +@noindent +instead of the globals @code{stdin}, @code{stdout}, and +@code{stderr}. The argument <[reent]> is a pointer to a reentrancy +structure. + +@menu +* clearerr:: Clear file or stream error indicator +* fclose:: Close a file +* feof:: Test for end of file +* ferror:: Test whether read/write error has occurred +* fflush:: Flush buffered file output +* fgetc:: Get a character from a file or stream +* fgetpos:: Record position in a stream or file +* fgets:: Get character string from a file or stream +* fiprintf:: Write formatted output to file (integer only) +* fopen:: Open a file +* fdopen:: Turn an open file into a stream +* fputc:: Write a character on a stream or file +* fputs:: Write a character string in a file or stream +* fread:: Read array elements from a file +* freopen:: Open a file using an existing file descriptor +* fseek:: Set file position +* fsetpos:: Restore position of a stream or file +* ftell:: Return position in a stream or file +* fwrite:: Write array elements from memory to a file or stream +* getc:: Get a character from a file or stream (macro) +* getchar:: Get a character from standard input (macro) +* gets:: Get character string from standard input (obsolete) +* iprintf:: Write formatted output (integer only) +* mktemp:: Generate unused file name +* perror:: Print an error message on standard error +* putc:: Write a character on a stream or file (macro) +* putchar:: Write a character on standard output (macro) +* puts:: Write a character string on standard output +* remove:: Delete a file's name +* rename:: Rename a file +* rewind:: Reinitialize a file or stream +* setbuf:: Specify full buffering for a file or stream +* setvbuf:: Specify buffering for a file or stream +* siprintf:: Write formatted output (integer only) +* printf:: Write formatted output +* scanf:: Scan and format input +* tmpfile:: Create a temporary file +* tmpnam:: Generate name for a temporary file +* vprintf:: Format variable argument list +@end menu + +@page +@include stdio/clearerr.def + +@page +@include stdio/fclose.def + +@page +@include stdio/feof.def + +@page +@include stdio/ferror.def + +@page +@include stdio/fflush.def + +@page +@include stdio/fgetc.def + +@page +@include stdio/fgetpos.def + +@page +@include stdio/fgets.def + +@page +@include stdio/fiprintf.def + +@page +@include stdio/fopen.def + +@page +@include stdio/fdopen.def + +@page +@include stdio/fputc.def + +@page +@include stdio/fputs.def + +@page +@include stdio/fread.def + +@page +@include stdio/freopen.def + +@page +@include stdio/fseek.def + +@page +@include stdio/fsetpos.def + +@page +@include stdio/ftell.def + +@page +@include stdio/fwrite.def + +@page +@include stdio/getc.def + +@page +@include stdio/getchar.def + +@page +@include stdio/gets.def + +@page +@include stdio/iprintf.def + +@page +@include stdio/mktemp.def + +@page +@include stdio/perror.def + +@page +@include stdio/putc.def + +@page +@include stdio/putchar.def + +@page +@include stdio/puts.def + +@page +@include stdio/remove.def + +@page +@include stdio/rename.def + +@page +@include stdio/rewind.def + +@page +@include stdio/setbuf.def + +@page +@include stdio/setvbuf.def + +@page +@include stdio/siprintf.def + +@page +@include stdio/sprintf.def + +@page +@include stdio/sscanf.def + +@page +@include stdio/tmpfile.def + +@page +@include stdio/tmpnam.def + +@page +@include stdio/vfprintf.def diff --git a/newlib/libc/stdio/tmpfile.c b/newlib/libc/stdio/tmpfile.c new file mode 100644 index 000000000..4b31396e2 --- /dev/null +++ b/newlib/libc/stdio/tmpfile.c @@ -0,0 +1,77 @@ +/* +FUNCTION +<>---create a temporary file + +INDEX + tmpfile +INDEX + _tmpfile_r + +ANSI_SYNOPSIS + #include + FILE *tmpfile(void); + + FILE *_tmpfile_r(void *<[reent]>); + +TRAD_SYNOPSIS + #include + FILE *tmpfile(); + + FILE *_tmpfile_r(<[reent]>) + char *<[reent]>; + +DESCRIPTION +Create a temporary file (a file which will be deleted automatically), +using a name generated by <>. The temporary file is opened with +the mode <<"wb+">>, permitting you to read and write anywhere in it +as a binary file (without any data transformations the host system may +perform for text files). + +The alternate function <<_tmpfile_r>> is a reentrant version. The +argument <[reent]> is a pointer to a reentrancy structure. + +RETURNS +<> normally returns a pointer to the temporary file. If no +temporary file could be created, the result is NULL, and <> +records the reason for failure. + +PORTABILITY +Both ANSI C and the System V Interface Definition (Issue 2) require +<>. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>, <>, <>. + +<> also requires the global pointer <>. +*/ + +#include +#include + +FILE * +_DEFUN (_tmpfile_r, (ptr), + struct _reent *ptr) +{ + FILE *fp; + int e; + char *f; + char buf[L_tmpnam]; + + if ((f = _tmpnam_r (ptr, buf)) == NULL) + return NULL; + fp = fopen (f, "wb+"); + e = ptr->_errno; + _CAST_VOID remove (f); + ptr->_errno = e; + return fp; +} + +#ifndef _REENT_ONLY + +FILE * +_DEFUN_VOID (tmpfile) +{ + return _tmpfile_r (_REENT); +} + +#endif diff --git a/newlib/libc/stdio/tmpnam.c b/newlib/libc/stdio/tmpnam.c new file mode 100644 index 000000000..28b394f10 --- /dev/null +++ b/newlib/libc/stdio/tmpnam.c @@ -0,0 +1,208 @@ +/* + * tmpname.c + * Original Author: G. Haley + */ + +/* +FUNCTION +<>, <>---name for a temporary file + +INDEX + tmpnam +INDEX + tempnam +INDEX + _tmpnam_r +INDEX + _tempnam_r + +ANSI_SYNOPSIS + #include + char *tmpnam(char *<[s]>); + char *tempnam(char *<[dir]>, char *<[pfx]>); + char *_tmpnam_r(void *<[reent]>, char *<[s]>); + char *_tempnam_r(void *<[reent]>, char *<[dir]>, char *<[pfx]>); + +TRAD_SYNOPSIS + #include + char *tmpnam(<[s]>) + char *<[s]>; + + char *tempnam(<[dir]>, <[pfx]>) + char *<[dir]>; + char *<[pfx]>; + + char *_tmpnam_r(<[reent]>, <[s]>) + char *<[reent]>; + char *<[s]>; + + char *_tempnam_r(<[reent]>, <[dir]>, <[pfx]>) + char *<[reent]>; + char *<[dir]>; + char *<[pfx]>; + +DESCRIPTION +Use either of these functions to generate a name for a temporary file. +The generated name is guaranteed to avoid collision with other files +(for up to <> calls of either function). + +<> generates file names with the value of <> +(defined in `<>') as the leading directory component of the path. + +You can use the <> argument <[s]> to specify a suitable area +of memory for the generated filename; otherwise, you can call +<> to use an internal static buffer. + +<> allows you more control over the generated filename: you +can use the argument <[dir]> to specify the path to a directory for +temporary files, and you can use the argument <[pfx]> to specify a +prefix for the base filename. + +If <[dir]> is <>, <> will attempt to use the value of +environment variable <> instead; if there is no such value, +<> uses the value of <> (defined in `<>'). + +If you don't need any particular prefix to the basename of temporary +files, you can pass <> as the <[pfx]> argument to <>. + +<<_tmpnam_r>> and <<_tempnam_r>> are reentrant versions of <> +and <> respectively. The extra argument <[reent]> is a +pointer to a reentrancy structure. + +WARNINGS +The generated filenames are suitable for temporary files, but do not +in themselves make files temporary. Files with these names must still +be explicitly removed when you no longer want them. + +If you supply your own data area <[s]> for <>, you must ensure +that it has room for at least <> elements of type <>. + +RETURNS +Both <> and <> return a pointer to the newly +generated filename. + +PORTABILITY +ANSI C requires <>, but does not specify the use of +<>. The System V Interface Definition (Issue 2) requires +both <> and <>. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>, <>, <>. + +The global pointer <> is also required. +*/ + +#include <_ansi.h> +#include +#include +#include +#include +#include +#include + +/* Try to open the file specified, if it can't be opened then try + another one. Return nonzero if successful, otherwise zero. */ + +static int +worker (ptr, result, part1, part2, part3, part4) + struct _reent *ptr; + char *result; + _CONST char *part1; + _CONST char *part2; + int part3; + int *part4; +{ + /* Generate the filename and make sure that there isn't one called + it already. */ + + while (1) + { + int t; + _sprintf_r (ptr, result, "%s/%s%x.%x", part1, part2, part3, *part4); + (*part4)++; + t = _open_r (ptr, result, O_RDONLY, 0); + if (t == -1) + { + if (ptr->_errno == ENOSYS) + { + result[0] = '\0'; + return 0; + } + break; + } + _close_r (ptr, t); + } + return 1; +} + +char * +_DEFUN (_tmpnam_r, (p, s), + struct _reent *p _AND + char *s) +{ + char *result; + int pid; + + if (s == NULL) + { + /* ANSI states we must use an internal static buffer if s is NULL */ + result = p->_emergency; + } + else + { + result = s; + } + pid = _getpid_r (p); + + if (worker (p, result, P_tmpdir, "t", pid, &p->_inc)) + { + p->_inc++; + return result; + } + + return NULL; +} + +char * +_DEFUN (_tempnam_r, (p, dir, pfx), + struct _reent *p _AND + _CONST char *dir _AND + _CONST char *pfx) +{ + char *filename; + int length; + _CONST char *prefix = (pfx) ? pfx : ""; + if (dir == NULL && (dir = getenv ("TMPDIR")) == NULL) + dir = P_tmpdir; + + /* two 8 digit numbers + . / */ + length = strlen (dir) + strlen (prefix) + (4 * sizeof (int)) + 2 + 1; + + filename = _malloc_r (p, length); + if (filename) + { + if (! worker (p, filename, dir, prefix, + _getpid_r (p) ^ (int) (_POINTER_INT) p, &p->_inc)) + return NULL; + } + return filename; +} + +#ifndef _REENT_ONLY + +char * +_DEFUN (tempnam, (dir, pfx), + _CONST char *dir _AND + _CONST char *pfx) +{ + return _tempnam_r (_REENT, dir, pfx); +} + +char * +_DEFUN (tmpnam, (s), + char *s) +{ + return _tmpnam_r (_REENT, s); +} + +#endif diff --git a/newlib/libc/stdio/ungetc.c b/newlib/libc/stdio/ungetc.c new file mode 100644 index 000000000..418717e68 --- /dev/null +++ b/newlib/libc/stdio/ungetc.c @@ -0,0 +1,145 @@ +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "%W% (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include "local.h" + +/* + * Expand the ungetc buffer `in place'. That is, adjust fp->_p when + * the buffer moves, so that it points the same distance from the end, + * and move the bytes in the buffer around as necessary so that they + * are all at the end (stack-style). + */ + +/*static*/ +int +__submore (fp) + register FILE *fp; +{ + register int i; + register unsigned char *p; + + if (fp->_ub._base == fp->_ubuf) + { + /* + * Get a new buffer (rather than expanding the old one). + */ + if ((p = (unsigned char *) _malloc_r (fp->_data, (size_t) BUFSIZ)) == NULL) + return EOF; + fp->_ub._base = p; + fp->_ub._size = BUFSIZ; + p += BUFSIZ - sizeof (fp->_ubuf); + for (i = sizeof (fp->_ubuf); --i >= 0;) + p[i] = fp->_ubuf[i]; + fp->_p = p; + return 0; + } + i = fp->_ub._size; + p = (unsigned char *) _realloc_r (fp->_data, (_PTR) (fp->_ub._base), i << 1); + if (p == NULL) + return EOF; + (void) memcpy ((void *) (p + i), (void *) p, (size_t) i); + fp->_p = p + i; + fp->_ub._base = p; + fp->_ub._size = i << 1; + return 0; +} + +int +ungetc (c, fp) + int c; + register FILE *fp; +{ + if (c == EOF) + return (EOF); + + /* Ensure stdio has been initialized. + ??? Might be able to remove this as some other stdio routine should + have already been called to get the char we are un-getting. */ + + CHECK_INIT (fp); + + /* After ungetc, we won't be at eof anymore */ + fp->_flags &= ~__SEOF; + + if ((fp->_flags & __SRD) == 0) + { + /* + * Not already reading: no good unless reading-and-writing. + * Otherwise, flush any current write stuff. + */ + if ((fp->_flags & __SRW) == 0) + return EOF; + if (fp->_flags & __SWR) + { + if (fflush (fp)) + return EOF; + fp->_flags &= ~__SWR; + fp->_w = 0; + fp->_lbfsize = 0; + } + fp->_flags |= __SRD; + } + c = (unsigned char) c; + + /* + * If we are in the middle of ungetc'ing, just continue. + * This may require expanding the current ungetc buffer. + */ + + if (HASUB (fp)) + { + if (fp->_r >= fp->_ub._size && __submore (fp)) + return EOF; + *--fp->_p = c; + fp->_r++; + return c; + } + + /* + * If we can handle this by simply backing up, do so, + * but never replace the original character. + * (This makes sscanf() work when scanning `const' data.) + */ + + if (fp->_bf._base != NULL && fp->_p > fp->_bf._base && fp->_p[-1] == c) + { + fp->_p--; + fp->_r++; + return c; + } + + /* + * Create an ungetc buffer. + * Initially, we will use the `reserve' buffer. + */ + + fp->_ur = fp->_r; + fp->_up = fp->_p; + fp->_ub._base = fp->_ubuf; + fp->_ub._size = sizeof (fp->_ubuf); + fp->_ubuf[sizeof (fp->_ubuf) - 1] = c; + fp->_p = &fp->_ubuf[sizeof (fp->_ubuf) - 1]; + fp->_r = 1; + return c; +} diff --git a/newlib/libc/stdio/vfieeefp.h b/newlib/libc/stdio/vfieeefp.h new file mode 100644 index 000000000..6843d5f47 --- /dev/null +++ b/newlib/libc/stdio/vfieeefp.h @@ -0,0 +1,205 @@ +/**************************************************************** + * + * The author of this software is David M. Gay. + * + * Copyright (c) 1991 by AT&T. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose without fee is hereby granted, provided that this entire notice + * is included in all copies of any software which is or includes a copy + * or modification of this software and in all copies of the supporting + * documentation for such software. + * + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY + * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + * + ***************************************************************/ + +/* Please send bug reports to + David M. Gay + AT&T Bell Laboratories, Room 2C-463 + 600 Mountain Avenue + Murray Hill, NJ 07974-2070 + U.S.A. + dmg@research.att.com or research!dmg + */ + +/* This header file is a modification of mprec.h that only contains floating + point union code. */ + +#include +#include +#include +#include +#include + +#ifdef __IEEE_LITTLE_ENDIAN +#define IEEE_8087 +#endif + +#ifdef __IEEE_BIG_ENDIAN +#define IEEE_MC68k +#endif + +#ifdef __Z8000__ +#define Just_16 +#endif + +#ifdef Unsigned_Shifts +#define Sign_Extend(a,b) if (b < 0) a |= (__uint32_t)0xffff0000; +#else +#define Sign_Extend(a,b) /*no-op*/ +#endif + +#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM) != 1 +Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined. +#endif + +/* If we are going to examine or modify specific bits in a double using + the word0 and/or word1 macros, then we must wrap the double inside + a union. This is necessary to avoid undefined behavior according to + the ANSI C spec. */ +union double_union +{ + double d; + __uint32_t i[2]; +}; + +#ifdef IEEE_8087 +#define word0(x) (x.i[1]) +#define word1(x) (x.i[0]) +#else +#define word0(x) (x.i[0]) +#define word1(x) (x.i[1]) +#endif + +/* #define P DBL_MANT_DIG */ +/* Ten_pmax = floor(P*log(2)/log(5)) */ +/* Bletch = (highest power of 2 < DBL_MAX_10_EXP) / 16 */ +/* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */ +/* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */ + +#if defined(IEEE_8087) + defined(IEEE_MC68k) +#if defined (_DOUBLE_IS_32BITS) +#define Exp_shift 23 +#define Exp_shift1 23 +#define Exp_msk1 ((__uint32_t)0x00800000L) +#define Exp_msk11 ((__uint32_t)0x00800000L) +#define Exp_mask ((__uint32_t)0x7f800000L) +#define P 24 +#define Bias 127 +#if 0 +#define IEEE_Arith /* it is, but the code doesn't handle IEEE singles yet */ +#endif +#define Emin (-126) +#define Exp_1 ((__uint32_t)0x3f800000L) +#define Exp_11 ((__uint32_t)0x3f800000L) +#define Ebits 8 +#define Frac_mask ((__uint32_t)0x007fffffL) +#define Frac_mask1 ((__uint32_t)0x007fffffL) +#define Ten_pmax 10 +#define Sign_bit ((__uint32_t)0x80000000L) +#define Ten_pmax 10 +#define Bletch 2 +#define Bndry_mask ((__uint32_t)0x007fffffL) +#define Bndry_mask1 ((__uint32_t)0x007fffffL) +#define LSB 1 +#define Sign_bit ((__uint32_t)0x80000000L) +#define Log2P 1 +#define Tiny0 0 +#define Tiny1 1 +#define Quick_max 5 +#define Int_max 6 +#define Infinite(x) (word0(x) == ((__uint32_t)0x7f800000L)) +#undef word0 +#undef word1 + +#define word0(x) (x.i[0]) +#define word1(x) 0 +#else + +#define Exp_shift 20 +#define Exp_shift1 20 +#define Exp_msk1 ((__uint32_t)0x100000L) +#define Exp_msk11 ((__uint32_t)0x100000L) +#define Exp_mask ((__uint32_t)0x7ff00000L) +#define P 53 +#define Bias 1023 +#define IEEE_Arith +#define Emin (-1022) +#define Exp_1 ((__uint32_t)0x3ff00000L) +#define Exp_11 ((__uint32_t)0x3ff00000L) +#define Ebits 11 +#define Frac_mask ((__uint32_t)0xfffffL) +#define Frac_mask1 ((__uint32_t)0xfffffL) +#define Ten_pmax 22 +#define Bletch 0x10 +#define Bndry_mask ((__uint32_t)0xfffffL) +#define Bndry_mask1 ((__uint32_t)0xfffffL) +#define LSB 1 +#define Sign_bit ((__uint32_t)0x80000000L) +#define Log2P 1 +#define Tiny0 0 +#define Tiny1 1 +#define Quick_max 14 +#define Int_max 14 +#define Infinite(x) (word0(x) == ((__uint32_t)0x7ff00000L)) /* sufficient test for here */ +#endif + +#else +#undef Sudden_Underflow +#define Sudden_Underflow +#ifdef IBM +#define Exp_shift 24 +#define Exp_shift1 24 +#define Exp_msk1 ((__uint32_t)0x1000000L) +#define Exp_msk11 ((__uint32_t)0x1000000L) +#define Exp_mask ((__uint32_t)0x7f000000L) +#define P 14 +#define Bias 65 +#define Exp_1 ((__uint32_t)0x41000000L) +#define Exp_11 ((__uint32_t)0x41000000L) +#define Ebits 8 /* exponent has 7 bits, but 8 is the right value in b2d */ +#define Frac_mask ((__uint32_t)0xffffffL) +#define Frac_mask1 ((__uint32_t)0xffffffL) +#define Bletch 4 +#define Ten_pmax 22 +#define Bndry_mask ((__uint32_t)0xefffffL) +#define Bndry_mask1 ((__uint32_t)0xffffffL) +#define LSB 1 +#define Sign_bit ((__uint32_t)0x80000000L) +#define Log2P 4 +#define Tiny0 ((__uint32_t)0x100000L) +#define Tiny1 0 +#define Quick_max 14 +#define Int_max 15 +#else /* VAX */ +#define Exp_shift 23 +#define Exp_shift1 7 +#define Exp_msk1 0x80 +#define Exp_msk11 ((__uint32_t)0x800000L) +#define Exp_mask ((__uint32_t)0x7f80L) +#define P 56 +#define Bias 129 +#define Exp_1 ((__uint32_t)0x40800000L) +#define Exp_11 ((__uint32_t)0x4080L) +#define Ebits 8 +#define Frac_mask ((__uint32_t)0x7fffffL) +#define Frac_mask1 ((__uint32_t)0xffff007fL) +#define Ten_pmax 24 +#define Bletch 2 +#define Bndry_mask ((__uint32_t)0xffff007fL) +#define Bndry_mask1 ((__uint32_t)0xffff007fL) +#define LSB ((__uint32_t)0x10000L) +#define Sign_bit ((__uint32_t)0x8000L) +#define Log2P 1 +#define Tiny0 0x80 +#define Tiny1 0 +#define Quick_max 15 +#define Int_max 15 +#endif +#endif + + diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c new file mode 100644 index 000000000..4b2043e49 --- /dev/null +++ b/newlib/libc/stdio/vfprintf.c @@ -0,0 +1,939 @@ +/* +FUNCTION +<>, <>, <>---format argument list + +INDEX + vprintf +INDEX + vfprintf +INDEX + vsprintf +INDEX + vsnprintf + +ANSI_SYNOPSIS + #include + #include + int vprintf(const char *<[fmt]>, va_list <[list]>); + int vfprintf(FILE *<[fp]>, const char *<[fmt]>, va_list <[list]>); + int vsprintf(char *<[str]>, const char *<[fmt]>, va_list <[list]>); + int vsnprintf(char *<[str]>, size_t <[size]>, const char *<[fmt]>, va_list <[list]>); + + int _vprintf_r(void *<[reent]>, const char *<[fmt]>, + va_list <[list]>); + int _vfprintf_r(void *<[reent]>, FILE *<[fp]>, const char *<[fmt]>, + va_list <[list]>); + int _vsprintf_r(void *<[reent]>, char *<[str]>, const char *<[fmt]>, + va_list <[list]>); + int _vsnprintf_r(void *<[reent]>, char *<[str]>, size_t <[size]>, const char *<[fmt]>, + va_list <[list]>); + +TRAD_SYNOPSIS + #include + #include + int vprintf( <[fmt]>, <[list]>) + char *<[fmt]>; + va_list <[list]>; + + int vfprintf(<[fp]>, <[fmt]>, <[list]>) + FILE *<[fp]>; + char *<[fmt]>; + va_list <[list]>; + + int vsprintf(<[str]>, <[fmt]>, <[list]>) + char *<[str]>; + char *<[fmt]>; + va_list <[list]>; + + int vsnprintf(<[str]>, <[size]>, <[fmt]>, <[list]>) + char *<[str]>; + size_t <[size]>; + char *<[fmt]>; + va_list <[list]>; + + int _vprintf_r(<[reent]>, <[fmt]>, <[list]>) + char *<[reent]>; + char *<[fmt]>; + va_list <[list]>; + + int _vfprintf_r(<[reent]>, <[fp]>, <[fmt]>, <[list]>) + char *<[reent]>; + FILE *<[fp]>; + char *<[fmt]>; + va_list <[list]>; + + int _vsprintf_r(<[reent]>, <[str]>, <[fmt]>, <[list]>) + char *<[reent]>; + char *<[str]>; + char *<[fmt]>; + va_list <[list]>; + + int _vsnprintf_r(<[reent]>, <[str]>, <[size]>, <[fmt]>, <[list]>) + char *<[reent]>; + char *<[str]>; + size_t <[size]>; + char *<[fmt]>; + va_list <[list]>; + +DESCRIPTION +<>, <>, <> and <> are (respectively) +variants of <>, <>, <> and <>. They differ +only in allowing their caller to pass the variable argument list as a +<> object (initialized by <>) rather than directly +accepting a variable number of arguments. + +RETURNS +The return values are consistent with the corresponding functions: +<> returns the number of bytes in the output string, +save that the concluding <> is not counted. +<> and <> return the number of characters transmitted. +If an error occurs, <> and <> return <>. No +error returns occur for <>. + +PORTABILITY +ANSI C requires all three functions. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +/*static char *sccsid = "from: @(#)vfprintf.c 5.50 (Berkeley) 12/16/92";*/ +static char *rcsid = "$Id$"; +#endif /* LIBC_SCCS and not lint */ + +/* + * Actual printf innards. + * + * This code is large and complicated... + */ + +#ifdef INTEGER_ONLY +#define VFPRINTF vfiprintf +#define _VFPRINTF_R _vfiprintf_r +#else +#define VFPRINTF vfprintf +#define _VFPRINTF_R _vfprintf_r +#define FLOATING_POINT +#endif + +#define _NO_LONGLONG +#if defined WANT_PRINTF_LONG_LONG && defined __GNUC__ +# undef _NO_LONGLONG +#endif + +#include <_ansi.h> +#include +#include +#include +#include + +#ifdef _HAVE_STDC +#include +#else +#include +#endif + +#include "local.h" +#include "fvwrite.h" +#include "vfieeefp.h" + +/* + * Flush out all the vectors defined by the given uio, + * then reset it so that it can be reused. + */ +static int +__sprint(fp, uio) + FILE *fp; + register struct __suio *uio; +{ + register int err; + + if (uio->uio_resid == 0) { + uio->uio_iovcnt = 0; + return (0); + } + err = __sfvwrite(fp, uio); + uio->uio_resid = 0; + uio->uio_iovcnt = 0; + return (err); +} + +/* + * Helper function for `fprintf to unbuffered unix file': creates a + * temporary buffer. We only work on write-only files; this avoids + * worries about ungetc buffers and so forth. + */ +static int +__sbprintf(fp, fmt, ap) + register FILE *fp; + const char *fmt; + va_list ap; +{ + int ret; + FILE fake; + unsigned char buf[BUFSIZ]; + + /* copy the important variables */ + fake._data = fp->_data; + fake._flags = fp->_flags & ~__SNBF; + fake._file = fp->_file; + fake._cookie = fp->_cookie; + fake._write = fp->_write; + + /* set up the buffer */ + fake._bf._base = fake._p = buf; + fake._bf._size = fake._w = sizeof(buf); + fake._lbfsize = 0; /* not actually used, but Just In Case */ + + /* do the work, then copy any error status */ + ret = VFPRINTF(&fake, fmt, ap); + if (ret >= 0 && fflush(&fake)) + ret = EOF; + if (fake._flags & __SERR) + fp->_flags |= __SERR; + return (ret); +} + + +#ifdef FLOATING_POINT +#include +#include +#include "floatio.h" + +#define BUF (MAXEXP+MAXFRACT+1) /* + decimal point */ +#define DEFPREC 6 + +static char *cvt _PARAMS((struct _reent *, double, int, int, char *, int *, int, int *)); +static int exponent _PARAMS((char *, int, int)); + +#else /* no FLOATING_POINT */ + +#define BUF 40 + +#endif /* FLOATING_POINT */ + + +/* + * Macros for converting digits to letters and vice versa + */ +#define to_digit(c) ((c) - '0') +#define is_digit(c) ((unsigned)to_digit(c) <= 9) +#define to_char(n) ((n) + '0') + +/* + * Flags used during conversion. + */ +#define ALT 0x001 /* alternate form */ +#define HEXPREFIX 0x002 /* add 0x or 0X prefix */ +#define LADJUST 0x004 /* left adjustment */ +#define LONGDBL 0x008 /* long double; unimplemented */ +#define LONGINT 0x010 /* long integer */ +#define QUADINT 0x020 /* quad integer */ +#define SHORTINT 0x040 /* short integer */ +#define ZEROPAD 0x080 /* zero (as opposed to blank) pad */ +#define FPT 0x100 /* Floating point number */ + +int +_DEFUN (VFPRINTF, (fp, fmt0, ap), + FILE * fp _AND + _CONST char *fmt0 _AND + va_list ap) +{ + return _VFPRINTF_R (fp->_data, fp, fmt0, ap); +} + +int +_DEFUN (_VFPRINTF_R, (data, fp, fmt0, ap), + struct _reent *data _AND + FILE * fp _AND + _CONST char *fmt0 _AND + va_list ap) +{ + register char *fmt; /* format string */ + register int ch; /* character from fmt */ + register int n, m; /* handy integers (short term usage) */ + register char *cp; /* handy char pointer (short term usage) */ + register struct __siov *iovp;/* for PRINT macro */ + register int flags; /* flags as above */ + int ret; /* return value accumulator */ + int width; /* width from format (%8d), or 0 */ + int prec; /* precision from format (%.3d), or -1 */ + char sign; /* sign prefix (' ', '+', '-', or \0) */ + wchar_t wc; +#ifdef FLOATING_POINT + char *decimal_point = localeconv()->decimal_point; + char softsign; /* temporary negative sign for floats */ + double _double; /* double precision arguments %[eEfgG] */ + int expt; /* integer value of exponent */ + int expsize; /* character count for expstr */ + int ndig; /* actual number of digits returned by cvt */ + char expstr[7]; /* buffer for exponent string */ +#endif + +#ifndef _NO_LONGLONG +#define quad_t long long +#define u_quad_t unsigned long long +#endif + +#ifndef _NO_LONGLONG + u_quad_t _uquad; /* integer arguments %[diouxX] */ +#else + u_long _uquad; +#endif + enum { OCT, DEC, HEX } base;/* base for [diouxX] conversion */ + int dprec; /* a copy of prec if [diouxX], 0 otherwise */ + int realsz; /* field size expanded by dprec */ + int size; /* size of converted field or string */ + char *xdigs; /* digits for [xX] conversion */ +#define NIOV 8 + struct __suio uio; /* output information: summary */ + struct __siov iov[NIOV];/* ... and individual io vectors */ + char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */ + char ox[2]; /* space for 0x hex-prefix */ + int state = 0; /* mbtowc calls from library must not change state */ + + /* + * Choose PADSIZE to trade efficiency vs. size. If larger printf + * fields occur frequently, increase PADSIZE and make the initialisers + * below longer. + */ +#define PADSIZE 16 /* pad chunk size */ + static _CONST char blanks[PADSIZE] = + {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; + static _CONST char zeroes[PADSIZE] = + {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; + + /* + * BEWARE, these `goto error' on error, and PAD uses `n'. + */ +#define PRINT(ptr, len) { \ + iovp->iov_base = (ptr); \ + iovp->iov_len = (len); \ + uio.uio_resid += (len); \ + iovp++; \ + if (++uio.uio_iovcnt >= NIOV) { \ + if (__sprint(fp, &uio)) \ + goto error; \ + iovp = iov; \ + } \ +} +#define PAD(howmany, with) { \ + if ((n = (howmany)) > 0) { \ + while (n > PADSIZE) { \ + PRINT(with, PADSIZE); \ + n -= PADSIZE; \ + } \ + PRINT(with, n); \ + } \ +} +#define FLUSH() { \ + if (uio.uio_resid && __sprint(fp, &uio)) \ + goto error; \ + uio.uio_iovcnt = 0; \ + iovp = iov; \ +} + + /* + * To extend shorts properly, we need both signed and unsigned + * argument extraction methods. + */ +#ifndef _NO_LONGLONG +#define SARG() \ + (flags&QUADINT ? va_arg(ap, quad_t) : \ + flags&LONGINT ? va_arg(ap, long) : \ + flags&SHORTINT ? (long)(short)va_arg(ap, int) : \ + (long)va_arg(ap, int)) +#define UARG() \ + (flags&QUADINT ? va_arg(ap, u_quad_t) : \ + flags&LONGINT ? va_arg(ap, u_long) : \ + flags&SHORTINT ? (u_long)(u_short)va_arg(ap, int) : \ + (u_long)va_arg(ap, u_int)) +#else +#define SARG() \ + (flags&LONGINT ? va_arg(ap, long) : \ + flags&SHORTINT ? (long)(short)va_arg(ap, int) : \ + (long)va_arg(ap, int)) +#define UARG() \ + (flags&LONGINT ? va_arg(ap, u_long) : \ + flags&SHORTINT ? (u_long)(u_short)va_arg(ap, int) : \ + (u_long)va_arg(ap, u_int)) +#endif + + CHECK_INIT (fp); + + /* sorry, fprintf(read_only_file, "") returns EOF, not 0 */ + if (cantwrite(fp)) + return (EOF); + + /* optimise fprintf(stderr) (and other unbuffered Unix files) */ + if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && + fp->_file >= 0) + return (__sbprintf(fp, fmt0, ap)); + + fmt = (char *)fmt0; + uio.uio_iov = iovp = iov; + uio.uio_resid = 0; + uio.uio_iovcnt = 0; + ret = 0; + + /* + * Scan the format for conversions (`%' character). + */ + for (;;) { + cp = fmt; + while ((n = _mbtowc_r(_REENT, &wc, fmt, MB_CUR_MAX, &state)) > 0) { + fmt += n; + if (wc == '%') { + fmt--; + break; + } + } + if ((m = fmt - cp) != 0) { + PRINT(cp, m); + ret += m; + } + if (n <= 0) + goto done; + fmt++; /* skip over '%' */ + + flags = 0; + dprec = 0; + width = 0; + prec = -1; + sign = '\0'; + +rflag: ch = *fmt++; +reswitch: switch (ch) { + case ' ': + /* + * ``If the space and + flags both appear, the space + * flag will be ignored.'' + * -- ANSI X3J11 + */ + if (!sign) + sign = ' '; + goto rflag; + case '#': + flags |= ALT; + goto rflag; + case '*': + /* + * ``A negative field width argument is taken as a + * - flag followed by a positive field width.'' + * -- ANSI X3J11 + * They don't exclude field widths read from args. + */ + if ((width = va_arg(ap, int)) >= 0) + goto rflag; + width = -width; + /* FALLTHROUGH */ + case '-': + flags |= LADJUST; + goto rflag; + case '+': + sign = '+'; + goto rflag; + case '.': + if ((ch = *fmt++) == '*') { + n = va_arg(ap, int); + prec = n < 0 ? -1 : n; + goto rflag; + } + n = 0; + while (is_digit(ch)) { + n = 10 * n + to_digit(ch); + ch = *fmt++; + } + prec = n < 0 ? -1 : n; + goto reswitch; + case '0': + /* + * ``Note that 0 is taken as a flag, not as the + * beginning of a field width.'' + * -- ANSI X3J11 + */ + flags |= ZEROPAD; + goto rflag; + case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + n = 0; + do { + n = 10 * n + to_digit(ch); + ch = *fmt++; + } while (is_digit(ch)); + width = n; + goto reswitch; +#ifdef FLOATING_POINT + case 'L': + flags |= LONGDBL; + goto rflag; +#endif + case 'h': + flags |= SHORTINT; + goto rflag; + case 'l': + if (*fmt == 'l') { + fmt++; + flags |= QUADINT; + } else { + flags |= LONGINT; + } + goto rflag; + case 'q': + flags |= QUADINT; + goto rflag; + case 'c': + *(cp = buf) = va_arg(ap, int); + size = 1; + sign = '\0'; + break; + case 'D': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'd': + case 'i': + _uquad = SARG(); +#ifndef _NO_LONGLONG + if ((quad_t)_uquad < 0) +#else + if ((long) _uquad < 0) +#endif + { + + _uquad = -_uquad; + sign = '-'; + } + base = DEC; + goto number; +#ifdef FLOATING_POINT + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + if (prec == -1) { + prec = DEFPREC; + } else if ((ch == 'g' || ch == 'G') && prec == 0) { + prec = 1; + } + + if (flags & LONGDBL) { + _double = (double) va_arg(ap, long double); + } else { + _double = va_arg(ap, double); + } + + /* do this before tricky precision changes */ + if (isinf(_double)) { + if (_double < 0) + sign = '-'; + cp = "Inf"; + size = 3; + break; + } + if (isnan(_double)) { + cp = "NaN"; + size = 3; + break; + } + + flags |= FPT; + cp = cvt(data, _double, prec, flags, &softsign, + &expt, ch, &ndig); + if (ch == 'g' || ch == 'G') { + if (expt <= -4 || expt > prec) + ch = (ch == 'g') ? 'e' : 'E'; + else + ch = 'g'; + } + if (ch <= 'e') { /* 'e' or 'E' fmt */ + --expt; + expsize = exponent(expstr, expt, ch); + size = expsize + ndig; + if (ndig > 1 || flags & ALT) + ++size; + } else if (ch == 'f') { /* f fmt */ + if (expt > 0) { + size = expt; + if (prec || flags & ALT) + size += prec + 1; + } else /* "0.X" */ + size = prec + 2; + } else if (expt >= ndig) { /* fixed g fmt */ + size = expt; + if (flags & ALT) + ++size; + } else + size = ndig + (expt > 0 ? + 1 : 2 - expt); + + if (softsign) + sign = '-'; + break; +#endif /* FLOATING_POINT */ + case 'n': +#ifndef _NO_LONGLONG + if (flags & QUADINT) + *va_arg(ap, quad_t *) = ret; + else +#endif + if (flags & LONGINT) + *va_arg(ap, long *) = ret; + else if (flags & SHORTINT) + *va_arg(ap, short *) = ret; + else + *va_arg(ap, int *) = ret; + continue; /* no output */ + case 'O': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'o': + _uquad = UARG(); + base = OCT; + goto nosign; + case 'p': + /* + * ``The argument shall be a pointer to void. The + * value of the pointer is converted to a sequence + * of printable characters, in an implementation- + * defined manner.'' + * -- ANSI X3J11 + */ + /* NOSTRICT */ + _uquad = (u_long)(unsigned _POINTER_INT)va_arg(ap, void *); + base = HEX; + xdigs = "0123456789abcdef"; + flags |= HEXPREFIX; + ch = 'x'; + goto nosign; + case 's': + if ((cp = va_arg(ap, char *)) == NULL) + cp = "(null)"; + if (prec >= 0) { + /* + * can't use strlen; can only look for the + * NUL in the first `prec' characters, and + * strlen() will go further. + */ + char *p = memchr(cp, 0, prec); + + if (p != NULL) { + size = p - cp; + if (size > prec) + size = prec; + } else + size = prec; + } else + size = strlen(cp); + sign = '\0'; + break; + case 'U': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'u': + _uquad = UARG(); + base = DEC; + goto nosign; + case 'X': + xdigs = "0123456789ABCDEF"; + goto hex; + case 'x': + xdigs = "0123456789abcdef"; +hex: _uquad = UARG(); + base = HEX; + /* leading 0x/X only if non-zero */ + if (flags & ALT && _uquad != 0) + flags |= HEXPREFIX; + + /* unsigned conversions */ +nosign: sign = '\0'; + /* + * ``... diouXx conversions ... if a precision is + * specified, the 0 flag will be ignored.'' + * -- ANSI X3J11 + */ +number: if ((dprec = prec) >= 0) + flags &= ~ZEROPAD; + + /* + * ``The result of converting a zero value with an + * explicit precision of zero is no characters.'' + * -- ANSI X3J11 + */ + cp = buf + BUF; + if (_uquad != 0 || prec != 0) { + /* + * Unsigned mod is hard, and unsigned mod + * by a constant is easier than that by + * a variable; hence this switch. + */ + switch (base) { + case OCT: + do { + *--cp = to_char(_uquad & 7); + _uquad >>= 3; + } while (_uquad); + /* handle octal leading 0 */ + if (flags & ALT && *cp != '0') + *--cp = '0'; + break; + + case DEC: + /* many numbers are 1 digit */ + while (_uquad >= 10) { + *--cp = to_char(_uquad % 10); + _uquad /= 10; + } + *--cp = to_char(_uquad); + break; + + case HEX: + do { + *--cp = xdigs[_uquad & 15]; + _uquad >>= 4; + } while (_uquad); + break; + + default: + cp = "bug in vfprintf: bad base"; + size = strlen(cp); + goto skipsize; + } + } + size = buf + BUF - cp; + skipsize: + break; + default: /* "%?" prints ?, unless ? is NUL */ + if (ch == '\0') + goto done; + /* pretend it was %c with argument ch */ + cp = buf; + *cp = ch; + size = 1; + sign = '\0'; + break; + } + + /* + * All reasonable formats wind up here. At this point, `cp' + * points to a string which (if not flags&LADJUST) should be + * padded out to `width' places. If flags&ZEROPAD, it should + * first be prefixed by any sign or other prefix; otherwise, + * it should be blank padded before the prefix is emitted. + * After any left-hand padding and prefixing, emit zeroes + * required by a decimal [diouxX] precision, then print the + * string proper, then emit zeroes required by any leftover + * floating precision; finally, if LADJUST, pad with blanks. + * + * Compute actual size, so we know how much to pad. + * size excludes decimal prec; realsz includes it. + */ + realsz = dprec > size ? dprec : size; + if (sign) + realsz++; + else if (flags & HEXPREFIX) + realsz+= 2; + + /* right-adjusting blank padding */ + if ((flags & (LADJUST|ZEROPAD)) == 0) + PAD(width - realsz, blanks); + + /* prefix */ + if (sign) { + PRINT(&sign, 1); + } else if (flags & HEXPREFIX) { + ox[0] = '0'; + ox[1] = ch; + PRINT(ox, 2); + } + + /* right-adjusting zero padding */ + if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) + PAD(width - realsz, zeroes); + + /* leading zeroes from decimal precision */ + PAD(dprec - size, zeroes); + + /* the string or number proper */ +#ifdef FLOATING_POINT + if ((flags & FPT) == 0) { + PRINT(cp, size); + } else { /* glue together f_p fragments */ + if (ch >= 'f') { /* 'f' or 'g' */ + if (_double == 0) { + /* kludge for __dtoa irregularity */ + PRINT("0", 1); + if (expt < ndig || (flags & ALT) != 0) { + PRINT(decimal_point, 1); + PAD(ndig - 1, zeroes); + } + } else if (expt <= 0) { + PRINT("0", 1); + PRINT(decimal_point, 1); + PAD(-expt, zeroes); + PRINT(cp, ndig); + } else if (expt >= ndig) { + PRINT(cp, ndig); + PAD(expt - ndig, zeroes); + if (flags & ALT) + PRINT(".", 1); + } else { + PRINT(cp, expt); + cp += expt; + PRINT(".", 1); + PRINT(cp, ndig-expt); + } + } else { /* 'e' or 'E' */ + if (ndig > 1 || flags & ALT) { + ox[0] = *cp++; + ox[1] = '.'; + PRINT(ox, 2); + if (_double || flags & ALT == 0) { + PRINT(cp, ndig-1); + } else /* 0.[0..] */ + /* __dtoa irregularity */ + PAD(ndig - 1, zeroes); + } else /* XeYYY */ + PRINT(cp, 1); + PRINT(expstr, expsize); + } + } +#else + PRINT(cp, size); +#endif + /* left-adjusting padding (always blank) */ + if (flags & LADJUST) + PAD(width - realsz, blanks); + + /* finally, adjust ret */ + ret += width > realsz ? width : realsz; + + FLUSH(); /* copy out the I/O vectors */ + } +done: + FLUSH(); +error: + return (__sferror(fp) ? EOF : ret); + /* NOTREACHED */ +} + +#ifdef FLOATING_POINT + +extern char *_dtoa_r _PARAMS((struct _reent *, double, int, + int, int *, int *, char **)); + +static char * +cvt(data, value, ndigits, flags, sign, decpt, ch, length) + struct _reent *data; + double value; + int ndigits, flags, *decpt, ch, *length; + char *sign; +{ + int mode, dsgn; + char *digits, *bp, *rve; + union double_union tmp; + + if (ch == 'f') { + mode = 3; /* ndigits after the decimal point */ + } else { + /* To obtain ndigits after the decimal point for the 'e' + * and 'E' formats, round to ndigits + 1 significant + * figures. + */ + if (ch == 'e' || ch == 'E') { + ndigits++; + } + mode = 2; /* ndigits significant digits */ + } + + tmp.d = value; + if (word0(tmp) & Sign_bit) { /* this will check for < 0 and -0.0 */ + value = -value; + *sign = '-'; + } else + *sign = '\000'; + digits = _dtoa_r(data, value, mode, ndigits, decpt, &dsgn, &rve); + if ((ch != 'g' && ch != 'G') || flags & ALT) { /* Print trailing zeros */ + bp = digits + ndigits; + if (ch == 'f') { + if (*digits == '0' && value) + *decpt = -ndigits + 1; + bp += *decpt; + } + if (value == 0) /* kludge for __dtoa irregularity */ + rve = bp; + while (rve < bp) + *rve++ = '0'; + } + *length = rve - digits; + return (digits); +} + +static int +exponent(p0, exp, fmtch) + char *p0; + int exp, fmtch; +{ + register char *p, *t; + char expbuf[MAXEXP]; + + p = p0; + *p++ = fmtch; + if (exp < 0) { + exp = -exp; + *p++ = '-'; + } + else + *p++ = '+'; + t = expbuf + MAXEXP; + if (exp > 9) { + do { + *--t = to_char(exp % 10); + } while ((exp /= 10) > 9); + *--t = to_char(exp); + for (; t < expbuf + MAXEXP; *p++ = *t++); + } + else { + *p++ = '0'; + *p++ = to_char(exp); + } + return (p - p0); +} +#endif /* FLOATING_POINT */ diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c new file mode 100644 index 000000000..00fd98d76 --- /dev/null +++ b/newlib/libc/stdio/vfscanf.c @@ -0,0 +1,956 @@ +/* No user fns here. Pesch 15apr92. */ + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include <_ansi.h> +#include +#include +#include +#include +#ifdef _HAVE_STDC +#include +#else +#include +#endif +#include "local.h" + +#ifndef NO_FLOATING_POINT +#define FLOATING_POINT +#endif + +#ifdef FLOATING_POINT +#include "floatio.h" +#define BUF (MAXEXP+MAXFRACT+3) /* 3 = sign + decimal point + NUL */ +/* An upper bound for how long a long prints in decimal. 4 / 13 approximates + log (2). Add one char for roundoff compensation and one for the sign. */ +#define MAX_LONG_LEN ((CHAR_BIT * sizeof (long) - 1) * 4 / 13 + 2) +#else +#define BUF 40 +#endif + +/* + * Flags used during conversion. + */ + +#define LONG 0x01 /* l: long or double */ +#define LONGDBL 0x02 /* L: long double; unimplemented */ +#define SHORT 0x04 /* h: short */ +#define SUPPRESS 0x08 /* suppress assignment */ +#define POINTER 0x10 /* weird %p pointer (`fake hex') */ +#define NOSKIP 0x20 /* do not skip blanks */ + +/* + * The following are used in numeric conversions only: + * SIGNOK, NDIGITS, DPTOK, and EXPOK are for floating point; + * SIGNOK, NDIGITS, PFXOK, and NZDIGITS are for integral. + */ + +#define SIGNOK 0x40 /* +/- is (still) legal */ +#define NDIGITS 0x80 /* no digits detected */ + +#define DPTOK 0x100 /* (float) decimal point is still legal */ +#define EXPOK 0x200 /* (float) exponent (e+3, etc) still legal */ + +#define PFXOK 0x100 /* 0x prefix is (still) legal */ +#define NZDIGITS 0x200 /* no zero digits detected */ + +/* + * Conversion types. + */ + +#define CT_CHAR 0 /* %c conversion */ +#define CT_CCL 1 /* %[...] conversion */ +#define CT_STRING 2 /* %s conversion */ +#define CT_INT 3 /* integer, i.e., strtol or strtoul */ +#define CT_FLOAT 4 /* floating, i.e., strtod */ + +#if 0 +#define u_char unsigned char +#endif +#define u_char char +#define u_long unsigned long + +/*static*/ u_char *__sccl (); + +/* + * vfscanf + */ + +#define BufferEmpty (fp->_r <= 0 && __srefill(fp)) + +int +__svfscanf (fp, fmt0, ap) + register FILE *fp; + char _CONST *fmt0; + va_list ap; +{ + register u_char *fmt = (u_char *) fmt0; + register int c; /* character from format, or conversion */ + register size_t width; /* field width, or 0 */ + register char *p; /* points into all kinds of strings */ + register int n; /* handy integer */ + register int flags; /* flags as defined above */ + register char *p0; /* saves original value of p when necessary */ + int nassigned; /* number of fields assigned */ + int nread; /* number of characters consumed from fp */ + int base = 0; /* base argument to strtol/strtoul */ + int nbytes = 1; /* number of bytes read from fmt string */ + wchar_t wc; /* wchar to use to read format string */ + + u_long (*ccfn) () = 0; /* conversion function (strtol/strtoul) */ + char ccltab[256]; /* character class table for %[...] */ + char buf[BUF]; /* buffer for numeric conversions */ + char *lptr; /* literal pointer */ + int state = 0; /* value to keep track of multibyte state */ + + short *sp; + int *ip; + float *flp; + _LONG_DOUBLE *ldp; + double *dp; + long *lp; + + /* `basefix' is used to avoid `if' tests in the integer scanner */ + static _CONST short basefix[17] = + {10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; + + nassigned = 0; + nread = 0; + for (;;) + { +#ifndef MB_CAPABLE + wc = *fmt; +#else + nbytes = _mbtowc_r (_REENT, &wc, fmt, MB_CUR_MAX, &state); +#endif + fmt += nbytes; + if (wc == 0) + return nassigned; + if (nbytes == 1 && isspace (wc)) + { + for (;;) + { + if (BufferEmpty) + return nassigned; + if (!isspace (*fp->_p)) + break; + nread++, fp->_r--, fp->_p++; + } + continue; + } + if (wc != '%') + goto literal; + width = 0; + flags = 0; + + /* + * switch on the format. continue if done; break once format + * type is derived. + */ + + again: + c = *fmt++; + + switch (c) + { + case '%': + literal: + lptr = fmt - nbytes; + for (n = 0; n < nbytes; ++n) + { + if (BufferEmpty) + goto input_failure; + if (*fp->_p != *lptr) + goto match_failure; + fp->_r--, fp->_p++; + nread++; + ++lptr; + } + continue; + + case '*': + flags |= SUPPRESS; + goto again; + case 'l': + flags |= LONG; + goto again; + case 'L': + flags |= LONGDBL; + goto again; + case 'h': + flags |= SHORT; + goto again; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + width = width * 10 + c - '0'; + goto again; + + /* + * Conversions. Those marked `compat' are for + * 4.[123]BSD compatibility. + * + * (According to ANSI, E and X formats are supposed to + * the same as e and x. Sorry about that.) + */ + + case 'D': /* compat */ + flags |= LONG; + /* FALLTHROUGH */ + case 'd': + c = CT_INT; + ccfn = (u_long (*)())strtol; + base = 10; + break; + + case 'i': + c = CT_INT; + ccfn = (u_long (*)())strtol; + base = 0; + break; + + case 'O': /* compat */ + flags |= LONG; + /* FALLTHROUGH */ + case 'o': + c = CT_INT; + ccfn = strtoul; + base = 8; + break; + + case 'u': + c = CT_INT; + ccfn = strtoul; + base = 10; + break; + + case 'X': /* compat XXX */ + case 'x': + flags |= PFXOK; /* enable 0x prefixing */ + c = CT_INT; + ccfn = strtoul; + base = 16; + break; + +#ifdef FLOATING_POINT + case 'E': /* compat XXX */ + case 'G': /* compat XXX */ +/* ANSI says that E,G and X behave the same way as e,g,x */ + /* FALLTHROUGH */ + case 'e': + case 'f': + case 'g': + c = CT_FLOAT; + break; +#endif + + case 's': + c = CT_STRING; + break; + + case '[': + fmt = __sccl (ccltab, fmt); + flags |= NOSKIP; + c = CT_CCL; + break; + + case 'c': + flags |= NOSKIP; + c = CT_CHAR; + break; + + case 'p': /* pointer format is like hex */ + flags |= POINTER | PFXOK; + c = CT_INT; + ccfn = strtoul; + base = 16; + break; + + case 'n': + if (flags & SUPPRESS) /* ??? */ + continue; + if (flags & SHORT) + { + sp = va_arg (ap, short *); + *sp = nread; + } + else if (flags & LONG) + { + lp = va_arg (ap, long *); + *lp = nread; + } + else + { + ip = va_arg (ap, int *); + *ip = nread; + } + continue; + + /* + * Disgusting backwards compatibility hacks. XXX + */ + case '\0': /* compat */ + return EOF; + + default: /* compat */ + if (isupper (c)) + flags |= LONG; + c = CT_INT; + ccfn = (u_long (*)())strtol; + base = 10; + break; + } + + /* + * We have a conversion that requires input. + */ + if (BufferEmpty) + goto input_failure; + + /* + * Consume leading white space, except for formats that + * suppress this. + */ + if ((flags & NOSKIP) == 0) + { + while (isspace (*fp->_p)) + { + nread++; + if (--fp->_r > 0) + fp->_p++; + else +#ifndef CYGNUS_NEC + if (__srefill (fp)) +#endif + goto input_failure; + } + /* + * Note that there is at least one character in the + * buffer, so conversions that do not set NOSKIP ca + * no longer result in an input failure. + */ + } + + /* + * Do the conversion. + */ + switch (c) + { + + case CT_CHAR: + /* scan arbitrary characters (sets NOSKIP) */ + if (width == 0) + width = 1; + if (flags & SUPPRESS) + { + size_t sum = 0; + + for (;;) + { + if ((n = fp->_r) < width) + { + sum += n; + width -= n; + fp->_p += n; +#ifndef CYGNUS_NEC + if (__srefill (fp)) + { +#endif + if (sum == 0) + goto input_failure; + break; +#ifndef CYGNUS_NEC + } +#endif + } + else + { + sum += width; + fp->_r -= width; + fp->_p += width; + break; + } + } + nread += sum; + } + else + { +#ifdef CYGNUS_NEC + /* Kludge city for the moment */ + char *dest = va_arg (ap, char *); + int n = width; + if (fp->_r == 0) + goto input_failure; + + while (n && fp->_r) + { + *dest++ = *(fp->_p++); + n--; + fp->_r--; + nread++; + } +#else + size_t r = fread ((_PTR) va_arg (ap, char *), 1, width, fp); + + if (r == 0) + goto input_failure; + nread += r; +#endif + nassigned++; + } + break; + + case CT_CCL: + /* scan a (nonempty) character class (sets NOSKIP) */ + if (width == 0) + width = ~0; /* `infinity' */ + /* take only those things in the class */ + if (flags & SUPPRESS) + { + n = 0; + while (ccltab[*fp->_p]) + { + n++, fp->_r--, fp->_p++; + if (--width == 0) + break; + if (BufferEmpty) + { + if (n == 0) + goto input_failure; + break; + } + } + if (n == 0) + goto match_failure; + } + else + { + p0 = p = va_arg (ap, char *); + while (ccltab[*fp->_p]) + { + fp->_r--; + *p++ = *fp->_p++; + if (--width == 0) + break; + if (BufferEmpty) + { + if (p == p0) + goto input_failure; + break; + } + } + n = p - p0; + if (n == 0) + goto match_failure; + *p = 0; + nassigned++; + } + nread += n; + break; + + case CT_STRING: + /* like CCL, but zero-length string OK, & no NOSKIP */ + if (width == 0) + width = ~0; + if (flags & SUPPRESS) + { + n = 0; + while (!isspace (*fp->_p)) + { + n++, fp->_r--, fp->_p++; + if (--width == 0) + break; + if (BufferEmpty) + break; + } + nread += n; + } + else + { + p0 = p = va_arg (ap, char *); + while (!isspace (*fp->_p)) + { + fp->_r--; + *p++ = *fp->_p++; + if (--width == 0) + break; + if (BufferEmpty) + break; + } + *p = 0; + nread += p - p0; + nassigned++; + } + continue; + + case CT_INT: + /* scan an integer as if by strtol/strtoul */ +#ifdef hardway + if (width == 0 || width > sizeof (buf) - 1) + width = sizeof (buf) - 1; +#else + /* size_t is unsigned, hence this optimisation */ + if (--width > sizeof (buf) - 2) + width = sizeof (buf) - 2; + width++; +#endif + flags |= SIGNOK | NDIGITS | NZDIGITS; + for (p = buf; width; width--) + { + c = *fp->_p; + /* + * Switch on the character; `goto ok' if we + * accept it as a part of number. + */ + switch (c) + { + /* + * The digit 0 is always legal, but is special. + * For %i conversions, if no digits (zero or nonzero) + * have been scanned (only signs), we will have base==0. + * In that case, we should set it to 8 and enable 0x + * prefixing. Also, if we have not scanned zero digits + * before this, do not turn off prefixing (someone else + * will turn it off if we have scanned any nonzero digits). + */ + case '0': + if (base == 0) + { + base = 8; + flags |= PFXOK; + } + if (flags & NZDIGITS) + flags &= ~(SIGNOK | NZDIGITS | NDIGITS); + else + flags &= ~(SIGNOK | PFXOK | NDIGITS); + goto ok; + + /* 1 through 7 always legal */ + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + base = basefix[base]; + flags &= ~(SIGNOK | PFXOK | NDIGITS); + goto ok; + + /* digits 8 and 9 ok iff decimal or hex */ + case '8': + case '9': + base = basefix[base]; + if (base <= 8) + break; /* not legal here */ + flags &= ~(SIGNOK | PFXOK | NDIGITS); + goto ok; + + /* letters ok iff hex */ + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + /* no need to fix base here */ + if (base <= 10) + break; /* not legal here */ + flags &= ~(SIGNOK | PFXOK | NDIGITS); + goto ok; + + /* sign ok only as first character */ + case '+': + case '-': + if (flags & SIGNOK) + { + flags &= ~SIGNOK; + goto ok; + } + break; + + /* x ok iff flag still set & 2nd char */ + case 'x': + case 'X': + if (flags & PFXOK && p == buf + 1) + { + base = 16;/* if %i */ + flags &= ~PFXOK; + goto ok; + } + break; + } + + /* + * If we got here, c is not a legal character + * for a number. Stop accumulating digits. + */ + break; + ok: + /* + * c is legal: store it and look at the next. + */ + *p++ = c; + if (--fp->_r > 0) + fp->_p++; + else +#ifndef CYGNUS_NEC + if (__srefill (fp)) +#endif + break; /* EOF */ + } + /* + * If we had only a sign, it is no good; push back the sign. + * If the number ends in `x', it was [sign] '0' 'x', so push back + * the x and treat it as [sign] '0'. + */ + if (flags & NDIGITS) + { + if (p > buf) + _CAST_VOID ungetc (*(u_char *)-- p, fp); + goto match_failure; + } + c = ((u_char *) p)[-1]; + if (c == 'x' || c == 'X') + { + --p; + /*(void)*/ ungetc (c, fp); + } + if ((flags & SUPPRESS) == 0) + { + u_long res; + + *p = 0; + res = (*ccfn) (buf, (char **) NULL, base); + if (flags & POINTER) + *(va_arg (ap, _PTR *)) = (_PTR) (unsigned _POINTER_INT) res; + else if (flags & SHORT) + { + sp = va_arg (ap, short *); + *sp = res; + } + else if (flags & LONG) + { + lp = va_arg (ap, long *); + *lp = res; + } + else + { + ip = va_arg (ap, int *); + *ip = res; + } + nassigned++; + } + nread += p - buf; + break; + +#ifdef FLOATING_POINT + case CT_FLOAT: + { + /* scan a floating point number as if by strtod */ + /* This code used to assume that the number of digits is reasonable. + However, ANSI / ISO C makes no such stipulation; we have to get + exact results even when there is an unreasonable amount of + leading zeroes. */ + long leading_zeroes, zeroes, exp_adjust; + char *exp_start; +#ifdef hardway + if (width == 0 || width > sizeof (buf) - 1) + width = sizeof (buf) - 1; +#else + /* size_t is unsigned, hence this optimisation */ + if (--width > sizeof (buf) - 2) + width = sizeof (buf) - 2; + width++; +#endif + flags |= SIGNOK | NDIGITS | DPTOK | EXPOK; + zeroes = 0; + exp_adjust = 0; + for (p = buf; width; ) + { + c = *fp->_p; + /* + * This code mimicks the integer conversion + * code, but is much simpler. + */ + switch (c) + { + + case '0': + if (flags & NDIGITS) + { + flags &= ~SIGNOK; + zeroes++; + goto fskip; + } + /* Fall through. */ + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + flags &= ~(SIGNOK | NDIGITS); + goto fok; + + case '+': + case '-': + if (flags & SIGNOK) + { + flags &= ~SIGNOK; + goto fok; + } + break; + case '.': + if (flags & DPTOK) + { + flags &= ~(SIGNOK | DPTOK); + leading_zeroes = zeroes; + goto fok; + } + break; + case 'e': + case 'E': + /* no exponent without some digits */ + if ((flags & (NDIGITS | EXPOK)) == EXPOK + || ((flags & EXPOK) && zeroes)) + { + if (! (flags & DPTOK)) + { + exp_adjust = zeroes - leading_zeroes; + exp_start = p; + } + flags = + (flags & ~(EXPOK | DPTOK)) | + SIGNOK | NDIGITS; + zeroes = 0; + goto fok; + } + break; + } + break; + fok: + *p++ = c; + width--; + fskip: + if (--fp->_r > 0) + fp->_p++; + else +#ifndef CYGNUS_NEC + if (__srefill (fp)) +#endif + break; /* EOF */ + } + if (zeroes) + flags &= ~NDIGITS; + /* + * If no digits, might be missing exponent digits + * (just give back the exponent) or might be missing + * regular digits, but had sign and/or decimal point. + */ + if (flags & NDIGITS) + { + if (flags & EXPOK) + { + /* no digits at all */ + while (p > buf) + ungetc (*(u_char *)-- p, fp); + goto match_failure; + } + /* just a bad exponent (e and maybe sign) */ + c = *(u_char *)-- p; + if (c != 'e' && c != 'E') + { + _CAST_VOID ungetc (c, fp); /* sign */ + c = *(u_char *)-- p; + } + _CAST_VOID ungetc (c, fp); + } + if ((flags & SUPPRESS) == 0) + { + double res; + long new_exp; + + *p = 0; + if ((flags & (DPTOK | EXPOK)) == EXPOK) + { + exp_adjust = zeroes - leading_zeroes; + new_exp = -exp_adjust; + exp_start = p; + } + else if (exp_adjust) + new_exp = atol (exp_start + 1) - exp_adjust; + if (exp_adjust) + { + + /* If there might not be enough space for the new exponent, + truncate some trailing digits to make room. */ + if (exp_start >= buf + sizeof (buf) - MAX_LONG_LEN) + exp_start = buf + sizeof (buf) - MAX_LONG_LEN - 1; + sprintf (exp_start, "e%d", new_exp); + } + res = atof (buf); + if (flags & LONG) + { + dp = va_arg (ap, double *); + *dp = res; + } + else if (flags & LONGDBL) + { + ldp = va_arg (ap, _LONG_DOUBLE *); + *ldp = res; + } + else + { + flp = va_arg (ap, float *); + *flp = res; + } + nassigned++; + } + nread += p - buf; + break; + } +#endif /* FLOATING_POINT */ + } + } +input_failure: + return nassigned ? nassigned : -1; +match_failure: + return nassigned; +} + +/* + * Fill in the given table from the scanset at the given format + * (just after `['). Return a pointer to the character past the + * closing `]'. The table has a 1 wherever characters should be + * considered part of the scanset. + */ + +/*static*/ +u_char * +__sccl (tab, fmt) + register char *tab; + register u_char *fmt; +{ + register int c, n, v; + + /* first `clear' the whole table */ + c = *fmt++; /* first char hat => negated scanset */ + if (c == '^') + { + v = 1; /* default => accept */ + c = *fmt++; /* get new first char */ + } + else + v = 0; /* default => reject */ + /* should probably use memset here */ + for (n = 0; n < 256; n++) + tab[n] = v; + if (c == 0) + return fmt - 1; /* format ended before closing ] */ + + /* + * Now set the entries corresponding to the actual scanset to the + * opposite of the above. + * + * The first character may be ']' (or '-') without being special; the + * last character may be '-'. + */ + + v = 1 - v; + for (;;) + { + tab[c] = v; /* take character c */ + doswitch: + n = *fmt++; /* and examine the next */ + switch (n) + { + + case 0: /* format ended too soon */ + return fmt - 1; + + case '-': + /* + * A scanset of the form [01+-] is defined as `the digit 0, the + * digit 1, the character +, the character -', but the effect of a + * scanset such as [a-zA-Z0-9] is implementation defined. The V7 + * Unix scanf treats `a-z' as `the letters a through z', but treats + * `a-a' as `the letter a, the character -, and the letter a'. + * + * For compatibility, the `-' is not considerd to define a range if + * the character following it is either a close bracket (required by + * ANSI) or is not numerically greater than the character we just + * stored in the table (c). + */ + n = *fmt; + if (n == ']' || n < c) + { + c = '-'; + break; /* resume the for(;;) */ + } + fmt++; + do + { /* fill in the range */ + tab[++c] = v; + } + while (c < n); +#if 1 /* XXX another disgusting compatibility hack */ + /* + * Alas, the V7 Unix scanf also treats formats such + * as [a-c-e] as `the letters a through e'. This too + * is permitted by the standard.... + */ + goto doswitch; +#else + c = *fmt++; + if (c == 0) + return fmt - 1; + if (c == ']') + return fmt; +#endif + + break; + + + case ']': /* end of scanset */ + return fmt; + + default: /* just another character */ + c = n; + break; + } + } + /* NOTREACHED */ +} diff --git a/newlib/libc/stdio/vprintf.c b/newlib/libc/stdio/vprintf.c new file mode 100644 index 000000000..c270141f0 --- /dev/null +++ b/newlib/libc/stdio/vprintf.c @@ -0,0 +1,35 @@ +/* doc in vfprintf.c */ + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include <_ansi.h> +#include + +#ifdef _HAVE_STDC +#include +#else +#include +#endif + +int +vprintf (fmt, ap) + char _CONST *fmt; + va_list ap; +{ + return vfprintf (stdout, fmt, ap); +} diff --git a/newlib/libc/stdio/vsnprintf.c b/newlib/libc/stdio/vsnprintf.c new file mode 100644 index 000000000..18df5864a --- /dev/null +++ b/newlib/libc/stdio/vsnprintf.c @@ -0,0 +1,73 @@ +/* doc in vfprintf.c */ + +/* This code created by modifying vsprintf.c so copyright inherited. */ + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "%W% (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ + +#include <_ansi.h> +#include +#include +#include +#ifdef _HAVE_STDC +#include +#else +#include +#endif + +int +vsnprintf (str, size, fmt, ap) + char *str; + size_t size; + char _CONST *fmt; + va_list ap; +{ + int ret; + FILE f; + + f._flags = __SWR | __SSTR; + f._bf._base = f._p = (unsigned char *) str; + f._bf._size = f._w = size; + f._data = _REENT; + ret = vfprintf (&f, fmt, ap); + *f._p = 0; + return ret; +} + +int +vsnprintf_r (ptr, str, size, fmt, ap) + struct _reent *ptr; + char *str; + size_t size; + char _CONST *fmt; + va_list ap; +{ + int ret; + FILE f; + + f._flags = __SWR | __SSTR; + f._bf._base = f._p = (unsigned char *) str; + f._bf._size = f._w = size; + f._data = ptr; + ret = vfprintf (&f, fmt, ap); + *f._p = 0; + return ret; +} diff --git a/newlib/libc/stdio/vsprintf.c b/newlib/libc/stdio/vsprintf.c new file mode 100644 index 000000000..416c184e8 --- /dev/null +++ b/newlib/libc/stdio/vsprintf.c @@ -0,0 +1,70 @@ +/* doc in vfprintf.c */ + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "%W% (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ + +#include <_ansi.h> +#include +#include +#include +#ifdef _HAVE_STDC +#include +#else +#include +#endif + +int +vsprintf (str, fmt, ap) + char *str; + char _CONST *fmt; + va_list ap; +{ + int ret; + FILE f; + + f._flags = __SWR | __SSTR; + f._bf._base = f._p = (unsigned char *) str; + f._bf._size = f._w = INT_MAX; + f._data = _REENT; + ret = vfprintf (&f, fmt, ap); + *f._p = 0; + return ret; +} + +int +vsprintf_r (ptr, str, fmt, ap) + struct _reent *ptr; + char *str; + char _CONST *fmt; + va_list ap; +{ + int ret; + FILE f; + + f._flags = __SWR | __SSTR; + f._bf._base = f._p = (unsigned char *) str; + f._bf._size = f._w = INT_MAX; + f._data = ptr; + ret = vfprintf (&f, fmt, ap); + *f._p = 0; + return ret; +} + diff --git a/newlib/libc/stdio/wbuf.c b/newlib/libc/stdio/wbuf.c new file mode 100644 index 000000000..110682971 --- /dev/null +++ b/newlib/libc/stdio/wbuf.c @@ -0,0 +1,81 @@ +/* No user fns here. Pesch 15apr92. */ + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "%W% (Berkeley) %G%"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include "local.h" +#include "fvwrite.h" + +/* + * Write the given character into the (probably full) buffer for + * the given file. Flush the buffer out if it is or becomes full, + * or if c=='\n' and the file is line buffered. + */ + +int +__swbuf (c, fp) + register int c; + register FILE *fp; +{ + register int n; + + /* Ensure stdio has been initialized. */ + + CHECK_INIT (fp); + + /* + * In case we cannot write, or longjmp takes us out early, + * make sure _w is 0 (if fully- or un-buffered) or -_bf._size + * (if line buffered) so that we will get called again. + * If we did not do this, a sufficient number of putc() + * calls might wrap _w from negative to positive. + */ + + fp->_w = fp->_lbfsize; + if (cantwrite (fp)) + return EOF; + c = (unsigned char) c; + + /* + * If it is completely full, flush it out. Then, in any case, + * stuff c into the buffer. If this causes the buffer to fill + * completely, or if c is '\n' and the file is line buffered, + * flush it (perhaps a second time). The second flush will always + * happen on unbuffered streams, where _bf._size==1; fflush() + * guarantees that putc() will always call wbuf() by setting _w + * to 0, so we need not do anything else. + */ + + n = fp->_p - fp->_bf._base; + if (n >= fp->_bf._size) + { + if (fflush (fp)) + return EOF; + n = 0; + } + fp->_w--; + *fp->_p++ = c; + if (++n == fp->_bf._size || (fp->_flags & __SLBF && c == '\n')) + if (fflush (fp)) + return EOF; + return c; +} diff --git a/newlib/libc/stdio/wsetup.c b/newlib/libc/stdio/wsetup.c new file mode 100644 index 000000000..23b032efe --- /dev/null +++ b/newlib/libc/stdio/wsetup.c @@ -0,0 +1,79 @@ +/* No user fns here. Pesch 15apr92. */ + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include +#include +#include "local.h" + +/* + * Various output routines call wsetup to be sure it is safe to write, + * because either _flags does not include __SWR, or _buf is NULL. + * _wsetup returns 0 if OK to write, nonzero otherwise. + */ + +int +_DEFUN (__swsetup, (fp), + register FILE * fp) +{ + /* Make sure stdio is set up. */ + + CHECK_INIT (fp); + + /* + * If we are not writing, we had better be reading and writing. + */ + + if ((fp->_flags & __SWR) == 0) + { + if ((fp->_flags & __SRW) == 0) + return EOF; + if (fp->_flags & __SRD) + { + /* clobber any ungetc data */ + if (HASUB (fp)) + FREEUB (fp); + fp->_flags &= ~(__SRD | __SEOF); + fp->_r = 0; + fp->_p = fp->_bf._base; + } + fp->_flags |= __SWR; + } + + /* + * Make a buffer if necessary, then set _w. + */ + /* NOT NEEDED FOR CYGNUS SPRINTF ONLY jpg */ + if (fp->_bf._base == NULL) + __smakebuf (fp); + + if (fp->_flags & __SLBF) + { + /* + * It is line buffered, so make _lbfsize be -_bufsize + * for the putc() macro. We will change _lbfsize back + * to 0 whenever we turn off __SWR. + */ + fp->_w = 0; + fp->_lbfsize = -fp->_bf._size; + } + else + fp->_w = fp->_flags & __SNBF ? 0 : fp->_bf._size; + + return 0; +} diff --git a/newlib/libc/stdlib/Makefile.am b/newlib/libc/stdlib/Makefile.am new file mode 100644 index 000000000..f33550fc7 --- /dev/null +++ b/newlib/libc/stdlib/Makefile.am @@ -0,0 +1,166 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + __adjust.c \ + __exp10.c \ + __ten_mu.c \ + abort.c \ + abs.c \ + assert.c \ + atexit.c \ + atof.c \ + atoff.c \ + atoi.c \ + atol.c \ + bsearch.c \ + calloc.c \ + div.c \ + dtoa.c \ + dtoastub.c \ + ecvtbuf.c \ + efgcvt.c \ + environ.c \ + envlock.c \ + eprintf.c \ + exit.c \ + getenv.c \ + getenv_r.c \ + getopt.c \ + labs.c \ + ldiv.c \ + malign.c \ + malloc.c \ + mblen.c \ + mblen_r.c \ + mbstowcs.c \ + mbstowcs_r.c \ + mbtowc.c \ + mbtowc_r.c \ + mlock.c \ + mprec.c \ + msize.c \ + mstats.c \ + mtrim.c \ + putenv.c \ + putenv_r.c \ + qsort.c \ + rand.c \ + rand_r.c \ + realloc.c \ + setenv.c \ + setenv_r.c \ + strdup.c \ + strdup_r.c \ + strtod.c \ + strtol.c \ + strtoul.c \ + system.c \ + valloc.c \ + wcstombs.c \ + wcstombs_r.c \ + wctomb.c \ + wctomb_r.c + +lib_a_LIBADD = mallocr.o freer.o reallocr.o callocr.o cfreer.o malignr.o \ + vallocr.o pvallocr.o mallinfor.o mallstatsr.o msizer.o malloptr.o + +MALLOC_COMPILE = $(COMPILE) -DINTERNAL_NEWLIB + +mallocr.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_MALLOC -c $(srcdir)/mallocr.c -o $@ + +freer.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_FREE -c $(srcdir)/mallocr.c -o $@ + +reallocr.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_REALLOC -c $(srcdir)/mallocr.c -o $@ + +callocr.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_CALLOC -c $(srcdir)/mallocr.c -o $@ + +cfreer.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_CFREE -c $(srcdir)/mallocr.c -o $@ + +malignr.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_MEMALIGN -c $(srcdir)/mallocr.c -o $@ + +vallocr.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_VALLOC -c $(srcdir)/mallocr.c -o $@ + +pvallocr.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_PVALLOC -c $(srcdir)/mallocr.c -o $@ + +mallinfor.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_MALLINFO -c $(srcdir)/mallocr.c -o $@ + +mallstatsr.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_MALLOC_STATS -c $(srcdir)/mallocr.c -o $@ + +msizer.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_MALLOC_USABLE_SIZE -c $(srcdir)/mallocr.c -o $@ + +malloptr.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_MALLOPT -c $(srcdir)/mallocr.c -o $@ + +CHEWOUT_FILES= \ + abort.def \ + abs.def \ + assert.def \ + atexit.def \ + atof.def \ + ecvtbuf.def \ + atoi.def \ + bsearch.def \ + calloc.def \ + div.def \ + efgcvt.def \ + envlock.def \ + exit.def \ + getenv.def \ + labs.def \ + ldiv.def \ + malloc.def \ + mallocr.def \ + mblen.def \ + mbstowcs.def \ + mbtowc.def \ + mlock.def \ + mstats.def \ + qsort.def \ + rand.def \ + strtod.def \ + strtol.def \ + strtoul.def \ + system.def \ + wcstombs.def \ + wctomb.def + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +TARGETDOC = ../tmp.texi + +doc: $(CHEWOUT_FILES) + cat $(srcdir)/stdlib.tex >> $(TARGETDOC) + +CLEANFILES = $(CHEWOUT_FILES) *.ref + +dtoa.o: dtoa.c mprec.h +ecvtbuf.o: ecvtbuf.c mprec.h +mbtowc_r.o: mbtowc_r.c mbctype.h + $(COMPILE) -c -fshort-enums $(srcdir)/mbtowc_r.c -o $@ + +mprec.o: mprec.c mprec.h +strtod.o: strtod.c mprec.h +wctomb_r.o: wctomb_r.c mbctype.h diff --git a/newlib/libc/stdlib/Makefile.in b/newlib/libc/stdlib/Makefile.in new file mode 100644 index 000000000..82664b3b6 --- /dev/null +++ b/newlib/libc/stdlib/Makefile.in @@ -0,0 +1,449 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +CRT0 = @CRT0@ +EXEEXT = @EXEEXT@ +LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@ +LIBC_POSIX_LIB = @LIBC_POSIX_LIB@ +LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@ +LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@ +LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ +LIBC_SYS_LIB = @LIBC_SYS_LIB@ +LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + __adjust.c \ + __exp10.c \ + __ten_mu.c \ + abort.c \ + abs.c \ + assert.c \ + atexit.c \ + atof.c \ + atoff.c \ + atoi.c \ + atol.c \ + bsearch.c \ + calloc.c \ + div.c \ + dtoa.c \ + dtoastub.c \ + ecvtbuf.c \ + efgcvt.c \ + environ.c \ + envlock.c \ + eprintf.c \ + exit.c \ + getenv.c \ + getenv_r.c \ + getopt.c \ + labs.c \ + ldiv.c \ + malign.c \ + malloc.c \ + mblen.c \ + mblen_r.c \ + mbstowcs.c \ + mbstowcs_r.c \ + mbtowc.c \ + mbtowc_r.c \ + mlock.c \ + mprec.c \ + msize.c \ + mstats.c \ + mtrim.c \ + putenv.c \ + putenv_r.c \ + qsort.c \ + rand.c \ + rand_r.c \ + realloc.c \ + setenv.c \ + setenv_r.c \ + strdup.c \ + strdup_r.c \ + strtod.c \ + strtol.c \ + strtoul.c \ + system.c \ + valloc.c \ + wcstombs.c \ + wcstombs_r.c \ + wctomb.c \ + wctomb_r.c + + +lib_a_LIBADD = mallocr.o freer.o reallocr.o callocr.o cfreer.o malignr.o \ + vallocr.o pvallocr.o mallinfor.o mallstatsr.o msizer.o malloptr.o + + +MALLOC_COMPILE = $(COMPILE) -DINTERNAL_NEWLIB + +CHEWOUT_FILES = \ + abort.def \ + abs.def \ + assert.def \ + atexit.def \ + atof.def \ + ecvtbuf.def \ + atoi.def \ + bsearch.def \ + calloc.def \ + div.def \ + efgcvt.def \ + envlock.def \ + exit.def \ + getenv.def \ + labs.def \ + ldiv.def \ + malloc.def \ + mallocr.def \ + mblen.def \ + mbstowcs.def \ + mbtowc.def \ + mlock.def \ + mstats.def \ + qsort.def \ + rand.def \ + strtod.def \ + strtol.def \ + strtoul.def \ + system.def \ + wcstombs.def \ + wctomb.def + + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +TARGETDOC = ../tmp.texi + +CLEANFILES = $(CHEWOUT_FILES) *.ref +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_DEPENDENCIES = mallocr.o freer.o reallocr.o callocr.o cfreer.o \ +malignr.o vallocr.o pvallocr.o mallinfor.o mallstatsr.o msizer.o \ +malloptr.o +lib_a_OBJECTS = __adjust.o __exp10.o __ten_mu.o abort.o abs.o assert.o \ +atexit.o atof.o atoff.o atoi.o atol.o bsearch.o calloc.o div.o dtoa.o \ +dtoastub.o ecvtbuf.o efgcvt.o environ.o envlock.o eprintf.o exit.o \ +getenv.o getenv_r.o getopt.o labs.o ldiv.o malign.o malloc.o mblen.o \ +mblen_r.o mbstowcs.o mbstowcs_r.o mbtowc.o mbtowc_r.o mlock.o mprec.o \ +msize.o mstats.o mtrim.o putenv.o putenv_r.o qsort.o rand.o rand_r.o \ +realloc.o setenv.o setenv_r.o strdup.o strdup_r.o strtod.o strtol.o \ +strtoul.o system.o valloc.o wcstombs.o wcstombs_r.o wctomb.o wctomb_r.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .def .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus stdlib/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = stdlib + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ +check-am installcheck-am installcheck install-info-am install-info \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +mallocr.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_MALLOC -c $(srcdir)/mallocr.c -o $@ + +freer.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_FREE -c $(srcdir)/mallocr.c -o $@ + +reallocr.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_REALLOC -c $(srcdir)/mallocr.c -o $@ + +callocr.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_CALLOC -c $(srcdir)/mallocr.c -o $@ + +cfreer.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_CFREE -c $(srcdir)/mallocr.c -o $@ + +malignr.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_MEMALIGN -c $(srcdir)/mallocr.c -o $@ + +vallocr.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_VALLOC -c $(srcdir)/mallocr.c -o $@ + +pvallocr.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_PVALLOC -c $(srcdir)/mallocr.c -o $@ + +mallinfor.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_MALLINFO -c $(srcdir)/mallocr.c -o $@ + +mallstatsr.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_MALLOC_STATS -c $(srcdir)/mallocr.c -o $@ + +msizer.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_MALLOC_USABLE_SIZE -c $(srcdir)/mallocr.c -o $@ + +malloptr.o: mallocr.c + $(MALLOC_COMPILE) -DDEFINE_MALLOPT -c $(srcdir)/mallocr.c -o $@ + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +doc: $(CHEWOUT_FILES) + cat $(srcdir)/stdlib.tex >> $(TARGETDOC) + +dtoa.o: dtoa.c mprec.h +ecvtbuf.o: ecvtbuf.c mprec.h +mbtowc_r.o: mbtowc_r.c mbctype.h + $(COMPILE) -c -fshort-enums $(srcdir)/mbtowc_r.c -o $@ + +mprec.o: mprec.c mprec.h +strtod.o: strtod.c mprec.h +wctomb_r.o: wctomb_r.c mbctype.h + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/stdlib/__adjust.c b/newlib/libc/stdlib/__adjust.c new file mode 100644 index 000000000..d5c70758b --- /dev/null +++ b/newlib/libc/stdlib/__adjust.c @@ -0,0 +1,44 @@ +/* + * return (*acc) scaled by 10**dexp. + */ + +#include <_ansi.h> +#include +#include "std.h" + +#define abs(x) (((x) < 0) ? -(x) : (x)) + +double +_DEFUN (__adjust, (ptr, acc, dexp, sign), + struct _reent *ptr _AND + double *acc _AND + int dexp _AND + int sign) + /* *acc the 64 bit accumulator */ + /* dexp decimal exponent */ + /* sign sign flag */ +{ + double r; + + if (dexp > MAXE) + { + ptr->_errno = ERANGE; + return (sign) ? -HUGE_VAL : HUGE_VAL; + } + else if (dexp < MINE) + { + ptr->_errno = ERANGE; + return 0.0; + } + + r = *acc; + if (sign) + r = -r; + if (dexp == 0) + return r; + + if (dexp < 0) + return r / __exp10 (abs (dexp)); + else + return r * __exp10 (dexp); +} diff --git a/newlib/libc/stdlib/__exp10.c b/newlib/libc/stdlib/__exp10.c new file mode 100644 index 000000000..967362347 --- /dev/null +++ b/newlib/libc/stdlib/__exp10.c @@ -0,0 +1,29 @@ +/* + * compute 10**x by successive squaring. + */ + +#include <_ansi.h> + +double +_DEFUN (__exp10, (x), + unsigned x) +{ + static _CONST double powtab[] = + {1.0, + 10.0, + 100.0, + 1000.0, + 10000.0}; + + if (x < (sizeof (powtab) / sizeof (double))) + return powtab[x]; + else if (x & 1) + { + return 10.0 * __exp10 (x - 1); + } + else + { + double n = __exp10 (x / 2); + return n * n; + } +} diff --git a/newlib/libc/stdlib/__ten_mu.c b/newlib/libc/stdlib/__ten_mu.c new file mode 100644 index 000000000..439c226e1 --- /dev/null +++ b/newlib/libc/stdlib/__ten_mu.c @@ -0,0 +1,23 @@ +/* + * [atw] multiply 64 bit accumulator by 10 and add digit. + * The KA/CA way to do this should be to use + * a 64-bit integer internally and use "adjust" to + * convert it to float at the end of processing. + */ + +#include <_ansi.h> + +int +_DEFUN (__ten_mul, (acc, digit), + double *acc _AND + int digit) +{ + /* + * [atw] Crude, but effective (at least on a KB)... + */ + + *acc *= 10; + *acc += digit; + + return 0; /* no overflow */ +} diff --git a/newlib/libc/stdlib/abort.c b/newlib/libc/stdlib/abort.c new file mode 100644 index 000000000..b3d671ed6 --- /dev/null +++ b/newlib/libc/stdlib/abort.c @@ -0,0 +1,66 @@ +/* NetWare can not use this implementation of abort. It provides its + own version of abort in clib.nlm. If we can not use clib.nlm, then + we must write abort in sys/netware. */ + +#ifdef ABORT_PROVIDED + +int _dummy_abort = 1; + +#else + +/* +FUNCTION +<>---abnormal termination of a program + +INDEX + abort + +ANSI_SYNOPSIS + #include + void abort(void); + +TRAD_SYNOPSIS + #include + void abort(); + +DESCRIPTION +Use <> to signal that your program has detected a condition it +cannot deal with. Normally, <> ends your program's execution. + +Before terminating your program, <> raises the exception <> +(using `<>'). If you have used <> to register +an exception handler for this condition, that handler has the +opportunity to retain control, thereby avoiding program termination. + +In this implementation, <> does not perform any stream- or +file-related cleanup (the host environment may do so; if not, you can +arrange for your program to do its own cleanup with a <> +exception handler). + +RETURNS +<> does not return to its caller. + +PORTABILITY +ANSI C requires <>. + +Supporting OS subroutines required: <>, <>. +*/ + +#include +#include + +_VOID +_DEFUN_VOID (abort) +{ +#ifdef ABORT_MESSAGE + write (2, "Abort called\n", sizeof ("Abort called\n")-1); +#endif + + while (1) + { + raise (SIGABRT); + _exit (1); + } +} + +#endif diff --git a/newlib/libc/stdlib/abs.c b/newlib/libc/stdlib/abs.c new file mode 100644 index 000000000..0308b5729 --- /dev/null +++ b/newlib/libc/stdlib/abs.c @@ -0,0 +1,43 @@ +/* +FUNCTION +<>---integer absolute value (magnitude) + +INDEX + abs + +ANSI_SYNOPSIS + #include + int abs(int <[i]>); + +TRAD_SYNOPSIS + #include + int abs(<[i]>) + int <[i]>; + +DESCRIPTION +<> returns +@tex +$|x|$, +@end tex +the absolute value of <[i]> (also called the magnitude +of <[i]>). That is, if <[i]> is negative, the result is the opposite +of <[i]>, but if <[i]> is nonnegative the result is <[i]>. + +The similar function <> uses and returns <> rather than <> values. + +RETURNS +The result is a nonnegative integer. + +PORTABILITY +<> is ANSI. + +No supporting OS subroutines are required. +*/ + +#include + +int +_DEFUN (abs, (i), int i) +{ + return (i < 0) ? -i : i; +} diff --git a/newlib/libc/stdlib/assert.c b/newlib/libc/stdlib/assert.c new file mode 100644 index 000000000..5b08bbaf4 --- /dev/null +++ b/newlib/libc/stdlib/assert.c @@ -0,0 +1,62 @@ +/* +FUNCTION +<>---Macro for Debugging Diagnostics + +INDEX + assert + +ANSI_SYNOPSIS + #include + void assert(int <[expression]>); + +TRAD_SYNOPSIS + #include + assert(<[expression]>) + int <[expression]>; + +DESCRIPTION + Use this macro to embed debuggging diagnostic statements in + your programs. The argument <[expression]> should be an + expression which evaluates to true (nonzero) when your program + is working as you intended. + + When <[expression]> evaluates to false (zero), <> + calls <>, after first printing a message showing what + failed and where: + +. Assertion failed: <[expression]>, file <[filename]>, line <[lineno]> + + The macro is defined to permit you to turn off all uses of + <> at compile time by defining <> as a + preprocessor variable. If you do this, the <> macro + expands to + +. (void(0)) + +RETURNS + <> does not return a value. + +PORTABILITY + The <> macro is required by ANSI, as is the behavior + when <> is defined. + +Supporting OS subroutines required (only if enabled): <>, <>, +<>, <>, <>, <>, <>, <>, <>. +*/ + +#include +#include +#include + +void +_DEFUN (__assert, (file, line, failedexpr), + const char *file _AND + int line _AND + const char *failedexpr) +{ + (void)fiprintf(stderr, + "assertion \"%s\" failed: file \"%s\", line %d\n", + failedexpr, file, line); + abort(); + /* NOTREACHED */ +} diff --git a/newlib/libc/stdlib/atexit.c b/newlib/libc/stdlib/atexit.c new file mode 100644 index 000000000..88cdd234c --- /dev/null +++ b/newlib/libc/stdlib/atexit.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 1990 Regents of the University of California. + * All rights reserved. + * + * %sccs.include.redist.c% + */ + +/* +FUNCTION +<>---request execution of functions at program exit + +INDEX + atexit + +ANSI_SYNOPSIS + #include + int atexit (void (*<[function]>)(void)); + +TRAD_SYNOPSIS + #include + int atexit ((<[function]>) + void (*<[function]>)(); + +DESCRIPTION +You can use <> to enroll functions in a list of functions that +will be called when your program terminates normally. The argument is +a pointer to a user-defined function (which must not require arguments and +must not return a result). + +The functions are kept in a LIFO stack; that is, the last function +enrolled by <> will be the first to execute when your program +exits. + +There is no built-in limit to the number of functions you can enroll +in this list; however, after every group of 32 functions is enrolled, +<> will call <> to get space for the next part of the +list. The initial list of 32 functions is statically allocated, so +you can always count on at least that many slots available. + +RETURNS +<> returns <<0>> if it succeeds in enrolling your function, +<<-1>> if it fails (possible only if no space was available for +<> to extend the list of functions). + +PORTABILITY +<> is required by the ANSI standard, which also specifies that +implementations must support enrolling at least 32 functions. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include +#include +#include + +/* + * Register a function to be performed at exit. + */ + +int +_DEFUN (atexit, + (fn), + _VOID _EXFUN ((*fn), (_VOID))) +{ + register struct _atexit *p; + + if ((p = _REENT->_atexit) == NULL) + _REENT->_atexit = p = &_REENT->_atexit0; + if (p->_ind >= _ATEXIT_SIZE) + { + if ((p = (struct _atexit *) malloc (sizeof *p)) == NULL) + return -1; + p->_ind = 0; + p->_next = _REENT->_atexit; + _REENT->_atexit = p; + } + p->_fns[p->_ind++] = fn; + return 0; +} diff --git a/newlib/libc/stdlib/atexit.h b/newlib/libc/stdlib/atexit.h new file mode 100644 index 000000000..44a928126 --- /dev/null +++ b/newlib/libc/stdlib/atexit.h @@ -0,0 +1,13 @@ +/* + * %G% (UofMD) %D% + */ + +#define ATEXIT_SIZE 32 /* must be at least 32 to guarantee ANSI conformance */ + +struct atexit { + struct atexit *next; /* next in list */ + int ind; /* next index in this table */ + void (*fns[ATEXIT_SIZE])(); /* the table itself */ +}; + +struct atexit *__atexit; /* points to head of LIFO stack */ diff --git a/newlib/libc/stdlib/atof.c b/newlib/libc/stdlib/atof.c new file mode 100644 index 000000000..cf4abdb71 --- /dev/null +++ b/newlib/libc/stdlib/atof.c @@ -0,0 +1,72 @@ +/* +FUNCTION + <>, <>---string to double or float + +INDEX + atof +INDEX + atoff + +ANSI_SYNOPSIS + #include + double atof(const char *<[s]>); + float atoff(const char *<[s]>); + +TRAD_SYNOPSIS + #include + double atof(<[s]>) + char *<[s]>; + + float atoff(<[s]>) + char *<[s]>; + +DESCRIPTION +<> converts the initial portion of a string to a <>. +<> converts the initial portion of a string to a <>. + +The functions parse the character string <[s]>, +locating a substring which can be converted to a floating point +value. The substring must match the format: +. [+|-]<[digits]>[.][<[digits]>][(e|E)[+|-]<[digits]>] +The substring converted is the longest initial +fragment of <[s]> that has the expected format, beginning with +the first non-whitespace character. The substring +is empty if <> is empty, consists entirely +of whitespace, or if the first non-whitespace character is +something other than <<+>>, <<->>, <<.>>, or a digit. + +<)>> is implemented as <, NULL)>>. +<)>> is implemented as <, NULL)>>. + +RETURNS +<> returns the converted substring value, if any, as a +<>; or <<0.0>>, if no conversion could be performed. +If the correct value is out of the range of representable values, plus +or minus <> is returned, and <> is stored in +<>. +If the correct value would cause underflow, <<0.0>> is returned +and <> is stored in <>. + +<> obeys the same rules as <>, except that it +returns a <>. + +PORTABILITY +<> is ANSI C. <>, <>, and <> are subsumed by <> +and <>, but are used extensively in existing code. These functions are +less reliable, but may be faster if the argument is verified to be in a valid +range. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + + +#include +#include <_ansi.h> + +double +_DEFUN (atof, (s), + _CONST char *s) +{ + return strtod (s, NULL); +} diff --git a/newlib/libc/stdlib/atoff.c b/newlib/libc/stdlib/atoff.c new file mode 100644 index 000000000..9c682c47a --- /dev/null +++ b/newlib/libc/stdlib/atoff.c @@ -0,0 +1,9 @@ +#include +#include <_ansi.h> + +float +_DEFUN (atoff, (s), + _CONST char *s) +{ + return strtodf (s, NULL); +} diff --git a/newlib/libc/stdlib/atoi.c b/newlib/libc/stdlib/atoi.c new file mode 100644 index 000000000..c7792a454 --- /dev/null +++ b/newlib/libc/stdlib/atoi.c @@ -0,0 +1,54 @@ +/* +FUNCTION + <>, <>---string to integer + +INDEX + atoi +INDEX + atol + +ANSI_SYNOPSIS + #include + int atoi(const char *<[s]>); + long atol(const char *<[s]>); + +TRAD_SYNOPSIS + #include + int atoi(<[s]>) + char *<[s]>; + + long atol(<[s]>) + char *<[s]>; + + +DESCRIPTION + <> converts the initial portion of a string to an <>. + <> converts the initial portion of a string to a <>. + + <> is implemented as <<(int)strtol(s, NULL, 10).>> + <> is implemented as <> + +RETURNS + The functions return the converted value, if any. If no conversion was + made, <<0>> is returned. + +PORTABILITY +<> is ANSI. + +No supporting OS subroutines are required. +*/ + +/* + * Andy Wilson, 2-Oct-89. + */ + +#include +#include <_ansi.h> + +int +_DEFUN (atoi, (s), + _CONST char *s) +{ + return (int) strtol (s, NULL, 10); +} + diff --git a/newlib/libc/stdlib/atol.c b/newlib/libc/stdlib/atol.c new file mode 100644 index 000000000..6b059a8d2 --- /dev/null +++ b/newlib/libc/stdlib/atol.c @@ -0,0 +1,12 @@ +/* + * Andy Wilson, 2-Oct-89. + */ + +#include +#include <_ansi.h> + +long +_DEFUN (atol, (s), _CONST char *s) +{ + return strtol (s, NULL, 10); +} diff --git a/newlib/libc/stdlib/bsearch.c b/newlib/libc/stdlib/bsearch.c new file mode 100644 index 000000000..b9539aa3b --- /dev/null +++ b/newlib/libc/stdlib/bsearch.c @@ -0,0 +1,100 @@ +/* + * bsearch.c + * Original Author: G. Haley + * Rewritten by: G. Noer + * + * Searches an array of nmemb members, the initial member of which is pointed + * to by base, for a member that matches the object pointed to by key. The + * contents of the array shall be in ascending order according to a comparison + * function pointed to by compar. The function shall return an integer less + * than, equal to or greater than zero if the first argument is considered to be + * respectively less than, equal to or greater than the second. Returns a + * pointer to the matching member of the array, or a null pointer if no match + * is found. + */ + +/* +FUNCTION +<>---binary search + +INDEX + bsearch + +ANSI_SYNOPSIS + #include + void *bsearch(const void *<[key]>, const void *<[base]>, + size_t <[nmemb]>, size_t <[size]>, + int (*<[compar]>)(const void *, const void *)); + +TRAD_SYNOPSIS + #include + char *bsearch(<[key]>, <[base]>, <[nmemb]>, <[size]>, <[compar]>) + char *<[key]>; + char *<[base]>; + size_t <[nmemb]>, <[size]>; + int (*<[compar]>)(); + +DESCRIPTION +<> searches an array beginning at <[base]> for any element +that matches <[key]>, using binary search. <[nmemb]> is the element +count of the array; <[size]> is the size of each element. + +The array must be sorted in ascending order with respect to the +comparison function <[compar]> (which you supply as the last argument of +<>). + +You must define the comparison function <<(*<[compar]>)>> to have two +arguments; its result must be negative if the first argument is +less than the second, zero if the two arguments match, and +positive if the first argument is greater than the second (where +``less than'' and ``greater than'' refer to whatever arbitrary +ordering is appropriate). + +RETURNS +Returns a pointer to an element of <[array]> that matches <[key]>. If +more than one matching element is available, the result may point to +any of them. + +PORTABILITY +<> is ANSI. + +No supporting OS subroutines are required. +*/ + +#include + +_PTR +_DEFUN (bsearch, (key, base, nmemb, size, compar), + _CONST _PTR key _AND + _CONST _PTR base _AND + size_t nmemb _AND + size_t size _AND + int _EXFUN ((*compar), (const _PTR, const _PTR))) +{ + _PTR current; + size_t lower = 0; + size_t upper = nmemb; + size_t index; + int result; + + if (nmemb == 0 || size == 0) + return NULL; + + while (lower < upper) + { + index = (lower + upper) / 2; + current = (_PTR) (((char *) base) + (index * size)); + + result = compar (key, current); + + if (result < 0) + upper = index; + else if (result > 0) + lower = index + 1; + else + return current; + } + + return NULL; +} + diff --git a/newlib/libc/stdlib/calloc.c b/newlib/libc/stdlib/calloc.c new file mode 100644 index 000000000..af9a4adc1 --- /dev/null +++ b/newlib/libc/stdlib/calloc.c @@ -0,0 +1,69 @@ +#ifdef MALLOC_PROVIDED +int _dummy_calloc = 1; +#else +/* +FUNCTION +<>---allocate space for arrays + +INDEX + calloc + +INDEX + _calloc_r + +ANSI_SYNOPSIS + #include + void *calloc(size_t <[n]>, size_t <[s]>); + void *calloc_r(void *<[reent]>, size_t , <[s]>); + +TRAD_SYNOPSIS + #include + char *calloc(<[n]>, <[s]>) + size_t <[n]>, <[s]>; + + char *_calloc_r(<[reent]>, <[n]>, <[s]>) + char *<[reent]>; + size_t <[n]>; + size_t <[s]>; + + + +DESCRIPTION +Use <> to request a block of memory sufficient to hold an +array of <[n]> elements, each of which has size <[s]>. + +The memory allocated by <> comes out of the same memory pool +used by <>, but the memory block is initialized to all zero +bytes. (To avoid the overhead of initializing the space, use +<> instead.) + +The alternate function <<_calloc_r>> is reentrant. +The extra argument <[reent]> is a pointer to a reentrancy structure. + +RETURNS +If successful, a pointer to the newly allocated space. + +If unsuccessful, <>. + +PORTABILITY +<> is ANSI. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include +#include + +#ifndef _REENT_ONLY + +_PTR +_DEFUN (calloc, (n, size), + size_t n _AND + size_t size) +{ + return _calloc_r (_REENT, n, size); +} + +#endif +#endif /* MALLOC_PROVIDED */ diff --git a/newlib/libc/stdlib/div.c b/newlib/libc/stdlib/div.c new file mode 100644 index 000000000..2c070dec7 --- /dev/null +++ b/newlib/libc/stdlib/div.c @@ -0,0 +1,132 @@ +/* +FUNCTION +<
>---divide two integers + +INDEX + div + +ANSI_SYNOPSIS + #include + div_t div(int <[n]>, int <[d]>); + +TRAD_SYNOPSIS + #include + div_t div(<[n]>, <[d]>) + int <[n]>, <[d]>; + +DESCRIPTION +Divide +@tex +$n/d$, +@end tex +@ifinfo +<[n]>/<[d]>, +@end ifinfo +returning quotient and remainder as two integers in a structure <>. + +RETURNS +The result is represented with the structure + +. typedef struct +. { +. int quot; +. int rem; +. } div_t; + +where the <> field represents the quotient, and <> the +remainder. For nonzero <[d]>, if `<<<[r]> = div(<[n]>,<[d]>);>>' then +<[n]> equals `<<<[r]>.rem + <[d]>*<[r]>.quot>>'. + +To divide <> rather than <> values, use the similar +function <>. + +PORTABILITY +<
> is ANSI. + +No supporting OS subroutines are required. +*/ + +/* + * Copyright (c) 1990 Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <_ansi.h> +#include /* div_t */ + +div_t +_DEFUN (div, (num, denom), + int num _AND + int denom) +{ + div_t r; + + r.quot = num / denom; + r.rem = num % denom; + /* + * The ANSI standard says that |r.quot| <= |n/d|, where + * n/d is to be computed in infinite precision. In other + * words, we should always truncate the quotient towards + * 0, never -infinity or +infinity. + * + * Machine division and remainer may work either way when + * one or both of n or d is negative. If only one is + * negative and r.quot has been truncated towards -inf, + * r.rem will have the same sign as denom and the opposite + * sign of num; if both are negative and r.quot has been + * truncated towards -inf, r.rem will be positive (will + * have the opposite sign of num). These are considered + * `wrong'. + * + * If both are num and denom are positive, r will always + * be positive. + * + * This all boils down to: + * if num >= 0, but r.rem < 0, we got the wrong answer. + * In that case, to get the right answer, add 1 to r.quot and + * subtract denom from r.rem. + * if num < 0, but r.rem > 0, we also have the wrong answer. + * In this case, to get the right answer, subtract 1 from r.quot and + * add denom to r.rem. + */ + if (num >= 0 && r.rem < 0) { + ++r.quot; + r.rem -= denom; + } + else if (num < 0 && r.rem > 0) { + --r.quot; + r.rem += denom; + } + return (r); +} diff --git a/newlib/libc/stdlib/dtoa.c b/newlib/libc/stdlib/dtoa.c new file mode 100644 index 000000000..3911f0e7b --- /dev/null +++ b/newlib/libc/stdlib/dtoa.c @@ -0,0 +1,854 @@ +/**************************************************************** + * + * The author of this software is David M. Gay. + * + * Copyright (c) 1991 by AT&T. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose without fee is hereby granted, provided that this entire notice + * is included in all copies of any software which is or includes a copy + * or modification of this software and in all copies of the supporting + * documentation for such software. + * + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY + * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + * + ***************************************************************/ + +/* Please send bug reports to + David M. Gay + AT&T Bell Laboratories, Room 2C-463 + 600 Mountain Avenue + Murray Hill, NJ 07974-2070 + U.S.A. + dmg@research.att.com or research!dmg + */ + +#include <_ansi.h> +#include +#include +#include +#include "mprec.h" + +static int +_DEFUN (quorem, + (b, S), + _Bigint * b _AND _Bigint * S) +{ + int n; + __Long borrow, y; + __ULong carry, q, ys; + __ULong *bx, *bxe, *sx, *sxe; +#ifdef Pack_32 + __Long z; + __ULong si, zs; +#endif + + n = S->_wds; +#ifdef DEBUG + /*debug*/ if (b->_wds > n) + /*debug*/ Bug ("oversize b in quorem"); +#endif + if (b->_wds < n) + return 0; + sx = S->_x; + sxe = sx + --n; + bx = b->_x; + bxe = bx + n; + q = *bxe / (*sxe + 1); /* ensure q <= true quotient */ +#ifdef DEBUG + /*debug*/ if (q > 9) + /*debug*/ Bug ("oversized quotient in quorem"); +#endif + if (q) + { + borrow = 0; + carry = 0; + do + { +#ifdef Pack_32 + si = *sx++; + ys = (si & 0xffff) * q + carry; + zs = (si >> 16) * q + (ys >> 16); + carry = zs >> 16; + y = (*bx & 0xffff) - (ys & 0xffff) + borrow; + borrow = y >> 16; + Sign_Extend (borrow, y); + z = (*bx >> 16) - (zs & 0xffff) + borrow; + borrow = z >> 16; + Sign_Extend (borrow, z); + Storeinc (bx, z, y); +#else + ys = *sx++ * q + carry; + carry = ys >> 16; + y = *bx - (ys & 0xffff) + borrow; + borrow = y >> 16; + Sign_Extend (borrow, y); + *bx++ = y & 0xffff; +#endif + } + while (sx <= sxe); + if (!*bxe) + { + bx = b->_x; + while (--bxe > bx && !*bxe) + --n; + b->_wds = n; + } + } + if (cmp (b, S) >= 0) + { + q++; + borrow = 0; + carry = 0; + bx = b->_x; + sx = S->_x; + do + { +#ifdef Pack_32 + si = *sx++; + ys = (si & 0xffff) + carry; + zs = (si >> 16) + (ys >> 16); + carry = zs >> 16; + y = (*bx & 0xffff) - (ys & 0xffff) + borrow; + borrow = y >> 16; + Sign_Extend (borrow, y); + z = (*bx >> 16) - (zs & 0xffff) + borrow; + borrow = z >> 16; + Sign_Extend (borrow, z); + Storeinc (bx, z, y); +#else + ys = *sx++ + carry; + carry = ys >> 16; + y = *bx - (ys & 0xffff) + borrow; + borrow = y >> 16; + Sign_Extend (borrow, y); + *bx++ = y & 0xffff; +#endif + } + while (sx <= sxe); + bx = b->_x; + bxe = bx + n; + if (!*bxe) + { + while (--bxe > bx && !*bxe) + --n; + b->_wds = n; + } + } + return q; +} + +/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string. + * + * Inspired by "How to Print Floating-Point Numbers Accurately" by + * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 92-101]. + * + * Modifications: + * 1. Rather than iterating, we use a simple numeric overestimate + * to determine k = floor(log10(d)). We scale relevant + * quantities using O(log2(k)) rather than O(k) multiplications. + * 2. For some modes > 2 (corresponding to ecvt and fcvt), we don't + * try to generate digits strictly left to right. Instead, we + * compute with fewer bits and propagate the carry if necessary + * when rounding the final digit up. This is often faster. + * 3. Under the assumption that input will be rounded nearest, + * mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22. + * That is, we allow equality in stopping tests when the + * round-nearest rule will give the same floating-point value + * as would satisfaction of the stopping test with strict + * inequality. + * 4. We remove common factors of powers of 2 from relevant + * quantities. + * 5. When converting floating-point integers less than 1e16, + * we use floating-point arithmetic rather than resorting + * to multiple-precision integers. + * 6. When asked to produce fewer than 15 digits, we first try + * to get by with floating-point arithmetic; we resort to + * multiple-precision integer arithmetic only if we cannot + * guarantee that the floating-point calculation has given + * the correctly rounded result. For k requested digits and + * "uniformly" distributed input, the probability is + * something like 10^(k-15) that we must resort to the long + * calculation. + */ + + +char * +_DEFUN (_dtoa_r, + (ptr, _d, mode, ndigits, decpt, sign, rve), + struct _reent *ptr _AND + double _d _AND + int mode _AND + int ndigits _AND + int *decpt _AND + int *sign _AND + char **rve) +{ + /* Arguments ndigits, decpt, sign are similar to those + of ecvt and fcvt; trailing zeros are suppressed from + the returned string. If not null, *rve is set to point + to the end of the return value. If d is +-Infinity or NaN, + then *decpt is set to 9999. + + mode: + 0 ==> shortest string that yields d when read in + and rounded to nearest. + 1 ==> like 0, but with Steele & White stopping rule; + e.g. with IEEE P754 arithmetic , mode 0 gives + 1e23 whereas mode 1 gives 9.999999999999999e22. + 2 ==> max(1,ndigits) significant digits. This gives a + return value similar to that of ecvt, except + that trailing zeros are suppressed. + 3 ==> through ndigits past the decimal point. This + gives a return value similar to that from fcvt, + except that trailing zeros are suppressed, and + ndigits can be negative. + 4-9 should give the same return values as 2-3, i.e., + 4 <= mode <= 9 ==> same return as mode + 2 + (mode & 1). These modes are mainly for + debugging; often they run slower but sometimes + faster than modes 2-3. + 4,5,8,9 ==> left-to-right digit generation. + 6-9 ==> don't try fast floating-point estimate + (if applicable). + + Values of mode other than 0-9 are treated as mode 0. + + Sufficient space is allocated to the return value + to hold the suppressed trailing zeros. + */ + + int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1, j, j1, k, k0, + k_check, leftright, m2, m5, s2, s5, spec_case, try_quick; + union double_union d, d2, eps; + __Long L; +#ifndef Sudden_Underflow + int denorm; + __ULong x; +#endif + _Bigint *b, *b1, *delta, *mlo, *mhi, *S; + double ds; + char *s, *s0; + + d.d = _d; + + if (ptr->_result) + { + ptr->_result->_k = ptr->_result_k; + ptr->_result->_maxwds = 1 << ptr->_result_k; + Bfree (ptr, ptr->_result); + ptr->_result = 0; + } + + if (word0 (d) & Sign_bit) + { + /* set sign for everything, including 0's and NaNs */ + *sign = 1; + word0 (d) &= ~Sign_bit; /* clear sign bit */ + } + else + *sign = 0; + +#if defined(IEEE_Arith) + defined(VAX) +#ifdef IEEE_Arith + if ((word0 (d) & Exp_mask) == Exp_mask) +#else + if (word0 (d) == 0x8000) +#endif + { + /* Infinity or NaN */ + *decpt = 9999; + s = +#ifdef IEEE_Arith + !word1 (d) && !(word0 (d) & 0xfffff) ? "Infinity" : +#endif + "NaN"; + if (rve) + *rve = +#ifdef IEEE_Arith + s[3] ? s + 8 : +#endif + s + 3; + return s; + } +#endif +#ifdef IBM + d.d += 0; /* normalize */ +#endif + if (!d.d) + { + *decpt = 1; + s = "0"; + if (rve) + *rve = s + 1; + return s; + } + + b = d2b (ptr, d.d, &be, &bbits); +#ifdef Sudden_Underflow + i = (int) (word0 (d) >> Exp_shift1 & (Exp_mask >> Exp_shift1)); +#else + if (i = (int) (word0 (d) >> Exp_shift1 & (Exp_mask >> Exp_shift1))) + { +#endif + d2.d = d.d; + word0 (d2) &= Frac_mask1; + word0 (d2) |= Exp_11; +#ifdef IBM + if (j = 11 - hi0bits (word0 (d2) & Frac_mask)) + d2.d /= 1 << j; +#endif + + /* log(x) ~=~ log(1.5) + (x-1.5)/1.5 + * log10(x) = log(x) / log(10) + * ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10)) + * log10(d) = (i-Bias)*log(2)/log(10) + log10(d2) + * + * This suggests computing an approximation k to log10(d) by + * + * k = (i - Bias)*0.301029995663981 + * + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 ); + * + * We want k to be too large rather than too small. + * The error in the first-order Taylor series approximation + * is in our favor, so we just round up the constant enough + * to compensate for any error in the multiplication of + * (i - Bias) by 0.301029995663981; since |i - Bias| <= 1077, + * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14, + * adding 1e-13 to the constant term more than suffices. + * Hence we adjust the constant term to 0.1760912590558. + * (We could get a more accurate k by invoking log10, + * but this is probably not worthwhile.) + */ + + i -= Bias; +#ifdef IBM + i <<= 2; + i += j; +#endif +#ifndef Sudden_Underflow + denorm = 0; + } + else + { + /* d is denormalized */ + + i = bbits + be + (Bias + (P - 1) - 1); + x = i > 32 ? word0 (d) << 64 - i | word1 (d) >> i - 32 + : word1 (d) << 32 - i; + d2.d = x; + word0 (d2) -= 31 * Exp_msk1; /* adjust exponent */ + i -= (Bias + (P - 1) - 1) + 1; + denorm = 1; + } +#endif + ds = (d2.d - 1.5) * 0.289529654602168 + 0.1760912590558 + i * 0.301029995663981; + k = (int) ds; + if (ds < 0. && ds != k) + k--; /* want k = floor(ds) */ + k_check = 1; + if (k >= 0 && k <= Ten_pmax) + { + if (d.d < tens[k]) + k--; + k_check = 0; + } + j = bbits - i - 1; + if (j >= 0) + { + b2 = 0; + s2 = j; + } + else + { + b2 = -j; + s2 = 0; + } + if (k >= 0) + { + b5 = 0; + s5 = k; + s2 += k; + } + else + { + b2 -= k; + b5 = -k; + s5 = 0; + } + if (mode < 0 || mode > 9) + mode = 0; + try_quick = 1; + if (mode > 5) + { + mode -= 4; + try_quick = 0; + } + leftright = 1; + switch (mode) + { + case 0: + case 1: + ilim = ilim1 = -1; + i = 18; + ndigits = 0; + break; + case 2: + leftright = 0; + /* no break */ + case 4: + if (ndigits <= 0) + ndigits = 1; + ilim = ilim1 = i = ndigits; + break; + case 3: + leftright = 0; + /* no break */ + case 5: + i = ndigits + k + 1; + ilim = i; + ilim1 = i - 1; + if (i <= 0) + i = 1; + } + j = sizeof (__ULong); + for (ptr->_result_k = 0; sizeof (_Bigint) - sizeof (__ULong) + j <= i; + j <<= 1) + ptr->_result_k++; + ptr->_result = Balloc (ptr, ptr->_result_k); + s = s0 = (char *) ptr->_result; + + if (ilim >= 0 && ilim <= Quick_max && try_quick) + { + /* Try to get by with floating-point arithmetic. */ + + i = 0; + d2.d = d.d; + k0 = k; + ilim0 = ilim; + ieps = 2; /* conservative */ + if (k > 0) + { + ds = tens[k & 0xf]; + j = k >> 4; + if (j & Bletch) + { + /* prevent overflows */ + j &= Bletch - 1; + d.d /= bigtens[n_bigtens - 1]; + ieps++; + } + for (; j; j >>= 1, i++) + if (j & 1) + { + ieps++; + ds *= bigtens[i]; + } + d.d /= ds; + } + else if (j1 = -k) + { + d.d *= tens[j1 & 0xf]; + for (j = j1 >> 4; j; j >>= 1, i++) + if (j & 1) + { + ieps++; + d.d *= bigtens[i]; + } + } + if (k_check && d.d < 1. && ilim > 0) + { + if (ilim1 <= 0) + goto fast_failed; + ilim = ilim1; + k--; + d.d *= 10.; + ieps++; + } + eps.d = ieps * d.d + 7.; + word0 (eps) -= (P - 1) * Exp_msk1; + if (ilim == 0) + { + S = mhi = 0; + d.d -= 5.; + if (d.d > eps.d) + goto one_digit; + if (d.d < -eps.d) + goto no_digits; + goto fast_failed; + } +#ifndef No_leftright + if (leftright) + { + /* Use Steele & White method of only + * generating digits needed. + */ + eps.d = 0.5 / tens[ilim - 1] - eps.d; + for (i = 0;;) + { + L = d.d; + d.d -= L; + *s++ = '0' + (int) L; + if (d.d < eps.d) + goto ret1; + if (1. - d.d < eps.d) + goto bump_up; + if (++i >= ilim) + break; + eps.d *= 10.; + d.d *= 10.; + } + } + else + { +#endif + /* Generate ilim digits, then fix them up. */ + eps.d *= tens[ilim - 1]; + for (i = 1;; i++, d.d *= 10.) + { + L = d.d; + d.d -= L; + *s++ = '0' + (int) L; + if (i == ilim) + { + if (d.d > 0.5 + eps.d) + goto bump_up; + else if (d.d < 0.5 - eps.d) + { + while (*--s == '0'); + s++; + goto ret1; + } + break; + } + } +#ifndef No_leftright + } +#endif + fast_failed: + s = s0; + d.d = d2.d; + k = k0; + ilim = ilim0; + } + + /* Do we have a "small" integer? */ + + if (be >= 0 && k <= Int_max) + { + /* Yes. */ + ds = tens[k]; + if (ndigits < 0 && ilim <= 0) + { + S = mhi = 0; + if (ilim < 0 || d.d <= 5 * ds) + goto no_digits; + goto one_digit; + } + for (i = 1;; i++) + { + L = d.d / ds; + d.d -= L * ds; +#ifdef Check_FLT_ROUNDS + /* If FLT_ROUNDS == 2, L will usually be high by 1 */ + if (d.d < 0) + { + L--; + d.d += ds; + } +#endif + *s++ = '0' + (int) L; + if (i == ilim) + { + d.d += d.d; + if (d.d > ds || d.d == ds && L & 1) + { + bump_up: + while (*--s == '9') + if (s == s0) + { + k++; + *s = '0'; + break; + } + ++*s++; + } + break; + } + if (!(d.d *= 10.)) + break; + } + goto ret1; + } + + m2 = b2; + m5 = b5; + mhi = mlo = 0; + if (leftright) + { + if (mode < 2) + { + i = +#ifndef Sudden_Underflow + denorm ? be + (Bias + (P - 1) - 1 + 1) : +#endif +#ifdef IBM + 1 + 4 * P - 3 - bbits + ((bbits + be - 1) & 3); +#else + 1 + P - bbits; +#endif + } + else + { + j = ilim - 1; + if (m5 >= j) + m5 -= j; + else + { + s5 += j -= m5; + b5 += j; + m5 = 0; + } + if ((i = ilim) < 0) + { + m2 -= i; + i = 0; + } + } + b2 += i; + s2 += i; + mhi = i2b (ptr, 1); + } + if (m2 > 0 && s2 > 0) + { + i = m2 < s2 ? m2 : s2; + b2 -= i; + m2 -= i; + s2 -= i; + } + if (b5 > 0) + { + if (leftright) + { + if (m5 > 0) + { + mhi = pow5mult (ptr, mhi, m5); + b1 = mult (ptr, mhi, b); + Bfree (ptr, b); + b = b1; + } + if (j = b5 - m5) + b = pow5mult (ptr, b, j); + } + else + b = pow5mult (ptr, b, b5); + } + S = i2b (ptr, 1); + if (s5 > 0) + S = pow5mult (ptr, S, s5); + + /* Check for special case that d is a normalized power of 2. */ + + if (mode < 2) + { + if (!word1 (d) && !(word0 (d) & Bndry_mask) +#ifndef Sudden_Underflow + && word0 (d) & Exp_mask +#endif + ) + { + /* The special case */ + b2 += Log2P; + s2 += Log2P; + spec_case = 1; + } + else + spec_case = 0; + } + + /* Arrange for convenient computation of quotients: + * shift left if necessary so divisor has 4 leading 0 bits. + * + * Perhaps we should just compute leading 28 bits of S once + * and for all and pass them and a shift to quorem, so it + * can do shifts and ors to compute the numerator for q. + */ + +#ifdef Pack_32 + if (i = ((s5 ? 32 - hi0bits (S->_x[S->_wds - 1]) : 1) + s2) & 0x1f) + i = 32 - i; +#else + if (i = ((s5 ? 32 - hi0bits (S->_x[S->_wds - 1]) : 1) + s2) & 0xf) + i = 16 - i; +#endif + if (i > 4) + { + i -= 4; + b2 += i; + m2 += i; + s2 += i; + } + else if (i < 4) + { + i += 28; + b2 += i; + m2 += i; + s2 += i; + } + if (b2 > 0) + b = lshift (ptr, b, b2); + if (s2 > 0) + S = lshift (ptr, S, s2); + if (k_check) + { + if (cmp (b, S) < 0) + { + k--; + b = multadd (ptr, b, 10, 0); /* we botched the k estimate */ + if (leftright) + mhi = multadd (ptr, mhi, 10, 0); + ilim = ilim1; + } + } + if (ilim <= 0 && mode > 2) + { + if (ilim < 0 || cmp (b, S = multadd (ptr, S, 5, 0)) <= 0) + { + /* no digits, fcvt style */ + no_digits: + k = -1 - ndigits; + goto ret; + } + one_digit: + *s++ = '1'; + k++; + goto ret; + } + if (leftright) + { + if (m2 > 0) + mhi = lshift (ptr, mhi, m2); + + /* Compute mlo -- check for special case + * that d is a normalized power of 2. + */ + + mlo = mhi; + if (spec_case) + { + mhi = Balloc (ptr, mhi->_k); + Bcopy (mhi, mlo); + mhi = lshift (ptr, mhi, Log2P); + } + + for (i = 1;; i++) + { + dig = quorem (b, S) + '0'; + /* Do we yet have the shortest decimal string + * that will round to d? + */ + j = cmp (b, mlo); + delta = diff (ptr, S, mhi); + j1 = delta->_sign ? 1 : cmp (b, delta); + Bfree (ptr, delta); +#ifndef ROUND_BIASED + if (j1 == 0 && !mode && !(word1 (d) & 1)) + { + if (dig == '9') + goto round_9_up; + if (j > 0) + dig++; + *s++ = dig; + goto ret; + } +#endif + if (j < 0 || j == 0 && !mode +#ifndef ROUND_BIASED + && !(word1 (d) & 1) +#endif + ) + { + if (j1 > 0) + { + b = lshift (ptr, b, 1); + j1 = cmp (b, S); + if ((j1 > 0 || j1 == 0 && dig & 1) + && dig++ == '9') + goto round_9_up; + } + *s++ = dig; + goto ret; + } + if (j1 > 0) + { + if (dig == '9') + { /* possible if i == 1 */ + round_9_up: + *s++ = '9'; + goto roundoff; + } + *s++ = dig + 1; + goto ret; + } + *s++ = dig; + if (i == ilim) + break; + b = multadd (ptr, b, 10, 0); + if (mlo == mhi) + mlo = mhi = multadd (ptr, mhi, 10, 0); + else + { + mlo = multadd (ptr, mlo, 10, 0); + mhi = multadd (ptr, mhi, 10, 0); + } + } + } + else + for (i = 1;; i++) + { + *s++ = dig = quorem (b, S) + '0'; + if (i >= ilim) + break; + b = multadd (ptr, b, 10, 0); + } + + /* Round off last digit */ + + b = lshift (ptr, b, 1); + j = cmp (b, S); + if (j > 0 || j == 0 && dig & 1) + { + roundoff: + while (*--s == '9') + if (s == s0) + { + k++; + *s++ = '1'; + goto ret; + } + ++*s++; + } + else + { + while (*--s == '0'); + s++; + } +ret: + Bfree (ptr, S); + if (mhi) + { + if (mlo && mlo != mhi) + Bfree (ptr, mlo); + Bfree (ptr, mhi); + } +ret1: + Bfree (ptr, b); + *s = 0; + *decpt = k + 1; + if (rve) + *rve = s; + return s0; +} diff --git a/newlib/libc/stdlib/dtoastub.c b/newlib/libc/stdlib/dtoastub.c new file mode 100644 index 000000000..ff2b087f2 --- /dev/null +++ b/newlib/libc/stdlib/dtoastub.c @@ -0,0 +1,23 @@ +#include <_ansi.h> +#include +#include +#include + +/* Nothing in newlib actually *calls* dtoa, they all call _dtoa_r, so this + is a safe way of providing it to the user. */ +#ifndef NO_REENT + +char * +_DEFUN (__dtoa, + (d, mode, ndigits, decpt, sign, rve), + double d _AND + int mode _AND + int ndigits _AND + int *decpt _AND + int *sign _AND + char **rve) +{ + return _dtoa_r (_REENT, d, mode, ndigits, decpt, sign, rve); +} + +#endif diff --git a/newlib/libc/stdlib/ecvtbuf.c b/newlib/libc/stdlib/ecvtbuf.c new file mode 100644 index 000000000..146a4febb --- /dev/null +++ b/newlib/libc/stdlib/ecvtbuf.c @@ -0,0 +1,470 @@ +/* +FUNCTION +<>, <>---double or float to string + +INDEX + ecvtbuf +INDEX + fcvtbuf + +ANSI_SYNOPSIS + #include + + char *ecvtbuf(double <[val]>, int <[chars]>, int *<[decpt]>, + int *<[sgn]>, char *<[buf]>); + + char *fcvtbuf(double <[val]>, int <[decimals]>, int *<[decpt]>, + int *<[sgn]>, char *<[buf]>); + +TRAD_SYNOPSIS + #include + + char *ecvtbuf(<[val]>, <[chars]>, <[decpt]>, <[sgn]>, <[buf]>); + double <[val]>; + int <[chars]>; + int *<[decpt]>; + int *<[sgn]>; + char *<[buf]>; + + char *fcvtbuf(<[val]>, <[decimals]>, <[decpt]>, <[sgn]>, <[buf]>); + double <[val]>; + int <[decimals]>; + int *<[decpt]>; + int *<[sgn]>; + char *<[buf]>; + +DESCRIPTION + <> and <> produce (null-terminated) strings + of digits representating the <> number <[val]>. + + The only difference between <> and <> is the + interpretation of the second argument (<[chars]> or + <[decimals]>). For <>, the second argument <[chars]> + specifies the total number of characters to write (which is + also the number of significant digits in the formatted string, + since these two functions write only digits). For <>, + the second argument <[decimals]> specifies the number of + characters to write after the decimal point; all digits for + the integer part of <[val]> are always included. + + Since <> and <> write only digits in the + output string, they record the location of the decimal point + in <<*<[decpt]>>>, and the sign of the number in <<*<[sgn]>>>. + After formatting a number, <<*<[decpt]>>> contains the number + of digits to the left of the decimal point. <<*<[sgn]>>> + contains <<0>> if the number is positive, and <<1>> if it is + negative. For both functions, you supply a pointer <[buf]> to + an area of memory to hold the converted string. + +RETURNS + Both functions return a pointer to <[buf]>, the string + containing a character representation of <[val]>. + +PORTABILITY + Neither function is ANSI C. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include <_ansi.h> +#include +#include +#include +#include "mprec.h" +#include "local.h" + +static void +_DEFUN (print_f, (ptr, buf, invalue, ndigit, type, dot, mode), + struct _reent *ptr _AND + char *buf _AND + double invalue _AND + int ndigit _AND + char type _AND + int dot _AND + int mode) +{ + int decpt; + int sign; + char *p, *start, *end; + + start = p = _dtoa_r (ptr, invalue, mode, ndigit, &decpt, &sign, &end); + + if (decpt == 9999) + { + strcpy (buf, p); + return; + } + while (*p && decpt > 0) + { + *buf++ = *p++; + decpt--; + } + /* Even if not in buffer */ + while (decpt > 0) + { + *buf++ = '0'; + decpt--; + } + + if (dot || *p) + { + if (p == start) + *buf++ = '0'; + *buf++ = '.'; + while (decpt < 0 && ndigit > 0) + { + *buf++ = '0'; + decpt++; + ndigit--; + } + + /* Print rest of stuff */ + while (*p && ndigit > 0) + { + *buf++ = *p++; + ndigit--; + } + /* And trailing zeros */ + while (ndigit > 0) + { + *buf++ = '0'; + ndigit--; + } + } + *buf++ = 0; +} + +/* Print number in e format with width chars after. + + TYPE is one of 'e' or 'E'. It may also be one of 'g' or 'G' indicating + that _gcvt is calling us and we should remove trailing zeroes. + + WIDTH is the number of digits of precision after the decimal point. */ + +static void +_DEFUN (print_e, (ptr, buf, invalue, width, type, dot), + struct _reent *ptr _AND + char *buf _AND + double invalue _AND + int width _AND + char type _AND + int dot) +{ + int dp; + int sign; + char *end; + char *p; + int decpt; + int top; + int ndigit = width; + + p = _dtoa_r (ptr, invalue, 2, width + 1, &decpt, &sign, &end); + + if (decpt == 9999) + { + strcpy (buf, p); + return; + } + + *buf++ = *p++; + if (dot || ndigit != 0) + *buf++ = '.'; + + while (*p && ndigit > 0) + { + *buf++ = *p++; + ndigit--; + } + + /* Add trailing zeroes to fill out to ndigits unless this is 'g' format. + Also, convert g/G to e/E. */ + + if (type == 'g') + type = 'e'; + else if (type == 'G') + type = 'E'; + else + { + while (ndigit > 0) + { + *buf++ = '0'; + ndigit--; + } + } + + /* Add the exponent. */ + + *buf++ = type; + decpt--; + if (decpt < 0) + { + *buf++ = '-'; + decpt = -decpt; + } + else + { + *buf++ = '+'; + } + if (decpt > 99) + { + int top = decpt / 100; + *buf++ = top + '0'; + decpt -= top * 100; + } + top = decpt / 10; + *buf++ = top + '0'; + decpt -= top * 10; + *buf++ = decpt + '0'; + + *buf++ = 0; +} + +#ifndef _REENT_ONLY + +/* Undocumented behaviour: when given NULL as a buffer, return a + pointer to static space in the rent structure. This is only to + support ecvt and fcvt, which aren't ANSI anyway. */ + +char * +_DEFUN (fcvtbuf, (invalue, ndigit, decpt, sign, fcvt_buf), + double invalue _AND + int ndigit _AND + int *decpt _AND + int *sign _AND + char *fcvt_buf) +{ + char *save; + char *p; + char *end; + int done = 0; + + if (fcvt_buf == NULL) + { + if (_REENT->_cvtlen <= ndigit + 35) + { + if ((fcvt_buf = (char *) _realloc_r (_REENT, _REENT->_cvtbuf, + ndigit + 36)) == NULL) + return NULL; + _REENT->_cvtlen = ndigit + 36; + _REENT->_cvtbuf = fcvt_buf; + } + + fcvt_buf = _REENT->_cvtbuf ; + } + + save = fcvt_buf; + + if (invalue < 1.0 && invalue > -1.0) + { + p = _dtoa_r (_REENT, invalue, 2, ndigit, decpt, sign, &end); + } + else + { + p = _dtoa_r (_REENT, invalue, 3, ndigit, decpt, sign, &end); + } + + /* Now copy */ + + done = -*decpt; + while (p < end) + { + *fcvt_buf++ = *p++; + done++; + } + /* And unsuppress the trailing zeroes */ + while (done < ndigit) + { + *fcvt_buf++ = '0'; + done++; + } + *fcvt_buf++ = 0; + return save; +} + +char * +_DEFUN (ecvtbuf, (invalue, ndigit, decpt, sign, fcvt_buf), + double invalue _AND + int ndigit _AND + int *decpt _AND + int *sign _AND + char *fcvt_buf) +{ + char *save; + char *p; + char *end; + int done = 0; + + if (fcvt_buf == NULL) + { + if (_REENT->_cvtlen <= ndigit) + { + if ((fcvt_buf = (char *) _realloc_r (_REENT, _REENT->_cvtbuf, + ndigit + 1)) == NULL) + return NULL; + _REENT->_cvtlen = ndigit + 1; + _REENT->_cvtbuf = fcvt_buf; + } + + fcvt_buf = _REENT->_cvtbuf ; + } + + save = fcvt_buf; + + p = _dtoa_r (_REENT, invalue, 2, ndigit, decpt, sign, &end); + + /* Now copy */ + + while (p < end) + { + *fcvt_buf++ = *p++; + done++; + } + /* And unsuppress the trailing zeroes */ + while (done < ndigit) + { + *fcvt_buf++ = '0'; + done++; + } + *fcvt_buf++ = 0; + return save; +} + +#endif + +char * +_DEFUN (_gcvt, (ptr, invalue, ndigit, buf, type, dot), + struct _reent *ptr _AND + double invalue _AND + int ndigit _AND + char *buf _AND + char type _AND + int dot) +{ + char *save = buf; + + if (invalue < 0) + { + invalue = -invalue; + } + + if (invalue == 0) + { + *buf++ = '0'; + *buf = '\0'; + } + else + /* Which one to print ? + ANSI says that anything with more that 4 zeros after the . or more + than precision digits before is printed in e with the qualification + that trailing zeroes are removed from the fraction portion. */ + + if (0.0001 >= invalue || invalue >= _mprec_log10 (ndigit)) + { + /* We subtract 1 from ndigit because in the 'e' format the precision is + the number of digits after the . but in 'g' format it is the number + of significant digits. + + We defer changing type to e/E so that print_e() can know it's us + calling and thus should remove trailing zeroes. */ + + print_e (ptr, buf, invalue, ndigit - 1, type, dot); + } + else + { + int decpt; + int sign; + char *end; + char *p; + + if (invalue < 1.0) + { + /* what we want is ndigits after the point */ + p = _dtoa_r (ptr, invalue, 3, ndigit, &decpt, &sign, &end); + } + else + { + p = _dtoa_r (ptr, invalue, 2, ndigit, &decpt, &sign, &end); + } + + if (decpt == 9999) + { + strcpy (buf, p); + return save; + } + while (*p && decpt > 0) + { + *buf++ = *p++; + decpt--; + ndigit--; + } + /* Even if not in buffer */ + while (decpt > 0 && ndigit > 0) + { + *buf++ = '0'; + decpt--; + ndigit--; + } + + if (dot || *p) + { + if (buf == save) + *buf++ = '0'; + *buf++ = '.'; + while (decpt < 0 && ndigit > 0) + { + *buf++ = '0'; + decpt++; + ndigit--; + } + + /* Print rest of stuff */ + while (*p && ndigit > 0) + { + *buf++ = *p++; + ndigit--; + } + /* And trailing zeros */ + if (dot) + { + while (ndigit > 0) + { + *buf++ = '0'; + ndigit--; + } + } + } + *buf++ = 0; + } + + return save; +} + +char * +_DEFUN (_dcvt, (ptr, buffer, invalue, precision, width, type, dot), + struct _reent *ptr _AND + char *buffer _AND + double invalue _AND + int precision _AND + int width _AND + char type _AND + int dot) +{ + switch (type) + { + case 'f': + case 'F': + print_f (ptr, buffer, invalue, precision, type, precision == 0 ? dot : 1, 3); + break; + case 'g': + case 'G': + if (precision == 0) + precision = 1; + _gcvt (ptr, invalue, precision, buffer, type, dot); + break; + case 'e': + case 'E': + print_e (ptr, buffer, invalue, precision, type, dot); + } + return buffer; +} diff --git a/newlib/libc/stdlib/efgcvt.c b/newlib/libc/stdlib/efgcvt.c new file mode 100644 index 000000000..556d22414 --- /dev/null +++ b/newlib/libc/stdlib/efgcvt.c @@ -0,0 +1,202 @@ +/* +FUNCTION +<>,<>,<>,<>---double or float to string + +INDEX + ecvt +INDEX + fcvt + +ANSI_SYNOPSIS + #include + + char *ecvt(double <[val]>, int <[chars]>, int *<[decpt]>, int *<[sgn]>); + char *ecvtf(float <[val]>, int <[chars]>, int *<[decpt]>, int *<[sgn]>); + + char *fcvt(double <[val]>, int <[decimals]>, + int *<[decpt]>, int *<[sgn]>); + char *fcvtf(float <[val]>, int <[decimals]>, + int *<[decpt]>, int *<[sgn]>); + +TRAD_SYNOPSIS + #include + + char *ecvt(<[val]>, <[chars]>, <[decpt]>, <[sgn]>); + double <[val]>; + int <[chars]>; + int *<[decpt]>; + int *<[sgn]>; + char *ecvtf(<[val]>, <[chars]>, <[decpt]>, <[sgn]>); + float <[val]>; + int <[chars]>; + int *<[decpt]>; + int *<[sgn]>; + + char *fcvt(<[val]>, <[decimals]>, <[decpt]>, <[sgn]>); + double <[val]>; + int <[decimals]>; + int *<[decpt]>; + int *<[sgn]>; + char *fcvtf(<[val]>, <[decimals]>, <[decpt]>, <[sgn]>); + float <[val]>; + int <[decimals]>; + int *<[decpt]>; + int *<[sgn]>; + +DESCRIPTION +<> and <> produce (null-terminated) strings of digits +representating the <> number <[val]>. +<> and <> produce the corresponding character +representations of <> numbers. + +(The <> functions <> and <> are reentrant +versions of <> and <>.) + +The only difference between <> and <> is the +interpretation of the second argument (<[chars]> or <[decimals]>). +For <>, the second argument <[chars]> specifies the total number +of characters to write (which is also the number of significant digits +in the formatted string, since these two functions write only digits). +For <>, the second argument <[decimals]> specifies the number of +characters to write after the decimal point; all digits for the integer +part of <[val]> are always included. + +Since <> and <> write only digits in the output string, +they record the location of the decimal point in <<*<[decpt]>>>, and +the sign of the number in <<*<[sgn]>>>. After formatting a number, +<<*<[decpt]>>> contains the number of digits to the left of the +decimal point. <<*<[sgn]>>> contains <<0>> if the number is positive, +and <<1>> if it is negative. + +RETURNS +All four functions return a pointer to the new string containing a +character representation of <[val]>. + +PORTABILITY +None of these functions are ANSI C. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. + +NEWPAGE +FUNCTION +<>, <>---format double or float as string + +INDEX + gcvt +INDEX + gcvtf + +ANSI_SYNOPSIS + #include + + char *gcvt(double <[val]>, int <[precision]>, char *<[buf]>); + char *gcvtf(float <[val]>, int <[precision]>, char *<[buf]>); + +TRAD_SYNOPSIS + #include + + char *gcvt(<[val]>, <[precision]>, <[buf]>); + double <[val]>; + int <[precision]>; + char *<[buf]>; + char *gcvtf(<[val]>, <[precision]>, <[buf]>); + float <[val]>; + int <[precision]>; + char *<[buf]>; + +DESCRIPTION +<> writes a fully formatted number as a null-terminated +string in the buffer <<*<[buf]>>>. <> produces corresponding +character representations of <> numbers. + +<> uses the same rules as the <> format +`<<%.<[precision]>g>>'---only negative values are signed (with +`<<->>'), and either exponential or ordinary decimal-fraction format +is chosen depending on the number of significant digits (specified by +<[precision]>). + +RETURNS +The result is a pointer to the formatted representation of <[val]> +(the same as the argument <[buf]>). + +PORTABILITY +Neither function is ANSI C. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +#include <_ansi.h> +#include +#include +#include +#include "local.h" + +char * +_DEFUN (fcvt, (d, ndigit, decpt, sign), + double d _AND + int ndigit _AND + int *decpt _AND + int *sign) +{ + return fcvtbuf (d, ndigit, decpt, sign, NULL); +} + +char * +_DEFUN (fcvtf, (d, ndigit, decpt, sign), + float d _AND + int ndigit _AND + int *decpt _AND + int *sign) +{ + return fcvt ((float) d, ndigit, decpt, sign); +} + + +char * +_DEFUN (gcvtf, (d, ndigit, buf), + float d _AND + int ndigit _AND + char *buf) +{ + double asd = d; + return gcvt (asd, ndigit, buf); +} + + +char * +_DEFUN (ecvt, (d, ndigit, decpt, sign), + double d _AND + int ndigit _AND + int *decpt _AND + int *sign) +{ + return ecvtbuf (d, ndigit, decpt, sign, NULL); +} + +char * +_DEFUN (ecvtf, (d, ndigit, decpt, sign), + float d _AND + int ndigit _AND + int *decpt _AND + int *sign) +{ + return ecvt ((double) d, ndigit, decpt, sign); +} + + +char * +_DEFUN (gcvt, (d, ndigit, buf), + double d _AND + int ndigit _AND + char *buf) +{ + char *tbuf = buf; + if (d < 0) { + *buf = '-'; + buf++; + ndigit--; + } + return (_gcvt (_REENT, d, ndigit, buf, 'g', 0) ? tbuf : 0); +} diff --git a/newlib/libc/stdlib/environ.c b/newlib/libc/stdlib/environ.c new file mode 100644 index 000000000..4f6ff8b6a --- /dev/null +++ b/newlib/libc/stdlib/environ.c @@ -0,0 +1,23 @@ +/* Copyright (c) 1995, 1996 Cygnus Support. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * at Cygnus Support, Inc. Cygnus Support, Inc. may not be used to + * endorse or promote products derived from this software without + * specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +/* Provide a definition of `environ' if crt0.o doesn't. */ + +static char *initial_env[] = { 0 }; + +/* Posix says `environ' is a pointer to a null terminated list of pointers. + Hence `environ' itself is never NULL. */ +char **environ = &initial_env[0]; diff --git a/newlib/libc/stdlib/envlock.c b/newlib/libc/stdlib/envlock.c new file mode 100644 index 000000000..0ef6ec491 --- /dev/null +++ b/newlib/libc/stdlib/envlock.c @@ -0,0 +1,48 @@ +/* +FUNCTION +<<__env_lock>>, <<__env_unlock>>--lock environ variable + +INDEX + __env_lock +INDEX + __env_unlock + +ANSI_SYNOPSIS + #include "envlock.h" + void __env_lock (void *<[reent]>); + void __env_unlock (void *<[reent]>); + +TRAD_SYNOPSIS + void __env_lock(<[reent]>) + char *<[reent]>; + + void __env_unlock(<[reent]>) + char *<[reent]>; + +DESCRIPTION +The <> family of routines call these functions when they need +to modify the environ variable. The version of these routines supplied +in the library does not do anything. If multiple threads of execution +can call <>, or if <> can be called reentrantly, then +you need to define your own versions of these functions in order to +safely lock the memory pool during a call. If you do not, the memory +pool may become corrupted. + +A call to <> may call <<__env_lock>> recursively; that is, +the sequence of calls may go <<__env_lock>>, <<__env_lock>>, +<<__env_unlock>>, <<__env_unlock>>. Any implementation of these +routines must be careful to avoid causing a thread to wait for a lock +that it already holds. +*/ + +void +__env_lock (ptr) + struct _reent *ptr; +{ +} + +void +__env_unlock (ptr) + struct _reent *ptr; +{ +} diff --git a/newlib/libc/stdlib/envlock.h b/newlib/libc/stdlib/envlock.h new file mode 100644 index 000000000..df3a0ba58 --- /dev/null +++ b/newlib/libc/stdlib/envlock.h @@ -0,0 +1,12 @@ +/* envlock.h -- header file for env routines. */ + +#ifndef _INCLUDE_ENVLOCK_H_ +#define _INCLUDE_ENVLOCK_H_ + +#include <_ansi.h> +#include + +#define ENV_LOCK __env_lock(reent_ptr) +#define ENV_UNLOCK __env_unlock(reent_ptr) + +#endif /* _INCLUDE_ENVLOCK_H_ */ diff --git a/newlib/libc/stdlib/eprintf.c b/newlib/libc/stdlib/eprintf.c new file mode 100644 index 000000000..46cf8104b --- /dev/null +++ b/newlib/libc/stdlib/eprintf.c @@ -0,0 +1,26 @@ +/* This is an implementation of the __eprintf function which is + compatible with the assert.h which is distributed with gcc. + + This function is provided because in some cases libgcc.a will not + provide __eprintf. This will happen if inhibit_libc is defined, + which is done because at the time that libgcc2.c is compiled, the + correct may not be available. newlib provides its own + copy of assert.h, which calls __assert, not __eprintf. However, in + some cases you may accidentally wind up compiling with the gcc + assert.h. In such a case, this __eprintf will be used if there + does not happen to be one in libgcc2.c. */ + +#include +#include + +void +__eprintf (format, file, line, expression) + const char *format; + const char *file; + unsigned int line; + const char *expression; +{ + (void) fiprintf (stderr, format, file, line, expression); + abort (); + /*NOTREACHED*/ +} diff --git a/newlib/libc/stdlib/exit.c b/newlib/libc/stdlib/exit.c new file mode 100644 index 000000000..543bd0e30 --- /dev/null +++ b/newlib/libc/stdlib/exit.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 1990 Regents of the University of California. + * All rights reserved. + * + * %sccs.include.redist.c% + */ + +/* +FUNCTION +<>---end program execution + +INDEX + exit + +ANSI_SYNOPSIS + #include + void exit(int <[code]>); + +TRAD_SYNOPSIS + #include + void exit(<[code]>) + int <[code]>; + +DESCRIPTION +Use <> to return control from a program to the host operating +environment. Use the argument <[code]> to pass an exit status to the +operating environment: two particular values, <> and +<>, are defined in `<>' to indicate success or +failure in a portable fashion. + +<> does two kinds of cleanup before ending execution of your +program. First, it calls all application-defined cleanup functions +you have enrolled with <>. Second, files and streams are +cleaned up: any pending output is delivered to the host system, each +open file or stream is closed, and files created by <> are +deleted. + +RETURNS +<> does not return to its caller. + +PORTABILITY +ANSI C requires <>, and specifies that <> and +<> must be defined. + +Supporting OS subroutines required: <<_exit>>. +*/ + +#include +#include /* for _exit() declaration */ +#include + +#ifndef _REENT_ONLY + +/* + * Exit, flushing stdio buffers if necessary. + */ + +void +_DEFUN (exit, (code), + int code) +{ + register struct _atexit *p; + register int n; + + for (p = _REENT->_atexit; p; p = p->_next) + for (n = p->_ind; --n >= 0;) + (*p->_fns[n]) (); + if (_REENT->__cleanup) + (*_REENT->__cleanup) (_REENT); + _exit (code); +} + +#endif diff --git a/newlib/libc/stdlib/getenv.c b/newlib/libc/stdlib/getenv.c new file mode 100644 index 000000000..c9f1ecd96 --- /dev/null +++ b/newlib/libc/stdlib/getenv.c @@ -0,0 +1,101 @@ +/* +FUNCTION +<>---look up environment variable + +INDEX + getenv +INDEX + environ + +ANSI_SYNOPSIS + #include + char *getenv(const char *<[name]>); + +TRAD_SYNOPSIS + #include + char *getenv(<[name]>) + char *<[name]>; + +DESCRIPTION +<> searches the list of environment variable names and values +(using the global pointer `<>') for a variable whose +name matches the string at <[name]>. If a variable name matches, +<> returns a pointer to the associated value. + +RETURNS +A pointer to the (string) value of the environment variable, or +<> if there is no such environment variable. + +PORTABILITY +<> is ANSI, but the rules for properly forming names of environment +variables vary from one system to another. + +<> requires a global pointer <>. +*/ + +/* This file may have been modified by DJ Delorie (Jan 1991). If so, +** these modifications are Coyright (C) 1991 DJ Delorie, 24 Kirsten Ave, +** Rochester NH, 03867-2954, USA. +*/ + +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that: (1) source distributions retain this entire copyright + * notice and comment, and (2) distributions including binaries display + * the following acknowledgement: ``This product includes software + * developed by the University of California, Berkeley and its contributors'' + * in the documentation or other materials provided with the distribution + * and in all advertising materials mentioning features or use of this + * software. Neither the name of the University nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifndef _REENT_ONLY + +#include +#include +#include + +extern char **environ; + +/* + * _findenv -- + * Returns pointer to value associated with name, if any, else NULL. + * Sets offset to be the offset of the name/value combination in the + * environmental array, for use by setenv(3) and unsetenv(3). + * Explicitly removes '=' in argument name. + * + * This routine *should* be a static; don't use it. + */ + +char * +_DEFUN (_findenv, (name, offset), + register _CONST char *name _AND + int *offset) +{ + return _findenv_r (_REENT, name, offset); +} + +/* + * getenv -- + * Returns ptr to value associated with name, if any, else NULL. + */ + +char * +_DEFUN (getenv, (name), + _CONST char *name) +{ + int offset; + char *_findenv_r (); + + return _findenv_r (_REENT, name, &offset); +} + +#endif /* !_REENT_ONLY */ diff --git a/newlib/libc/stdlib/getenv_r.c b/newlib/libc/stdlib/getenv_r.c new file mode 100644 index 000000000..2ccb89a17 --- /dev/null +++ b/newlib/libc/stdlib/getenv_r.c @@ -0,0 +1,129 @@ +/* +FUNCTION +<<_getenv_r>>---look up environment variable + +INDEX + _getenv_r +INDEX + environ + +ANSI_SYNOPSIS + #include + char *_getenv_r(struct _reent *<[reent_ptr]>, const char *<[name]>); + +TRAD_SYNOPSIS + #include + char *_getenv_r(<[reent_ptr]>, <[name]>) + struct _reent *<[reent_ptr]>; + char *<[name]>; + +DESCRIPTION +<<_getenv_r>> searches the list of environment variable names and values +(using the global pointer `<>') for a variable whose +name matches the string at <[name]>. If a variable name matches, +<<_getenv_r>> returns a pointer to the associated value. + +RETURNS +A pointer to the (string) value of the environment variable, or +<> if there is no such environment variable. + +PORTABILITY +<<_getenv_r>> is not ANSI; the rules for properly forming names of environment +variables vary from one system to another. + +<<_getenv_r>> requires a global pointer <>. +*/ + +/* This file may have been modified by DJ Delorie (Jan 1991). If so, +** these modifications are Coyright (C) 1991 DJ Delorie, 24 Kirsten Ave, +** Rochester NH, 03867-2954, USA. +*/ + +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that: (1) source distributions retain this entire copyright + * notice and comment, and (2) distributions including binaries display + * the following acknowledgement: ``This product includes software + * developed by the University of California, Berkeley and its contributors'' + * in the documentation or other materials provided with the distribution + * and in all advertising materials mentioning features or use of this + * software. Neither the name of the University nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include +#include +#include +#include "envlock.h" + +extern char **environ; + +/* + * _findenv -- + * Returns pointer to value associated with name, if any, else NULL. + * Sets offset to be the offset of the name/value combination in the + * environmental array, for use by setenv(3) and unsetenv(3). + * Explicitly removes '=' in argument name. + * + * This routine *should* be a static; don't use it. + */ + +char * +_DEFUN (_findenv_r, (reent_ptr, name, offset), + struct _reent *reent_ptr _AND + register _CONST char *name _AND + int *offset) +{ + register int len; + register char **p; + _CONST char *c; + + ENV_LOCK; + + /* In some embedded systems, this does not get set. This protects + newlib from dereferencing a bad pointer. */ + if (!environ) + return NULL; + + c = name; + len = 0; + while (*c && *c != '=') + { + c++; + len++; + } + + for (p = environ; *p; ++p) + if (!strncmp (*p, name, len)) + if (*(c = *p + len) == '=') + { + *offset = p - environ; + ENV_UNLOCK; + return (char *) (++c); + } + ENV_UNLOCK; + return NULL; +} + +/* + * _getenv_r -- + * Returns ptr to value associated with name, if any, else NULL. + */ + +char * +_DEFUN (_getenv_r, (reent_ptr, name), + struct _reent *reent_ptr _AND + _CONST char *name) +{ + int offset; + char *_findenv_r (); + + return _findenv_r (reent_ptr, name, &offset); +} diff --git a/newlib/libc/stdlib/getopt.c b/newlib/libc/stdlib/getopt.c new file mode 100644 index 000000000..b38938d5f --- /dev/null +++ b/newlib/libc/stdlib/getopt.c @@ -0,0 +1,117 @@ +/* + * Copyright (c) 1987, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +/* static char sccsid[] = "from: @(#)getopt.c 8.2 (Berkeley) 4/2/94"; */ +static char *rcsid = "$Id$"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include + +int opterr = 1, /* if error message should be printed */ + optind = 1, /* index into parent argv vector */ + optopt, /* character checked for validity */ + optreset; /* reset getopt */ +char *optarg; /* argument associated with option */ + +#define BADCH (int)'?' +#define BADARG (int)':' +#define EMSG "" + +/* + * getopt -- + * Parse argc/argv argument vector. + */ +int +getopt(nargc, nargv, ostr) + int nargc; + char * const *nargv; + const char *ostr; +{ + static char *place = EMSG; /* option letter processing */ + char *oli; /* option letter list index */ + + if (optreset || !*place) { /* update scanning pointer */ + optreset = 0; + if (optind >= nargc || *(place = nargv[optind]) != '-') { + place = EMSG; + return (-1); + } + if (place[1] && *++place == '-') { /* found "--" */ + ++optind; + place = EMSG; + return (-1); + } + } /* option letter okay? */ + if ((optopt = (int)*place++) == (int)':' || + !(oli = strchr(ostr, optopt))) { + /* + * if the user didn't specify '-' as an option, + * assume it means -1. + */ + if (optopt == (int)'-') + return (-1); + if (!*place) + ++optind; + if (opterr && *ostr != ':') + (void)fprintf(stderr, + "%s: illegal option -- %c\n", nargv[0], optopt); + return (BADCH); + } + if (*++oli != ':') { /* don't need argument */ + optarg = NULL; + if (!*place) + ++optind; + } + else { /* need an argument */ + if (*place) /* no white space */ + optarg = place; + else if (nargc <= ++optind) { /* no arg */ + place = EMSG; + if (*ostr == ':') + return (BADARG); + if (opterr) + (void)fprintf(stderr, + "%s: option requires an argument -- %c\n", + nargv[0], optopt); + return (BADCH); + } + else /* white space */ + optarg = nargv[optind]; + place = EMSG; + ++optind; + } + return (optopt); /* dump back option letter */ +} diff --git a/newlib/libc/stdlib/labs.c b/newlib/libc/stdlib/labs.c new file mode 100644 index 000000000..634cf7348 --- /dev/null +++ b/newlib/libc/stdlib/labs.c @@ -0,0 +1,49 @@ +/* +FUNCTION +<>---long integer absolute value + +INDEX + labs + +ANSI_SYNOPSIS + #include + long labs(long <[i]>); + +TRAD_SYNOPSIS + #include + long labs(<[i]>) + long <[i]>; + +DESCRIPTION +<> returns +@tex +$|x|$, +@end tex +the absolute value of <[i]> (also called the magnitude +of <[i]>). That is, if <[i]> is negative, the result is the opposite +of <[i]>, but if <[i]> is nonnegative the result is <[i]>. + +The similar function <> uses and returns <> rather than +<> values. + +RETURNS +The result is a nonnegative long integer. + +PORTABILITY +<> is ANSI. + +No supporting OS subroutine calls are required. +*/ + +#include + +long +_DEFUN (labs, (x), + long x) +{ + if (x < 0) + { + x = -x; + } + return x; +} diff --git a/newlib/libc/stdlib/ldiv.c b/newlib/libc/stdlib/ldiv.c new file mode 100644 index 000000000..054b33837 --- /dev/null +++ b/newlib/libc/stdlib/ldiv.c @@ -0,0 +1,109 @@ +/* +FUNCTION +<>---divide two long integers + +INDEX + ldiv + +ANSI_SYNOPSIS + #include + ldiv_t ldiv(long <[n]>, long <[d]>); + +TRAD_SYNOPSIS + #include + ldiv_t ldiv(<[n]>, <[d]>) + long <[n]>, <[d]>; + +DESCRIPTION +Divide +@tex +$n/d$, +@end tex +@ifinfo +<[n]>/<[d]>, +@end ifinfo +returning quotient and remainder as two long integers in a structure <>. + +RETURNS +The result is represented with the structure + +. typedef struct +. { +. long quot; +. long rem; +. } ldiv_t; + +where the <> field represents the quotient, and <> the +remainder. For nonzero <[d]>, if `<<<[r]> = ldiv(<[n]>,<[d]>);>>' then +<[n]> equals `<<<[r]>.rem + <[d]>*<[r]>.quot>>'. + +To divide <> rather than <> values, use the similar +function <
>. + +PORTABILITY +<> is ANSI. + +No supporting OS subroutines are required. +*/ + + +/* + * Copyright (c) 1990 Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <_ansi.h> +#include /* ldiv_t */ + +ldiv_t +_DEFUN (ldiv, (num, denom), + long num _AND + long denom) +{ + ldiv_t r; + + /* see div.c for comments */ + + r.quot = num / denom; + r.rem = num % denom; + if (num >= 0 && r.rem < 0) { + ++r.quot; + r.rem -= denom; + } + else if (num < 0 && r.rem > 0) { + --r.quot; + r.rem += denom; + } + return (r); +} diff --git a/newlib/libc/stdlib/local.h b/newlib/libc/stdlib/local.h new file mode 100644 index 000000000..a274f20a1 --- /dev/null +++ b/newlib/libc/stdlib/local.h @@ -0,0 +1,8 @@ +/* Misc. local definitions for libc/stdlib */ + +#ifndef _LOCAL_H_ +#define _LOCAL_H_ + +char * _EXFUN(_gcvt,(struct _reent *, double , int , char *, char, int)); + +#endif diff --git a/newlib/libc/stdlib/malign.c b/newlib/libc/stdlib/malign.c new file mode 100644 index 000000000..d012d9be2 --- /dev/null +++ b/newlib/libc/stdlib/malign.c @@ -0,0 +1,18 @@ +/* malign.c -- a wrapper for memalign_r. */ + +#include <_ansi.h> +#include +#include +#include + +#ifndef _REENT_ONLY + +_PTR +_DEFUN (memalign, (align, nbytes), + size_t align _AND + size_t nbytes) +{ + return _memalign_r (_REENT, align, nbytes); +} + +#endif diff --git a/newlib/libc/stdlib/malloc.c b/newlib/libc/stdlib/malloc.c new file mode 100644 index 000000000..83453ab8d --- /dev/null +++ b/newlib/libc/stdlib/malloc.c @@ -0,0 +1,206 @@ +/* VxWorks provides its own version of malloc, and we can't use this + one because VxWorks does not provide sbrk. So we have a hook to + not compile this code. */ + +/* The routines here are simple cover fns to the routines that do the real + work (the reentrant versions). */ +/* FIXME: Does the warning below (see WARNINGS) about non-reentrancy still + apply? A first guess would be "no", but how about reentrancy in the *same* + thread? */ + +#ifdef MALLOC_PROVIDED + +int _dummy_malloc = 1; + +#else + +/* +FUNCTION +<>, <>, <>---manage memory + +INDEX + malloc +INDEX + realloc +INDEX + free +INDEX + memalign +INDEX + malloc_usable_size +INDEX + _malloc_r +INDEX + _realloc_r +INDEX + _free_r +INDEX + _memalign_r +INDEX + _malloc_usable_size_r + +ANSI_SYNOPSIS + #include + void *malloc(size_t <[nbytes]>); + void *realloc(void *<[aptr]>, size_t <[nbytes]>); + void free(void *<[aptr]>); + + void *memalign(size_t <[align]>, size_t <[nbytes]>); + + size_t malloc_usable_size(void *<[aptr]>); + + void *_malloc_r(void *<[reent]>, size_t <[nbytes]>); + void *_realloc_r(void *<[reent]>, + void *<[aptr]>, size_t <[nbytes]>); + void _free_r(void *<[reent]>, void *<[aptr]>); + + void *_memalign_r(void *<[reent]>, + size_t <[align]>, size_t <[nbytes]>); + + size_t _malloc_usable_size_r(void *<[reent]>, void *<[aptr]>); + +TRAD_SYNOPSIS + #include + char *malloc(<[nbytes]>) + size_t <[nbytes]>; + + char *realloc(<[aptr]>, <[nbytes]>) + char *<[aptr]>; + size_t <[nbytes]>; + + void free(<[aptr]>) + char *<[aptr]>; + + char *memalign(<[align]>, <[nbytes]>) + size_t <[align]>; + size_t <[nbytes]>; + + size_t malloc_usable_size(<[aptr]>) + char *<[aptr]>; + + char *_malloc_r(<[reent]>,<[nbytes]>) + char *<[reent]>; + size_t <[nbytes]>; + + char *_realloc_r(<[reent]>, <[aptr]>, <[nbytes]>) + char *<[reent]>; + char *<[aptr]>; + size_t <[nbytes]>; + + void _free_r(<[reent]>, <[aptr]>) + char *<[reent]>; + char *<[aptr]>; + + char *_memalign_r(<[reent]>, <[align]>, <[nbytes]>) + char *<[reent]>; + size_t <[align]>; + size_t <[nbytes]>; + + size_t malloc_usable_size(<[reent]>, <[aptr]>) + char *<[reent]>; + char *<[aptr]>; + +DESCRIPTION +These functions manage a pool of system memory. + +Use <> to request allocation of an object with at least +<[nbytes]> bytes of storage available. If the space is available, +<> returns a pointer to a newly allocated block as its result. + +If you already have a block of storage allocated by <>, but +you no longer need all the space allocated to it, you can make it +smaller by calling <> with both the object pointer and the +new desired size as arguments. <> guarantees that the +contents of the smaller object match the beginning of the original object. + +Similarly, if you need more space for an object, use <> to +request the larger size; again, <> guarantees that the +beginning of the new, larger object matches the contents of the +original object. + +When you no longer need an object originally allocated by <> +or <> (or the related function <>), return it to the +memory storage pool by calling <> with the address of the object +as the argument. You can also use <> for this purpose by +calling it with <<0>> as the <[nbytes]> argument. + +The <> function returns a block of size <[nbytes]> aligned +to a <[align]> boundary. The <[align]> argument must be a power of +two. + +The <> function takes a pointer to a block +allocated by <>. It returns the amount of space that is +available in the block. This may or may not be more than the size +requested from <>, due to alignment or minimum size +constraints. + +The alternate functions <<_malloc_r>>, <<_realloc_r>>, <<_free_r>>, +<<_memalign_r>>, and <<_malloc_usable_size_r>> are reentrant versions. +The extra argument <[reent]> is a pointer to a reentrancy structure. + +If you have multiple threads of execution which may call any of these +routines, or if any of these routines may be called reentrantly, then +you must provide implementations of the <<__malloc_lock>> and +<<__malloc_unlock>> functions for your system. See the documentation +for those functions. + +These functions operate by calling the function <<_sbrk_r>> or +<>, which allocates space. You may need to provide one of these +functions for your system. <<_sbrk_r>> is called with a positive +value to allocate more space, and with a negative value to release +previously allocated space if it is no longer required. +@xref{Stubs}. + +RETURNS +<> returns a pointer to the newly allocated space, if +successful; otherwise it returns <>. If your application needs +to generate empty objects, you may use <> for this purpose. + +<> returns a pointer to the new block of memory, or <> +if a new block could not be allocated. <> is also the result +when you use `<,0)>>' (which has the same effect as +`<)>>'). You should always check the result of +<>; successful reallocation is not guaranteed even when +you request a smaller object. + +<> does not return a result. + +<> returns a pointer to the newly allocated space. + +<> returns the usable size. + +PORTABILITY +<>, <>, and <> are specified by the ANSI C +standard, but other conforming implementations of <> may +behave differently when <[nbytes]> is zero. + +<> is part of SVR4. + +<> is not portable. + +Supporting OS subroutines required: <>. */ + +#include <_ansi.h> +#include +#include +#include + +#ifndef _REENT_ONLY + +_PTR +_DEFUN (malloc, (nbytes), + size_t nbytes) /* get a block */ +{ + return _malloc_r (_REENT, nbytes); +} + +void +_DEFUN (free, (aptr), + _PTR aptr) +{ + _free_r (_REENT, aptr); +} + +#endif + +#endif /* ! defined (MALLOC_PROVIDED) */ diff --git a/newlib/libc/stdlib/mallocr.c b/newlib/libc/stdlib/mallocr.c new file mode 100644 index 000000000..797e04656 --- /dev/null +++ b/newlib/libc/stdlib/mallocr.c @@ -0,0 +1,3646 @@ +#ifdef MALLOC_PROVIDED +int _dummy_mallocr = 1; +#else +/* ---------- To make a malloc.h, start cutting here ------------ */ + +/* + A version of malloc/free/realloc written by Doug Lea and released to the + public domain. Send questions/comments/complaints/performance data + to dl@cs.oswego.edu + +* VERSION 2.6.4 Thu Nov 28 07:54:55 1996 Doug Lea (dl at gee) + + Note: There may be an updated version of this malloc obtainable at + ftp://g.oswego.edu/pub/misc/malloc.c + Check before installing! + +* Why use this malloc? + + This is not the fastest, most space-conserving, most portable, or + most tunable malloc ever written. However it is among the fastest + while also being among the most space-conserving, portable and tunable. + Consistent balance across these factors results in a good general-purpose + allocator. For a high-level description, see + http://g.oswego.edu/dl/html/malloc.html + +* Synopsis of public routines + + (Much fuller descriptions are contained in the program documentation below.) + + malloc(size_t n); + Return a pointer to a newly allocated chunk of at least n bytes, or null + if no space is available. + free(Void_t* p); + Release the chunk of memory pointed to by p, or no effect if p is null. + realloc(Void_t* p, size_t n); + Return a pointer to a chunk of size n that contains the same data + as does chunk p up to the minimum of (n, p's size) bytes, or null + if no space is available. The returned pointer may or may not be + the same as p. If p is null, equivalent to malloc. Unless the + #define REALLOC_ZERO_BYTES_FREES below is set, realloc with a + size argument of zero (re)allocates a minimum-sized chunk. + memalign(size_t alignment, size_t n); + Return a pointer to a newly allocated chunk of n bytes, aligned + in accord with the alignment argument, which must be a power of + two. + valloc(size_t n); + Equivalent to memalign(pagesize, n), where pagesize is the page + size of the system (or as near to this as can be figured out from + all the includes/defines below.) + pvalloc(size_t n); + Equivalent to valloc(minimum-page-that-holds(n)), that is, + round up n to nearest pagesize. + calloc(size_t unit, size_t quantity); + Returns a pointer to quantity * unit bytes, with all locations + set to zero. + cfree(Void_t* p); + Equivalent to free(p). + malloc_trim(size_t pad); + Release all but pad bytes of freed top-most memory back + to the system. Return 1 if successful, else 0. + malloc_usable_size(Void_t* p); + Report the number usable allocated bytes associated with allocated + chunk p. This may or may not report more bytes than were requested, + due to alignment and minimum size constraints. + malloc_stats(); + Prints brief summary statistics on stderr. + mallinfo() + Returns (by copy) a struct containing various summary statistics. + mallopt(int parameter_number, int parameter_value) + Changes one of the tunable parameters described below. Returns + 1 if successful in changing the parameter, else 0. + +* Vital statistics: + + Alignment: 8-byte + 8 byte alignment is currently hardwired into the design. This + seems to suffice for all current machines and C compilers. + + Assumed pointer representation: 4 or 8 bytes + Code for 8-byte pointers is untested by me but has worked + reliably by Wolfram Gloger, who contributed most of the + changes supporting this. + + Assumed size_t representation: 4 or 8 bytes + Note that size_t is allowed to be 4 bytes even if pointers are 8. + + Minimum overhead per allocated chunk: 4 or 8 bytes + Each malloced chunk has a hidden overhead of 4 bytes holding size + and status information. + + Minimum allocated size: 4-byte ptrs: 16 bytes (including 4 overhead) + 8-byte ptrs: 24/32 bytes (including, 4/8 overhead) + + When a chunk is freed, 12 (for 4byte ptrs) or 20 (for 8 byte + ptrs but 4 byte size) or 24 (for 8/8) additional bytes are + needed; 4 (8) for a trailing size field + and 8 (16) bytes for free list pointers. Thus, the minimum + allocatable size is 16/24/32 bytes. + + Even a request for zero bytes (i.e., malloc(0)) returns a + pointer to something of the minimum allocatable size. + + Maximum allocated size: 4-byte size_t: 2^31 - 8 bytes + 8-byte size_t: 2^63 - 16 bytes + + It is assumed that (possibly signed) size_t bit values suffice to + represent chunk sizes. `Possibly signed' is due to the fact + that `size_t' may be defined on a system as either a signed or + an unsigned type. To be conservative, values that would appear + as negative numbers are avoided. + Requests for sizes with a negative sign bit will return a + minimum-sized chunk. + + Maximum overhead wastage per allocated chunk: normally 15 bytes + + Alignnment demands, plus the minimum allocatable size restriction + make the normal worst-case wastage 15 bytes (i.e., up to 15 + more bytes will be allocated than were requested in malloc), with + two exceptions: + 1. Because requests for zero bytes allocate non-zero space, + the worst case wastage for a request of zero bytes is 24 bytes. + 2. For requests >= mmap_threshold that are serviced via + mmap(), the worst case wastage is 8 bytes plus the remainder + from a system page (the minimal mmap unit); typically 4096 bytes. + +* Limitations + + Here are some features that are NOT currently supported + + * No user-definable hooks for callbacks and the like. + * No automated mechanism for fully checking that all accesses + to malloced memory stay within their bounds. + * No support for compaction. + +* Synopsis of compile-time options: + + People have reported using previous versions of this malloc on all + versions of Unix, sometimes by tweaking some of the defines + below. It has been tested most extensively on Solaris and + Linux. It is also reported to work on WIN32 platforms. + People have also reported adapting this malloc for use in + stand-alone embedded systems. + + The implementation is in straight, hand-tuned ANSI C. Among other + consequences, it uses a lot of macros. Because of this, to be at + all usable, this code should be compiled using an optimizing compiler + (for example gcc -O2) that can simplify expressions and control + paths. + + __STD_C (default: derived from C compiler defines) + Nonzero if using ANSI-standard C compiler, a C++ compiler, or + a C compiler sufficiently close to ANSI to get away with it. + DEBUG (default: NOT defined) + Define to enable debugging. Adds fairly extensive assertion-based + checking to help track down memory errors, but noticeably slows down + execution. + SEPARATE_OBJECTS (default: NOT defined) + Define this to compile into separate .o files. You must then + compile malloc.c several times, defining a DEFINE_* macro each + time. The list of DEFINE_* macros appears below. + MALLOC_LOCK (default: NOT defined) + MALLOC_UNLOCK (default: NOT defined) + Define these to C expressions which are run to lock and unlock + the malloc data structures. Calls may be nested; that is, + MALLOC_LOCK may be called more than once before the corresponding + MALLOC_UNLOCK calls. MALLOC_LOCK must avoid waiting for a lock + that it already holds. + MALLOC_ALIGNMENT (default: NOT defined) + Define this to 16 if you need 16 byte alignment instead of 8 byte alignment + which is the normal default. + SIZE_T_SMALLER_THAN_LONG (default: NOT defined) + Define this when the platform you are compiling has sizeof(long) > sizeof(size_t). + The option causes some extra code to be generated to handle operations + that use size_t operands and have long results. + REALLOC_ZERO_BYTES_FREES (default: NOT defined) + Define this if you think that realloc(p, 0) should be equivalent + to free(p). Otherwise, since malloc returns a unique pointer for + malloc(0), so does realloc(p, 0). + HAVE_MEMCPY (default: defined) + Define if you are not otherwise using ANSI STD C, but still + have memcpy and memset in your C library and want to use them. + Otherwise, simple internal versions are supplied. + USE_MEMCPY (default: 1 if HAVE_MEMCPY is defined, 0 otherwise) + Define as 1 if you want the C library versions of memset and + memcpy called in realloc and calloc (otherwise macro versions are used). + At least on some platforms, the simple macro versions usually + outperform libc versions. + HAVE_MMAP (default: defined as 1) + Define to non-zero to optionally make malloc() use mmap() to + allocate very large blocks. + HAVE_MREMAP (default: defined as 0 unless Linux libc set) + Define to non-zero to optionally make realloc() use mremap() to + reallocate very large blocks. + malloc_getpagesize (default: derived from system #includes) + Either a constant or routine call returning the system page size. + HAVE_USR_INCLUDE_MALLOC_H (default: NOT defined) + Optionally define if you are on a system with a /usr/include/malloc.h + that declares struct mallinfo. It is not at all necessary to + define this even if you do, but will ensure consistency. + INTERNAL_SIZE_T (default: size_t) + Define to a 32-bit type (probably `unsigned int') if you are on a + 64-bit machine, yet do not want or need to allow malloc requests of + greater than 2^31 to be handled. This saves space, especially for + very small chunks. + INTERNAL_LINUX_C_LIB (default: NOT defined) + Defined only when compiled as part of Linux libc. + Also note that there is some odd internal name-mangling via defines + (for example, internally, `malloc' is named `mALLOc') needed + when compiling in this case. These look funny but don't otherwise + affect anything. + INTERNAL_NEWLIB (default: NOT defined) + Defined only when compiled as part of the Cygnus newlib + distribution. + WIN32 (default: undefined) + Define this on MS win (95, nt) platforms to compile in sbrk emulation. + LACKS_UNISTD_H (default: undefined) + Define this if your system does not have a . + MORECORE (default: sbrk) + The name of the routine to call to obtain more memory from the system. + MORECORE_FAILURE (default: -1) + The value returned upon failure of MORECORE. + MORECORE_CLEARS (default 1) + True (1) if the routine mapped to MORECORE zeroes out memory (which + holds for sbrk). + DEFAULT_TRIM_THRESHOLD + DEFAULT_TOP_PAD + DEFAULT_MMAP_THRESHOLD + DEFAULT_MMAP_MAX + Default values of tunable parameters (described in detail below) + controlling interaction with host system routines (sbrk, mmap, etc). + These values may also be changed dynamically via mallopt(). The + preset defaults are those that give best performance for typical + programs/systems. + + +*/ + + + + +/* Preliminaries */ + +#ifndef __STD_C +#ifdef __STDC__ +#define __STD_C 1 +#else +#if __cplusplus +#define __STD_C 1 +#else +#define __STD_C 0 +#endif /*__cplusplus*/ +#endif /*__STDC__*/ +#endif /*__STD_C*/ + +#ifndef Void_t +#if __STD_C +#define Void_t void +#else +#define Void_t char +#endif +#endif /*Void_t*/ + +#if __STD_C +#include /* for size_t */ +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#include /* needed for malloc_stats */ + + +/* + Compile-time options +*/ + + +/* + + Special defines for Cygnus newlib distribution. + + */ + +#ifdef INTERNAL_NEWLIB + +#include + +/* + In newlib, all the publically visible routines take a reentrancy + pointer. We don't currently do anything much with it, but we do + pass it to the lock routine. + */ + +#include + +#define POINTER_UINT unsigned _POINTER_INT +#define SEPARATE_OBJECTS +#define HAVE_MMAP 0 +#define MORECORE(size) _sbrk_r(reent_ptr, (size)) +#define MORECORE_CLEARS 0 +#define MALLOC_LOCK __malloc_lock(reent_ptr) +#define MALLOC_UNLOCK __malloc_unlock(reent_ptr) + +#ifndef _WIN32 +#ifdef SMALL_MEMORY +#define malloc_getpagesize (128) +#else +#define malloc_getpagesize (4096) +#endif +#endif + +#if __STD_C +extern void __malloc_lock(struct _reent *); +extern void __malloc_unlock(struct _reent *); +#else +extern void __malloc_lock(); +extern void __malloc_unlock(); +#endif + +#if __STD_C +#define RARG struct _reent *reent_ptr, +#define RONEARG struct _reent *reent_ptr +#else +#define RARG reent_ptr +#define RONEARG reent_ptr +#define RDECL struct _reent *reent_ptr; +#endif + +#define RCALL reent_ptr, +#define RONECALL reent_ptr + +#else /* ! INTERNAL_NEWLIB */ + +#define POINTER_UINT unsigned long +#define RARG +#define RONEARG +#define RDECL +#define RCALL +#define RONECALL + +#endif /* ! INTERNAL_NEWLIB */ + +/* + Debugging: + + Because freed chunks may be overwritten with link fields, this + malloc will often die when freed memory is overwritten by user + programs. This can be very effective (albeit in an annoying way) + in helping track down dangling pointers. + + If you compile with -DDEBUG, a number of assertion checks are + enabled that will catch more memory errors. You probably won't be + able to make much sense of the actual assertion errors, but they + should help you locate incorrectly overwritten memory. The + checking is fairly extensive, and will slow down execution + noticeably. Calling malloc_stats or mallinfo with DEBUG set will + attempt to check every non-mmapped allocated and free chunk in the + course of computing the summmaries. (By nature, mmapped regions + cannot be checked very much automatically.) + + Setting DEBUG may also be helpful if you are trying to modify + this code. The assertions in the check routines spell out in more + detail the assumptions and invariants underlying the algorithms. + +*/ + +#if DEBUG +#include +#else +#define assert(x) ((void)0) +#endif + + +/* + SEPARATE_OBJECTS should be defined if you want each function to go + into a separate .o file. You must then compile malloc.c once per + function, defining the appropriate DEFINE_ macro. See below for the + list of macros. + */ + +#ifndef SEPARATE_OBJECTS +#define DEFINE_MALLOC +#define DEFINE_FREE +#define DEFINE_REALLOC +#define DEFINE_CALLOC +#define DEFINE_CFREE +#define DEFINE_MEMALIGN +#define DEFINE_VALLOC +#define DEFINE_PVALLOC +#define DEFINE_MALLINFO +#define DEFINE_MALLOC_STATS +#define DEFINE_MALLOC_USABLE_SIZE +#define DEFINE_MALLOPT + +#define STATIC static +#else +#define STATIC +#endif + +/* + Define MALLOC_LOCK and MALLOC_UNLOCK to C expressions to run to + lock and unlock the malloc data structures. MALLOC_LOCK may be + called recursively. + */ + +#ifndef MALLOC_LOCK +#define MALLOC_LOCK +#endif + +#ifndef MALLOC_UNLOCK +#define MALLOC_UNLOCK +#endif + +/* + INTERNAL_SIZE_T is the word-size used for internal bookkeeping + of chunk sizes. On a 64-bit machine, you can reduce malloc + overhead by defining INTERNAL_SIZE_T to be a 32 bit `unsigned int' + at the expense of not being able to handle requests greater than + 2^31. This limitation is hardly ever a concern; you are encouraged + to set this. However, the default version is the same as size_t. +*/ + +#ifndef INTERNAL_SIZE_T +#define INTERNAL_SIZE_T size_t +#endif + +/* + Following is needed on implementations whereby long > size_t. + The problem is caused because the code performs subtractions of + size_t values and stores the result in long values. In the case + where long > size_t and the first value is actually less than + the second value, the resultant value is positive. For example, + (long)(x - y) where x = 0 and y is 1 ends up being 0x00000000FFFFFFFF + which is 2*31 - 1 instead of 0xFFFFFFFFFFFFFFFF. This is due to the + fact that assignment from unsigned to signed won't sign extend. +*/ + +#ifdef SIZE_T_SMALLER_THAN_LONG +#define long_sub_size_t(x, y) ( (x < y) ? -((long)(y - x)) : (x - y) ); +#else +#define long_sub_size_t(x, y) ( (long)(x - y) ) +#endif + +/* + REALLOC_ZERO_BYTES_FREES should be set if a call to + realloc with zero bytes should be the same as a call to free. + Some people think it should. Otherwise, since this malloc + returns a unique pointer for malloc(0), so does realloc(p, 0). +*/ + + +/* #define REALLOC_ZERO_BYTES_FREES */ + + +/* + WIN32 causes an emulation of sbrk to be compiled in + mmap-based options are not currently supported in WIN32. +*/ + +/* #define WIN32 */ +#ifdef WIN32 +#define MORECORE wsbrk +#define HAVE_MMAP 0 +#endif + + +/* + HAVE_MEMCPY should be defined if you are not otherwise using + ANSI STD C, but still have memcpy and memset in your C library + and want to use them in calloc and realloc. Otherwise simple + macro versions are defined here. + + USE_MEMCPY should be defined as 1 if you actually want to + have memset and memcpy called. People report that the macro + versions are often enough faster than libc versions on many + systems that it is better to use them. + +*/ + +#define HAVE_MEMCPY + +#ifndef USE_MEMCPY +#ifdef HAVE_MEMCPY +#define USE_MEMCPY 1 +#else +#define USE_MEMCPY 0 +#endif +#endif + +#if (__STD_C || defined(HAVE_MEMCPY)) + +#if __STD_C +void* memset(void*, int, size_t); +void* memcpy(void*, const void*, size_t); +#else +Void_t* memset(); +Void_t* memcpy(); +#endif +#endif + +#if USE_MEMCPY + +/* The following macros are only invoked with (2n+1)-multiples of + INTERNAL_SIZE_T units, with a positive integer n. This is exploited + for fast inline execution when n is small. */ + +#define MALLOC_ZERO(charp, nbytes) \ +do { \ + INTERNAL_SIZE_T mzsz = (nbytes); \ + if(mzsz <= 9*sizeof(mzsz)) { \ + INTERNAL_SIZE_T* mz = (INTERNAL_SIZE_T*) (charp); \ + if(mzsz >= 5*sizeof(mzsz)) { *mz++ = 0; \ + *mz++ = 0; \ + if(mzsz >= 7*sizeof(mzsz)) { *mz++ = 0; \ + *mz++ = 0; \ + if(mzsz >= 9*sizeof(mzsz)) { *mz++ = 0; \ + *mz++ = 0; }}} \ + *mz++ = 0; \ + *mz++ = 0; \ + *mz = 0; \ + } else memset((charp), 0, mzsz); \ +} while(0) + +#define MALLOC_COPY(dest,src,nbytes) \ +do { \ + INTERNAL_SIZE_T mcsz = (nbytes); \ + if(mcsz <= 9*sizeof(mcsz)) { \ + INTERNAL_SIZE_T* mcsrc = (INTERNAL_SIZE_T*) (src); \ + INTERNAL_SIZE_T* mcdst = (INTERNAL_SIZE_T*) (dest); \ + if(mcsz >= 5*sizeof(mcsz)) { *mcdst++ = *mcsrc++; \ + *mcdst++ = *mcsrc++; \ + if(mcsz >= 7*sizeof(mcsz)) { *mcdst++ = *mcsrc++; \ + *mcdst++ = *mcsrc++; \ + if(mcsz >= 9*sizeof(mcsz)) { *mcdst++ = *mcsrc++; \ + *mcdst++ = *mcsrc++; }}} \ + *mcdst++ = *mcsrc++; \ + *mcdst++ = *mcsrc++; \ + *mcdst = *mcsrc ; \ + } else memcpy(dest, src, mcsz); \ +} while(0) + +#else /* !USE_MEMCPY */ + +/* Use Duff's device for good zeroing/copying performance. */ + +#define MALLOC_ZERO(charp, nbytes) \ +do { \ + INTERNAL_SIZE_T* mzp = (INTERNAL_SIZE_T*)(charp); \ + long mctmp = (nbytes)/sizeof(INTERNAL_SIZE_T), mcn; \ + if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp %= 8; } \ + switch (mctmp) { \ + case 0: for(;;) { *mzp++ = 0; \ + case 7: *mzp++ = 0; \ + case 6: *mzp++ = 0; \ + case 5: *mzp++ = 0; \ + case 4: *mzp++ = 0; \ + case 3: *mzp++ = 0; \ + case 2: *mzp++ = 0; \ + case 1: *mzp++ = 0; if(mcn <= 0) break; mcn--; } \ + } \ +} while(0) + +#define MALLOC_COPY(dest,src,nbytes) \ +do { \ + INTERNAL_SIZE_T* mcsrc = (INTERNAL_SIZE_T*) src; \ + INTERNAL_SIZE_T* mcdst = (INTERNAL_SIZE_T*) dest; \ + long mctmp = (nbytes)/sizeof(INTERNAL_SIZE_T), mcn; \ + if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp %= 8; } \ + switch (mctmp) { \ + case 0: for(;;) { *mcdst++ = *mcsrc++; \ + case 7: *mcdst++ = *mcsrc++; \ + case 6: *mcdst++ = *mcsrc++; \ + case 5: *mcdst++ = *mcsrc++; \ + case 4: *mcdst++ = *mcsrc++; \ + case 3: *mcdst++ = *mcsrc++; \ + case 2: *mcdst++ = *mcsrc++; \ + case 1: *mcdst++ = *mcsrc++; if(mcn <= 0) break; mcn--; } \ + } \ +} while(0) + +#endif + + +/* + Define HAVE_MMAP to optionally make malloc() use mmap() to + allocate very large blocks. These will be returned to the + operating system immediately after a free(). +*/ + +#ifndef HAVE_MMAP +#define HAVE_MMAP 1 +#endif + +/* + Define HAVE_MREMAP to make realloc() use mremap() to re-allocate + large blocks. This is currently only possible on Linux with + kernel versions newer than 1.3.77. +*/ + +#ifndef HAVE_MREMAP +#ifdef INTERNAL_LINUX_C_LIB +#define HAVE_MREMAP 1 +#else +#define HAVE_MREMAP 0 +#endif +#endif + +#if HAVE_MMAP + +#include +#include +#include + +#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) +#define MAP_ANONYMOUS MAP_ANON +#endif + +#endif /* HAVE_MMAP */ + +/* + Access to system page size. To the extent possible, this malloc + manages memory from the system in page-size units. + + The following mechanics for getpagesize were adapted from + bsd/gnu getpagesize.h +*/ + +#ifndef LACKS_UNISTD_H +# include +#endif + +#ifndef malloc_getpagesize +# ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */ +# ifndef _SC_PAGE_SIZE +# define _SC_PAGE_SIZE _SC_PAGESIZE +# endif +# endif +# ifdef _SC_PAGE_SIZE +# define malloc_getpagesize sysconf(_SC_PAGE_SIZE) +# else +# if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE) + extern size_t getpagesize(); +# define malloc_getpagesize getpagesize() +# else +# include +# ifdef EXEC_PAGESIZE +# define malloc_getpagesize EXEC_PAGESIZE +# else +# ifdef NBPG +# ifndef CLSIZE +# define malloc_getpagesize NBPG +# else +# define malloc_getpagesize (NBPG * CLSIZE) +# endif +# else +# ifdef NBPC +# define malloc_getpagesize NBPC +# else +# ifdef PAGESIZE +# define malloc_getpagesize PAGESIZE +# else +# define malloc_getpagesize (4096) /* just guess */ +# endif +# endif +# endif +# endif +# endif +# endif +#endif + + + +/* + + This version of malloc supports the standard SVID/XPG mallinfo + routine that returns a struct containing the same kind of + information you can get from malloc_stats. It should work on + any SVID/XPG compliant system that has a /usr/include/malloc.h + defining struct mallinfo. (If you'd like to install such a thing + yourself, cut out the preliminary declarations as described above + and below and save them in a malloc.h file. But there's no + compelling reason to bother to do this.) + + The main declaration needed is the mallinfo struct that is returned + (by-copy) by mallinfo(). The SVID/XPG malloinfo struct contains a + bunch of fields, most of which are not even meaningful in this + version of malloc. Some of these fields are are instead filled by + mallinfo() with other numbers that might possibly be of interest. + + HAVE_USR_INCLUDE_MALLOC_H should be set if you have a + /usr/include/malloc.h file that includes a declaration of struct + mallinfo. If so, it is included; else an SVID2/XPG2 compliant + version is declared below. These must be precisely the same for + mallinfo() to work. + +*/ + +/* #define HAVE_USR_INCLUDE_MALLOC_H */ + +#if HAVE_USR_INCLUDE_MALLOC_H +#include "/usr/include/malloc.h" +#else + +/* SVID2/XPG mallinfo structure */ + +struct mallinfo { + int arena; /* total space allocated from system */ + int ordblks; /* number of non-inuse chunks */ + int smblks; /* unused -- always zero */ + int hblks; /* number of mmapped regions */ + int hblkhd; /* total space in mmapped regions */ + int usmblks; /* unused -- always zero */ + int fsmblks; /* unused -- always zero */ + int uordblks; /* total allocated space */ + int fordblks; /* total non-inuse space */ + int keepcost; /* top-most, releasable (via malloc_trim) space */ +}; + +/* SVID2/XPG mallopt options */ + +#define M_MXFAST 1 /* UNUSED in this malloc */ +#define M_NLBLKS 2 /* UNUSED in this malloc */ +#define M_GRAIN 3 /* UNUSED in this malloc */ +#define M_KEEP 4 /* UNUSED in this malloc */ + +#endif + +/* mallopt options that actually do something */ + +#define M_TRIM_THRESHOLD -1 +#define M_TOP_PAD -2 +#define M_MMAP_THRESHOLD -3 +#define M_MMAP_MAX -4 + + + +#ifndef DEFAULT_TRIM_THRESHOLD +#define DEFAULT_TRIM_THRESHOLD (128L * 1024L) +#endif + +/* + M_TRIM_THRESHOLD is the maximum amount of unused top-most memory + to keep before releasing via malloc_trim in free(). + + Automatic trimming is mainly useful in long-lived programs. + Because trimming via sbrk can be slow on some systems, and can + sometimes be wasteful (in cases where programs immediately + afterward allocate more large chunks) the value should be high + enough so that your overall system performance would improve by + releasing. + + The trim threshold and the mmap control parameters (see below) + can be traded off with one another. Trimming and mmapping are + two different ways of releasing unused memory back to the + system. Between these two, it is often possible to keep + system-level demands of a long-lived program down to a bare + minimum. For example, in one test suite of sessions measuring + the XF86 X server on Linux, using a trim threshold of 128K and a + mmap threshold of 192K led to near-minimal long term resource + consumption. + + If you are using this malloc in a long-lived program, it should + pay to experiment with these values. As a rough guide, you + might set to a value close to the average size of a process + (program) running on your system. Releasing this much memory + would allow such a process to run in memory. Generally, it's + worth it to tune for trimming rather tham memory mapping when a + program undergoes phases where several large chunks are + allocated and released in ways that can reuse each other's + storage, perhaps mixed with phases where there are no such + chunks at all. And in well-behaved long-lived programs, + controlling release of large blocks via trimming versus mapping + is usually faster. + + However, in most programs, these parameters serve mainly as + protection against the system-level effects of carrying around + massive amounts of unneeded memory. Since frequent calls to + sbrk, mmap, and munmap otherwise degrade performance, the default + parameters are set to relatively high values that serve only as + safeguards. + + The default trim value is high enough to cause trimming only in + fairly extreme (by current memory consumption standards) cases. + It must be greater than page size to have any useful effect. To + disable trimming completely, you can set to (unsigned long)(-1); + + +*/ + + +#ifndef DEFAULT_TOP_PAD +#define DEFAULT_TOP_PAD (0) +#endif + +/* + M_TOP_PAD is the amount of extra `padding' space to allocate or + retain whenever sbrk is called. It is used in two ways internally: + + * When sbrk is called to extend the top of the arena to satisfy + a new malloc request, this much padding is added to the sbrk + request. + + * When malloc_trim is called automatically from free(), + it is used as the `pad' argument. + + In both cases, the actual amount of padding is rounded + so that the end of the arena is always a system page boundary. + + The main reason for using padding is to avoid calling sbrk so + often. Having even a small pad greatly reduces the likelihood + that nearly every malloc request during program start-up (or + after trimming) will invoke sbrk, which needlessly wastes + time. + + Automatic rounding-up to page-size units is normally sufficient + to avoid measurable overhead, so the default is 0. However, in + systems where sbrk is relatively slow, it can pay to increase + this value, at the expense of carrying around more memory than + the program needs. + +*/ + + +#ifndef DEFAULT_MMAP_THRESHOLD +#define DEFAULT_MMAP_THRESHOLD (128 * 1024) +#endif + +/* + + M_MMAP_THRESHOLD is the request size threshold for using mmap() + to service a request. Requests of at least this size that cannot + be allocated using already-existing space will be serviced via mmap. + (If enough normal freed space already exists it is used instead.) + + Using mmap segregates relatively large chunks of memory so that + they can be individually obtained and released from the host + system. A request serviced through mmap is never reused by any + other request (at least not directly; the system may just so + happen to remap successive requests to the same locations). + + Segregating space in this way has the benefit that mmapped space + can ALWAYS be individually released back to the system, which + helps keep the system level memory demands of a long-lived + program low. Mapped memory can never become `locked' between + other chunks, as can happen with normally allocated chunks, which + menas that even trimming via malloc_trim would not release them. + + However, it has the disadvantages that: + + 1. The space cannot be reclaimed, consolidated, and then + used to service later requests, as happens with normal chunks. + 2. It can lead to more wastage because of mmap page alignment + requirements + 3. It causes malloc performance to be more dependent on host + system memory management support routines which may vary in + implementation quality and may impose arbitrary + limitations. Generally, servicing a request via normal + malloc steps is faster than going through a system's mmap. + + All together, these considerations should lead you to use mmap + only for relatively large requests. + + +*/ + + + +#ifndef DEFAULT_MMAP_MAX +#if HAVE_MMAP +#define DEFAULT_MMAP_MAX (64) +#else +#define DEFAULT_MMAP_MAX (0) +#endif +#endif + +/* + M_MMAP_MAX is the maximum number of requests to simultaneously + service using mmap. This parameter exists because: + + 1. Some systems have a limited number of internal tables for + use by mmap. + 2. In most systems, overreliance on mmap can degrade overall + performance. + 3. If a program allocates many large regions, it is probably + better off using normal sbrk-based allocation routines that + can reclaim and reallocate normal heap memory. Using a + small value allows transition into this mode after the + first few allocations. + + Setting to 0 disables all use of mmap. If HAVE_MMAP is not set, + the default value is 0, and attempts to set it to non-zero values + in mallopt will fail. +*/ + + + + +/* + + Special defines for linux libc + + Except when compiled using these special defines for Linux libc + using weak aliases, this malloc is NOT designed to work in + multithreaded applications. No semaphores or other concurrency + control are provided to ensure that multiple malloc or free calls + don't run at the same time, which could be disasterous. A single + semaphore could be used across malloc, realloc, and free (which is + essentially the effect of the linux weak alias approach). It would + be hard to obtain finer granularity. + +*/ + + +#ifdef INTERNAL_LINUX_C_LIB + +#if __STD_C + +Void_t * __default_morecore_init (ptrdiff_t); +Void_t *(*__morecore)(ptrdiff_t) = __default_morecore_init; + +#else + +Void_t * __default_morecore_init (); +Void_t *(*__morecore)() = __default_morecore_init; + +#endif + +#define MORECORE (*__morecore) +#define MORECORE_FAILURE 0 +#define MORECORE_CLEARS 1 + +#else /* INTERNAL_LINUX_C_LIB */ + +#ifndef INTERNAL_NEWLIB +#if __STD_C +extern Void_t* sbrk(ptrdiff_t); +#else +extern Void_t* sbrk(); +#endif +#endif + +#ifndef MORECORE +#define MORECORE sbrk +#endif + +#ifndef MORECORE_FAILURE +#define MORECORE_FAILURE -1 +#endif + +#ifndef MORECORE_CLEARS +#define MORECORE_CLEARS 1 +#endif + +#endif /* INTERNAL_LINUX_C_LIB */ + +#if defined(INTERNAL_LINUX_C_LIB) && defined(__ELF__) + +#define cALLOc __libc_calloc +#define fREe __libc_free +#define mALLOc __libc_malloc +#define mEMALIGn __libc_memalign +#define rEALLOc __libc_realloc +#define vALLOc __libc_valloc +#define pvALLOc __libc_pvalloc +#define mALLINFo __libc_mallinfo +#define mALLOPt __libc_mallopt + +#pragma weak calloc = __libc_calloc +#pragma weak free = __libc_free +#pragma weak cfree = __libc_free +#pragma weak malloc = __libc_malloc +#pragma weak memalign = __libc_memalign +#pragma weak realloc = __libc_realloc +#pragma weak valloc = __libc_valloc +#pragma weak pvalloc = __libc_pvalloc +#pragma weak mallinfo = __libc_mallinfo +#pragma weak mallopt = __libc_mallopt + +#else + +#ifdef INTERNAL_NEWLIB + +#define cALLOc _calloc_r +#define fREe _free_r +#define mALLOc _malloc_r +#define mEMALIGn _memalign_r +#define rEALLOc _realloc_r +#define vALLOc _valloc_r +#define pvALLOc _pvalloc_r +#define mALLINFo _mallinfo_r +#define mALLOPt _mallopt_r + +#define malloc_stats _malloc_stats_r +#define malloc_trim _malloc_trim_r +#define malloc_usable_size _malloc_usable_size_r + +#define malloc_update_mallinfo __malloc_update_mallinfo + +#define malloc_av_ __malloc_av_ +#define malloc_current_mallinfo __malloc_current_mallinfo +#define malloc_max_sbrked_mem __malloc_max_sbrked_mem +#define malloc_max_total_mem __malloc_max_total_mem +#define malloc_sbrk_base __malloc_sbrk_base +#define malloc_top_pad __malloc_top_pad +#define malloc_trim_threshold __malloc_trim_threshold + +#else /* ! INTERNAL_NEWLIB */ + +#define cALLOc calloc +#define fREe free +#define mALLOc malloc +#define mEMALIGn memalign +#define rEALLOc realloc +#define vALLOc valloc +#define pvALLOc pvalloc +#define mALLINFo mallinfo +#define mALLOPt mallopt + +#endif /* ! INTERNAL_NEWLIB */ +#endif + +/* Public routines */ + +#if __STD_C + +Void_t* mALLOc(RARG size_t); +void fREe(RARG Void_t*); +Void_t* rEALLOc(RARG Void_t*, size_t); +Void_t* mEMALIGn(RARG size_t, size_t); +Void_t* vALLOc(RARG size_t); +Void_t* pvALLOc(RARG size_t); +Void_t* cALLOc(RARG size_t, size_t); +void cfree(Void_t*); +int malloc_trim(RARG size_t); +size_t malloc_usable_size(RARG Void_t*); +void malloc_stats(RONEARG); +int mALLOPt(RARG int, int); +struct mallinfo mALLINFo(RONEARG); +#else +Void_t* mALLOc(); +void fREe(); +Void_t* rEALLOc(); +Void_t* mEMALIGn(); +Void_t* vALLOc(); +Void_t* pvALLOc(); +Void_t* cALLOc(); +void cfree(); +int malloc_trim(); +size_t malloc_usable_size(); +void malloc_stats(); +int mALLOPt(); +struct mallinfo mALLINFo(); +#endif + + +#ifdef __cplusplus +}; /* end of extern "C" */ +#endif + +/* ---------- To make a malloc.h, end cutting here ------------ */ + + +/* + Emulation of sbrk for WIN32 + All code within the ifdef WIN32 is untested by me. +*/ + + +#ifdef WIN32 + +#define AlignPage(add) (((add) + (malloc_getpagesize-1)) & +~(malloc_getpagesize-1)) + +/* resrve 64MB to insure large contiguous space */ +#define RESERVED_SIZE (1024*1024*64) +#define NEXT_SIZE (2048*1024) +#define TOP_MEMORY ((unsigned long)2*1024*1024*1024) + +struct GmListElement; +typedef struct GmListElement GmListElement; + +struct GmListElement +{ + GmListElement* next; + void* base; +}; + +static GmListElement* head = 0; +static unsigned int gNextAddress = 0; +static unsigned int gAddressBase = 0; +static unsigned int gAllocatedSize = 0; + +static +GmListElement* makeGmListElement (void* bas) +{ + GmListElement* this; + this = (GmListElement*)(void*)LocalAlloc (0, sizeof (GmListElement)); + ASSERT (this); + if (this) + { + this->base = bas; + this->next = head; + head = this; + } + return this; +} + +void gcleanup () +{ + BOOL rval; + ASSERT ( (head == NULL) || (head->base == (void*)gAddressBase)); + if (gAddressBase && (gNextAddress - gAddressBase)) + { + rval = VirtualFree ((void*)gAddressBase, + gNextAddress - gAddressBase, + MEM_DECOMMIT); + ASSERT (rval); + } + while (head) + { + GmListElement* next = head->next; + rval = VirtualFree (head->base, 0, MEM_RELEASE); + ASSERT (rval); + LocalFree (head); + head = next; + } +} + +static +void* findRegion (void* start_address, unsigned long size) +{ + MEMORY_BASIC_INFORMATION info; + while ((unsigned long)start_address < TOP_MEMORY) + { + VirtualQuery (start_address, &info, sizeof (info)); + if (info.State != MEM_FREE) + start_address = (char*)info.BaseAddress + info.RegionSize; + else if (info.RegionSize >= size) + return start_address; + else + start_address = (char*)info.BaseAddress + info.RegionSize; + } + return NULL; + +} + + +void* wsbrk (long size) +{ + void* tmp; + if (size > 0) + { + if (gAddressBase == 0) + { + gAllocatedSize = max (RESERVED_SIZE, AlignPage (size)); + gNextAddress = gAddressBase = + (unsigned int)VirtualAlloc (NULL, gAllocatedSize, + MEM_RESERVE, PAGE_NOACCESS); + } else if (AlignPage (gNextAddress + size) > (gAddressBase + +gAllocatedSize)) + { + long new_size = max (NEXT_SIZE, AlignPage (size)); + void* new_address = (void*)(gAddressBase+gAllocatedSize); + do + { + new_address = findRegion (new_address, new_size); + + if (new_address == 0) + return (void*)-1; + + gAddressBase = gNextAddress = + (unsigned int)VirtualAlloc (new_address, new_size, + MEM_RESERVE, PAGE_NOACCESS); + // repeat in case of race condition + // The region that we found has been snagged + // by another thread + } + while (gAddressBase == 0); + + ASSERT (new_address == (void*)gAddressBase); + + gAllocatedSize = new_size; + + if (!makeGmListElement ((void*)gAddressBase)) + return (void*)-1; + } + if ((size + gNextAddress) > AlignPage (gNextAddress)) + { + void* res; + res = VirtualAlloc ((void*)AlignPage (gNextAddress), + (size + gNextAddress - + AlignPage (gNextAddress)), + MEM_COMMIT, PAGE_READWRITE); + if (res == 0) + return (void*)-1; + } + tmp = (void*)gNextAddress; + gNextAddress = (unsigned int)tmp + size; + return tmp; + } + else if (size < 0) + { + unsigned int alignedGoal = AlignPage (gNextAddress + size); + /* Trim by releasing the virtual memory */ + if (alignedGoal >= gAddressBase) + { + VirtualFree ((void*)alignedGoal, gNextAddress - alignedGoal, + MEM_DECOMMIT); + gNextAddress = gNextAddress + size; + return (void*)gNextAddress; + } + else + { + VirtualFree ((void*)gAddressBase, gNextAddress - gAddressBase, + MEM_DECOMMIT); + gNextAddress = gAddressBase; + return (void*)-1; + } + } + else + { + return (void*)gNextAddress; + } +} + +#endif + + + +/* + Type declarations +*/ + + +struct malloc_chunk +{ + INTERNAL_SIZE_T prev_size; /* Size of previous chunk (if free). */ + INTERNAL_SIZE_T size; /* Size in bytes, including overhead. */ + struct malloc_chunk* fd; /* double links -- used only if free. */ + struct malloc_chunk* bk; +}; + +typedef struct malloc_chunk* mchunkptr; + +/* + + malloc_chunk details: + + (The following includes lightly edited explanations by Colin Plumb.) + + Chunks of memory are maintained using a `boundary tag' method as + described in e.g., Knuth or Standish. (See the paper by Paul + Wilson ftp://ftp.cs.utexas.edu/pub/garbage/allocsrv.ps for a + survey of such techniques.) Sizes of free chunks are stored both + in the front of each chunk and at the end. This makes + consolidating fragmented chunks into bigger chunks very fast. The + size fields also hold bits representing whether chunks are free or + in use. + + An allocated chunk looks like this: + + + chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Size of previous chunk, if allocated | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Size of chunk, in bytes |P| + mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | User data starts here... . + . . + . (malloc_usable_space() bytes) . + . | +nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Size of chunk | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + + Where "chunk" is the front of the chunk for the purpose of most of + the malloc code, but "mem" is the pointer that is returned to the + user. "Nextchunk" is the beginning of the next contiguous chunk. + + Chunks always begin on even word boundries, so the mem portion + (which is returned to the user) is also on an even word boundary, and + thus double-word aligned. + + Free chunks are stored in circular doubly-linked lists, and look like this: + + chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Size of previous chunk | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + `head:' | Size of chunk, in bytes |P| + mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Forward pointer to next chunk in list | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Back pointer to previous chunk in list | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Unused space (may be 0 bytes long) . + . . + . | +nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + `foot:' | Size of chunk, in bytes | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + The P (PREV_INUSE) bit, stored in the unused low-order bit of the + chunk size (which is always a multiple of two words), is an in-use + bit for the *previous* chunk. If that bit is *clear*, then the + word before the current chunk size contains the previous chunk + size, and can be used to find the front of the previous chunk. + (The very first chunk allocated always has this bit set, + preventing access to non-existent (or non-owned) memory.) + + Note that the `foot' of the current chunk is actually represented + as the prev_size of the NEXT chunk. (This makes it easier to + deal with alignments etc). + + The two exceptions to all this are + + 1. The special chunk `top', which doesn't bother using the + trailing size field since there is no + next contiguous chunk that would have to index off it. (After + initialization, `top' is forced to always exist. If it would + become less than MINSIZE bytes long, it is replenished via + malloc_extend_top.) + + 2. Chunks allocated via mmap, which have the second-lowest-order + bit (IS_MMAPPED) set in their size fields. Because they are + never merged or traversed from any other chunk, they have no + foot size or inuse information. + + Available chunks are kept in any of several places (all declared below): + + * `av': An array of chunks serving as bin headers for consolidated + chunks. Each bin is doubly linked. The bins are approximately + proportionally (log) spaced. There are a lot of these bins + (128). This may look excessive, but works very well in + practice. All procedures maintain the invariant that no + consolidated chunk physically borders another one. Chunks in + bins are kept in size order, with ties going to the + approximately least recently used chunk. + + The chunks in each bin are maintained in decreasing sorted order by + size. This is irrelevant for the small bins, which all contain + the same-sized chunks, but facilitates best-fit allocation for + larger chunks. (These lists are just sequential. Keeping them in + order almost never requires enough traversal to warrant using + fancier ordered data structures.) Chunks of the same size are + linked with the most recently freed at the front, and allocations + are taken from the back. This results in LRU or FIFO allocation + order, which tends to give each chunk an equal opportunity to be + consolidated with adjacent freed chunks, resulting in larger free + chunks and less fragmentation. + + * `top': The top-most available chunk (i.e., the one bordering the + end of available memory) is treated specially. It is never + included in any bin, is used only if no other chunk is + available, and is released back to the system if it is very + large (see M_TRIM_THRESHOLD). + + * `last_remainder': A bin holding only the remainder of the + most recently split (non-top) chunk. This bin is checked + before other non-fitting chunks, so as to provide better + locality for runs of sequentially allocated chunks. + + * Implicitly, through the host system's memory mapping tables. + If supported, requests greater than a threshold are usually + serviced via calls to mmap, and then later released via munmap. + +*/ + + + + + + +/* sizes, alignments */ + +#define SIZE_SZ (sizeof(INTERNAL_SIZE_T)) +#ifndef MALLOC_ALIGNMENT +#define MALLOC_ALIGN 8 +#define MALLOC_ALIGNMENT (SIZE_SZ + SIZE_SZ) +#else +#define MALLOC_ALIGN MALLOC_ALIGNMENT +#endif +#define MALLOC_ALIGN_MASK (MALLOC_ALIGNMENT - 1) +#define MINSIZE (sizeof(struct malloc_chunk)) + +/* conversion from malloc headers to user pointers, and back */ + +#define chunk2mem(p) ((Void_t*)((char*)(p) + 2*SIZE_SZ)) +#define mem2chunk(mem) ((mchunkptr)((char*)(mem) - 2*SIZE_SZ)) + +/* pad request bytes into a usable size */ + +#define request2size(req) \ + (((long)((req) + (SIZE_SZ + MALLOC_ALIGN_MASK)) < \ + (long)(MINSIZE + MALLOC_ALIGN_MASK)) ? ((MINSIZE + MALLOC_ALIGN_MASK) & ~(MALLOC_ALIGN_MASK)) : \ + (((req) + (SIZE_SZ + MALLOC_ALIGN_MASK)) & ~(MALLOC_ALIGN_MASK))) + +/* Check if m has acceptable alignment */ + +#define aligned_OK(m) (((unsigned long)((m)) & (MALLOC_ALIGN_MASK)) == 0) + + + + +/* + Physical chunk operations +*/ + + +/* size field is or'ed with PREV_INUSE when previous adjacent chunk in use */ + +#define PREV_INUSE 0x1 + +/* size field is or'ed with IS_MMAPPED if the chunk was obtained with mmap() */ + +#define IS_MMAPPED 0x2 + +/* Bits to mask off when extracting size */ + +#define SIZE_BITS (PREV_INUSE|IS_MMAPPED) + + +/* Ptr to next physical malloc_chunk. */ + +#define next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->size & ~PREV_INUSE) )) + +/* Ptr to previous physical malloc_chunk */ + +#define prev_chunk(p)\ + ((mchunkptr)( ((char*)(p)) - ((p)->prev_size) )) + + +/* Treat space at ptr + offset as a chunk */ + +#define chunk_at_offset(p, s) ((mchunkptr)(((char*)(p)) + (s))) + + + + +/* + Dealing with use bits +*/ + +/* extract p's inuse bit */ + +#define inuse(p)\ +((((mchunkptr)(((char*)(p))+((p)->size & ~PREV_INUSE)))->size) & PREV_INUSE) + +/* extract inuse bit of previous chunk */ + +#define prev_inuse(p) ((p)->size & PREV_INUSE) + +/* check for mmap()'ed chunk */ + +#define chunk_is_mmapped(p) ((p)->size & IS_MMAPPED) + +/* set/clear chunk as in use without otherwise disturbing */ + +#define set_inuse(p)\ +((mchunkptr)(((char*)(p)) + ((p)->size & ~PREV_INUSE)))->size |= PREV_INUSE + +#define clear_inuse(p)\ +((mchunkptr)(((char*)(p)) + ((p)->size & ~PREV_INUSE)))->size &= ~(PREV_INUSE) + +/* check/set/clear inuse bits in known places */ + +#define inuse_bit_at_offset(p, s)\ + (((mchunkptr)(((char*)(p)) + (s)))->size & PREV_INUSE) + +#define set_inuse_bit_at_offset(p, s)\ + (((mchunkptr)(((char*)(p)) + (s)))->size |= PREV_INUSE) + +#define clear_inuse_bit_at_offset(p, s)\ + (((mchunkptr)(((char*)(p)) + (s)))->size &= ~(PREV_INUSE)) + + + + +/* + Dealing with size fields +*/ + +/* Get size, ignoring use bits */ + +#define chunksize(p) ((p)->size & ~(SIZE_BITS)) + +/* Set size at head, without disturbing its use bit */ + +#define set_head_size(p, s) ((p)->size = (((p)->size & PREV_INUSE) | (s))) + +/* Set size/use ignoring previous bits in header */ + +#define set_head(p, s) ((p)->size = (s)) + +/* Set size at footer (only when chunk is not in use) */ + +#define set_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_size = (s)) + + + + + +/* + Bins + + The bins, `av_' are an array of pairs of pointers serving as the + heads of (initially empty) doubly-linked lists of chunks, laid out + in a way so that each pair can be treated as if it were in a + malloc_chunk. (This way, the fd/bk offsets for linking bin heads + and chunks are the same). + + Bins for sizes < 512 bytes contain chunks of all the same size, spaced + 8 bytes apart. Larger bins are approximately logarithmically + spaced. (See the table below.) The `av_' array is never mentioned + directly in the code, but instead via bin access macros. + + Bin layout: + + 64 bins of size 8 + 32 bins of size 64 + 16 bins of size 512 + 8 bins of size 4096 + 4 bins of size 32768 + 2 bins of size 262144 + 1 bin of size what's left + + There is actually a little bit of slop in the numbers in bin_index + for the sake of speed. This makes no difference elsewhere. + + The special chunks `top' and `last_remainder' get their own bins, + (this is implemented via yet more trickery with the av_ array), + although `top' is never properly linked to its bin since it is + always handled specially. + +*/ + +#ifdef SEPARATE_OBJECTS +#define av_ malloc_av_ +#endif + +#define NAV 128 /* number of bins */ + +typedef struct malloc_chunk* mbinptr; + +/* access macros */ + +#define bin_at(i) ((mbinptr)((char*)&(av_[2*(i) + 2]) - 2*SIZE_SZ)) +#define next_bin(b) ((mbinptr)((char*)(b) + 2 * sizeof(mbinptr))) +#define prev_bin(b) ((mbinptr)((char*)(b) - 2 * sizeof(mbinptr))) + +/* + The first 2 bins are never indexed. The corresponding av_ cells are instead + used for bookkeeping. This is not to save space, but to simplify + indexing, maintain locality, and avoid some initialization tests. +*/ + +#define top (bin_at(0)->fd) /* The topmost chunk */ +#define last_remainder (bin_at(1)) /* remainder from last split */ + + +/* + Because top initially points to its own bin with initial + zero size, thus forcing extension on the first malloc request, + we avoid having any special code in malloc to check whether + it even exists yet. But we still need to in malloc_extend_top. +*/ + +#define initial_top ((mchunkptr)(bin_at(0))) + +/* Helper macro to initialize bins */ + +#define IAV(i) bin_at(i), bin_at(i) + +#ifdef DEFINE_MALLOC +STATIC mbinptr av_[NAV * 2 + 2] = { + 0, 0, + IAV(0), IAV(1), IAV(2), IAV(3), IAV(4), IAV(5), IAV(6), IAV(7), + IAV(8), IAV(9), IAV(10), IAV(11), IAV(12), IAV(13), IAV(14), IAV(15), + IAV(16), IAV(17), IAV(18), IAV(19), IAV(20), IAV(21), IAV(22), IAV(23), + IAV(24), IAV(25), IAV(26), IAV(27), IAV(28), IAV(29), IAV(30), IAV(31), + IAV(32), IAV(33), IAV(34), IAV(35), IAV(36), IAV(37), IAV(38), IAV(39), + IAV(40), IAV(41), IAV(42), IAV(43), IAV(44), IAV(45), IAV(46), IAV(47), + IAV(48), IAV(49), IAV(50), IAV(51), IAV(52), IAV(53), IAV(54), IAV(55), + IAV(56), IAV(57), IAV(58), IAV(59), IAV(60), IAV(61), IAV(62), IAV(63), + IAV(64), IAV(65), IAV(66), IAV(67), IAV(68), IAV(69), IAV(70), IAV(71), + IAV(72), IAV(73), IAV(74), IAV(75), IAV(76), IAV(77), IAV(78), IAV(79), + IAV(80), IAV(81), IAV(82), IAV(83), IAV(84), IAV(85), IAV(86), IAV(87), + IAV(88), IAV(89), IAV(90), IAV(91), IAV(92), IAV(93), IAV(94), IAV(95), + IAV(96), IAV(97), IAV(98), IAV(99), IAV(100), IAV(101), IAV(102), IAV(103), + IAV(104), IAV(105), IAV(106), IAV(107), IAV(108), IAV(109), IAV(110), IAV(111), + IAV(112), IAV(113), IAV(114), IAV(115), IAV(116), IAV(117), IAV(118), IAV(119), + IAV(120), IAV(121), IAV(122), IAV(123), IAV(124), IAV(125), IAV(126), IAV(127) +}; +#else +extern mbinptr av_[NAV * 2 + 2]; +#endif + + + +/* field-extraction macros */ + +#define first(b) ((b)->fd) +#define last(b) ((b)->bk) + +/* + Indexing into bins +*/ + +#define bin_index(sz) \ +(((((unsigned long)(sz)) >> 9) == 0) ? (((unsigned long)(sz)) >> 3): \ + ((((unsigned long)(sz)) >> 9) <= 4) ? 56 + (((unsigned long)(sz)) >> 6): \ + ((((unsigned long)(sz)) >> 9) <= 20) ? 91 + (((unsigned long)(sz)) >> 9): \ + ((((unsigned long)(sz)) >> 9) <= 84) ? 110 + (((unsigned long)(sz)) >> 12): \ + ((((unsigned long)(sz)) >> 9) <= 340) ? 119 + (((unsigned long)(sz)) >> 15): \ + ((((unsigned long)(sz)) >> 9) <= 1364) ? 124 + (((unsigned long)(sz)) >> 18): \ + 126) +/* + bins for chunks < 512 are all spaced SMALLBIN_WIDTH bytes apart, and hold + identically sized chunks. This is exploited in malloc. +*/ + +#define MAX_SMALLBIN_SIZE 512 +#define SMALLBIN_WIDTH 8 +#define SMALLBIN_WIDTH_BITS 3 +#define MAX_SMALLBIN (MAX_SMALLBIN_SIZE / SMALLBIN_WIDTH) - 1 + +#define smallbin_index(sz) (((unsigned long)(sz)) >> SMALLBIN_WIDTH_BITS) + +/* + Requests are `small' if both the corresponding and the next bin are small +*/ + +#define is_small_request(nb) (nb < MAX_SMALLBIN_SIZE - SMALLBIN_WIDTH) + + + +/* + To help compensate for the large number of bins, a one-level index + structure is used for bin-by-bin searching. `binblocks' is a + one-word bitvector recording whether groups of BINBLOCKWIDTH bins + have any (possibly) non-empty bins, so they can be skipped over + all at once during during traversals. The bits are NOT always + cleared as soon as all bins in a block are empty, but instead only + when all are noticed to be empty during traversal in malloc. +*/ + +#define BINBLOCKWIDTH 4 /* bins per block */ + +#define binblocks (bin_at(0)->size) /* bitvector of nonempty blocks */ + +/* bin<->block macros */ + +#define idx2binblock(ix) ((unsigned long)1 << (ix / BINBLOCKWIDTH)) +#define mark_binblock(ii) (binblocks |= idx2binblock(ii)) +#define clear_binblock(ii) (binblocks &= ~(idx2binblock(ii))) + + + + + +/* Other static bookkeeping data */ + +#ifdef SEPARATE_OBJECTS +#define trim_threshold malloc_trim_threshold +#define top_pad malloc_top_pad +#define n_mmaps_max malloc_n_mmaps_max +#define mmap_threshold malloc_mmap_threshold +#define sbrk_base malloc_sbrk_base +#define max_sbrked_mem malloc_max_sbrked_mem +#define max_total_mem malloc_max_total_mem +#define current_mallinfo malloc_current_mallinfo +#define n_mmaps malloc_n_mmaps +#define max_n_mmaps malloc_max_n_mmaps +#define mmapped_mem malloc_mmapped_mem +#define max_mmapped_mem malloc_max_mmapped_mem +#endif + +/* variables holding tunable values */ + +#ifdef DEFINE_MALLOC + +STATIC unsigned long trim_threshold = DEFAULT_TRIM_THRESHOLD; +STATIC unsigned long top_pad = DEFAULT_TOP_PAD; +#if HAVE_MMAP +STATIC unsigned int n_mmaps_max = DEFAULT_MMAP_MAX; +STATIC unsigned long mmap_threshold = DEFAULT_MMAP_THRESHOLD; +#endif + +/* The first value returned from sbrk */ +STATIC char* sbrk_base = (char*)(-1); + +/* The maximum memory obtained from system via sbrk */ +STATIC unsigned long max_sbrked_mem = 0; + +/* The maximum via either sbrk or mmap */ +STATIC unsigned long max_total_mem = 0; + +/* internal working copy of mallinfo */ +STATIC struct mallinfo current_mallinfo = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + +#if HAVE_MMAP + +/* Tracking mmaps */ + +STATIC unsigned int n_mmaps = 0; +STATIC unsigned int max_n_mmaps = 0; +STATIC unsigned long mmapped_mem = 0; +STATIC unsigned long max_mmapped_mem = 0; + +#endif + +#else /* ! DEFINE_MALLOC */ + +extern unsigned long trim_threshold; +extern unsigned long top_pad; +#if HAVE_MMAP +extern unsigned int n_mmaps_max; +extern unsigned long mmap_threshold; +#endif +extern char* sbrk_base; +extern unsigned long max_sbrked_mem; +extern unsigned long max_total_mem; +extern struct mallinfo current_mallinfo; +#if HAVE_MMAP +extern unsigned int n_mmaps; +extern unsigned int max_n_mmaps; +extern unsigned long mmapped_mem; +extern unsigned long max_mmapped_mem; +#endif + +#endif /* ! DEFINE_MALLOC */ + +/* The total memory obtained from system via sbrk */ +#define sbrked_mem (current_mallinfo.arena) + + + +/* + Debugging support +*/ + +#if DEBUG + + +/* + These routines make a number of assertions about the states + of data structures that should be true at all times. If any + are not true, it's very likely that a user program has somehow + trashed memory. (It's also possible that there is a coding error + in malloc. In which case, please report it!) +*/ + +#if __STD_C +static void do_check_chunk(mchunkptr p) +#else +static void do_check_chunk(p) mchunkptr p; +#endif +{ + INTERNAL_SIZE_T sz = p->size & ~PREV_INUSE; + + /* No checkable chunk is mmapped */ + assert(!chunk_is_mmapped(p)); + + /* Check for legal address ... */ + assert((char*)p >= sbrk_base); + if (p != top) + assert((char*)p + sz <= (char*)top); + else + assert((char*)p + sz <= sbrk_base + sbrked_mem); + +} + + +#if __STD_C +static void do_check_free_chunk(mchunkptr p) +#else +static void do_check_free_chunk(p) mchunkptr p; +#endif +{ + INTERNAL_SIZE_T sz = p->size & ~PREV_INUSE; + mchunkptr next = chunk_at_offset(p, sz); + + do_check_chunk(p); + + /* Check whether it claims to be free ... */ + assert(!inuse(p)); + + /* Unless a special marker, must have OK fields */ + if ((long)sz >= (long)MINSIZE) + { + assert((sz & MALLOC_ALIGN_MASK) == 0); + assert(aligned_OK(chunk2mem(p))); + /* ... matching footer field */ + assert(next->prev_size == sz); + /* ... and is fully consolidated */ + assert(prev_inuse(p)); + assert (next == top || inuse(next)); + + /* ... and has minimally sane links */ + assert(p->fd->bk == p); + assert(p->bk->fd == p); + } + else /* markers are always of size SIZE_SZ */ + assert(sz == SIZE_SZ); +} + +#if __STD_C +static void do_check_inuse_chunk(mchunkptr p) +#else +static void do_check_inuse_chunk(p) mchunkptr p; +#endif +{ + mchunkptr next = next_chunk(p); + do_check_chunk(p); + + /* Check whether it claims to be in use ... */ + assert(inuse(p)); + + /* ... and is surrounded by OK chunks. + Since more things can be checked with free chunks than inuse ones, + if an inuse chunk borders them and debug is on, it's worth doing them. + */ + if (!prev_inuse(p)) + { + mchunkptr prv = prev_chunk(p); + assert(next_chunk(prv) == p); + do_check_free_chunk(prv); + } + if (next == top) + { + assert(prev_inuse(next)); + assert(chunksize(next) >= MINSIZE); + } + else if (!inuse(next)) + do_check_free_chunk(next); + +} + +#if __STD_C +static void do_check_malloced_chunk(mchunkptr p, INTERNAL_SIZE_T s) +#else +static void do_check_malloced_chunk(p, s) mchunkptr p; INTERNAL_SIZE_T s; +#endif +{ + INTERNAL_SIZE_T sz = p->size & ~PREV_INUSE; + long room = long_sub_size_t(sz, s); + + do_check_inuse_chunk(p); + + /* Legal size ... */ + assert((long)sz >= (long)MINSIZE); + assert((sz & MALLOC_ALIGN_MASK) == 0); + assert(room >= 0); + assert(room < (long)MINSIZE); + + /* ... and alignment */ + assert(aligned_OK(chunk2mem(p))); + + + /* ... and was allocated at front of an available chunk */ + assert(prev_inuse(p)); + +} + + +#define check_free_chunk(P) do_check_free_chunk(P) +#define check_inuse_chunk(P) do_check_inuse_chunk(P) +#define check_chunk(P) do_check_chunk(P) +#define check_malloced_chunk(P,N) do_check_malloced_chunk(P,N) +#else +#define check_free_chunk(P) +#define check_inuse_chunk(P) +#define check_chunk(P) +#define check_malloced_chunk(P,N) +#endif + + + +/* + Macro-based internal utilities +*/ + + +/* + Linking chunks in bin lists. + Call these only with variables, not arbitrary expressions, as arguments. +*/ + +/* + Place chunk p of size s in its bin, in size order, + putting it ahead of others of same size. +*/ + + +#define frontlink(P, S, IDX, BK, FD) \ +{ \ + if (S < MAX_SMALLBIN_SIZE) \ + { \ + IDX = smallbin_index(S); \ + mark_binblock(IDX); \ + BK = bin_at(IDX); \ + FD = BK->fd; \ + P->bk = BK; \ + P->fd = FD; \ + FD->bk = BK->fd = P; \ + } \ + else \ + { \ + IDX = bin_index(S); \ + BK = bin_at(IDX); \ + FD = BK->fd; \ + if (FD == BK) mark_binblock(IDX); \ + else \ + { \ + while (FD != BK && S < chunksize(FD)) FD = FD->fd; \ + BK = FD->bk; \ + } \ + P->bk = BK; \ + P->fd = FD; \ + FD->bk = BK->fd = P; \ + } \ +} + + +/* take a chunk off a list */ + +#define unlink(P, BK, FD) \ +{ \ + BK = P->bk; \ + FD = P->fd; \ + FD->bk = BK; \ + BK->fd = FD; \ +} \ + +/* Place p as the last remainder */ + +#define link_last_remainder(P) \ +{ \ + last_remainder->fd = last_remainder->bk = P; \ + P->fd = P->bk = last_remainder; \ +} + +/* Clear the last_remainder bin */ + +#define clear_last_remainder \ + (last_remainder->fd = last_remainder->bk = last_remainder) + + + + + + +/* Routines dealing with mmap(). */ + +#if HAVE_MMAP + +#ifdef DEFINE_MALLOC + +#if __STD_C +static mchunkptr mmap_chunk(size_t size) +#else +static mchunkptr mmap_chunk(size) size_t size; +#endif +{ + size_t page_mask = malloc_getpagesize - 1; + mchunkptr p; + +#ifndef MAP_ANONYMOUS + static int fd = -1; +#endif + + if(n_mmaps >= n_mmaps_max) return 0; /* too many regions */ + + /* For mmapped chunks, the overhead is one SIZE_SZ unit larger, because + * there is no following chunk whose prev_size field could be used. + */ + size = (size + SIZE_SZ + page_mask) & ~page_mask; + +#ifdef MAP_ANONYMOUS + p = (mchunkptr)mmap(0, size, PROT_READ|PROT_WRITE, + MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); +#else /* !MAP_ANONYMOUS */ + if (fd < 0) + { + fd = open("/dev/zero", O_RDWR); + if(fd < 0) return 0; + } + p = (mchunkptr)mmap(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); +#endif + + if(p == (mchunkptr)-1) return 0; + + n_mmaps++; + if (n_mmaps > max_n_mmaps) max_n_mmaps = n_mmaps; + + /* We demand that eight bytes into a page must be 8-byte aligned. */ + assert(aligned_OK(chunk2mem(p))); + + /* The offset to the start of the mmapped region is stored + * in the prev_size field of the chunk; normally it is zero, + * but that can be changed in memalign(). + */ + p->prev_size = 0; + set_head(p, size|IS_MMAPPED); + + mmapped_mem += size; + if ((unsigned long)mmapped_mem > (unsigned long)max_mmapped_mem) + max_mmapped_mem = mmapped_mem; + if ((unsigned long)(mmapped_mem + sbrked_mem) > (unsigned long)max_total_mem) + max_total_mem = mmapped_mem + sbrked_mem; + return p; +} + +#endif /* DEFINE_MALLOC */ + +#ifdef SEPARATE_OBJECTS +#define munmap_chunk malloc_munmap_chunk +#endif + +#ifdef DEFINE_FREE + +#if __STD_C +STATIC void munmap_chunk(mchunkptr p) +#else +STATIC void munmap_chunk(p) mchunkptr p; +#endif +{ + INTERNAL_SIZE_T size = chunksize(p); + int ret; + + assert (chunk_is_mmapped(p)); + assert(! ((char*)p >= sbrk_base && (char*)p < sbrk_base + sbrked_mem)); + assert((n_mmaps > 0)); + assert(((p->prev_size + size) & (malloc_getpagesize-1)) == 0); + + n_mmaps--; + mmapped_mem -= (size + p->prev_size); + + ret = munmap((char *)p - p->prev_size, size + p->prev_size); + + /* munmap returns non-zero on failure */ + assert(ret == 0); +} + +#else /* ! DEFINE_FREE */ + +#if __STD_C +extern void munmap_chunk(mchunkptr); +#else +extern void munmap_chunk(); +#endif + +#endif /* ! DEFINE_FREE */ + +#if HAVE_MREMAP + +#ifdef DEFINE_REALLOC + +#if __STD_C +static mchunkptr mremap_chunk(mchunkptr p, size_t new_size) +#else +static mchunkptr mremap_chunk(p, new_size) mchunkptr p; size_t new_size; +#endif +{ + size_t page_mask = malloc_getpagesize - 1; + INTERNAL_SIZE_T offset = p->prev_size; + INTERNAL_SIZE_T size = chunksize(p); + char *cp; + + assert (chunk_is_mmapped(p)); + assert(! ((char*)p >= sbrk_base && (char*)p < sbrk_base + sbrked_mem)); + assert((n_mmaps > 0)); + assert(((size + offset) & (malloc_getpagesize-1)) == 0); + + /* Note the extra SIZE_SZ overhead as in mmap_chunk(). */ + new_size = (new_size + offset + SIZE_SZ + page_mask) & ~page_mask; + + cp = (char *)mremap((char *)p - offset, size + offset, new_size, 1); + + if (cp == (char *)-1) return 0; + + p = (mchunkptr)(cp + offset); + + assert(aligned_OK(chunk2mem(p))); + + assert((p->prev_size == offset)); + set_head(p, (new_size - offset)|IS_MMAPPED); + + mmapped_mem -= size + offset; + mmapped_mem += new_size; + if ((unsigned long)mmapped_mem > (unsigned long)max_mmapped_mem) + max_mmapped_mem = mmapped_mem; + if ((unsigned long)(mmapped_mem + sbrked_mem) > (unsigned long)max_total_mem) + max_total_mem = mmapped_mem + sbrked_mem; + return p; +} + +#endif /* DEFINE_REALLOC */ + +#endif /* HAVE_MREMAP */ + +#endif /* HAVE_MMAP */ + + + + +#ifdef DEFINE_MALLOC + +/* + Extend the top-most chunk by obtaining memory from system. + Main interface to sbrk (but see also malloc_trim). +*/ + +#if __STD_C +static void malloc_extend_top(RARG INTERNAL_SIZE_T nb) +#else +static void malloc_extend_top(RARG nb) RDECL INTERNAL_SIZE_T nb; +#endif +{ + char* brk; /* return value from sbrk */ + INTERNAL_SIZE_T front_misalign; /* unusable bytes at front of sbrked space */ + INTERNAL_SIZE_T correction; /* bytes for 2nd sbrk call */ + char* new_brk; /* return of 2nd sbrk call */ + INTERNAL_SIZE_T top_size; /* new size of top chunk */ + + mchunkptr old_top = top; /* Record state of old top */ + INTERNAL_SIZE_T old_top_size = chunksize(old_top); + char* old_end = (char*)(chunk_at_offset(old_top, old_top_size)); + + /* Pad request with top_pad plus minimal overhead */ + + INTERNAL_SIZE_T sbrk_size = nb + top_pad + MINSIZE; + unsigned long pagesz = malloc_getpagesize; + + /* If not the first time through, round to preserve page boundary */ + /* Otherwise, we need to correct to a page size below anyway. */ + /* (We also correct below if an intervening foreign sbrk call.) */ + + if (sbrk_base != (char*)(-1)) + sbrk_size = (sbrk_size + (pagesz - 1)) & ~(pagesz - 1); + + brk = (char*)(MORECORE (sbrk_size)); + + /* Fail if sbrk failed or if a foreign sbrk call killed our space */ + if (brk == (char*)(MORECORE_FAILURE) || + (brk < old_end && old_top != initial_top)) + return; + + sbrked_mem += sbrk_size; + + if (brk == old_end) /* can just add bytes to current top */ + { + top_size = sbrk_size + old_top_size; + set_head(top, top_size | PREV_INUSE); + } + else + { + if (sbrk_base == (char*)(-1)) /* First time through. Record base */ + sbrk_base = brk; + else /* Someone else called sbrk(). Count those bytes as sbrked_mem. */ + sbrked_mem += brk - (char*)old_end; + + /* Guarantee alignment of first new chunk made from this space */ + front_misalign = (POINTER_UINT)chunk2mem(brk) & MALLOC_ALIGN_MASK; + if (front_misalign > 0) + { + correction = (MALLOC_ALIGNMENT) - front_misalign; + brk += correction; + } + else + correction = 0; + + /* Guarantee the next brk will be at a page boundary */ + correction += pagesz - ((POINTER_UINT)(brk + sbrk_size) & (pagesz - 1)); + + /* Allocate correction */ + new_brk = (char*)(MORECORE (correction)); + if (new_brk == (char*)(MORECORE_FAILURE)) return; + + sbrked_mem += correction; + + top = (mchunkptr)brk; + top_size = new_brk - brk + correction; + set_head(top, top_size | PREV_INUSE); + + if (old_top != initial_top) + { + + /* There must have been an intervening foreign sbrk call. */ + /* A double fencepost is necessary to prevent consolidation */ + + /* If not enough space to do this, then user did something very wrong */ + if (old_top_size < MINSIZE) + { + set_head(top, PREV_INUSE); /* will force null return from malloc */ + return; + } + + /* Also keep size a multiple of MALLOC_ALIGNMENT */ + old_top_size = (old_top_size - 3*SIZE_SZ) & ~MALLOC_ALIGN_MASK; + set_head_size(old_top, old_top_size); + chunk_at_offset(old_top, old_top_size )->size = + SIZE_SZ|PREV_INUSE; + chunk_at_offset(old_top, old_top_size + SIZE_SZ)->size = + SIZE_SZ|PREV_INUSE; + /* If possible, release the rest. */ + if (old_top_size >= MINSIZE) + fREe(RCALL chunk2mem(old_top)); + } + } + + if ((unsigned long)sbrked_mem > (unsigned long)max_sbrked_mem) + max_sbrked_mem = sbrked_mem; +#if HAVE_MMAP + if ((unsigned long)(mmapped_mem + sbrked_mem) > (unsigned long)max_total_mem) + max_total_mem = mmapped_mem + sbrked_mem; +#else + if ((unsigned long)(sbrked_mem) > (unsigned long)max_total_mem) + max_total_mem = sbrked_mem; +#endif + + /* We always land on a page boundary */ + assert(((unsigned long)((char*)top + top_size) & (pagesz - 1)) == 0); +} + +#endif /* DEFINE_MALLOC */ + + +/* Main public routines */ + +#ifdef DEFINE_MALLOC + +/* + Malloc Algorthim: + + The requested size is first converted into a usable form, `nb'. + This currently means to add 4 bytes overhead plus possibly more to + obtain 8-byte alignment and/or to obtain a size of at least + MINSIZE (currently 16 bytes), the smallest allocatable size. + (All fits are considered `exact' if they are within MINSIZE bytes.) + + From there, the first successful of the following steps is taken: + + 1. The bin corresponding to the request size is scanned, and if + a chunk of exactly the right size is found, it is taken. + + 2. The most recently remaindered chunk is used if it is big + enough. This is a form of (roving) first fit, used only in + the absence of exact fits. Runs of consecutive requests use + the remainder of the chunk used for the previous such request + whenever possible. This limited use of a first-fit style + allocation strategy tends to give contiguous chunks + coextensive lifetimes, which improves locality and can reduce + fragmentation in the long run. + + 3. Other bins are scanned in increasing size order, using a + chunk big enough to fulfill the request, and splitting off + any remainder. This search is strictly by best-fit; i.e., + the smallest (with ties going to approximately the least + recently used) chunk that fits is selected. + + 4. If large enough, the chunk bordering the end of memory + (`top') is split off. (This use of `top' is in accord with + the best-fit search rule. In effect, `top' is treated as + larger (and thus less well fitting) than any other available + chunk since it can be extended to be as large as necessary + (up to system limitations). + + 5. If the request size meets the mmap threshold and the + system supports mmap, and there are few enough currently + allocated mmapped regions, and a call to mmap succeeds, + the request is allocated via direct memory mapping. + + 6. Otherwise, the top of memory is extended by + obtaining more space from the system (normally using sbrk, + but definable to anything else via the MORECORE macro). + Memory is gathered from the system (in system page-sized + units) in a way that allows chunks obtained across different + sbrk calls to be consolidated, but does not require + contiguous memory. Thus, it should be safe to intersperse + mallocs with other sbrk calls. + + + All allocations are made from the the `lowest' part of any found + chunk. (The implementation invariant is that prev_inuse is + always true of any allocated chunk; i.e., that each allocated + chunk borders either a previously allocated and still in-use chunk, + or the base of its memory arena.) + +*/ + +#if __STD_C +Void_t* mALLOc(RARG size_t bytes) +#else +Void_t* mALLOc(RARG bytes) RDECL size_t bytes; +#endif +{ +#ifdef MALLOC_PROVIDED + + malloc (bytes); + +#else + + mchunkptr victim; /* inspected/selected chunk */ + INTERNAL_SIZE_T victim_size; /* its size */ + int idx; /* index for bin traversal */ + mbinptr bin; /* associated bin */ + mchunkptr remainder; /* remainder from a split */ + long remainder_size; /* its size */ + int remainder_index; /* its bin index */ + unsigned long block; /* block traverser bit */ + int startidx; /* first bin of a traversed block */ + mchunkptr fwd; /* misc temp for linking */ + mchunkptr bck; /* misc temp for linking */ + mbinptr q; /* misc temp */ + + INTERNAL_SIZE_T nb = request2size(bytes); /* padded request size; */ + + MALLOC_LOCK; + + /* Check for exact match in a bin */ + + if (is_small_request(nb)) /* Faster version for small requests */ + { + idx = smallbin_index(nb); + + /* No traversal or size check necessary for small bins. */ + + q = bin_at(idx); + victim = last(q); + +#if MALLOC_ALIGN != 16 + /* Also scan the next one, since it would have a remainder < MINSIZE */ + if (victim == q) + { + q = next_bin(q); + victim = last(q); + } +#endif + if (victim != q) + { + victim_size = chunksize(victim); + unlink(victim, bck, fwd); + set_inuse_bit_at_offset(victim, victim_size); + check_malloced_chunk(victim, nb); + MALLOC_UNLOCK; + return chunk2mem(victim); + } + + idx += 2; /* Set for bin scan below. We've already scanned 2 bins. */ + + } + else + { + idx = bin_index(nb); + bin = bin_at(idx); + + for (victim = last(bin); victim != bin; victim = victim->bk) + { + victim_size = chunksize(victim); + remainder_size = long_sub_size_t(victim_size, nb); + + if (remainder_size >= (long)MINSIZE) /* too big */ + { + --idx; /* adjust to rescan below after checking last remainder */ + break; + } + + else if (remainder_size >= 0) /* exact fit */ + { + unlink(victim, bck, fwd); + set_inuse_bit_at_offset(victim, victim_size); + check_malloced_chunk(victim, nb); + MALLOC_UNLOCK; + return chunk2mem(victim); + } + } + + ++idx; + + } + + /* Try to use the last split-off remainder */ + + if ( (victim = last_remainder->fd) != last_remainder) + { + victim_size = chunksize(victim); + remainder_size = long_sub_size_t(victim_size, nb); + + if (remainder_size >= (long)MINSIZE) /* re-split */ + { + remainder = chunk_at_offset(victim, nb); + set_head(victim, nb | PREV_INUSE); + link_last_remainder(remainder); + set_head(remainder, remainder_size | PREV_INUSE); + set_foot(remainder, remainder_size); + check_malloced_chunk(victim, nb); + MALLOC_UNLOCK; + return chunk2mem(victim); + } + + clear_last_remainder; + + if (remainder_size >= 0) /* exhaust */ + { + set_inuse_bit_at_offset(victim, victim_size); + check_malloced_chunk(victim, nb); + MALLOC_UNLOCK; + return chunk2mem(victim); + } + + /* Else place in bin */ + + frontlink(victim, victim_size, remainder_index, bck, fwd); + } + + /* + If there are any possibly nonempty big-enough blocks, + search for best fitting chunk by scanning bins in blockwidth units. + */ + + if ( (block = idx2binblock(idx)) <= binblocks) + { + + /* Get to the first marked block */ + + if ( (block & binblocks) == 0) + { + /* force to an even block boundary */ + idx = (idx & ~(BINBLOCKWIDTH - 1)) + BINBLOCKWIDTH; + block <<= 1; + while ((block & binblocks) == 0) + { + idx += BINBLOCKWIDTH; + block <<= 1; + } + } + + /* For each possibly nonempty block ... */ + for (;;) + { + startidx = idx; /* (track incomplete blocks) */ + q = bin = bin_at(idx); + + /* For each bin in this block ... */ + do + { + /* Find and use first big enough chunk ... */ + + for (victim = last(bin); victim != bin; victim = victim->bk) + { + victim_size = chunksize(victim); + remainder_size = long_sub_size_t(victim_size, nb); + + if (remainder_size >= (long)MINSIZE) /* split */ + { + remainder = chunk_at_offset(victim, nb); + set_head(victim, nb | PREV_INUSE); + unlink(victim, bck, fwd); + link_last_remainder(remainder); + set_head(remainder, remainder_size | PREV_INUSE); + set_foot(remainder, remainder_size); + check_malloced_chunk(victim, nb); + MALLOC_UNLOCK; + return chunk2mem(victim); + } + + else if (remainder_size >= 0) /* take */ + { + set_inuse_bit_at_offset(victim, victim_size); + unlink(victim, bck, fwd); + check_malloced_chunk(victim, nb); + MALLOC_UNLOCK; + return chunk2mem(victim); + } + + } + + bin = next_bin(bin); + +#if MALLOC_ALIGN == 16 + if (idx < MAX_SMALLBIN) + { + bin = next_bin(bin); + ++idx; + } +#endif + } while ((++idx & (BINBLOCKWIDTH - 1)) != 0); + + /* Clear out the block bit. */ + + do /* Possibly backtrack to try to clear a partial block */ + { + if ((startidx & (BINBLOCKWIDTH - 1)) == 0) + { + binblocks &= ~block; + break; + } + --startidx; + q = prev_bin(q); + } while (first(q) == q); + + /* Get to the next possibly nonempty block */ + + if ( (block <<= 1) <= binblocks && (block != 0) ) + { + while ((block & binblocks) == 0) + { + idx += BINBLOCKWIDTH; + block <<= 1; + } + } + else + break; + } + } + + + /* Try to use top chunk */ + + /* Require that there be a remainder, ensuring top always exists */ + remainder_size = long_sub_size_t(chunksize(top), nb); + if (chunksize(top) < nb || remainder_size < (long)MINSIZE) + { + +#if HAVE_MMAP + /* If big and would otherwise need to extend, try to use mmap instead */ + if ((unsigned long)nb >= (unsigned long)mmap_threshold && + (victim = mmap_chunk(nb)) != 0) + { + MALLOC_UNLOCK; + return chunk2mem(victim); + } +#endif + + /* Try to extend */ + malloc_extend_top(RCALL nb); + remainder_size = long_sub_size_t(chunksize(top), nb); + if (chunksize(top) < nb || remainder_size < (long)MINSIZE) + { + MALLOC_UNLOCK; + return 0; /* propagate failure */ + } + } + + victim = top; + set_head(victim, nb | PREV_INUSE); + top = chunk_at_offset(victim, nb); + set_head(top, remainder_size | PREV_INUSE); + check_malloced_chunk(victim, nb); + MALLOC_UNLOCK; + return chunk2mem(victim); + +#endif /* MALLOC_PROVIDED */ +} + +#endif /* DEFINE_MALLOC */ + +#ifdef DEFINE_FREE + +/* + + free() algorithm : + + cases: + + 1. free(0) has no effect. + + 2. If the chunk was allocated via mmap, it is release via munmap(). + + 3. If a returned chunk borders the current high end of memory, + it is consolidated into the top, and if the total unused + topmost memory exceeds the trim threshold, malloc_trim is + called. + + 4. Other chunks are consolidated as they arrive, and + placed in corresponding bins. (This includes the case of + consolidating with the current `last_remainder'). + +*/ + + +#if __STD_C +void fREe(RARG Void_t* mem) +#else +void fREe(RARG mem) RDECL Void_t* mem; +#endif +{ +#ifdef MALLOC_PROVIDED + + free (mem); + +#else + + mchunkptr p; /* chunk corresponding to mem */ + INTERNAL_SIZE_T hd; /* its head field */ + INTERNAL_SIZE_T sz; /* its size */ + int idx; /* its bin index */ + mchunkptr next; /* next contiguous chunk */ + INTERNAL_SIZE_T nextsz; /* its size */ + INTERNAL_SIZE_T prevsz; /* size of previous contiguous chunk */ + mchunkptr bck; /* misc temp for linking */ + mchunkptr fwd; /* misc temp for linking */ + int islr; /* track whether merging with last_remainder */ + + if (mem == 0) /* free(0) has no effect */ + return; + + MALLOC_LOCK; + + p = mem2chunk(mem); + hd = p->size; + +#if HAVE_MMAP + if (hd & IS_MMAPPED) /* release mmapped memory. */ + { + munmap_chunk(p); + MALLOC_UNLOCK; + return; + } +#endif + + check_inuse_chunk(p); + + sz = hd & ~PREV_INUSE; + next = chunk_at_offset(p, sz); + nextsz = chunksize(next); + + if (next == top) /* merge with top */ + { + sz += nextsz; + + if (!(hd & PREV_INUSE)) /* consolidate backward */ + { + prevsz = p->prev_size; + p = chunk_at_offset(p, -prevsz); + sz += prevsz; + unlink(p, bck, fwd); + } + + set_head(p, sz | PREV_INUSE); + top = p; + if ((unsigned long)(sz) >= (unsigned long)trim_threshold) + malloc_trim(RCALL top_pad); + MALLOC_UNLOCK; + return; + } + + set_head(next, nextsz); /* clear inuse bit */ + + islr = 0; + + if (!(hd & PREV_INUSE)) /* consolidate backward */ + { + prevsz = p->prev_size; + p = chunk_at_offset(p, -prevsz); + sz += prevsz; + + if (p->fd == last_remainder) /* keep as last_remainder */ + islr = 1; + else + unlink(p, bck, fwd); + } + + if (!(inuse_bit_at_offset(next, nextsz))) /* consolidate forward */ + { + sz += nextsz; + + if (!islr && next->fd == last_remainder) /* re-insert last_remainder */ + { + islr = 1; + link_last_remainder(p); + } + else + unlink(next, bck, fwd); + } + + + set_head(p, sz | PREV_INUSE); + set_foot(p, sz); + if (!islr) + frontlink(p, sz, idx, bck, fwd); + + MALLOC_UNLOCK; + +#endif /* MALLOC_PROVIDED */ +} + +#endif /* DEFINE_FREE */ + +#ifdef DEFINE_REALLOC + +/* + + Realloc algorithm: + + Chunks that were obtained via mmap cannot be extended or shrunk + unless HAVE_MREMAP is defined, in which case mremap is used. + Otherwise, if their reallocation is for additional space, they are + copied. If for less, they are just left alone. + + Otherwise, if the reallocation is for additional space, and the + chunk can be extended, it is, else a malloc-copy-free sequence is + taken. There are several different ways that a chunk could be + extended. All are tried: + + * Extending forward into following adjacent free chunk. + * Shifting backwards, joining preceding adjacent space + * Both shifting backwards and extending forward. + * Extending into newly sbrked space + + Unless the #define REALLOC_ZERO_BYTES_FREES is set, realloc with a + size argument of zero (re)allocates a minimum-sized chunk. + + If the reallocation is for less space, and the new request is for + a `small' (<512 bytes) size, then the newly unused space is lopped + off and freed. + + The old unix realloc convention of allowing the last-free'd chunk + to be used as an argument to realloc is no longer supported. + I don't know of any programs still relying on this feature, + and allowing it would also allow too many other incorrect + usages of realloc to be sensible. + + +*/ + + +#if __STD_C +Void_t* rEALLOc(RARG Void_t* oldmem, size_t bytes) +#else +Void_t* rEALLOc(RARG oldmem, bytes) RDECL Void_t* oldmem; size_t bytes; +#endif +{ +#ifdef MALLOC_PROVIDED + + realloc (oldmem, bytes); + +#else + + INTERNAL_SIZE_T nb; /* padded request size */ + + mchunkptr oldp; /* chunk corresponding to oldmem */ + INTERNAL_SIZE_T oldsize; /* its size */ + + mchunkptr newp; /* chunk to return */ + INTERNAL_SIZE_T newsize; /* its size */ + Void_t* newmem; /* corresponding user mem */ + + mchunkptr next; /* next contiguous chunk after oldp */ + INTERNAL_SIZE_T nextsize; /* its size */ + + mchunkptr prev; /* previous contiguous chunk before oldp */ + INTERNAL_SIZE_T prevsize; /* its size */ + + mchunkptr remainder; /* holds split off extra space from newp */ + INTERNAL_SIZE_T remainder_size; /* its size */ + + mchunkptr bck; /* misc temp for linking */ + mchunkptr fwd; /* misc temp for linking */ + +#ifdef REALLOC_ZERO_BYTES_FREES + if (bytes == 0) { fREe(RCALL oldmem); return 0; } +#endif + + + /* realloc of null is supposed to be same as malloc */ + if (oldmem == 0) return mALLOc(RCALL bytes); + + MALLOC_LOCK; + + newp = oldp = mem2chunk(oldmem); + newsize = oldsize = chunksize(oldp); + + + nb = request2size(bytes); + +#if HAVE_MMAP + if (chunk_is_mmapped(oldp)) + { +#if HAVE_MREMAP + newp = mremap_chunk(oldp, nb); + if(newp) + { + MALLOC_UNLOCK; + return chunk2mem(newp); + } +#endif + /* Note the extra SIZE_SZ overhead. */ + if(oldsize - SIZE_SZ >= nb) + { + MALLOC_UNLOCK; + return oldmem; /* do nothing */ + } + /* Must alloc, copy, free. */ + newmem = mALLOc(RCALL bytes); + if (newmem == 0) + { + MALLOC_UNLOCK; + return 0; /* propagate failure */ + } + MALLOC_COPY(newmem, oldmem, oldsize - 2*SIZE_SZ); + munmap_chunk(oldp); + MALLOC_UNLOCK; + return newmem; + } +#endif + + check_inuse_chunk(oldp); + + if ((long)(oldsize) < (long)(nb)) + { + + /* Try expanding forward */ + + next = chunk_at_offset(oldp, oldsize); + if (next == top || !inuse(next)) + { + nextsize = chunksize(next); + + /* Forward into top only if a remainder */ + if (next == top) + { + if ((long)(nextsize + newsize) >= (long)(nb + MINSIZE)) + { + newsize += nextsize; + top = chunk_at_offset(oldp, nb); + set_head(top, (newsize - nb) | PREV_INUSE); + set_head_size(oldp, nb); + MALLOC_UNLOCK; + return chunk2mem(oldp); + } + } + + /* Forward into next chunk */ + else if (((long)(nextsize + newsize) >= (long)(nb))) + { + unlink(next, bck, fwd); + newsize += nextsize; + goto split; + } + } + else + { + next = 0; + nextsize = 0; + } + + /* Try shifting backwards. */ + + if (!prev_inuse(oldp)) + { + prev = prev_chunk(oldp); + prevsize = chunksize(prev); + + /* try forward + backward first to save a later consolidation */ + + if (next != 0) + { + /* into top */ + if (next == top) + { + if ((long)(nextsize + prevsize + newsize) >= (long)(nb + MINSIZE)) + { + unlink(prev, bck, fwd); + newp = prev; + newsize += prevsize + nextsize; + newmem = chunk2mem(newp); + MALLOC_COPY(newmem, oldmem, oldsize - SIZE_SZ); + top = chunk_at_offset(newp, nb); + set_head(top, (newsize - nb) | PREV_INUSE); + set_head_size(newp, nb); + MALLOC_UNLOCK; + return newmem; + } + } + + /* into next chunk */ + else if (((long)(nextsize + prevsize + newsize) >= (long)(nb))) + { + unlink(next, bck, fwd); + unlink(prev, bck, fwd); + newp = prev; + newsize += nextsize + prevsize; + newmem = chunk2mem(newp); + MALLOC_COPY(newmem, oldmem, oldsize - SIZE_SZ); + goto split; + } + } + + /* backward only */ + if (prev != 0 && (long)(prevsize + newsize) >= (long)nb) + { + unlink(prev, bck, fwd); + newp = prev; + newsize += prevsize; + newmem = chunk2mem(newp); + MALLOC_COPY(newmem, oldmem, oldsize - SIZE_SZ); + goto split; + } + } + + /* Must allocate */ + + newmem = mALLOc (RCALL bytes); + + if (newmem == 0) /* propagate failure */ + { + MALLOC_UNLOCK; + return 0; + } + + /* Avoid copy if newp is next chunk after oldp. */ + /* (This can only happen when new chunk is sbrk'ed.) */ + + if ( (newp = mem2chunk(newmem)) == next_chunk(oldp)) + { + newsize += chunksize(newp); + newp = oldp; + goto split; + } + + /* Otherwise copy, free, and exit */ + MALLOC_COPY(newmem, oldmem, oldsize - SIZE_SZ); + fREe(RCALL oldmem); + MALLOC_UNLOCK; + return newmem; + } + + + split: /* split off extra room in old or expanded chunk */ + + remainder_size = long_sub_size_t(newsize, nb); + + if (remainder_size >= (long)MINSIZE) /* split off remainder */ + { + remainder = chunk_at_offset(newp, nb); + set_head_size(newp, nb); + set_head(remainder, remainder_size | PREV_INUSE); + set_inuse_bit_at_offset(remainder, remainder_size); + fREe(RCALL chunk2mem(remainder)); /* let free() deal with it */ + } + else + { + set_head_size(newp, newsize); + set_inuse_bit_at_offset(newp, newsize); + } + + check_inuse_chunk(newp); + MALLOC_UNLOCK; + return chunk2mem(newp); + +#endif /* MALLOC_PROVIDED */ +} + +#endif /* DEFINE_REALLOC */ + +#ifdef DEFINE_MEMALIGN + +/* + + memalign algorithm: + + memalign requests more than enough space from malloc, finds a spot + within that chunk that meets the alignment request, and then + possibly frees the leading and trailing space. + + The alignment argument must be a power of two. This property is not + checked by memalign, so misuse may result in random runtime errors. + + 8-byte alignment is guaranteed by normal malloc calls, so don't + bother calling memalign with an argument of 8 or less. + + Overreliance on memalign is a sure way to fragment space. + +*/ + + +#if __STD_C +Void_t* mEMALIGn(RARG size_t alignment, size_t bytes) +#else +Void_t* mEMALIGn(RARG alignment, bytes) RDECL size_t alignment; size_t bytes; +#endif +{ + INTERNAL_SIZE_T nb; /* padded request size */ + char* m; /* memory returned by malloc call */ + mchunkptr p; /* corresponding chunk */ + char* brk; /* alignment point within p */ + mchunkptr newp; /* chunk to return */ + INTERNAL_SIZE_T newsize; /* its size */ + INTERNAL_SIZE_T leadsize; /* leading space befor alignment point */ + mchunkptr remainder; /* spare room at end to split off */ + long remainder_size; /* its size */ + + /* If need less alignment than we give anyway, just relay to malloc */ + + if (alignment <= MALLOC_ALIGNMENT) return mALLOc(RCALL bytes); + + /* Otherwise, ensure that it is at least a minimum chunk size */ + + if (alignment < MINSIZE) alignment = MINSIZE; + + /* Call malloc with worst case padding to hit alignment. */ + + nb = request2size(bytes); + m = (char*)(mALLOc(RCALL nb + alignment + MINSIZE)); + + if (m == 0) return 0; /* propagate failure */ + + MALLOC_LOCK; + + p = mem2chunk(m); + + if ((((unsigned long)(m)) % alignment) == 0) /* aligned */ + { +#if HAVE_MMAP + if(chunk_is_mmapped(p)) + { + MALLOC_UNLOCK; + return chunk2mem(p); /* nothing more to do */ + } +#endif + } + else /* misaligned */ + { + /* + Find an aligned spot inside chunk. + Since we need to give back leading space in a chunk of at + least MINSIZE, if the first calculation places us at + a spot with less than MINSIZE leader, we can move to the + next aligned spot -- we've allocated enough total room so that + this is always possible. + */ + + brk = (char*)mem2chunk(((unsigned long)(m + alignment - 1)) & -alignment); + if ((long)(brk - (char*)(p)) < (long)MINSIZE) brk = brk + alignment; + + newp = (mchunkptr)brk; + leadsize = brk - (char*)(p); + newsize = chunksize(p) - leadsize; + +#if HAVE_MMAP + if(chunk_is_mmapped(p)) + { + newp->prev_size = p->prev_size + leadsize; + set_head(newp, newsize|IS_MMAPPED); + MALLOC_UNLOCK; + return chunk2mem(newp); + } +#endif + + /* give back leader, use the rest */ + + set_head(newp, newsize | PREV_INUSE); + set_inuse_bit_at_offset(newp, newsize); + set_head_size(p, leadsize); + fREe(RCALL chunk2mem(p)); + p = newp; + + assert (newsize >= nb && (((unsigned long)(chunk2mem(p))) % alignment) == 0); + } + + /* Also give back spare room at the end */ + + remainder_size = long_sub_size_t(chunksize(p), nb); + + if (remainder_size >= (long)MINSIZE) + { + remainder = chunk_at_offset(p, nb); + set_head(remainder, remainder_size | PREV_INUSE); + set_head_size(p, nb); + fREe(RCALL chunk2mem(remainder)); + } + + check_inuse_chunk(p); + MALLOC_UNLOCK; + return chunk2mem(p); + +} + +#endif /* DEFINE_MEMALIGN */ + +#ifdef DEFINE_VALLOC + +/* + valloc just invokes memalign with alignment argument equal + to the page size of the system (or as near to this as can + be figured out from all the includes/defines above.) +*/ + +#if __STD_C +Void_t* vALLOc(RARG size_t bytes) +#else +Void_t* vALLOc(RARG bytes) RDECL size_t bytes; +#endif +{ + return mEMALIGn (RCALL malloc_getpagesize, bytes); +} + +#endif /* DEFINE_VALLOC */ + +#ifdef DEFINE_PVALLOC + +/* + pvalloc just invokes valloc for the nearest pagesize + that will accommodate request +*/ + + +#if __STD_C +Void_t* pvALLOc(RARG size_t bytes) +#else +Void_t* pvALLOc(RARG bytes) RDECL size_t bytes; +#endif +{ + size_t pagesize = malloc_getpagesize; + return mEMALIGn (RCALL pagesize, (bytes + pagesize - 1) & ~(pagesize - 1)); +} + +#endif /* DEFINE_PVALLOC */ + +#ifdef DEFINE_CALLOC + +/* + + calloc calls malloc, then zeroes out the allocated chunk. + +*/ + +#if __STD_C +Void_t* cALLOc(RARG size_t n, size_t elem_size) +#else +Void_t* cALLOc(RARG n, elem_size) RDECL size_t n; size_t elem_size; +#endif +{ + mchunkptr p; + INTERNAL_SIZE_T csz; + + INTERNAL_SIZE_T sz = n * elem_size; + +#if MORECORE_CLEARS + mchunkptr oldtop; + INTERNAL_SIZE_T oldtopsize; +#endif + Void_t* mem; + + /* check if expand_top called, in which case don't need to clear */ +#if MORECORE_CLEARS + MALLOC_LOCK; + oldtop = top; + oldtopsize = chunksize(top); +#endif + + mem = mALLOc (RCALL sz); + + if (mem == 0) + { +#if MORECORE_CLEARS + MALLOC_UNLOCK; +#endif + return 0; + } + else + { + p = mem2chunk(mem); + + /* Two optional cases in which clearing not necessary */ + + +#if HAVE_MMAP + if (chunk_is_mmapped(p)) + { +#if MORECORE_CLEARS + MALLOC_UNLOCK; +#endif + return mem; + } +#endif + + csz = chunksize(p); + +#if MORECORE_CLEARS + if (p == oldtop && csz > oldtopsize) + { + /* clear only the bytes from non-freshly-sbrked memory */ + csz = oldtopsize; + } + MALLOC_UNLOCK; +#endif + + MALLOC_ZERO(mem, csz - SIZE_SZ); + return mem; + } +} + +#endif /* DEFINE_CALLOC */ + +#ifdef DEFINE_CFREE + +/* + + cfree just calls free. It is needed/defined on some systems + that pair it with calloc, presumably for odd historical reasons. + +*/ + +#if !defined(INTERNAL_LINUX_C_LIB) || !defined(__ELF__) +#if !defined(INTERNAL_NEWLIB) || !defined(_REENT_ONLY) +#if __STD_C +void cfree(Void_t *mem) +#else +void cfree(mem) Void_t *mem; +#endif +{ +#ifdef INTERNAL_NEWLIB + fREe(_REENT, mem); +#else + fREe(mem); +#endif +} +#endif +#endif + +#endif /* DEFINE_CFREE */ + +#ifdef DEFINE_FREE + +/* + + Malloc_trim gives memory back to the system (via negative + arguments to sbrk) if there is unused memory at the `high' end of + the malloc pool. You can call this after freeing large blocks of + memory to potentially reduce the system-level memory requirements + of a program. However, it cannot guarantee to reduce memory. Under + some allocation patterns, some large free blocks of memory will be + locked between two used chunks, so they cannot be given back to + the system. + + The `pad' argument to malloc_trim represents the amount of free + trailing space to leave untrimmed. If this argument is zero, + only the minimum amount of memory to maintain internal data + structures will be left (one page or less). Non-zero arguments + can be supplied to maintain enough trailing space to service + future expected allocations without having to re-obtain memory + from the system. + + Malloc_trim returns 1 if it actually released any memory, else 0. + +*/ + +#if __STD_C +int malloc_trim(RARG size_t pad) +#else +int malloc_trim(RARG pad) RDECL size_t pad; +#endif +{ + long top_size; /* Amount of top-most memory */ + long extra; /* Amount to release */ + char* current_brk; /* address returned by pre-check sbrk call */ + char* new_brk; /* address returned by negative sbrk call */ + + unsigned long pagesz = malloc_getpagesize; + + MALLOC_LOCK; + + top_size = chunksize(top); + extra = ((top_size - pad - MINSIZE + (pagesz-1)) / pagesz - 1) * pagesz; + + if (extra < (long)pagesz) /* Not enough memory to release */ + { + MALLOC_UNLOCK; + return 0; + } + + else + { + /* Test to make sure no one else called sbrk */ + current_brk = (char*)(MORECORE (0)); + if (current_brk != (char*)(top) + top_size) + { + MALLOC_UNLOCK; + return 0; /* Apparently we don't own memory; must fail */ + } + + else + { + new_brk = (char*)(MORECORE (-extra)); + + if (new_brk == (char*)(MORECORE_FAILURE)) /* sbrk failed? */ + { + /* Try to figure out what we have */ + current_brk = (char*)(MORECORE (0)); + top_size = current_brk - (char*)top; + if (top_size >= (long)MINSIZE) /* if not, we are very very dead! */ + { + sbrked_mem = current_brk - sbrk_base; + set_head(top, top_size | PREV_INUSE); + } + check_chunk(top); + MALLOC_UNLOCK; + return 0; + } + + else + { + /* Success. Adjust top accordingly. */ + set_head(top, (top_size - extra) | PREV_INUSE); + sbrked_mem -= extra; + check_chunk(top); + MALLOC_UNLOCK; + return 1; + } + } + } +} + +#endif /* DEFINE_FREE */ + +#ifdef DEFINE_MALLOC_USABLE_SIZE + +/* + malloc_usable_size: + + This routine tells you how many bytes you can actually use in an + allocated chunk, which may be more than you requested (although + often not). You can use this many bytes without worrying about + overwriting other allocated objects. Not a particularly great + programming practice, but still sometimes useful. + +*/ + +#if __STD_C +size_t malloc_usable_size(RARG Void_t* mem) +#else +size_t malloc_usable_size(RARG mem) RDECL Void_t* mem; +#endif +{ + mchunkptr p; + if (mem == 0) + return 0; + else + { + p = mem2chunk(mem); + if(!chunk_is_mmapped(p)) + { + if (!inuse(p)) return 0; +#if DEBUG + MALLOC_LOCK; + check_inuse_chunk(p); + MALLOC_UNLOCK; +#endif + return chunksize(p) - SIZE_SZ; + } + return chunksize(p) - 2*SIZE_SZ; + } +} + +#endif /* DEFINE_MALLOC_USABLE_SIZE */ + +#ifdef DEFINE_MALLINFO + +/* Utility to update current_mallinfo for malloc_stats and mallinfo() */ + +STATIC void malloc_update_mallinfo() +{ + int i; + mbinptr b; + mchunkptr p; +#if DEBUG + mchunkptr q; +#endif + + INTERNAL_SIZE_T avail = chunksize(top); + int navail = ((long)(avail) >= (long)MINSIZE)? 1 : 0; + + for (i = 1; i < NAV; ++i) + { + b = bin_at(i); + for (p = last(b); p != b; p = p->bk) + { +#if DEBUG + check_free_chunk(p); + for (q = next_chunk(p); + q < top && inuse(q) && (long)(chunksize(q)) >= (long)MINSIZE; + q = next_chunk(q)) + check_inuse_chunk(q); +#endif + avail += chunksize(p); + navail++; + } + } + + current_mallinfo.ordblks = navail; + current_mallinfo.uordblks = sbrked_mem - avail; + current_mallinfo.fordblks = avail; +#if HAVE_MMAP + current_mallinfo.hblks = n_mmaps; + current_mallinfo.hblkhd = mmapped_mem; +#endif + current_mallinfo.keepcost = chunksize(top); + +} + +#else /* ! DEFINE_MALLINFO */ + +#if __STD_C +extern void malloc_update_mallinfo(void); +#else +extern void malloc_update_mallinfo(); +#endif + +#endif /* ! DEFINE_MALLINFO */ + +#ifdef DEFINE_MALLOC_STATS + +/* + + malloc_stats: + + Prints on stderr the amount of space obtain from the system (both + via sbrk and mmap), the maximum amount (which may be more than + current if malloc_trim and/or munmap got called), the maximum + number of simultaneous mmap regions used, and the current number + of bytes allocated via malloc (or realloc, etc) but not yet + freed. (Note that this is the number of bytes allocated, not the + number requested. It will be larger than the number requested + because of alignment and bookkeeping overhead.) + +*/ + +#if __STD_C +void malloc_stats(RONEARG) +#else +void malloc_stats(RONEARG) RDECL +#endif +{ + unsigned long local_max_total_mem; + int local_sbrked_mem; + struct mallinfo local_mallinfo; +#if HAVE_MMAP + unsigned long local_mmapped_mem, local_max_n_mmaps; +#endif + FILE *fp; + + MALLOC_LOCK; + malloc_update_mallinfo(); + local_max_total_mem = max_total_mem; + local_sbrked_mem = sbrked_mem; + local_mallinfo = current_mallinfo; +#if HAVE_MMAP + local_mmapped_mem = mmapped_mem; + local_max_n_mmaps = max_n_mmaps; +#endif + MALLOC_UNLOCK; + +#ifdef INTERNAL_NEWLIB + fp = _stderr_r(reent_ptr); +#define fprintf fiprintf +#else + fp = stderr; +#endif + + fprintf(fp, "max system bytes = %10u\n", + (unsigned int)(local_max_total_mem)); +#if HAVE_MMAP + fprintf(fp, "system bytes = %10u\n", + (unsigned int)(local_sbrked_mem + local_mmapped_mem)); + fprintf(fp, "in use bytes = %10u\n", + (unsigned int)(local_mallinfo.uordblks + local_mmapped_mem)); +#else + fprintf(fp, "system bytes = %10u\n", + (unsigned int)local_sbrked_mem); + fprintf(fp, "in use bytes = %10u\n", + (unsigned int)local_mallinfo.uordblks); +#endif +#if HAVE_MMAP + fprintf(fp, "max mmap regions = %10u\n", + (unsigned int)local_max_n_mmaps); +#endif +} + +#endif /* DEFINE_MALLOC_STATS */ + +#ifdef DEFINE_MALLINFO + +/* + mallinfo returns a copy of updated current mallinfo. +*/ + +#if __STD_C +struct mallinfo mALLINFo(RONEARG) +#else +struct mallinfo mALLINFo(RONEARG) RDECL +#endif +{ + struct mallinfo ret; + + MALLOC_LOCK; + malloc_update_mallinfo(); + ret = current_mallinfo; + MALLOC_UNLOCK; + return ret; +} + +#endif /* DEFINE_MALLINFO */ + +#ifdef DEFINE_MALLOPT + +/* + mallopt: + + mallopt is the general SVID/XPG interface to tunable parameters. + The format is to provide a (parameter-number, parameter-value) pair. + mallopt then sets the corresponding parameter to the argument + value if it can (i.e., so long as the value is meaningful), + and returns 1 if successful else 0. + + See descriptions of tunable parameters above. + +*/ + +#if __STD_C +int mALLOPt(RARG int param_number, int value) +#else +int mALLOPt(RARG param_number, value) RDECL int param_number; int value; +#endif +{ + MALLOC_LOCK; + switch(param_number) + { + case M_TRIM_THRESHOLD: + trim_threshold = value; MALLOC_UNLOCK; return 1; + case M_TOP_PAD: + top_pad = value; MALLOC_UNLOCK; return 1; + case M_MMAP_THRESHOLD: +#if HAVE_MMAP + mmap_threshold = value; +#endif + MALLOC_UNLOCK; + return 1; + case M_MMAP_MAX: +#if HAVE_MMAP + n_mmaps_max = value; MALLOC_UNLOCK; return 1; +#else + MALLOC_UNLOCK; return value == 0; +#endif + + default: + MALLOC_UNLOCK; + return 0; + } +} + +#endif /* DEFINE_MALLOPT */ + +/* + +History: + + V2.6.3 Sun May 19 08:17:58 1996 Doug Lea (dl at gee) + * Added pvalloc, as recommended by H.J. Liu + * Added 64bit pointer support mainly from Wolfram Gloger + * Added anonymously donated WIN32 sbrk emulation + * Malloc, calloc, getpagesize: add optimizations from Raymond Nijssen + * malloc_extend_top: fix mask error that caused wastage after + foreign sbrks + * Add linux mremap support code from HJ Liu + + V2.6.2 Tue Dec 5 06:52:55 1995 Doug Lea (dl at gee) + * Integrated most documentation with the code. + * Add support for mmap, with help from + Wolfram Gloger (Gloger@lrz.uni-muenchen.de). + * Use last_remainder in more cases. + * Pack bins using idea from colin@nyx10.cs.du.edu + * Use ordered bins instead of best-fit threshhold + * Eliminate block-local decls to simplify tracing and debugging. + * Support another case of realloc via move into top + * Fix error occuring when initial sbrk_base not word-aligned. + * Rely on page size for units instead of SBRK_UNIT to + avoid surprises about sbrk alignment conventions. + * Add mallinfo, mallopt. Thanks to Raymond Nijssen + (raymond@es.ele.tue.nl) for the suggestion. + * Add `pad' argument to malloc_trim and top_pad mallopt parameter. + * More precautions for cases where other routines call sbrk, + courtesy of Wolfram Gloger (Gloger@lrz.uni-muenchen.de). + * Added macros etc., allowing use in linux libc from + H.J. Lu (hjl@gnu.ai.mit.edu) + * Inverted this history list + + V2.6.1 Sat Dec 2 14:10:57 1995 Doug Lea (dl at gee) + * Re-tuned and fixed to behave more nicely with V2.6.0 changes. + * Removed all preallocation code since under current scheme + the work required to undo bad preallocations exceeds + the work saved in good cases for most test programs. + * No longer use return list or unconsolidated bins since + no scheme using them consistently outperforms those that don't + given above changes. + * Use best fit for very large chunks to prevent some worst-cases. + * Added some support for debugging + + V2.6.0 Sat Nov 4 07:05:23 1995 Doug Lea (dl at gee) + * Removed footers when chunks are in use. Thanks to + Paul Wilson (wilson@cs.texas.edu) for the suggestion. + + V2.5.4 Wed Nov 1 07:54:51 1995 Doug Lea (dl at gee) + * Added malloc_trim, with help from Wolfram Gloger + (wmglo@Dent.MED.Uni-Muenchen.DE). + + V2.5.3 Tue Apr 26 10:16:01 1994 Doug Lea (dl at g) + + V2.5.2 Tue Apr 5 16:20:40 1994 Doug Lea (dl at g) + * realloc: try to expand in both directions + * malloc: swap order of clean-bin strategy; + * realloc: only conditionally expand backwards + * Try not to scavenge used bins + * Use bin counts as a guide to preallocation + * Occasionally bin return list chunks in first scan + * Add a few optimizations from colin@nyx10.cs.du.edu + + V2.5.1 Sat Aug 14 15:40:43 1993 Doug Lea (dl at g) + * faster bin computation & slightly different binning + * merged all consolidations to one part of malloc proper + (eliminating old malloc_find_space & malloc_clean_bin) + * Scan 2 returns chunks (not just 1) + * Propagate failure in realloc if malloc returns 0 + * Add stuff to allow compilation on non-ANSI compilers + from kpv@research.att.com + + V2.5 Sat Aug 7 07:41:59 1993 Doug Lea (dl at g.oswego.edu) + * removed potential for odd address access in prev_chunk + * removed dependency on getpagesize.h + * misc cosmetics and a bit more internal documentation + * anticosmetics: mangled names in macros to evade debugger strangeness + * tested on sparc, hp-700, dec-mips, rs6000 + with gcc & native cc (hp, dec only) allowing + Detlefs & Zorn comparison study (in SIGPLAN Notices.) + + Trial version Fri Aug 28 13:14:29 1992 Doug Lea (dl at g.oswego.edu) + * Based loosely on libg++-1.2X malloc. (It retains some of the overall + structure of old version, but most details differ.) + +*/ +#endif diff --git a/newlib/libc/stdlib/mbctype.h b/newlib/libc/stdlib/mbctype.h new file mode 100644 index 000000000..81a6f3895 --- /dev/null +++ b/newlib/libc/stdlib/mbctype.h @@ -0,0 +1,20 @@ +#ifndef _MBCTYPE_H_ + +#define _MBCTYPE_H_ + +/* escape character used for JIS encoding */ +#define ESC_CHAR 0x1b + +/* functions used to support SHIFT_JIS, EUC-JP, and JIS multibyte encodings */ + +int _EXFUN(_issjis1, (int c)); +int _EXFUN(_issjis2, (int c)); +int _EXFUN(_iseucjp, (int c)); +int _EXFUN(_isjis, (int c)); + +#define _issjis1(c) ((c) >= 0x81 && (c) <= 0x9f || (c) >= 0xe0 && (c) <= 0xef) +#define _issjis2(c) ((c) >= 0x40 && (c) <= 0x7e || (c) >= 0x80 && (c) <= 0xfc) +#define _iseucjp(c) ((c) >= 0xa1 && (c) <= 0xfe) +#define _isjis(c) ((c) >= 0x21 && (c) <= 0x7e) + +#endif /* _MBCTYPE_H_ */ diff --git a/newlib/libc/stdlib/mblen.c b/newlib/libc/stdlib/mblen.c new file mode 100644 index 000000000..d9b774e45 --- /dev/null +++ b/newlib/libc/stdlib/mblen.c @@ -0,0 +1,66 @@ +/* +FUNCTION +<>---minimal multibyte length function + +INDEX + mblen + +ANSI_SYNOPSIS + #include + int mblen(const char *<[s]>, size_t <[n]>); + +TRAD_SYNOPSIS + #include + int mblen(<[s]>, <[n]>) + const char *<[s]>; + size_t <[n]>; + +DESCRIPTION +When MB_CAPABLE is not defined, this is a minimal ANSI-conforming +implementation of <>. In this case, the +only ``multi-byte character sequences'' recognized are single bytes, +and thus <<1>> is returned unless <[s]> is the null pointer or +has a length of 0 or is the empty string. + +When MB_CAPABLE is defined, this routine calls <<_mbtowc_r>> to perform +the conversion, passing a state variable to allow state dependent +decoding. The result is based on the locale setting which may +be restricted to a defined set of locales. + +RETURNS +This implementation of <> returns <<0>> if +<[s]> is <> or the empty string; it returns <<1>> if not MB_CAPABLE or +the character is a single-byte character; it returns <<-1>> +if the multi-byte character is invalid; otherwise it returns +the number of bytes in the multibyte character. + +PORTABILITY +<> is required in the ANSI C standard. However, the precise +effects vary with the locale. + +<> requires no supporting OS subroutines. +*/ + +#ifndef _REENT_ONLY + +#include + +int +_DEFUN (mblen, (s, n), + const char *s _AND + size_t n) +{ +#ifdef MB_CAPABLE + static int state; + + return _mbtowc_r (_REENT, NULL, s, n, &state); +#else /* not MB_CAPABLE */ + if (s == NULL || *s == '\0') + return 0; + if (n == 0) + return -1; + return 1; +#endif /* not MB_CAPABLE */ +} + +#endif /* !_REENT_ONLY */ diff --git a/newlib/libc/stdlib/mblen_r.c b/newlib/libc/stdlib/mblen_r.c new file mode 100644 index 000000000..22d1d40e6 --- /dev/null +++ b/newlib/libc/stdlib/mblen_r.c @@ -0,0 +1,66 @@ +/* +FUNCTION +<<_mblen_r>>---reentrant minimal multibyte length function + +INDEX + _mblen_r + +ANSI_SYNOPSIS + #include + int _mblen_r(struct _reent *<[r]>, const char *<[s]>, size_t <[n]>, int *<[state]>); + +TRAD_SYNOPSIS + #include + int _mblen_r(<[r]>, <[s]>, <[n]>, <[state]>) + struct _reent *<[r]>; + const char *<[s]>; + size_t <[n]>; + int *<[state]>; + +DESCRIPTION +When MB_CAPABLE is not defined, this is a minimal ANSI-conforming +implementation of <<_mblen_r>>. In this case, the +only ``multi-byte character sequences'' recognized are single bytes, +and thus <<1>> is returned unless <[s]> is the null pointer or +has a length of 0 or is the empty string. + +When MB_CAPABLE is defined, this routine calls <<_mbtowc_r>> to perform +the conversion, passing a state variable to allow state dependent +decoding. The result is based on the locale setting which may +be restricted to a defined set of locales. + +RETURNS +This implementation of <<_mblen_r>> returns <<0>> if +<[s]> is <> or the empty string; it returns <<1>> if not MB_CAPABLE or +the character is a single-byte character; it returns <<-1>> +if the multi-byte character is invalid; otherwise it returns +the number of bytes in the multibyte character. + +PORTABILITY +<<_mblen>> is required in the ANSI C standard. However, the precise +effects vary with the locale. + +<<_mblen_r>> requires no supporting OS subroutines. +*/ + +#include + +int +_DEFUN (_mblen_r, (r, s, n, state), + struct _reent *r _AND + const char *s _AND + size_t n _AND + int *state) +{ +#ifdef MB_CAPABLE + + return _mbtowc_r (r, NULL, s, n, state); +#else /* not MB_CAPABLE */ + if (s == NULL || *s == '\0') + return 0; + if (n == 0) + return -1; + return 1; +#endif /* not MB_CAPABLE */ +} + diff --git a/newlib/libc/stdlib/mbstowcs.c b/newlib/libc/stdlib/mbstowcs.c new file mode 100644 index 000000000..fee621a77 --- /dev/null +++ b/newlib/libc/stdlib/mbstowcs.c @@ -0,0 +1,80 @@ +/* +FUNCTION +<>---minimal multibyte string to wide char converter + +INDEX + mbstowcs + +ANSI_SYNOPSIS + #include + int mbstowcs(wchar_t *<[pwc]>, const char *<[s]>, size_t <[n]>); + +TRAD_SYNOPSIS + #include + int mbstowcs(<[pwc]>, <[s]>, <[n]>) + wchar_t *<[pwc]>; + const char *<[s]>; + size_t <[n]>; + +DESCRIPTION +When MB_CAPABLE is not defined, this is a minimal ANSI-conforming +implementation of <>. In this case, the +only ``multi-byte character sequences'' recognized are single bytes, +and they are ``converted'' to wide-char versions simply by byte +extension. + +When MB_CAPABLE is defined, this routine calls <<_mbstowcs_r>> to perform +the conversion, passing a state variable to allow state dependent +decoding. The result is based on the locale setting which may +be restricted to a defined set of locales. + +RETURNS +This implementation of <> returns <<0>> if +<[s]> is <> or is the empty string; +it returns <<-1>> if MB_CAPABLE and one of the +multi-byte characters is invalid or incomplete; +otherwise it returns the minimum of: <> or the +number of multi-byte characters in <> plus 1 (to +compensate for the nul character). +If the return value is -1, the state of the <> string is +indeterminate. If the input has a length of 0, the output +string will be modified to contain a wchar_t nul terminator. + +PORTABILITY +<> is required in the ANSI C standard. However, the precise +effects vary with the locale. + +<> requires no supporting OS subroutines. +*/ + +#ifndef _REENT_ONLY + +#include + +size_t +_DEFUN (mbstowcs, (pwcs, s, n), + wchar_t *pwcs _AND + const char *s _AND + size_t n) +{ +#ifdef MB_CAPABLE + int state = 0; + + return _mbstowcs_r (_REENT, pwcs, s, n, &state); +#else /* not MB_CAPABLE */ + + int count = 0; + + if (n != 0) { + do { + if ((*pwcs++ = (wchar_t) *s++) == 0) + break; + count++; + } while (--n != 0); + } + + return count; +#endif /* not MB_CAPABLE */ +} + +#endif /* !_REENT_ONLY */ diff --git a/newlib/libc/stdlib/mbstowcs_r.c b/newlib/libc/stdlib/mbstowcs_r.c new file mode 100644 index 000000000..5478849bb --- /dev/null +++ b/newlib/libc/stdlib/mbstowcs_r.c @@ -0,0 +1,29 @@ +#include + +size_t +_DEFUN (_mbstowcs_r, (reent, pwcs, s, n, state), + struct _reent *r _AND + wchar_t *pwcs _AND + const char *s _AND + size_t n _AND + int *state) +{ + wchar_t *ptr = pwcs; + size_t max = n; + char *t = (char *)s; + int bytes; + + while (n > 0) + { + bytes = _mbtowc_r (r, ptr, t, MB_CUR_MAX, state); + if (bytes == -1) + return -1; + else if (bytes == 0) + return ptr - pwcs; + t += bytes; + ++ptr; + --n; + } + + return max; +} diff --git a/newlib/libc/stdlib/mbtowc.c b/newlib/libc/stdlib/mbtowc.c new file mode 100644 index 000000000..5e34fe366 --- /dev/null +++ b/newlib/libc/stdlib/mbtowc.c @@ -0,0 +1,81 @@ +/* +FUNCTION +<>---minimal multibyte to wide char converter + +INDEX + mbtowc + +ANSI_SYNOPSIS + #include + int mbtowc(wchar_t *<[pwc]>, const char *<[s]>, size_t <[n]>); + +TRAD_SYNOPSIS + #include + int mbtowc(<[pwc]>, <[s]>, <[n]>) + wchar_t *<[pwc]>; + const char *<[s]>; + size_t <[n]>; + +DESCRIPTION +When MB_CAPABLE is not defined, this is a minimal ANSI-conforming +implementation of <>. In this case, +only ``multi-byte character sequences'' recognized are single bytes, +and they are ``converted'' to themselves. +Each call to <> copies one character from <<*<[s]>>> to +<<*<[pwc]>>>, unless <[s]> is a null pointer. The argument n +is ignored. + +When MB_CAPABLE is defined, this routine calls <<_mbtowc_r>> to perform +the conversion, passing a state variable to allow state dependent +decoding. The result is based on the locale setting which may +be restricted to a defined set of locales. + +RETURNS +This implementation of <> returns <<0>> if +<[s]> is <> or is the empty string; +it returns <<1>> if not MB_CAPABLE or +the character is a single-byte character; it returns <<-1>> +if n is <<0>> or the multi-byte character is invalid; +otherwise it returns the number of bytes in the multibyte character. +If the return value is -1, no changes are made to the <> +output string. If the input is the empty string, a wchar_t nul +is placed in the output string and 0 is returned. If the input +has a length of 0, no changes are made to the <> output string. + +PORTABILITY +<> is required in the ANSI C standard. However, the precise +effects vary with the locale. + +<> requires no supporting OS subroutines. +*/ + +#ifndef _REENT_ONLY + +#include + +int +_DEFUN (mbtowc, (pwc, s, n), + wchar_t *pwc _AND + const char *s _AND + size_t n) +{ +#ifdef MB_CAPABLE + static int state; + + return _mbtowc_r (_REENT, pwc, s, n, &state); +#else /* not MB_CAPABLE */ + if (s == NULL) + return 0; + if (n == 0) + return -1; + if (pwc) + *pwc = (wchar_t) *s; + return (*s != '\0'); +#endif /* not MB_CAPABLE */ +} + +#endif /* !_REENT_ONLY */ + + + + diff --git a/newlib/libc/stdlib/mbtowc_r.c b/newlib/libc/stdlib/mbtowc_r.c new file mode 100644 index 000000000..7d718c8b0 --- /dev/null +++ b/newlib/libc/stdlib/mbtowc_r.c @@ -0,0 +1,206 @@ +#include +#include +#include "mbctype.h" + +#ifdef MB_CAPABLE +typedef enum { ESCAPE, DOLLAR, BRACKET, AT, B, J, + NUL, JIS_CHAR, OTHER, JIS_C_NUM } JIS_CHAR_TYPE; +typedef enum { ASCII, A_ESC, A_ESC_DL, JIS, JIS_1, JIS_2, J_ESC, J_ESC_BR, + J2_ESC, J2_ESC_BR, DONE, INV, JIS_S_NUM } JIS_STATE; +typedef enum { COPY_A, COPY_J, COPY_J2, MAKE_A, MAKE_J, NOOP, EMPTY, ERROR } JIS_ACTION; + +/************************************************************************************** + * state/action tables for processing JIS encoding + * Where possible, switches to JIS are grouped with proceding JIS characters and switches + * to ASCII are grouped with preceding JIS characters. Thus, maximum returned length + * is 2 (switch to JIS) + 2 (JIS characters) + 2 (switch back to ASCII) = 6. + *************************************************************************************/ + +static JIS_STATE JIS_state_table[JIS_S_NUM][JIS_C_NUM] = { +/* ESCAPE DOLLAR BRACKET AT B J NUL JIS_CHAR OTHER */ +/* ASCII */ { A_ESC, DONE, DONE, DONE, DONE, DONE, DONE, DONE, DONE }, +/* A_ESC */ { DONE, A_ESC_DL, DONE, DONE, DONE, DONE, DONE, DONE, DONE }, +/* A_ESC_DL */{ DONE, DONE, DONE, JIS, JIS, DONE, DONE, DONE, DONE }, +/* JIS */ { J_ESC, JIS_1, JIS_1, JIS_1, JIS_1, JIS_1, INV, JIS_1, INV }, +/* JIS_1 */ { INV, JIS_2, JIS_2, JIS_2, JIS_2, JIS_2, INV, JIS_2, INV }, +/* JIS_2 */ { J2_ESC, DONE, DONE, DONE, DONE, DONE, INV, DONE, DONE }, +/* J_ESC */ { INV, INV, J_ESC_BR, INV, INV, INV, INV, INV, INV }, +/* J_ESC_BR */{ INV, INV, INV, INV, ASCII, ASCII, INV, INV, INV }, +/* J2_ESC */ { INV, INV, J2_ESC_BR,INV, INV, INV, INV, INV, INV }, +/* J2_ESC_BR*/{ INV, INV, INV, INV, DONE, DONE, INV, INV, INV }, +}; + +static JIS_ACTION JIS_action_table[JIS_S_NUM][JIS_C_NUM] = { +/* ESCAPE DOLLAR BRACKET AT B J NUL JIS_CHAR OTHER */ +/* ASCII */ { NOOP, COPY_A, COPY_A, COPY_A, COPY_A, COPY_A, EMPTY, COPY_A, COPY_A}, +/* A_ESC */ { COPY_A, NOOP, COPY_A, COPY_A, COPY_A, COPY_A, COPY_A, COPY_A, COPY_A}, +/* A_ESC_DL */{ COPY_A, COPY_A, COPY_A, MAKE_J, MAKE_J, COPY_A, COPY_A, COPY_A, COPY_A}, +/* JIS */ { NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, ERROR, NOOP, ERROR }, +/* JIS_1 */ { ERROR, NOOP, NOOP, NOOP, NOOP, NOOP, ERROR, NOOP, ERROR }, +/* JIS_2 */ { NOOP, COPY_J2, COPY_J2, COPY_J2, COPY_J2, COPY_J2, ERROR, COPY_J2, COPY_J2}, +/* J_ESC */ { ERROR, ERROR, NOOP, ERROR, ERROR, ERROR, ERROR, ERROR, ERROR }, +/* J_ESC_BR */{ ERROR, ERROR, ERROR, ERROR, NOOP, NOOP, ERROR, ERROR, ERROR }, +/* J2_ESC */ { ERROR, ERROR, NOOP, ERROR, ERROR, ERROR, ERROR, ERROR, ERROR }, +/* J2_ESC_BR*/{ ERROR, ERROR, ERROR, ERROR, COPY_J, COPY_J, ERROR, ERROR, ERROR }, +}; +#endif /* MB_CAPABLE */ + +int +_DEFUN (_mbtowc_r, (r, pwc, s, n, state), + struct _reent *r _AND + wchar_t *pwc _AND + const char *s _AND + size_t n _AND + int *state) +{ + wchar_t dummy; + unsigned char *t = (unsigned char *)s; + + if (pwc == NULL) + pwc = &dummy; + + if (s != NULL && n == 0) + return -1; + +#ifdef MB_CAPABLE + if (r->_current_locale == NULL || + (strlen (r->_current_locale) <= 1)) + { /* fall-through */ } + else if (!strcmp (r->_current_locale, "C-SJIS")) + { + int char1 = *t; + if (s == NULL) + return 0; /* not state-dependent */ + if (_issjis1 (char1)) + { + int char2 = t[1]; + if (n <= 1) + return -1; + if (_issjis2 (char2)) + { + *pwc = (((wchar_t)*t) << 8) + (wchar_t)(*(t+1)); + return 2; + } + else + return -1; + } + } + else if (!strcmp (r->_current_locale, "C-EUCJP")) + { + int char1 = *t; + if (s == NULL) + return 0; /* not state-dependent */ + if (_iseucjp (char1)) + { + int char2 = t[1]; + if (n <= 1) + return -1; + if (_iseucjp (char2)) + { + *pwc = (((wchar_t)*t) << 8) + (wchar_t)(*(t+1)); + return 2; + } + else + return -1; + } + } + else if (!strcmp (r->_current_locale, "C-JIS")) + { + JIS_STATE curr_state; + JIS_ACTION action; + JIS_CHAR_TYPE ch; + unsigned char *ptr; + int i, curr_ch; + + if (s == NULL) + { + *state = 0; + return 1; /* state-dependent */ + } + + curr_state = (*state == 0 ? ASCII : JIS); + ptr = t; + + for (i = 0; i < n; ++i) + { + curr_ch = t[i]; + switch (curr_ch) + { + case ESC_CHAR: + ch = ESCAPE; + break; + case '$': + ch = DOLLAR; + break; + case '@': + ch = AT; + break; + case '(': + ch = BRACKET; + break; + case 'B': + ch = B; + break; + case 'J': + ch = J; + break; + case '\0': + ch = NUL; + break; + default: + if (_isjis (curr_ch)) + ch = JIS_CHAR; + else + ch = OTHER; + } + + action = JIS_action_table[curr_state][ch]; + curr_state = JIS_state_table[curr_state][ch]; + + switch (action) + { + case NOOP: + break; + case EMPTY: + *state = 0; + *pwc = (wchar_t)0; + return i; + case COPY_A: + *state = 0; + *pwc = (wchar_t)*ptr; + return (i + 1); + case COPY_J: + *state = 0; + *pwc = (((wchar_t)*ptr) << 8) + (wchar_t)(*(ptr+1)); + return (i + 1); + case COPY_J2: + *state = 1; + *pwc = (((wchar_t)*ptr) << 8) + (wchar_t)(*(ptr+1)); + return (ptr - t) + 2; + case MAKE_A: + case MAKE_J: + ptr = (char *)(t + i + 1); + break; + case ERROR: + default: + return -1; + } + + } + + return -1; /* n < bytes needed */ + } +#endif /* MB_CAPABLE */ + + /* otherwise this must be the "C" locale or unknown locale */ + if (s == NULL) + return 0; /* not state-dependent */ + + *pwc = (wchar_t)*t; + + if (*t == '\0') + return 0; + + return 1; +} + diff --git a/newlib/libc/stdlib/mlock.c b/newlib/libc/stdlib/mlock.c new file mode 100644 index 000000000..e7f7242ce --- /dev/null +++ b/newlib/libc/stdlib/mlock.c @@ -0,0 +1,50 @@ +/* +FUNCTION +<<__malloc_lock>>, <<__malloc_unlock>>--lock malloc pool + +INDEX + __malloc_lock +INDEX + __malloc_unlock + +ANSI_SYNOPSIS + #include + void __malloc_lock (void *<[reent]>); + void __malloc_unlock (void *<[reent]>); + +TRAD_SYNOPSIS + void __malloc_lock(<[reent]>) + char *<[reent]>; + + void __malloc_unlock(<[reent]>) + char *<[reent]>; + +DESCRIPTION +The <> family of routines call these functions when they need +to lock the memory pool. The version of these routines supplied in +the library does not do anything. If multiple threads of execution +can call <>, or if <> can be called reentrantly, then +you need to define your own versions of these functions in order to +safely lock the memory pool during a call. If you do not, the memory +pool may become corrupted. + +A call to <> may call <<__malloc_lock>> recursively; that is, +the sequence of calls may go <<__malloc_lock>>, <<__malloc_lock>>, +<<__malloc_unlock>>, <<__malloc_unlock>>. Any implementation of these +routines must be careful to avoid causing a thread to wait for a lock +that it already holds. +*/ + +#include + +void +__malloc_lock (ptr) + struct _reent *ptr; +{ +} + +void +__malloc_unlock (ptr) + struct _reent *ptr; +{ +} diff --git a/newlib/libc/stdlib/mprec.c b/newlib/libc/stdlib/mprec.c new file mode 100644 index 000000000..48e10be87 --- /dev/null +++ b/newlib/libc/stdlib/mprec.c @@ -0,0 +1,980 @@ +/**************************************************************** + * + * The author of this software is David M. Gay. + * + * Copyright (c) 1991 by AT&T. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose without fee is hereby granted, provided that this entire notice + * is included in all copies of any software which is or includes a copy + * or modification of this software and in all copies of the supporting + * documentation for such software. + * + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY + * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + * + ***************************************************************/ + +/* Please send bug reports to + David M. Gay + AT&T Bell Laboratories, Room 2C-463 + 600 Mountain Avenue + Murray Hill, NJ 07974-2070 + U.S.A. + dmg@research.att.com or research!dmg + */ + +/* strtod for IEEE-, VAX-, and IBM-arithmetic machines. + * + * This strtod returns a nearest machine number to the input decimal + * string (or sets errno to ERANGE). With IEEE arithmetic, ties are + * broken by the IEEE round-even rule. Otherwise ties are broken by + * biased rounding (add half and chop). + * + * Inspired loosely by William D. Clinger's paper "How to Read Floating + * Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101]. + * + * Modifications: + * + * 1. We only require IEEE, IBM, or VAX double-precision + * arithmetic (not IEEE double-extended). + * 2. We get by with floating-point arithmetic in a case that + * Clinger missed -- when we're computing d * 10^n + * for a small integer d and the integer n is not too + * much larger than 22 (the maximum integer k for which + * we can represent 10^k exactly), we may be able to + * compute (d*10^k) * 10^(e-k) with just one roundoff. + * 3. Rather than a bit-at-a-time adjustment of the binary + * result in the hard case, we use floating-point + * arithmetic to determine the adjustment to within + * one bit; only in really hard cases do we need to + * compute a second residual. + * 4. Because of 3., we don't need a large table of powers of 10 + * for ten-to-e (just some small tables, e.g. of 10^k + * for 0 <= k <= 22). + */ + +/* + * #define IEEE_8087 for IEEE-arithmetic machines where the least + * significant byte has the lowest address. + * #define IEEE_MC68k for IEEE-arithmetic machines where the most + * significant byte has the lowest address. + * #define Sudden_Underflow for IEEE-format machines without gradual + * underflow (i.e., that flush to zero on underflow). + * #define IBM for IBM mainframe-style floating-point arithmetic. + * #define VAX for VAX-style floating-point arithmetic. + * #define Unsigned_Shifts if >> does treats its left operand as unsigned. + * #define No_leftright to omit left-right logic in fast floating-point + * computation of dtoa. + * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3. + * #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines + * that use extended-precision instructions to compute rounded + * products and quotients) with IBM. + * #define ROUND_BIASED for IEEE-format with biased rounding. + * #define Inaccurate_Divide for IEEE-format with correctly rounded + * products but inaccurate quotients, e.g., for Intel i860. + * #define Just_16 to store 16 bits per 32-bit long when doing high-precision + * integer arithmetic. Whether this speeds things up or slows things + * down depends on the machine and the number being converted. + */ + +#include <_ansi.h> +#include +#include +#include +#include "mprec.h" + +/* reent.c knows this value */ +#define _Kmax 15 + +_Bigint * +_DEFUN (Balloc, (ptr, k), struct _reent *ptr _AND int k) +{ + int x; + _Bigint *rv ; + + if (ptr->_freelist == NULL) + { + /* Allocate a list of pointers to the mprec objects */ + ptr->_freelist = (struct _Bigint **) _calloc_r (ptr, + sizeof (struct _Bigint *), + _Kmax + 1); + if (ptr->_freelist == NULL) + { + return NULL; + } + } + + if (rv = ptr->_freelist[k]) + { + ptr->_freelist[k] = rv->_next; + } + else + { + x = 1 << k; + /* Allocate an mprec Bigint and stick in in the freelist */ + rv = (_Bigint *) _calloc_r (ptr, + 1, + sizeof (_Bigint) + + (x-1) * sizeof(rv->_x)); + if (rv == NULL) return NULL; + rv->_k = k; + rv->_maxwds = x; + } + rv->_sign = rv->_wds = 0; + return rv; +} + +void +_DEFUN (Bfree, (ptr, v), struct _reent *ptr _AND _Bigint * v) +{ + if (v) + { + v->_next = ptr->_freelist[v->_k]; + ptr->_freelist[v->_k] = v; + } +} + +_Bigint * +_DEFUN (multadd, (ptr, b, m, a), + struct _reent *ptr _AND + _Bigint * b _AND + int m _AND + int a) +{ + int i, wds; + __ULong *x, y; +#ifdef Pack_32 + __ULong xi, z; +#endif + _Bigint *b1; + + wds = b->_wds; + x = b->_x; + i = 0; + do + { +#ifdef Pack_32 + xi = *x; + y = (xi & 0xffff) * m + a; + z = (xi >> 16) * m + (y >> 16); + a = (int) (z >> 16); + *x++ = (z << 16) + (y & 0xffff); +#else + y = *x * m + a; + a = (int) (y >> 16); + *x++ = y & 0xffff; +#endif + } + while (++i < wds); + if (a) + { + if (wds >= b->_maxwds) + { + b1 = Balloc (ptr, b->_k + 1); + Bcopy (b1, b); + Bfree (ptr, b); + b = b1; + } + b->_x[wds++] = a; + b->_wds = wds; + } + return b; +} + +_Bigint * +_DEFUN (s2b, (ptr, s, nd0, nd, y9), + struct _reent * ptr _AND + _CONST char *s _AND + int nd0 _AND + int nd _AND + __ULong y9) +{ + _Bigint *b; + int i, k; + __Long x, y; + + x = (nd + 8) / 9; + for (k = 0, y = 1; x > y; y <<= 1, k++); +#ifdef Pack_32 + b = Balloc (ptr, k); + b->_x[0] = y9; + b->_wds = 1; +#else + b = Balloc (ptr, k + 1); + b->_x[0] = y9 & 0xffff; + b->_wds = (b->_x[1] = y9 >> 16) ? 2 : 1; +#endif + + i = 9; + if (9 < nd0) + { + s += 9; + do + b = multadd (ptr, b, 10, *s++ - '0'); + while (++i < nd0); + s++; + } + else + s += 10; + for (; i < nd; i++) + b = multadd (ptr, b, 10, *s++ - '0'); + return b; +} + +int +_DEFUN (hi0bits, + (x), register __ULong x) +{ + register int k = 0; + + if (!(x & 0xffff0000)) + { + k = 16; + x <<= 16; + } + if (!(x & 0xff000000)) + { + k += 8; + x <<= 8; + } + if (!(x & 0xf0000000)) + { + k += 4; + x <<= 4; + } + if (!(x & 0xc0000000)) + { + k += 2; + x <<= 2; + } + if (!(x & 0x80000000)) + { + k++; + if (!(x & 0x40000000)) + return 32; + } + return k; +} + +int +_DEFUN (lo0bits, (y), __ULong *y) +{ + register int k; + register __ULong x = *y; + + if (x & 7) + { + if (x & 1) + return 0; + if (x & 2) + { + *y = x >> 1; + return 1; + } + *y = x >> 2; + return 2; + } + k = 0; + if (!(x & 0xffff)) + { + k = 16; + x >>= 16; + } + if (!(x & 0xff)) + { + k += 8; + x >>= 8; + } + if (!(x & 0xf)) + { + k += 4; + x >>= 4; + } + if (!(x & 0x3)) + { + k += 2; + x >>= 2; + } + if (!(x & 1)) + { + k++; + x >>= 1; + if (!x & 1) + return 32; + } + *y = x; + return k; +} + +_Bigint * +_DEFUN (i2b, (ptr, i), struct _reent * ptr _AND int i) +{ + _Bigint *b; + + b = Balloc (ptr, 1); + b->_x[0] = i; + b->_wds = 1; + return b; +} + +_Bigint * +_DEFUN (mult, (ptr, a, b), struct _reent * ptr _AND _Bigint * a _AND _Bigint * b) +{ + _Bigint *c; + int k, wa, wb, wc; + __ULong carry, y, z; + __ULong *x, *xa, *xae, *xb, *xbe, *xc, *xc0; +#ifdef Pack_32 + __ULong z2; +#endif + + if (a->_wds < b->_wds) + { + c = a; + a = b; + b = c; + } + k = a->_k; + wa = a->_wds; + wb = b->_wds; + wc = wa + wb; + if (wc > a->_maxwds) + k++; + c = Balloc (ptr, k); + for (x = c->_x, xa = x + wc; x < xa; x++) + *x = 0; + xa = a->_x; + xae = xa + wa; + xb = b->_x; + xbe = xb + wb; + xc0 = c->_x; +#ifdef Pack_32 + for (; xb < xbe; xb++, xc0++) + { + if (y = *xb & 0xffff) + { + x = xa; + xc = xc0; + carry = 0; + do + { + z = (*x & 0xffff) * y + (*xc & 0xffff) + carry; + carry = z >> 16; + z2 = (*x++ >> 16) * y + (*xc >> 16) + carry; + carry = z2 >> 16; + Storeinc (xc, z2, z); + } + while (x < xae); + *xc = carry; + } + if (y = *xb >> 16) + { + x = xa; + xc = xc0; + carry = 0; + z2 = *xc; + do + { + z = (*x & 0xffff) * y + (*xc >> 16) + carry; + carry = z >> 16; + Storeinc (xc, z, z2); + z2 = (*x++ >> 16) * y + (*xc & 0xffff) + carry; + carry = z2 >> 16; + } + while (x < xae); + *xc = z2; + } + } +#else + for (; xb < xbe; xc0++) + { + if (y = *xb++) + { + x = xa; + xc = xc0; + carry = 0; + do + { + z = *x++ * y + *xc + carry; + carry = z >> 16; + *xc++ = z & 0xffff; + } + while (x < xae); + *xc = carry; + } + } +#endif + for (xc0 = c->_x, xc = xc0 + wc; wc > 0 && !*--xc; --wc); + c->_wds = wc; + return c; +} + +_Bigint * +_DEFUN (pow5mult, + (ptr, b, k), struct _reent * ptr _AND _Bigint * b _AND int k) +{ + _Bigint *b1, *p5, *p51; + int i; + static _CONST int p05[3] = {5, 25, 125}; + + if (i = k & 3) + b = multadd (ptr, b, p05[i - 1], 0); + + if (!(k >>= 2)) + return b; + if (!(p5 = ptr->_p5s)) + { + /* first time */ + p5 = ptr->_p5s = i2b (ptr, 625); + p5->_next = 0; + } + for (;;) + { + if (k & 1) + { + b1 = mult (ptr, b, p5); + Bfree (ptr, b); + b = b1; + } + if (!(k >>= 1)) + break; + if (!(p51 = p5->_next)) + { + p51 = p5->_next = mult (ptr, p5, p5); + p51->_next = 0; + } + p5 = p51; + } + return b; +} + +_Bigint * +_DEFUN (lshift, (ptr, b, k), struct _reent * ptr _AND _Bigint * b _AND int k) +{ + int i, k1, n, n1; + _Bigint *b1; + __ULong *x, *x1, *xe, z; + +#ifdef Pack_32 + n = k >> 5; +#else + n = k >> 4; +#endif + k1 = b->_k; + n1 = n + b->_wds + 1; + for (i = b->_maxwds; n1 > i; i <<= 1) + k1++; + b1 = Balloc (ptr, k1); + x1 = b1->_x; + for (i = 0; i < n; i++) + *x1++ = 0; + x = b->_x; + xe = x + b->_wds; +#ifdef Pack_32 + if (k &= 0x1f) + { + k1 = 32 - k; + z = 0; + do + { + *x1++ = *x << k | z; + z = *x++ >> k1; + } + while (x < xe); + if (*x1 = z) + ++n1; + } +#else + if (k &= 0xf) + { + k1 = 16 - k; + z = 0; + do + { + *x1++ = *x << k & 0xffff | z; + z = *x++ >> k1; + } + while (x < xe); + if (*x1 = z) + ++n1; + } +#endif + else + do + *x1++ = *x++; + while (x < xe); + b1->_wds = n1 - 1; + Bfree (ptr, b); + return b1; +} + +int +_DEFUN (cmp, (a, b), _Bigint * a _AND _Bigint * b) +{ + __ULong *xa, *xa0, *xb, *xb0; + int i, j; + + i = a->_wds; + j = b->_wds; +#ifdef DEBUG + if (i > 1 && !a->_x[i - 1]) + Bug ("cmp called with a->_x[a->_wds-1] == 0"); + if (j > 1 && !b->_x[j - 1]) + Bug ("cmp called with b->_x[b->_wds-1] == 0"); +#endif + if (i -= j) + return i; + xa0 = a->_x; + xa = xa0 + j; + xb0 = b->_x; + xb = xb0 + j; + for (;;) + { + if (*--xa != *--xb) + return *xa < *xb ? -1 : 1; + if (xa <= xa0) + break; + } + return 0; +} + +_Bigint * +_DEFUN (diff, (ptr, a, b), struct _reent * ptr _AND + _Bigint * a _AND _Bigint * b) +{ + _Bigint *c; + int i, wa, wb; + __Long borrow, y; /* We need signed shifts here. */ + __ULong *xa, *xae, *xb, *xbe, *xc; +#ifdef Pack_32 + __Long z; +#endif + + i = cmp (a, b); + if (!i) + { + c = Balloc (ptr, 0); + c->_wds = 1; + c->_x[0] = 0; + return c; + } + if (i < 0) + { + c = a; + a = b; + b = c; + i = 1; + } + else + i = 0; + c = Balloc (ptr, a->_k); + c->_sign = i; + wa = a->_wds; + xa = a->_x; + xae = xa + wa; + wb = b->_wds; + xb = b->_x; + xbe = xb + wb; + xc = c->_x; + borrow = 0; +#ifdef Pack_32 + do + { + y = (*xa & 0xffff) - (*xb & 0xffff) + borrow; + borrow = y >> 16; + Sign_Extend (borrow, y); + z = (*xa++ >> 16) - (*xb++ >> 16) + borrow; + borrow = z >> 16; + Sign_Extend (borrow, z); + Storeinc (xc, z, y); + } + while (xb < xbe); + while (xa < xae) + { + y = (*xa & 0xffff) + borrow; + borrow = y >> 16; + Sign_Extend (borrow, y); + z = (*xa++ >> 16) + borrow; + borrow = z >> 16; + Sign_Extend (borrow, z); + Storeinc (xc, z, y); + } +#else + do + { + y = *xa++ - *xb++ + borrow; + borrow = y >> 16; + Sign_Extend (borrow, y); + *xc++ = y & 0xffff; + } + while (xb < xbe); + while (xa < xae) + { + y = *xa++ + borrow; + borrow = y >> 16; + Sign_Extend (borrow, y); + *xc++ = y & 0xffff; + } +#endif + while (!*--xc) + wa--; + c->_wds = wa; + return c; +} + +double +_DEFUN (ulp, (_x), double _x) +{ + union double_union x, a; + register __Long L; + + x.d = _x; + + L = (word0 (x) & Exp_mask) - (P - 1) * Exp_msk1; +#ifndef Sudden_Underflow + if (L > 0) + { +#endif +#ifdef IBM + L |= Exp_msk1 >> 4; +#endif + word0 (a) = L; +#ifndef _DOUBLE_IS_32BITS + word1 (a) = 0; +#endif + +#ifndef Sudden_Underflow + } + else + { + L = -L >> Exp_shift; + if (L < Exp_shift) + { + word0 (a) = 0x80000 >> L; +#ifndef _DOUBLE_IS_32BITS + word1 (a) = 0; +#endif + } + else + { + word0 (a) = 0; + L -= Exp_shift; +#ifndef _DOUBLE_IS_32BITS + word1 (a) = L >= 31 ? 1 : 1 << 31 - L; +#endif + } + } +#endif + return a.d; +} + +double +_DEFUN (b2d, (a, e), + _Bigint * a _AND int *e) +{ + __ULong *xa, *xa0, w, y, z; + int k; + union double_union d; +#ifdef VAX + __ULong d0, d1; +#else +#define d0 word0(d) +#define d1 word1(d) +#endif + + xa0 = a->_x; + xa = xa0 + a->_wds; + y = *--xa; +#ifdef DEBUG + if (!y) + Bug ("zero y in b2d"); +#endif + k = hi0bits (y); + *e = 32 - k; +#ifdef Pack_32 + if (k < Ebits) + { + d0 = Exp_1 | y >> Ebits - k; + w = xa > xa0 ? *--xa : 0; +#ifndef _DOUBLE_IS_32BITS + d1 = y << (32 - Ebits) + k | w >> Ebits - k; +#endif + goto ret_d; + } + z = xa > xa0 ? *--xa : 0; + if (k -= Ebits) + { + d0 = Exp_1 | y << k | z >> 32 - k; + y = xa > xa0 ? *--xa : 0; +#ifndef _DOUBLE_IS_32BITS + d1 = z << k | y >> 32 - k; +#endif + } + else + { + d0 = Exp_1 | y; +#ifndef _DOUBLE_IS_32BITS + d1 = z; +#endif + } +#else + if (k < Ebits + 16) + { + z = xa > xa0 ? *--xa : 0; + d0 = Exp_1 | y << k - Ebits | z >> Ebits + 16 - k; + w = xa > xa0 ? *--xa : 0; + y = xa > xa0 ? *--xa : 0; + d1 = z << k + 16 - Ebits | w << k - Ebits | y >> 16 + Ebits - k; + goto ret_d; + } + z = xa > xa0 ? *--xa : 0; + w = xa > xa0 ? *--xa : 0; + k -= Ebits + 16; + d0 = Exp_1 | y << k + 16 | z << k | w >> 16 - k; + y = xa > xa0 ? *--xa : 0; + d1 = w << k + 16 | y << k; +#endif +ret_d: +#ifdef VAX + word0 (d) = d0 >> 16 | d0 << 16; + word1 (d) = d1 >> 16 | d1 << 16; +#else +#undef d0 +#undef d1 +#endif + return d.d; +} + +_Bigint * +_DEFUN (d2b, + (ptr, _d, e, bits), + struct _reent * ptr _AND + double _d _AND + int *e _AND + int *bits) + +{ + union double_union d; + _Bigint *b; + int de, i, k; + __ULong *x, y, z; +#ifdef VAX + __ULong d0, d1; +#endif + d.d = _d; +#ifdef VAX + d0 = word0 (d) >> 16 | word0 (d) << 16; + d1 = word1 (d) >> 16 | word1 (d) << 16; +#else +#define d0 word0(d) +#define d1 word1(d) + d.d = _d; +#endif + +#ifdef Pack_32 + b = Balloc (ptr, 1); +#else + b = Balloc (ptr, 2); +#endif + x = b->_x; + + z = d0 & Frac_mask; + d0 &= 0x7fffffff; /* clear sign bit, which we ignore */ +#ifdef Sudden_Underflow + de = (int) (d0 >> Exp_shift); +#ifndef IBM + z |= Exp_msk11; +#endif +#else + if (de = (int) (d0 >> Exp_shift)) + z |= Exp_msk1; +#endif +#ifdef Pack_32 +#ifndef _DOUBLE_IS_32BITS + if (y = d1) + { + if (k = lo0bits (&y)) + { + x[0] = y | z << 32 - k; + z >>= k; + } + else + x[0] = y; + i = b->_wds = (x[1] = z) ? 2 : 1; + } + else +#endif + { +#ifdef DEBUG + if (!z) + Bug ("Zero passed to d2b"); +#endif + k = lo0bits (&z); + x[0] = z; + i = b->_wds = 1; +#ifndef _DOUBLE_IS_32BITS + k += 32; +#endif + } +#else + if (y = d1) + { + if (k = lo0bits (&y)) + if (k >= 16) + { + x[0] = y | z << 32 - k & 0xffff; + x[1] = z >> k - 16 & 0xffff; + x[2] = z >> k; + i = 2; + } + else + { + x[0] = y & 0xffff; + x[1] = y >> 16 | z << 16 - k & 0xffff; + x[2] = z >> k & 0xffff; + x[3] = z >> k + 16; + i = 3; + } + else + { + x[0] = y & 0xffff; + x[1] = y >> 16; + x[2] = z & 0xffff; + x[3] = z >> 16; + i = 3; + } + } + else + { +#ifdef DEBUG + if (!z) + Bug ("Zero passed to d2b"); +#endif + k = lo0bits (&z); + if (k >= 16) + { + x[0] = z; + i = 0; + } + else + { + x[0] = z & 0xffff; + x[1] = z >> 16; + i = 1; + } + k += 32; + } + while (!x[i]) + --i; + b->_wds = i + 1; +#endif +#ifndef Sudden_Underflow + if (de) + { +#endif +#ifdef IBM + *e = (de - Bias - (P - 1) << 2) + k; + *bits = 4 * P + 8 - k - hi0bits (word0 (d) & Frac_mask); +#else + *e = de - Bias - (P - 1) + k; + *bits = P - k; +#endif +#ifndef Sudden_Underflow + } + else + { + *e = de - Bias - (P - 1) + 1 + k; +#ifdef Pack_32 + *bits = 32 * i - hi0bits (x[i - 1]); +#else + *bits = (i + 2) * 16 - hi0bits (x[i]); +#endif + } +#endif + return b; +} +#undef d0 +#undef d1 + +double +_DEFUN (ratio, (a, b), _Bigint * a _AND _Bigint * b) + +{ + union double_union da, db; + int k, ka, kb; + + da.d = b2d (a, &ka); + db.d = b2d (b, &kb); +#ifdef Pack_32 + k = ka - kb + 32 * (a->_wds - b->_wds); +#else + k = ka - kb + 16 * (a->_wds - b->_wds); +#endif +#ifdef IBM + if (k > 0) + { + word0 (da) += (k >> 2) * Exp_msk1; + if (k &= 3) + da.d *= 1 << k; + } + else + { + k = -k; + word0 (db) += (k >> 2) * Exp_msk1; + if (k &= 3) + db.d *= 1 << k; + } +#else + if (k > 0) + word0 (da) += k * Exp_msk1; + else + { + k = -k; + word0 (db) += k * Exp_msk1; + } +#endif + return da.d / db.d; +} + + +_CONST double + tens[] = +{ + 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, + 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, + 1e20, 1e21, 1e22, 1e23, 1e24 + +}; + +#if !defined(_DOUBLE_IS_32BITS) && !defined(__v800) +_CONST double bigtens[] = +{1e16, 1e32, 1e64, 1e128, 1e256}; + +_CONST double tinytens[] = +{1e-16, 1e-32, 1e-64, 1e-128, 1e-256}; +#else +_CONST double bigtens[] = +{1e16, 1e32}; + +_CONST double tinytens[] = +{1e-16, 1e-32}; +#endif + + +double +_DEFUN (_mprec_log10, (dig), + int dig) +{ + double v = 1.0; + if (dig < 24) + return tens[dig]; + while (dig > 0) + { + v *= 10; + dig--; + } + return v; +} diff --git a/newlib/libc/stdlib/mprec.h b/newlib/libc/stdlib/mprec.h new file mode 100644 index 000000000..001f0c284 --- /dev/null +++ b/newlib/libc/stdlib/mprec.h @@ -0,0 +1,313 @@ +/**************************************************************** + * + * The author of this software is David M. Gay. + * + * Copyright (c) 1991 by AT&T. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose without fee is hereby granted, provided that this entire notice + * is included in all copies of any software which is or includes a copy + * or modification of this software and in all copies of the supporting + * documentation for such software. + * + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY + * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + * + ***************************************************************/ + +/* Please send bug reports to + David M. Gay + AT&T Bell Laboratories, Room 2C-463 + 600 Mountain Avenue + Murray Hill, NJ 07974-2070 + U.S.A. + dmg@research.att.com or research!dmg + */ + +#include +#include +#include +#include +#include + +#ifdef __IEEE_LITTLE_ENDIAN +#define IEEE_8087 +#endif + +#ifdef __IEEE_BIG_ENDIAN +#define IEEE_MC68k +#endif + +#ifdef __Z8000__ +#define Just_16 +#endif + +#ifdef DEBUG +#include "stdio.h" +#define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);} +#endif + +#ifdef Unsigned_Shifts +#define Sign_Extend(a,b) if (b < 0) a |= (__uint32_t)0xffff0000; +#else +#define Sign_Extend(a,b) /*no-op*/ +#endif + +#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM) != 1 +Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined. +#endif + +/* If we are going to examine or modify specific bits in a double using + the word0 and/or word1 macros, then we must wrap the double inside + a union. This is necessary to avoid undefined behavior according to + the ANSI C spec. */ +union double_union +{ + double d; + __uint32_t i[2]; +}; + +#ifdef IEEE_8087 +#define word0(x) (x.i[1]) +#define word1(x) (x.i[0]) +#else +#define word0(x) (x.i[0]) +#define word1(x) (x.i[1]) +#endif + +/* The following definition of Storeinc is appropriate for MIPS processors. + * An alternative that might be better on some machines is + * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff) + */ +#if defined(IEEE_8087) + defined(VAX) +#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \ +((unsigned short *)a)[0] = (unsigned short)c, a++) +#else +#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \ +((unsigned short *)a)[1] = (unsigned short)c, a++) +#endif + +/* #define P DBL_MANT_DIG */ +/* Ten_pmax = floor(P*log(2)/log(5)) */ +/* Bletch = (highest power of 2 < DBL_MAX_10_EXP) / 16 */ +/* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */ +/* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */ + +#if defined(IEEE_8087) + defined(IEEE_MC68k) +#if defined (_DOUBLE_IS_32BITS) +#define Exp_shift 23 +#define Exp_shift1 23 +#define Exp_msk1 ((__uint32_t)0x00800000L) +#define Exp_msk11 ((__uint32_t)0x00800000L) +#define Exp_mask ((__uint32_t)0x7f800000L) +#define P 24 +#define Bias 127 +#if 0 +#define IEEE_Arith /* it is, but the code doesn't handle IEEE singles yet */ +#endif +#define Emin (-126) +#define Exp_1 ((__uint32_t)0x3f800000L) +#define Exp_11 ((__uint32_t)0x3f800000L) +#define Ebits 8 +#define Frac_mask ((__uint32_t)0x007fffffL) +#define Frac_mask1 ((__uint32_t)0x007fffffL) +#define Ten_pmax 10 +#define Sign_bit ((__uint32_t)0x80000000L) +#define Ten_pmax 10 +#define Bletch 2 +#define Bndry_mask ((__uint32_t)0x007fffffL) +#define Bndry_mask1 ((__uint32_t)0x007fffffL) +#define LSB 1 +#define Sign_bit ((__uint32_t)0x80000000L) +#define Log2P 1 +#define Tiny0 0 +#define Tiny1 1 +#define Quick_max 5 +#define Int_max 6 +#define Infinite(x) (word0(x) == ((__uint32_t)0x7f800000L)) +#undef word0 +#undef word1 + +#define word0(x) (x.i[0]) +#define word1(x) 0 +#else + +#define Exp_shift 20 +#define Exp_shift1 20 +#define Exp_msk1 ((__uint32_t)0x100000L) +#define Exp_msk11 ((__uint32_t)0x100000L) +#define Exp_mask ((__uint32_t)0x7ff00000L) +#define P 53 +#define Bias 1023 +#define IEEE_Arith +#define Emin (-1022) +#define Exp_1 ((__uint32_t)0x3ff00000L) +#define Exp_11 ((__uint32_t)0x3ff00000L) +#define Ebits 11 +#define Frac_mask ((__uint32_t)0xfffffL) +#define Frac_mask1 ((__uint32_t)0xfffffL) +#define Ten_pmax 22 +#define Bletch 0x10 +#define Bndry_mask ((__uint32_t)0xfffffL) +#define Bndry_mask1 ((__uint32_t)0xfffffL) +#define LSB 1 +#define Sign_bit ((__uint32_t)0x80000000L) +#define Log2P 1 +#define Tiny0 0 +#define Tiny1 1 +#define Quick_max 14 +#define Int_max 14 +#define Infinite(x) (word0(x) == ((__uint32_t)0x7ff00000L)) /* sufficient test for here */ +#endif + +#else +#undef Sudden_Underflow +#define Sudden_Underflow +#ifdef IBM +#define Exp_shift 24 +#define Exp_shift1 24 +#define Exp_msk1 ((__uint32_t)0x1000000L) +#define Exp_msk11 ((__uint32_t)0x1000000L) +#define Exp_mask ((__uint32_t)0x7f000000L) +#define P 14 +#define Bias 65 +#define Exp_1 ((__uint32_t)0x41000000L) +#define Exp_11 ((__uint32_t)0x41000000L) +#define Ebits 8 /* exponent has 7 bits, but 8 is the right value in b2d */ +#define Frac_mask ((__uint32_t)0xffffffL) +#define Frac_mask1 ((__uint32_t)0xffffffL) +#define Bletch 4 +#define Ten_pmax 22 +#define Bndry_mask ((__uint32_t)0xefffffL) +#define Bndry_mask1 ((__uint32_t)0xffffffL) +#define LSB 1 +#define Sign_bit ((__uint32_t)0x80000000L) +#define Log2P 4 +#define Tiny0 ((__uint32_t)0x100000L) +#define Tiny1 0 +#define Quick_max 14 +#define Int_max 15 +#else /* VAX */ +#define Exp_shift 23 +#define Exp_shift1 7 +#define Exp_msk1 0x80 +#define Exp_msk11 ((__uint32_t)0x800000L) +#define Exp_mask ((__uint32_t)0x7f80L) +#define P 56 +#define Bias 129 +#define Exp_1 ((__uint32_t)0x40800000L) +#define Exp_11 ((__uint32_t)0x4080L) +#define Ebits 8 +#define Frac_mask ((__uint32_t)0x7fffffL) +#define Frac_mask1 ((__uint32_t)0xffff007fL) +#define Ten_pmax 24 +#define Bletch 2 +#define Bndry_mask ((__uint32_t)0xffff007fL) +#define Bndry_mask1 ((__uint32_t)0xffff007fL) +#define LSB ((__uint32_t)0x10000L) +#define Sign_bit ((__uint32_t)0x8000L) +#define Log2P 1 +#define Tiny0 0x80 +#define Tiny1 0 +#define Quick_max 15 +#define Int_max 15 +#endif +#endif + +#ifndef IEEE_Arith +#define ROUND_BIASED +#endif + +#ifdef RND_PRODQUOT +#define rounded_product(a,b) a = rnd_prod(a, b) +#define rounded_quotient(a,b) a = rnd_quot(a, b) +#ifdef KR_headers +extern double rnd_prod(), rnd_quot(); +#else +extern double rnd_prod(double, double), rnd_quot(double, double); +#endif +#else +#define rounded_product(a,b) a *= b +#define rounded_quotient(a,b) a /= b +#endif + +#define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1)) +#define Big1 ((__uint32_t)0xffffffffL) + +#ifndef Just_16 +/* When Pack_32 is not defined, we store 16 bits per 32-bit long. + * This makes some inner loops simpler and sometimes saves work + * during multiplications, but it often seems to make things slightly + * slower. Hence the default is now to store 32 bits per long. + */ + +#ifndef Pack_32 +#define Pack_32 +#endif +#endif + + +#ifdef __cplusplus +extern "C" double strtod(const char *s00, char **se); +extern "C" char *dtoa(double d, int mode, int ndigits, + int *decpt, int *sign, char **rve); +#endif + + +typedef struct _Bigint _Bigint; + +#define Balloc _Balloc +#define Bfree _Bfree +#define multadd _multadd +#define s2b _s2b +#define lo0bits _lo0bits +#define hi0bits _hi0bits +#define i2b _i2b +#define mult _multiply +#define pow5mult _pow5mult +#define lshift _lshift +#define cmp __mcmp +#define diff __mdiff +#define ulp _ulp +#define b2d _b2d +#define d2b _d2b +#define ratio _ratio + +#define tens __mprec_tens +#define bigtens __mprec_bigtens +#define tinytens __mprec_tinytens + +struct _reent ; +double _EXFUN(ulp,(double x)); +double _EXFUN(b2d,(_Bigint *a , int *e)); +_Bigint * _EXFUN(Balloc,(struct _reent *p, int k)); +void _EXFUN(Bfree,(struct _reent *p, _Bigint *v)); +_Bigint * _EXFUN(multadd,(struct _reent *p, _Bigint *, int, int)); +_Bigint * _EXFUN(s2b,(struct _reent *, const char*, int, int, __ULong)); +_Bigint * _EXFUN(i2b,(struct _reent *,int)); +_Bigint * _EXFUN(mult, (struct _reent *, _Bigint *, _Bigint *)); +_Bigint * _EXFUN(pow5mult, (struct _reent *, _Bigint *, int k)); +int _EXFUN(hi0bits,(__ULong)); +int _EXFUN(lo0bits,(__ULong *)); +_Bigint * _EXFUN(d2b,(struct _reent *p, double d, int *e, int *bits)); +_Bigint * _EXFUN(lshift,(struct _reent *p, _Bigint *b, int k)); +_Bigint * _EXFUN(diff,(struct _reent *p, _Bigint *a, _Bigint *b)); +int _EXFUN(cmp,(_Bigint *a, _Bigint *b)); + +double _EXFUN(ratio,(_Bigint *a, _Bigint *b)); +#define Bcopy(x,y) memcpy((char *)&x->_sign, (char *)&y->_sign, y->_wds*sizeof(__Long) + 2*sizeof(int)) + +#if defined(_DOUBLE_IS_32BITS) && defined(__v800) +#define n_bigtens 2 +#else +#define n_bigtens 5 +#endif + +extern _CONST double tinytens[]; +extern _CONST double bigtens[]; +extern _CONST double tens[]; + + +double _EXFUN(_mprec_log10,(int)); diff --git a/newlib/libc/stdlib/msize.c b/newlib/libc/stdlib/msize.c new file mode 100644 index 000000000..e910c44ec --- /dev/null +++ b/newlib/libc/stdlib/msize.c @@ -0,0 +1,17 @@ +/* msize.c -- a wrapper for malloc_usable_size. */ + +#include <_ansi.h> +#include +#include +#include + +#ifndef _REENT_ONLY + +size_t +_DEFUN (malloc_usable_size, (ptr), + _PTR ptr) +{ + return _malloc_usable_size_r (_REENT, ptr); +} + +#endif diff --git a/newlib/libc/stdlib/mstats.c b/newlib/libc/stdlib/mstats.c new file mode 100644 index 000000000..c1628957a --- /dev/null +++ b/newlib/libc/stdlib/mstats.c @@ -0,0 +1,151 @@ +/* VxWorks provides its own version of malloc, and we can't use this + one because VxWorks does not provide sbrk. So we have a hook to + not compile this code. */ + +#ifdef MALLOC_PROVIDED + +int _dummy_mstats = 1; + +#else + +/* +FUNCTION +<>, <>, <>--malloc support + +INDEX + mallinfo +INDEX + malloc_stats +INDEX + mallopt +INDEX + _mallinfo_r +INDEX + _malloc_stats_r +INDEX + _mallopt_r + +ANSI_SYNOPSIS + #include + struct mallinfo mallinfo(void); + void malloc_stats(void); + int mallopt(int <[parameter]>, <[value]>); + + struct mallinfo _mallinfo_r(void *<[reent]>); + void _malloc_stats_r(void *<[reent]>); + int _mallopt_r(void *<[reent]>, int <[parameter]>, <[value]>); + +TRAD_SYNOPSIS + #include + struct mallinfo mallinfo(); + + void malloc_stats(); + + int mallopt(<[parameter]>, <[value]>) + int <[parameter]>; + int <[value]>; + + struct mallinfo _mallinfo_r(<[reent]>); + char *<[reent]>; + + void _malloc_stats_r(<[reent]>); + char *<[reent]>; + + int _mallopt_r(<[reent]>, <[parameter]>, <[value]>) + char *<[reent]>; + int <[parameter]>; + int <[value]>; + +DESCRIPTION +<> returns a structure describing the current state of +memory allocation. The structure is defined in malloc.h. The +following fields are defined: <> is the total amount of space +in the heap; <> is the number of chunks which are not in use; +<> is the total amount of space allocated by <>; +<> is the total amount of space not in use; <> is +the size of the top most memory block. + +<> print some statistics about memory allocation on +standard error. + +<> takes a parameter and a value. The parameters are defined +in malloc.h, and may be one of the following: <> +sets the maximum amount of unused space in the top most block before +releasing it back to the system in <> (the space is released by +calling <<_sbrk_r>> with a negative argument); <> is the +amount of padding to allocate whenever <<_sbrk_r>> is called to +allocate more space. + +The alternate functions <<_mallinfo_r>>, <<_malloc_stats_r>>, and +<<_mallopt_r>> are reentrant versions. The extra argument <[reent]> +is a pointer to a reentrancy structure. + +RETURNS +<> returns a mallinfo structure. The structure is defined +in malloc.h. + +<> does not return a result. + +<> returns zero if the parameter could not be set, or +non-zero if it could be set. + +PORTABILITY +<> and <> are provided by SVR4, but <> +takes different parameters on different systems. <> is +not portable. + +*/ + +#include <_ansi.h> +#include +#include +#include +#include + +#ifndef _REENT_ONLY + +struct mallinfo +_DEFUN_VOID (mallinfo) +{ + return _mallinfo_r (_REENT); +} + +void +_DEFUN_VOID (malloc_stats) +{ + _malloc_stats_r (_REENT); +} + +int +_DEFUN (mallopt, (p, v), + int p _AND + int v) +{ + return _mallopt_r (_REENT, p, v); +} + +#endif + +/* mstats is now compatibility code. It used to be real, for a + previous version of the malloc routines. It now just calls + malloc_stats. */ + +void +_DEFUN (_mstats_r, (ptr, s), + struct _reent *ptr _AND + char *s) +{ + fiprintf (_stderr_r (ptr), "Memory allocation statistics %s\n", s); + _malloc_stats_r (ptr); +} + +#ifndef _REENT_ONLY +void +_DEFUN (mstats, (s), + char *s) +{ + _mstats_r (_REENT, s); +} + +#endif +#endif /* ! defined (MALLOC_PROVIDED) */ diff --git a/newlib/libc/stdlib/mtrim.c b/newlib/libc/stdlib/mtrim.c new file mode 100644 index 000000000..f5e0401c0 --- /dev/null +++ b/newlib/libc/stdlib/mtrim.c @@ -0,0 +1,17 @@ +/* mtrim.c -- a wrapper for malloc_trim. */ + +#include <_ansi.h> +#include +#include +#include + +#ifndef _REENT_ONLY + +int +_DEFUN (malloc_trim, (pad), + size_t pad) +{ + return _malloc_trim_r (_REENT, pad); +} + +#endif diff --git a/newlib/libc/stdlib/putenv.c b/newlib/libc/stdlib/putenv.c new file mode 100644 index 000000000..8942d2d3f --- /dev/null +++ b/newlib/libc/stdlib/putenv.c @@ -0,0 +1,37 @@ +/* This file may have been modified by DJ Delorie (Jan 1991). If so, +** these modifications are Coyright (C) 1991 DJ Delorie, 24 Kirsten Ave, +** Rochester NH, 03867-2954, USA. +*/ + +/*- + * Copyright (c) 1988 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that: (1) source distributions retain this entire copyright + * notice and comment, and (2) distributions including binaries display + * the following acknowledgement: ``This product includes software + * developed by the University of California, Berkeley and its contributors'' + * in the documentation or other materials provided with the distribution + * and in all advertising materials mentioning features or use of this + * software. Neither the name of the University nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifndef _REENT_ONLY + +#include +#include + +int +_DEFUN (putenv, (str), + _CONST char *str) +{ + return _putenv_r (_REENT, str); +} + +#endif /* !_REENT_ONLY */ diff --git a/newlib/libc/stdlib/putenv_r.c b/newlib/libc/stdlib/putenv_r.c new file mode 100644 index 000000000..f3c368a21 --- /dev/null +++ b/newlib/libc/stdlib/putenv_r.c @@ -0,0 +1,58 @@ +/* This file may have been modified by DJ Delorie (Jan 1991). If so, +** these modifications are Coyright (C) 1991 DJ Delorie, 24 Kirsten Ave, +** Rochester NH, 03867-2954, USA. +*/ + +/*- + * Copyright (c) 1988 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that: (1) source distributions retain this entire copyright + * notice and comment, and (2) distributions including binaries display + * the following acknowledgement: ``This product includes software + * developed by the University of California, Berkeley and its contributors'' + * in the documentation or other materials provided with the distribution + * and in all advertising materials mentioning features or use of this + * software. Neither the name of the University nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include +#include +#include + +#include "envlock.h" + +/* _putenv_r - reentrant version of putenv that either adds + or replaces the environment variable "name" + with "value" which is specified by str as "name=value". */ +int +_DEFUN (_putenv_r, (reent_ptr, str), + struct _reent *reent_ptr _AND + _CONST char *str) +{ + register char *p, *equal; + int rval; + + p = _strdup_r (reent_ptr, str); + + if (!p) + return 1; + + if (!(equal = index (p, '='))) + { + (void) _free_r (reent_ptr, p); + return 1; + } + + *equal = '\0'; + rval = _setenv_r (reent_ptr, p, equal + 1, 1); + (void) _free_r (reent_ptr, p); + + return rval; +} diff --git a/newlib/libc/stdlib/qsort.c b/newlib/libc/stdlib/qsort.c new file mode 100644 index 000000000..d47f47099 --- /dev/null +++ b/newlib/libc/stdlib/qsort.c @@ -0,0 +1,222 @@ +/* +FUNCTION +<>---sort an array + +INDEX + qsort + +ANSI_SYNOPSIS + #include + void qsort(void *<[base]>, size_t <[nmemb]>, size_t <[size]>, + int (*<[compar]>)(const void *, const void *) ); + +TRAD_SYNOPSIS + #include + qsort(<[base]>, <[nmemb]>, <[size]>, <[compar]> ) + char *<[base]>; + size_t <[nmemb]>; + size_t <[size]>; + int (*<[compar]>)(); + +DESCRIPTION +<> sorts an array (beginning at <[base]>) of <[nmemb]> objects. +<[size]> describes the size of each element of the array. + +You must supply a pointer to a comparison function, using the argument +shown as <[compar]>. (This permits sorting objects of unknown +properties.) Define the comparison function to accept two arguments, +each a pointer to an element of the array starting at <[base]>. The +result of <<(*<[compar]>)>> must be negative if the first argument is +less than the second, zero if the two arguments match, and positive if +the first argument is greater than the second (where ``less than'' and +``greater than'' refer to whatever arbitrary ordering is appropriate). + +The array is sorted in place; that is, when <> returns, the +array elements beginning at <[base]> have been reordered. + +RETURNS +<> does not return a result. + +PORTABILITY +<> is required by ANSI (without specifying the sorting algorithm). +*/ + +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <_ansi.h> +#include + +#ifndef __GNUC__ +#define inline +#endif + +static inline char *med3 _PARAMS((char *, char *, char *, int (*)())); +static inline void swapfunc _PARAMS((char *, char *, int, int)); + +#define min(a, b) (a) < (b) ? a : b + +/* + * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". + */ +#define swapcode(TYPE, parmi, parmj, n) { \ + long i = (n) / sizeof (TYPE); \ + register TYPE *pi = (TYPE *) (parmi); \ + register TYPE *pj = (TYPE *) (parmj); \ + do { \ + register TYPE t = *pi; \ + *pi++ = *pj; \ + *pj++ = t; \ + } while (--i > 0); \ +} + +#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \ + es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1; + +static inline void +_DEFUN(swapfunc, (a, b, n, swaptype), + char *a _AND + char *b _AND + int n _AND + int swaptype) +{ + if(swaptype <= 1) + swapcode(long, a, b, n) + else + swapcode(char, a, b, n) +} + +#define swap(a, b) \ + if (swaptype == 0) { \ + long t = *(long *)(a); \ + *(long *)(a) = *(long *)(b); \ + *(long *)(b) = t; \ + } else \ + swapfunc(a, b, es, swaptype) + +#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype) + +static inline char * +_DEFUN(med3, (a, b, c, cmp), + char *a _AND + char *b _AND + char *c _AND + int (*cmp)()) +{ + return cmp(a, b) < 0 ? + (cmp(b, c) < 0 ? b : (cmp(a, c) < 0 ? c : a )) + :(cmp(b, c) > 0 ? b : (cmp(a, c) < 0 ? a : c )); +} + +void +_DEFUN(qsort, (a, n, es, cmp), + void *a _AND + size_t n _AND + size_t es _AND + int (*cmp)()) +{ + char *pa, *pb, *pc, *pd, *pl, *pm, *pn; + int d, r, swaptype, swap_cnt; + +loop: SWAPINIT(a, es); + swap_cnt = 0; + if (n < 7) { + for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es) + for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0; + pl -= es) + swap(pl, pl - es); + return; + } + pm = (char *) a + (n / 2) * es; + if (n > 7) { + pl = a; + pn = (char *) a + (n - 1) * es; + if (n > 40) { + d = (n / 8) * es; + pl = med3(pl, pl + d, pl + 2 * d, cmp); + pm = med3(pm - d, pm, pm + d, cmp); + pn = med3(pn - 2 * d, pn - d, pn, cmp); + } + pm = med3(pl, pm, pn, cmp); + } + swap(a, pm); + pa = pb = (char *) a + es; + + pc = pd = (char *) a + (n - 1) * es; + for (;;) { + while (pb <= pc && (r = cmp(pb, a)) <= 0) { + if (r == 0) { + swap_cnt = 1; + swap(pa, pb); + pa += es; + } + pb += es; + } + while (pb <= pc && (r = cmp(pc, a)) >= 0) { + if (r == 0) { + swap_cnt = 1; + swap(pc, pd); + pd -= es; + } + pc -= es; + } + if (pb > pc) + break; + swap(pb, pc); + swap_cnt = 1; + pb += es; + pc -= es; + } + if (swap_cnt == 0) { /* Switch to insertion sort */ + for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es) + for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0; + pl -= es) + swap(pl, pl - es); + return; + } + + pn = (char *) a + n * es; + r = min(pa - (char *)a, pb - pa); + vecswap(a, pb - r, r); + r = min(pd - pc, pn - pd - es); + vecswap(pb, pn - r, r); + if ((r = pb - pa) > es) + qsort(a, r / es, es, cmp); + if ((r = pd - pc) > es) { + /* Iterate rather than recurse to save stack space */ + a = pn - r; + n = r / es; + goto loop; + } +/* qsort(pn - r, r / es, es, cmp);*/ +} diff --git a/newlib/libc/stdlib/rand.c b/newlib/libc/stdlib/rand.c new file mode 100644 index 000000000..3d739efbc --- /dev/null +++ b/newlib/libc/stdlib/rand.c @@ -0,0 +1,86 @@ +/* +FUNCTION +<>, <>---pseudo-random numbers + +INDEX + rand +INDEX + srand +INDEX + rand_r + +ANSI_SYNOPSIS + #include + int rand(void); + void srand(unsigned int <[seed]>); + int rand_r(unsigned int *<[seed]>); + +TRAD_SYNOPSIS + #include + int rand(); + + void srand(<[seed]>) + unsigned int <[seed]>; + + void rand_r(<[seed]>) + unsigned int *<[seed]>; + + +DESCRIPTION +<> returns a different integer each time it is called; each +integer is chosen by an algorithm designed to be unpredictable, so +that you can use <> when you require a random number. +The algorithm depends on a static variable called the ``random seed''; +starting with a given value of the random seed always produces the +same sequence of numbers in successive calls to <>. + +You can set the random seed using <>; it does nothing beyond +storing its argument in the static variable used by <>. You can +exploit this to make the pseudo-random sequence less predictable, if +you wish, by using some other unpredictable value (often the least +significant parts of a time-varying value) as the random seed before +beginning a sequence of calls to <>; or, if you wish to ensure +(for example, while debugging) that successive runs of your program +use the same ``random'' numbers, you can use <> to set the same +random seed at the outset. + +RETURNS +<> returns the next pseudo-random integer in sequence; it is a +number between <<0>> and <> (inclusive). + +<> does not return a result. + +NOTES +<> and <> are unsafe for multi-thread applications. +<> is MT-Safe and should be used instead. + + +PORTABILITY +<> is required by ANSI, but the algorithm for pseudo-random +number generation is not specified; therefore, even if you use +the same random seed, you cannot expect the same sequence of results +on two different systems. + +<> requires no supporting OS subroutines. +*/ + +#ifndef _REENT_ONLY + +#include +#include + +void +_DEFUN (srand, (seed), unsigned int seed) +{ + _REENT->_new._reent._rand_next = seed; +} + +int +_DEFUN_VOID (rand) +{ + return ((_REENT->_new._reent._rand_next = + _REENT->_new._reent._rand_next * 1103515245 + 12345 ) + & RAND_MAX ); +} + +#endif /* _REENT_ONLY */ diff --git a/newlib/libc/stdlib/rand_r.c b/newlib/libc/stdlib/rand_r.c new file mode 100644 index 000000000..25307275f --- /dev/null +++ b/newlib/libc/stdlib/rand_r.c @@ -0,0 +1,7 @@ +#include + +int +_DEFUN (rand_r, (seed), unsigned int *seed) +{ + return (((*seed) = (*seed) * 1103515245 + 12345) & RAND_MAX); +} diff --git a/newlib/libc/stdlib/realloc.c b/newlib/libc/stdlib/realloc.c new file mode 100644 index 000000000..2caa6e4d2 --- /dev/null +++ b/newlib/libc/stdlib/realloc.c @@ -0,0 +1,22 @@ +#ifdef MALLOC_PROVIDED +int _dummy_calloc = 1; +#else +/* realloc.c -- a wrapper for realloc_r. */ + +#include <_ansi.h> +#include +#include +#include + +#ifndef _REENT_ONLY + +_PTR +_DEFUN (realloc, (ap, nbytes), + _PTR ap _AND + size_t nbytes) +{ + return _realloc_r (_REENT, ap, nbytes); +} + +#endif +#endif /* MALLOC_PROVIDED */ diff --git a/newlib/libc/stdlib/setenv.c b/newlib/libc/stdlib/setenv.c new file mode 100644 index 000000000..49969817b --- /dev/null +++ b/newlib/libc/stdlib/setenv.c @@ -0,0 +1,59 @@ +/* This file may have been modified by DJ Delorie (Jan 1991). If so, +** these modifications are Coyright (C) 1991 DJ Delorie, 24 Kirsten Ave, +** Rochester NH, 03867-2954, USA. +*/ + +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that: (1) source distributions retain this entire copyright + * notice and comment, and (2) distributions including binaries display + * the following acknowledgement: ``This product includes software + * developed by the University of California, Berkeley and its contributors'' + * in the documentation or other materials provided with the distribution + * and in all advertising materials mentioning features or use of this + * software. Neither the name of the University nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifndef _REENT_ONLY + +#include +#include +#include + +extern void _unsetenv_r _PARAMS ((struct _reent *, const char *)); + +/* + * setenv -- + * Set the value of the environmental variable "name" to be + * "value". If rewrite is set, replace any current value. + */ + +int +_DEFUN (setenv, (name, value, rewrite), + _CONST char *name _AND + _CONST char *value _AND + int rewrite) +{ + return _setenv_r (_REENT, name, value, rewrite); +} + +/* + * unsetenv(name) -- + * Delete environmental variable "name". + */ +void +_DEFUN (unsetenv, (name), + _CONST char *name) +{ + _unsetenv_r (_REENT, name); +} + +#endif /* !_REENT_ONLY */ diff --git a/newlib/libc/stdlib/setenv_r.c b/newlib/libc/stdlib/setenv_r.c new file mode 100644 index 000000000..2d3c3f4e5 --- /dev/null +++ b/newlib/libc/stdlib/setenv_r.c @@ -0,0 +1,139 @@ +/* This file may have been modified by DJ Delorie (Jan 1991). If so, +** these modifications are Coyright (C) 1991 DJ Delorie, 24 Kirsten Ave, +** Rochester NH, 03867-2954, USA. +*/ + +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that: (1) source distributions retain this entire copyright + * notice and comment, and (2) distributions including binaries display + * the following acknowledgement: ``This product includes software + * developed by the University of California, Berkeley and its contributors'' + * in the documentation or other materials provided with the distribution + * and in all advertising materials mentioning features or use of this + * software. Neither the name of the University nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include + +#include +#include +#include +#include "envlock.h" + +/* _findenv_r is defined in getenv_r.c. */ +extern char *_findenv_r _PARAMS ((struct _reent *, const char *, int *)); + +/* + * _setenv_r -- + * Set the value of the environmental variable "name" to be + * "value". If rewrite is set, replace any current value. + */ + +int +_DEFUN (_setenv_r, (reent_ptr, name, value, rewrite), + struct _reent *reent_ptr _AND + _CONST char *name _AND + _CONST char *value _AND + int rewrite) +{ + extern char **environ; + static int alloced; /* if allocated space before */ + register char *C; + int l_value, offset; + + ENV_LOCK; + + if (*value == '=') /* no `=' in value */ + ++value; + l_value = strlen (value); + if ((C = _findenv_r (reent_ptr, name, &offset))) + { /* find if already exists */ + if (!rewrite) + { + ENV_UNLOCK; + return 0; + } + if (strlen (C) >= l_value) + { /* old larger; copy over */ + while (*C++ = *value++); + ENV_UNLOCK; + return 0; + } + } + else + { /* create new slot */ + register int cnt; + register char **P; + + for (P = environ, cnt = 0; *P; ++P, ++cnt); + if (alloced) + { /* just increase size */ + environ = (char **) _realloc_r (reent_ptr, (char *) environ, + (size_t) (sizeof (char *) * (cnt + 2))); + if (!environ) + { + ENV_UNLOCK; + return -1; + } + } + else + { /* get new space */ + alloced = 1; /* copy old entries into it */ + P = (char **) _malloc_r (reent_ptr, (size_t) (sizeof (char *) * (cnt + 2))); + if (!P) + { + ENV_UNLOCK; + return (-1); + } + bcopy ((char *) environ, (char *) P, cnt * sizeof (char *)); + environ = P; + } + environ[cnt + 1] = NULL; + offset = cnt; + } + for (C = (char *) name; *C && *C != '='; ++C); /* no `=' in name */ + if (!(environ[offset] = /* name + `=' + value */ + _malloc_r (reent_ptr, (size_t) ((int) (C - name) + l_value + 2)))) + { + ENV_UNLOCK; + return -1; + } + for (C = environ[offset]; (*C = *name++) && *C != '='; ++C); + for (*C++ = '='; *C++ = *value++;); + + ENV_UNLOCK; + + return 0; +} + +/* + * _unsetenv_r(name) -- + * Delete environmental variable "name". + */ +void +_DEFUN (_unsetenv_r, (reent_ptr, name), + struct _reent *reent_ptr _AND + _CONST char *name) +{ + extern char **environ; + register char **P; + int offset; + + ENV_LOCK; + + while (_findenv_r (reent_ptr, name, &offset)) /* if set multiple times */ + for (P = &environ[offset];; ++P) + if (!(*P = *(P + 1))) + break; + + ENV_UNLOCK; +} diff --git a/newlib/libc/stdlib/std.h b/newlib/libc/stdlib/std.h new file mode 100644 index 000000000..287503eac --- /dev/null +++ b/newlib/libc/stdlib/std.h @@ -0,0 +1,33 @@ +#include +#include +#include +#include +#include +#ifndef CYGNUS_NEC +#include +#endif + +#define Ise(c) ((c == 'e') || (c == 'E') || (c == 'd') || (c == 'D')) +#define Isdigit(c) ((c <= '9') && (c >= '0')) +#define Isspace(c) ((c == ' ') || (c == '\t') || (c=='\n') || (c=='\v') \ + || (c == '\r') || (c == '\f')) +#define Issign(c) ((c == '-') || (c == '+')) +#define Val(c) ((c - '0')) + +#define MAXE 308 +#define MINE (-308) + +/* flags */ +#define SIGN 0x01 +#define ESIGN 0x02 +#define DECP 0x04 + +#ifdef _HAVE_STDC +int __ten_mul(double *acc, int digit); +double __adjust(struct _reent *ptr, double *acc, int dexp, int sign); +const double __exp10(unsigned x); +#else +int __ten_mul(); +double __adjust(); +double __exp10(); +#endif diff --git a/newlib/libc/stdlib/stdlib.tex b/newlib/libc/stdlib/stdlib.tex new file mode 100644 index 000000000..7a0d723d3 --- /dev/null +++ b/newlib/libc/stdlib/stdlib.tex @@ -0,0 +1,130 @@ +@node Stdlib +@chapter Standard Utility Functions (@file{stdlib.h}) + +This chapter groups utility functions useful in a variety of programs. +The corresponding declarations are in the header file @file{stdlib.h}. + +@menu +* abort:: Abnormal termination of a program +* abs:: Integer absolute value (magnitude) +* assert:: Macro for Debugging Diagnostics +* atexit:: Request execution of functions at program exit +* atof:: String to double or float +* atoi:: String to integer +* bsearch:: Binary search +* calloc:: Allocate space for arrays +* div:: Divide two integers +* ecvtbuf:: Double or float to string of digits +* ecvt:: Double or float to string of digits (malloc result) +* __env_lock:: Lock environment list for getenv and setenv +* gvcvt:: Format double or float as string +* exit:: End program execution +* getenv:: Look up environment variable +* labs:: Long integer absolute value (magnitude) +* ldiv:: Divide two long integers +* malloc:: Allocate and manage memory (malloc, realloc, free) +* mallinfo:: Get information about allocated memory +* __malloc_lock:: Lock memory pool for malloc and free +* mbstowcs:: Minimal multibyte string to wide string converter +* mblen:: Minimal multibyte length +* mbtowc:: Minimal multibyte to wide character converter +* qsort:: Sort an array +* rand:: Pseudo-random numbers +* strtod:: String to double or float +* strtol:: String to long +* strtoul:: String to unsigned long +* system:: Execute command string +* wcstombs:: Minimal wide string to multibyte string converter +* wctomb:: Minimal wide character to multibyte converter +@end menu + +@page +@include stdlib/abort.def + +@page +@include stdlib/abs.def + +@page +@include stdlib/assert.def + +@page +@include stdlib/atexit.def + +@page +@include stdlib/atof.def + +@page +@include stdlib/atoi.def + +@page +@include stdlib/bsearch.def + +@page +@include stdlib/calloc.def + +@page +@include stdlib/div.def + +@page +@include stdlib/efgcvt.def + +@page +@include stdlib/ecvtbuf.def + +@page +@include stdlib/envlock.def + +@page +@include stdlib/exit.def + +@page +@include stdlib/getenv.def + +@page +@include stdlib/labs.def + +@page +@include stdlib/ldiv.def + +@page +@include stdlib/malloc.def + +@page +@include stdlib/mstats.def + +@page +@include stdlib/mlock.def + +@page +@include stdlib/mblen.def + +@page +@include stdlib/mbstowcs.def + +@page +@include stdlib/mbtowc.def + +@page +@include stdlib/qsort.def + +@page +@include stdlib/rand.def + +@page +@include stdlib/strtod.def + +@page +@include stdlib/strtol.def + +@page +@include stdlib/strtoul.def + +@page +@include stdlib/system.def + +@page +@include stdlib/wcstombs.def + +@page +@include stdlib/wctomb.def + diff --git a/newlib/libc/stdlib/strdup.c b/newlib/libc/stdlib/strdup.c new file mode 100644 index 000000000..dbb069264 --- /dev/null +++ b/newlib/libc/stdlib/strdup.c @@ -0,0 +1,13 @@ +#ifndef _REENT_ONLY + +#include +#include +#include + +char * +_DEFUN (strdup, (str), _CONST char *str) +{ + return _strdup_r (_REENT, str); +} + +#endif /* !_REENT_ONLY */ diff --git a/newlib/libc/stdlib/strdup_r.c b/newlib/libc/stdlib/strdup_r.c new file mode 100644 index 000000000..ef77a58eb --- /dev/null +++ b/newlib/libc/stdlib/strdup_r.c @@ -0,0 +1,17 @@ +#include +#include +#include + +char * +_DEFUN (_strdup_r, (reent_ptr, str), + struct _reent *reent_ptr _AND + _CONST char *str) +{ + size_t len = strlen (str) + 1; + char *copy = _malloc_r (reent_ptr, len); + if (copy) + { + memcpy (copy, str, len); + } + return copy; +} diff --git a/newlib/libc/stdlib/strtod.c b/newlib/libc/stdlib/strtod.c new file mode 100644 index 000000000..77a17a135 --- /dev/null +++ b/newlib/libc/stdlib/strtod.c @@ -0,0 +1,731 @@ +/* +FUNCTION + <>, <>---string to double or float + +INDEX + strtod +INDEX + _strtod_r +INDEX + strtodf + +ANSI_SYNOPSIS + #include + double strtod(const char *<[str]>, char **<[tail]>); + float strtodf(const char *<[str]>, char **<[tail]>); + + double _strtod_r(void *<[reent]>, + const char *<[str]>, char **<[tail]>); + +TRAD_SYNOPSIS + #include + double strtod(<[str]>,<[tail]>) + char *<[str]>; + char **<[tail]>; + + float strtodf(<[str]>,<[tail]>) + char *<[str]>; + char **<[tail]>; + + double _strtod_r(<[reent]>,<[str]>,<[tail]>) + char *<[reent]>; + char *<[str]>; + char **<[tail]>; + +DESCRIPTION + The function <> parses the character string <[str]>, + producing a substring which can be converted to a double + value. The substring converted is the longest initial + subsequence of <[str]>, beginning with the first + non-whitespace character, that has the format: + .[+|-]<[digits]>[.][<[digits]>][(e|E)[+|-]<[digits]>] + The substring contains no characters if <[str]> is empty, consists + entirely of whitespace, or if the first non-whitespace + character is something other than <<+>>, <<->>, <<.>>, or a + digit. If the substring is empty, no conversion is done, and + the value of <[str]> is stored in <<*<[tail]>>>. Otherwise, + the substring is converted, and a pointer to the final string + (which will contain at least the terminating null character of + <[str]>) is stored in <<*<[tail]>>>. If you want no + assignment to <<*<[tail]>>>, pass a null pointer as <[tail]>. + <> is identical to <> except for its return type. + + This implementation returns the nearest machine number to the + input decimal string. Ties are broken by using the IEEE + round-even rule. + + The alternate function <<_strtod_r>> is a reentrant version. + The extra argument <[reent]> is a pointer to a reentrancy structure. + +RETURNS + <> returns the converted substring value, if any. If + no conversion could be performed, 0 is returned. If the + correct value is out of the range of representable values, + plus or minus <> is returned, and <> is + stored in errno. If the correct value would cause underflow, 0 + is returned and <> is stored in errno. + +Supporting OS subroutines required: <>, <>, <>, +<>, <>, <>, <>. +*/ + +/**************************************************************** + * + * The author of this software is David M. Gay. + * + * Copyright (c) 1991 by AT&T. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose without fee is hereby granted, provided that this entire notice + * is included in all copies of any software which is or includes a copy + * or modification of this software and in all copies of the supporting + * documentation for such software. + * + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY + * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + * + ***************************************************************/ + +/* Please send bug reports to + David M. Gay + AT&T Bell Laboratories, Room 2C-463 + 600 Mountain Avenue + Murray Hill, NJ 07974-2070 + U.S.A. + dmg@research.att.com or research!dmg + */ + +#include <_ansi.h> +#include +#include +#include "mprec.h" + +double +_DEFUN (_strtod_r, (ptr, s00, se), + struct _reent *ptr _AND + _CONST char *s00 _AND + char **se) +{ + int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign, e1, esign, i, j, + k, nd, nd0, nf, nz, nz0, sign; + long e; + _CONST char *s, *s0, *s1; + double aadj, aadj1, adj; + long L; + unsigned long z; + __ULong y; + union double_union rv, rv0; + + _Bigint *bb, *bb1, *bd, *bd0, *bs, *delta; + sign = nz0 = nz = 0; + rv.d = 0.; + for (s = s00;; s++) + switch (*s) + { + case '-': + sign = 1; + /* no break */ + case '+': + if (*++s) + goto break2; + /* no break */ + case 0: + s = s00; + goto ret; + case '\t': + case '\n': + case '\v': + case '\f': + case '\r': + case ' ': + continue; + default: + goto break2; + } +break2: + if (*s == '0') + { + nz0 = 1; + while (*++s == '0'); + if (!*s) + goto ret; + } + s0 = s; + y = z = 0; + for (nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++) + if (nd < 9) + y = 10 * y + c - '0'; + else if (nd < 16) + z = 10 * z + c - '0'; + nd0 = nd; + if (c == '.') + { + c = *++s; + if (!nd) + { + for (; c == '0'; c = *++s) + nz++; + if (c > '0' && c <= '9') + { + s0 = s; + nf += nz; + nz = 0; + goto have_dig; + } + goto dig_done; + } + for (; c >= '0' && c <= '9'; c = *++s) + { + have_dig: + nz++; + if (c -= '0') + { + nf += nz; + for (i = 1; i < nz; i++) + if (nd++ < 9) + y *= 10; + else if (nd <= DBL_DIG + 1) + z *= 10; + if (nd++ < 9) + y = 10 * y + c; + else if (nd <= DBL_DIG + 1) + z = 10 * z + c; + nz = 0; + } + } + } +dig_done: + e = 0; + if (c == 'e' || c == 'E') + { + if (!nd && !nz && !nz0) + { + s = s00; + goto ret; + } + s00 = s; + esign = 0; + switch (c = *++s) + { + case '-': + esign = 1; + case '+': + c = *++s; + } + if (c >= '0' && c <= '9') + { + while (c == '0') + c = *++s; + if (c > '0' && c <= '9') + { + e = c - '0'; + s1 = s; + while ((c = *++s) >= '0' && c <= '9') + e = 10 * e + c - '0'; + if (s - s1 > 8) + /* Avoid confusion from exponents + * so large that e might overflow. + */ + e = 9999999L; + if (esign) + e = -e; + } + else + e = 0; + } + else + s = s00; + } + if (!nd) + { + if (!nz && !nz0) + s = s00; + goto ret; + } + e1 = e -= nf; + + /* Now we have nd0 digits, starting at s0, followed by a + * decimal point, followed by nd-nd0 digits. The number we're + * after is the integer represented by those digits times + * 10**e */ + + if (!nd0) + nd0 = nd; + k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1; + rv.d = y; + if (k > 9) + rv.d = tens[k - 9] * rv.d + z; + bd0 = 0; + if (nd <= DBL_DIG +#ifndef RND_PRODQUOT + && FLT_ROUNDS == 1 +#endif + ) + { + if (!e) + goto ret; + if (e > 0) + { + if (e <= Ten_pmax) + { +#ifdef VAX + goto vax_ovfl_check; +#else + /* rv.d = */ rounded_product (rv.d, tens[e]); + goto ret; +#endif + } + i = DBL_DIG - nd; + if (e <= Ten_pmax + i) + { + /* A fancier test would sometimes let us do + * this for larger i values. + */ + e -= i; + rv.d *= tens[i]; +#ifdef VAX + /* VAX exponent range is so narrow we must + * worry about overflow here... + */ + vax_ovfl_check: + word0 (rv) -= P * Exp_msk1; + /* rv.d = */ rounded_product (rv.d, tens[e]); + if ((word0 (rv) & Exp_mask) + > Exp_msk1 * (DBL_MAX_EXP + Bias - 1 - P)) + goto ovfl; + word0 (rv) += P * Exp_msk1; +#else + /* rv.d = */ rounded_product (rv.d, tens[e]); +#endif + goto ret; + } + } +#ifndef Inaccurate_Divide + else if (e >= -Ten_pmax) + { + /* rv.d = */ rounded_quotient (rv.d, tens[-e]); + goto ret; + } +#endif + } + e1 += nd - k; + + /* Get starting approximation = rv.d * 10**e1 */ + + if (e1 > 0) + { + if (i = e1 & 15) + rv.d *= tens[i]; + if (e1 &= ~15) + { + if (e1 > DBL_MAX_10_EXP) + { + ovfl: + ptr->_errno = ERANGE; +#ifdef _HAVE_STDC + rv.d = HUGE_VAL; +#else + /* Can't trust HUGE_VAL */ +#ifdef IEEE_Arith + word0 (rv) = Exp_mask; +#ifndef _DOUBLE_IS_32BITS + word1 (rv) = 0; +#endif +#else + word0 (rv) = Big0; +#ifndef _DOUBLE_IS_32BITS + word1 (rv) = Big1; +#endif +#endif +#endif + if (bd0) + goto retfree; + goto ret; + } + if (e1 >>= 4) + { + for (j = 0; e1 > 1; j++, e1 >>= 1) + if (e1 & 1) + rv.d *= bigtens[j]; + /* The last multiplication could overflow. */ + word0 (rv) -= P * Exp_msk1; + rv.d *= bigtens[j]; + if ((z = word0 (rv) & Exp_mask) + > Exp_msk1 * (DBL_MAX_EXP + Bias - P)) + goto ovfl; + if (z > Exp_msk1 * (DBL_MAX_EXP + Bias - 1 - P)) + { + /* set to largest number */ + /* (Can't trust DBL_MAX) */ + word0 (rv) = Big0; +#ifndef _DOUBLE_IS_32BITS + word1 (rv) = Big1; +#endif + } + else + word0 (rv) += P * Exp_msk1; + } + + } + } + else if (e1 < 0) + { + e1 = -e1; + if (i = e1 & 15) + rv.d /= tens[i]; + if (e1 &= ~15) + { + e1 >>= 4; + if (e1 >= 1 << n_bigtens) + goto undfl; + for (j = 0; e1 > 1; j++, e1 >>= 1) + if (e1 & 1) + rv.d *= tinytens[j]; + /* The last multiplication could underflow. */ + rv0.d = rv.d; + rv.d *= tinytens[j]; + if (!rv.d) + { + rv.d = 2. * rv0.d; + rv.d *= tinytens[j]; + if (!rv.d) + { + undfl: + rv.d = 0.; + ptr->_errno = ERANGE; + if (bd0) + goto retfree; + goto ret; + } +#ifndef _DOUBLE_IS_32BITS + word0 (rv) = Tiny0; + word1 (rv) = Tiny1; +#else + word0 (rv) = Tiny1; +#endif + /* The refinement below will clean + * this approximation up. + */ + } + } + } + + /* Now the hard part -- adjusting rv to the correct value.*/ + + /* Put digits into bd: true value = bd * 10^e */ + + bd0 = s2b (ptr, s0, nd0, nd, y); + + for (;;) + { + bd = Balloc (ptr, bd0->_k); + Bcopy (bd, bd0); + bb = d2b (ptr, rv.d, &bbe, &bbbits); /* rv.d = bb * 2^bbe */ + bs = i2b (ptr, 1); + + if (e >= 0) + { + bb2 = bb5 = 0; + bd2 = bd5 = e; + } + else + { + bb2 = bb5 = -e; + bd2 = bd5 = 0; + } + if (bbe >= 0) + bb2 += bbe; + else + bd2 -= bbe; + bs2 = bb2; +#ifdef Sudden_Underflow +#ifdef IBM + j = 1 + 4 * P - 3 - bbbits + ((bbe + bbbits - 1) & 3); +#else + j = P + 1 - bbbits; +#endif +#else + i = bbe + bbbits - 1; /* logb(rv.d) */ + if (i < Emin) /* denormal */ + j = bbe + (P - Emin); + else + j = P + 1 - bbbits; +#endif + bb2 += j; + bd2 += j; + i = bb2 < bd2 ? bb2 : bd2; + if (i > bs2) + i = bs2; + if (i > 0) + { + bb2 -= i; + bd2 -= i; + bs2 -= i; + } + if (bb5 > 0) + { + bs = pow5mult (ptr, bs, bb5); + bb1 = mult (ptr, bs, bb); + Bfree (ptr, bb); + bb = bb1; + } + if (bb2 > 0) + bb = lshift (ptr, bb, bb2); + if (bd5 > 0) + bd = pow5mult (ptr, bd, bd5); + if (bd2 > 0) + bd = lshift (ptr, bd, bd2); + if (bs2 > 0) + bs = lshift (ptr, bs, bs2); + delta = diff (ptr, bb, bd); + dsign = delta->_sign; + delta->_sign = 0; + i = cmp (delta, bs); + if (i < 0) + { + /* Error is less than half an ulp -- check for + * special case of mantissa a power of two. + */ + if (dsign || word1 (rv) || word0 (rv) & Bndry_mask) + break; + delta = lshift (ptr, delta, Log2P); + if (cmp (delta, bs) > 0) + goto drop_down; + break; + } + if (i == 0) + { + /* exactly half-way between */ + if (dsign) + { + if ((word0 (rv) & Bndry_mask1) == Bndry_mask1 + && word1 (rv) == 0xffffffff) + { + /*boundary case -- increment exponent*/ + word0 (rv) = (word0 (rv) & Exp_mask) + + Exp_msk1 +#ifdef IBM + | Exp_msk1 >> 4 +#endif + ; +#ifndef _DOUBLE_IS_32BITS + word1 (rv) = 0; +#endif + break; + } + } + else if (!(word0 (rv) & Bndry_mask) && !word1 (rv)) + { + drop_down: + /* boundary case -- decrement exponent */ +#ifdef Sudden_Underflow + L = word0 (rv) & Exp_mask; +#ifdef IBM + if (L < Exp_msk1) +#else + if (L <= Exp_msk1) +#endif + goto undfl; + L -= Exp_msk1; +#else + L = (word0 (rv) & Exp_mask) - Exp_msk1; +#endif + word0 (rv) = L | Bndry_mask1; +#ifndef _DOUBLE_IS_32BITS + word1 (rv) = 0xffffffff; +#endif +#ifdef IBM + goto cont; +#else + break; +#endif + } +#ifndef ROUND_BIASED + if (!(word1 (rv) & LSB)) + break; +#endif + if (dsign) + rv.d += ulp (rv.d); +#ifndef ROUND_BIASED + else + { + rv.d -= ulp (rv.d); +#ifndef Sudden_Underflow + if (!rv.d) + goto undfl; +#endif + } +#endif + break; + } + if ((aadj = ratio (delta, bs)) <= 2.) + { + if (dsign) + aadj = aadj1 = 1.; + else if (word1 (rv) || word0 (rv) & Bndry_mask) + { +#ifndef Sudden_Underflow + if (word1 (rv) == Tiny1 && !word0 (rv)) + goto undfl; +#endif + aadj = 1.; + aadj1 = -1.; + } + else + { + /* special case -- power of FLT_RADIX to be */ + /* rounded down... */ + + if (aadj < 2. / FLT_RADIX) + aadj = 1. / FLT_RADIX; + else + aadj *= 0.5; + aadj1 = -aadj; + } + } + else + { + aadj *= 0.5; + aadj1 = dsign ? aadj : -aadj; +#ifdef Check_FLT_ROUNDS + switch (FLT_ROUNDS) + { + case 2: /* towards +infinity */ + aadj1 -= 0.5; + break; + case 0: /* towards 0 */ + case 3: /* towards -infinity */ + aadj1 += 0.5; + } +#else + if (FLT_ROUNDS == 0) + aadj1 += 0.5; +#endif + } + y = word0 (rv) & Exp_mask; + + /* Check for overflow */ + + if (y == Exp_msk1 * (DBL_MAX_EXP + Bias - 1)) + { + rv0.d = rv.d; + word0 (rv) -= P * Exp_msk1; + adj = aadj1 * ulp (rv.d); + rv.d += adj; + if ((word0 (rv) & Exp_mask) >= + Exp_msk1 * (DBL_MAX_EXP + Bias - P)) + { + if (word0 (rv0) == Big0 && word1 (rv0) == Big1) + goto ovfl; +#ifdef _DOUBLE_IS_32BITS + word0 (rv) = Big1; +#else + word0 (rv) = Big0; + word1 (rv) = Big1; +#endif + goto cont; + } + else + word0 (rv) += P * Exp_msk1; + } + else + { +#ifdef Sudden_Underflow + if ((word0 (rv) & Exp_mask) <= P * Exp_msk1) + { + rv0.d = rv.d; + word0 (rv) += P * Exp_msk1; + adj = aadj1 * ulp (rv.d); + rv.d += adj; +#ifdef IBM + if ((word0 (rv) & Exp_mask) < P * Exp_msk1) +#else + if ((word0 (rv) & Exp_mask) <= P * Exp_msk1) +#endif + { + if (word0 (rv0) == Tiny0 + && word1 (rv0) == Tiny1) + goto undfl; + word0 (rv) = Tiny0; + word1 (rv) = Tiny1; + goto cont; + } + else + word0 (rv) -= P * Exp_msk1; + } + else + { + adj = aadj1 * ulp (rv.d); + rv.d += adj; + } +#else + /* Compute adj so that the IEEE rounding rules will + * correctly round rv.d + adj in some half-way cases. + * If rv.d * ulp(rv.d) is denormalized (i.e., + * y <= (P-1)*Exp_msk1), we must adjust aadj to avoid + * trouble from bits lost to denormalization; + * example: 1.2e-307 . + */ + if (y <= (P - 1) * Exp_msk1 && aadj >= 1.) + { + aadj1 = (double) (int) (aadj + 0.5); + if (!dsign) + aadj1 = -aadj1; + } + adj = aadj1 * ulp (rv.d); + rv.d += adj; +#endif + } + z = word0 (rv) & Exp_mask; + if (y == z) + { + /* Can we stop now? */ + L = aadj; + aadj -= L; + /* The tolerances below are conservative. */ + if (dsign || word1 (rv) || word0 (rv) & Bndry_mask) + { + if (aadj < .4999999 || aadj > .5000001) + break; + } + else if (aadj < .4999999 / FLT_RADIX) + break; + } + cont: + Bfree (ptr, bb); + Bfree (ptr, bd); + Bfree (ptr, bs); + Bfree (ptr, delta); + } +retfree: + Bfree (ptr, bb); + Bfree (ptr, bd); + Bfree (ptr, bs); + Bfree (ptr, bd0); + Bfree (ptr, delta); +ret: + if (se) + *se = (char *) s; + return sign ? -rv.d : rv.d; +} + +#ifndef NO_REENT + +double +_DEFUN (strtod, (s00, se), + _CONST char *s00 _AND char **se) +{ + return _strtod_r (_REENT, s00, se); +} + +float +_DEFUN (strtodf, (s00, se), + _CONST char *s00 _AND + char **se) +{ + return strtod (s00, se); +} + +#endif diff --git a/newlib/libc/stdlib/strtol.c b/newlib/libc/stdlib/strtol.c new file mode 100644 index 000000000..6d355d563 --- /dev/null +++ b/newlib/libc/stdlib/strtol.c @@ -0,0 +1,226 @@ +/* +FUNCTION + <>---string to long + +INDEX + strtol +INDEX + _strtol_r + +ANSI_SYNOPSIS + #include + long strtol(const char *<[s]>, char **<[ptr]>,int <[base]>); + + long _strtol_r(void *<[reent]>, + const char *<[s]>, char **<[ptr]>,int <[base]>); + +TRAD_SYNOPSIS + #include + long strtol (<[s]>, <[ptr]>, <[base]>) + char *<[s]>; + char **<[ptr]>; + int <[base]>; + + long _strtol_r (<[reent]>, <[s]>, <[ptr]>, <[base]>) + char *<[reent]>; + char *<[s]>; + char **<[ptr]>; + int <[base]>; + +DESCRIPTION +The function <> converts the string <<*<[s]>>> to +a <>. First, it breaks down the string into three parts: +leading whitespace, which is ignored; a subject string consisting +of characters resembling an integer in the radix specified by <[base]>; +and a trailing portion consisting of zero or more unparseable characters, +and always including the terminating null character. Then, it attempts +to convert the subject string into a <> and returns the +result. + +If the value of <[base]> is 0, the subject string is expected to look +like a normal C integer constant: an optional sign, a possible `<<0x>>' +indicating a hexadecimal base, and a number. If <[base]> is between +2 and 36, the expected form of the subject is a sequence of letters +and digits representing an integer in the radix specified by <[base]>, +with an optional plus or minus sign. The letters <>--<> (or, +equivalently, <>--<>) are used to signify values from 10 to 35; +only letters whose ascribed values are less than <[base]> are +permitted. If <[base]> is 16, a leading <<0x>> is permitted. + +The subject sequence is the longest initial sequence of the input +string that has the expected form, starting with the first +non-whitespace character. If the string is empty or consists entirely +of whitespace, or if the first non-whitespace character is not a +permissible letter or digit, the subject string is empty. + +If the subject string is acceptable, and the value of <[base]> is zero, +<> attempts to determine the radix from the input string. A +string with a leading <<0x>> is treated as a hexadecimal value; a string with +a leading 0 and no <> is treated as octal; all other strings are +treated as decimal. If <[base]> is between 2 and 36, it is used as the +conversion radix, as described above. If the subject string begins with +a minus sign, the value is negated. Finally, a pointer to the first +character past the converted subject string is stored in <[ptr]>, if +<[ptr]> is not <>. + +If the subject string is empty (or not in acceptable form), no conversion +is performed and the value of <[s]> is stored in <[ptr]> (if <[ptr]> is +not <>). + +The alternate function <<_strtol_r>> is a reentrant version. The +extra argument <[reent]> is a pointer to a reentrancy structure. + +RETURNS +<> returns the converted value, if any. If no conversion was +made, 0 is returned. + +<> returns <> or <> if the magnitude of +the converted value is too large, and sets <> to <>. + +PORTABILITY +<> is ANSI. + +No supporting OS subroutines are required. +*/ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include <_ansi.h> +#include +#include +#include +#include +#include + +/* + * Convert a string to a long integer. + * + * Ignores `locale' stuff. Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +long +_DEFUN (_strtol_r, (rptr, nptr, endptr, base), + struct _reent *rptr _AND + _CONST char *nptr _AND + char **endptr _AND + int base) +{ + register const char *s = nptr; + register unsigned long acc; + register int c; + register unsigned long cutoff; + register int neg = 0, any, cutlim; + + /* + * Skip white space and pick up leading +/- sign if any. + * If base is 0, allow 0x for hex and 0 for octal, else + * assume decimal; if base is already 16, allow 0x. + */ + do { + c = *s++; + } while (isspace(c)); + if (c == '-') { + neg = 1; + c = *s++; + } else if (c == '+') + c = *s++; + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + + /* + * Compute the cutoff value between legal numbers and illegal + * numbers. That is the largest legal value, divided by the + * base. An input number that is greater than this value, if + * followed by a legal input character, is too big. One that + * is equal to this value may be valid or not; the limit + * between valid and invalid numbers is then based on the last + * digit. For instance, if the range for longs is + * [-2147483648..2147483647] and the input base is 10, + * cutoff will be set to 214748364 and cutlim to either + * 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated + * a value > 214748364, or equal but the next digit is > 7 (or 8), + * the number is too big, and we will return a range error. + * + * Set any if any `digits' consumed; make it negative to indicate + * overflow. + */ + cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX; + cutlim = cutoff % (unsigned long)base; + cutoff /= (unsigned long)base; + for (acc = 0, any = 0;; c = *s++) { + if (isdigit(c)) + c -= '0'; + else if (isalpha(c)) + c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = neg ? LONG_MIN : LONG_MAX; + rptr->_errno = ERANGE; + } else if (neg) + acc = -acc; + if (endptr != 0) + *endptr = (char *) (any ? s - 1 : nptr); + return (acc); +} + +#ifndef _REENT_ONLY + +long +_DEFUN (strtol, (s, ptr, base), + _CONST char *s _AND + char **ptr _AND + int base) +{ + return _strtol_r (_REENT, s, ptr, base); +} + +#endif diff --git a/newlib/libc/stdlib/strtoul.c b/newlib/libc/stdlib/strtoul.c new file mode 100644 index 000000000..f62c2f8f8 --- /dev/null +++ b/newlib/libc/stdlib/strtoul.c @@ -0,0 +1,206 @@ +/* +FUNCTION + <>---string to unsigned long + +INDEX + strtoul +INDEX + _strtoul_r + +ANSI_SYNOPSIS + #include + unsigned long strtoul(const char *<[s]>, char **<[ptr]>, + int <[base]>); + + unsigned long _strtoul_r(void *<[reent]>, const char *<[s]>, + char **<[ptr]>, int <[base]>); + +TRAD_SYNOPSIS + #include + unsigned long strtoul(<[s]>, <[ptr]>, <[base]>) + char *<[s]>; + char **<[ptr]>; + int <[base]>; + + unsigned long _strtoul_r(<[reent]>, <[s]>, <[ptr]>, <[base]>) + char *<[reent]>; + char *<[s]>; + char **<[ptr]>; + int <[base]>; + +DESCRIPTION +The function <> converts the string <<*<[s]>>> to +an <>. First, it breaks down the string into three parts: +leading whitespace, which is ignored; a subject string consisting +of the digits meaningful in the radix specified by <[base]> +(for example, <<0>> through <<7>> if the value of <[base]> is 8); +and a trailing portion consisting of one or more unparseable characters, +which always includes the terminating null character. Then, it attempts +to convert the subject string into an unsigned long integer, and returns the +result. + +If the value of <[base]> is zero, the subject string is expected to look +like a normal C integer constant (save that no optional sign is permitted): +a possible <<0x>> indicating hexadecimal radix, and a number. +If <[base]> is between 2 and 36, the expected form of the subject is a +sequence of digits (which may include letters, depending on the +base) representing an integer in the radix specified by <[base]>. +The letters <>--<> (or <>--<>) are used as digits valued from +10 to 35. If <[base]> is 16, a leading <<0x>> is permitted. + +The subject sequence is the longest initial sequence of the input +string that has the expected form, starting with the first +non-whitespace character. If the string is empty or consists entirely +of whitespace, or if the first non-whitespace character is not a +permissible digit, the subject string is empty. + +If the subject string is acceptable, and the value of <[base]> is zero, +<> attempts to determine the radix from the input string. A +string with a leading <<0x>> is treated as a hexadecimal value; a string with +a leading <<0>> and no <> is treated as octal; all other strings are +treated as decimal. If <[base]> is between 2 and 36, it is used as the +conversion radix, as described above. Finally, a pointer to the first +character past the converted subject string is stored in <[ptr]>, if +<[ptr]> is not <>. + +If the subject string is empty (that is, if <<*>><[s]> does not start +with a substring in acceptable form), no conversion +is performed and the value of <[s]> is stored in <[ptr]> (if <[ptr]> is +not <>). + +The alternate function <<_strtoul_r>> is a reentrant version. The +extra argument <[reent]> is a pointer to a reentrancy structure. + + +RETURNS +<> returns the converted value, if any. If no conversion was +made, <<0>> is returned. + +<> returns <> if the magnitude of the converted +value is too large, and sets <> to <>. + +PORTABILITY +<> is ANSI. + +<> requires no supporting OS subroutines. +*/ + +/* + * Copyright (c) 1990 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <_ansi.h> +#include +#include +#include +#include +#include + +/* + * Convert a string to an unsigned long integer. + * + * Ignores `locale' stuff. Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +unsigned long +_DEFUN (_strtoul_r, (rptr, nptr, endptr, base), + struct _reent *rptr _AND + _CONST char *nptr _AND + char **endptr _AND + int base) +{ + register const char *s = nptr; + register unsigned long acc; + register int c; + register unsigned long cutoff; + register int neg = 0, any, cutlim; + + /* + * See strtol for comments as to the logic used. + */ + do { + c = *s++; + } while (isspace(c)); + if (c == '-') { + neg = 1; + c = *s++; + } else if (c == '+') + c = *s++; + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + cutoff = (unsigned long)ULONG_MAX / (unsigned long)base; + cutlim = (unsigned long)ULONG_MAX % (unsigned long)base; + for (acc = 0, any = 0;; c = *s++) { + if (isdigit(c)) + c -= '0'; + else if (isalpha(c)) + c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = ULONG_MAX; + rptr->_errno = ERANGE; + } else if (neg) + acc = -acc; + if (endptr != 0) + *endptr = (char *) (any ? s - 1 : nptr); + return (acc); +} + +#ifndef _REENT_ONLY + +unsigned long +_DEFUN (strtoul, (s, ptr, base), + _CONST char *s _AND + char **ptr _AND + int base) +{ + return _strtoul_r (_REENT, s, ptr, base); +} + +#endif diff --git a/newlib/libc/stdlib/system.c b/newlib/libc/stdlib/system.c new file mode 100644 index 000000000..4584ae180 --- /dev/null +++ b/newlib/libc/stdlib/system.c @@ -0,0 +1,179 @@ +/* +FUNCTION +<>---execute command string + +INDEX + system +INDEX + _system_r + +ANSI_SYNOPSIS + #include + int system(char *<[s]>); + + int _system_r(void *<[reent]>, char *<[s]>); + +TRAD_SYNOPSIS + #include + int system(<[s]>) + char *<[s]>; + + int _system_r(<[reent]>, <[s]>) + char *<[reent]>; + char *<[s]>; + +DESCRIPTION + +Use <> to pass a command string <<*<[s]>>> to <> on +your system, and wait for it to finish executing. + +Use `<>' to test whether your system has <> +available. + +The alternate function <<_system_r>> is a reentrant version. The +extra argument <[reent]> is a pointer to a reentrancy structure. + +RETURNS +<> returns a non-zero value if <> is available, and +<<0>> if it is not. + +With a command argument, the result of <> is the exit status +returned by <>. + +PORTABILITY +ANSI C requires <>, but leaves the nature and effects of a +command processor undefined. ANSI C does, however, specify that +<> return zero or nonzero to report on the existence of +a command processor. + +POSIX.2 requires <>, and requires that it invoke a <>. +Where <> is found is left unspecified. + +Supporting OS subroutines required: <<_exit>>, <<_execve>>, <<_fork_r>>, +<<_wait_r>>. +*/ + +#include +#include +#include +#include <_syslist.h> + +#if defined (unix) || defined (__CYGWIN32__) +static int do_system (); +#endif + +int +_system_r (ptr, s) + struct _reent *ptr; + _CONST char *s; +{ +#ifdef NO_EXEC + if (s == NULL) + return 0; + errno = ENOSYS; + return -1; +#else + + /* ??? How to handle (s == NULL) here is not exactly clear. + If _fork_r fails, that's not really a justification for returning 0. + For now we always return 0 and leave it to each target to explicitly + handle otherwise (this can always be relaxed in the future). */ + +#if defined (unix) || defined (__CYGWIN32__) + if (s == NULL) + return 1; + return do_system (ptr, s); +#else + if (s == NULL) + return 0; + errno = ENOSYS; + return -1; +#endif + +#endif +} + +#ifndef _REENT_ONLY + +int +system (s) + _CONST char *s; +{ + return _system_r (_REENT, s); +} + +#endif + +#if defined (unix) && !defined (__CYGWIN32__) +static int +do_system (ptr, s) + struct _reent *ptr; + _CONST char *s; +{ + char *argv[4]; + int pid, status; + extern char *environ[]; + + argv[0] = "sh"; + argv[1] = "-c"; + argv[2] = (char *) s; + argv[3] = NULL; + + if ((pid = _fork_r (ptr)) == 0) + { + _execve ("/bin/sh", argv, environ); + exit (100); + } + else if (pid == -1) + return -1; + else + { + int rc = _wait_r (ptr, &status); + if (rc == -1) + return -1; + status = (status >> 8) & 0xff; + return status; + } +} +#endif + +#if defined (__CYGWIN32__) +static int +do_system (ptr, s) + struct _reent *ptr; + _CONST char *s; +{ + char *argv[4]; + int pid, status; + extern char *environ[]; + + argv[0] = "sh"; + argv[1] = "-c"; + argv[2] = (char *) s; + argv[3] = NULL; + + if ((pid = vfork ()) == 0) + { + /* ??? It's not clear what's the right path to take (pun intended :-). + There won't be an "sh" in any fixed location so we need each user + to be able to say where to find "sh". That suggests using an + environment variable, but after a few more such situations we may + have too many of them. */ + char *sh = getenv ("SH_PATH"); + if (sh == NULL) + sh = "/bin/sh"; + _execve (sh, argv, environ); + exit (100); + } + else if (pid == -1) + return -1; + else + { + int rc = _wait (&status); + if (rc == -1) + return -1; + status = (status >> 8) & 0xff; + return status; + } +} +#endif diff --git a/newlib/libc/stdlib/valloc.c b/newlib/libc/stdlib/valloc.c new file mode 100644 index 000000000..42c09a054 --- /dev/null +++ b/newlib/libc/stdlib/valloc.c @@ -0,0 +1,24 @@ +/* valloc.c -- a wrapper for valloc_r and pvalloc_r. */ + +#include <_ansi.h> +#include +#include +#include + +#ifndef _REENT_ONLY + +_PTR +_DEFUN (valloc, (nbytes), + size_t nbytes) +{ + return _valloc_r (_REENT, nbytes); +} + +_PTR +_DEFUN (pvalloc, (nbytes), + size_t nbytes) +{ + return _pvalloc_r (_REENT, nbytes); +} + +#endif diff --git a/newlib/libc/stdlib/wcstombs.c b/newlib/libc/stdlib/wcstombs.c new file mode 100644 index 000000000..ca99f2ea1 --- /dev/null +++ b/newlib/libc/stdlib/wcstombs.c @@ -0,0 +1,80 @@ +/* +FUNCTION +<>---minimal wide char string to multibyte string converter + +INDEX + wcstombs + +ANSI_SYNOPSIS + #include + int wcstombs(const char *<[s]>, wchar_t *<[pwc]>, size_t <[n]>); + +TRAD_SYNOPSIS + #include + int wcstombs(<[s]>, <[pwc]>, <[n]>) + const char *<[s]>; + wchar_t *<[pwc]>; + size_t <[n]>; + +DESCRIPTION +When MB_CAPABLE is not defined, this is a minimal ANSI-conforming +implementation of <>. In this case, +all wide-characters are expected to represent single bytes and so +are converted simply by casting to char. + +When MB_CAPABLE is defined, this routine calls <<_wcstombs_r>> to perform +the conversion, passing a state variable to allow state dependent +decoding. The result is based on the locale setting which may +be restricted to a defined set of locales. + +RETURNS +This implementation of <> returns <<0>> if +<[s]> is <> or is the empty string; +it returns <<-1>> if MB_CAPABLE and one of the +wide-char characters does not represent a valid multi-byte character; +otherwise it returns the minimum of: <> or the +number of bytes that are transferred to <>, not including the +nul terminator. + +If the return value is -1, the state of the <> string is +indeterminate. If the input has a length of 0, the output +string will be modified to contain a wchar_t nul terminator if +<> > 0. + +PORTABILITY +<> is required in the ANSI C standard. However, the precise +effects vary with the locale. + +<> requires no supporting OS subroutines. +*/ + +#ifndef _REENT_ONLY + +#include + +size_t +_DEFUN (wcstombs, (s, pwcs, n), + char *s _AND + const wchar_t *pwcs _AND + size_t n) +{ +#ifdef MB_CAPABLE + int state = 0; + + return _wcstombs_r (_REENT, s, pwcs, n, &state); +#else /* not MB_CAPABLE */ + int count = 0; + + if (n != 0) { + do { + if ((*s++ = (char) *pwcs++) == 0) + break; + count++; + } while (--n != 0); + } + + return count; +#endif /* not MB_CAPABLE */ +} + +#endif /* !_REENT_ONLY */ diff --git a/newlib/libc/stdlib/wcstombs_r.c b/newlib/libc/stdlib/wcstombs_r.c new file mode 100644 index 000000000..69c82d411 --- /dev/null +++ b/newlib/libc/stdlib/wcstombs_r.c @@ -0,0 +1,32 @@ +#include + +size_t +_DEFUN (_wcstombs_r, (reent, s, pwcs, n, state), + struct _reent *r _AND + char *s _AND + const wchar_t *pwcs _AND + size_t n _AND + int *state) +{ + char *ptr = s; + size_t max = n; + char buff[8]; + int i, num_to_copy; + + while (n > 0) + { + int bytes = _wctomb_r (r, buff, *pwcs, state); + if (bytes == -1) + return -1; + num_to_copy = (n > bytes ? bytes : (int)n); + for (i = 0; i < num_to_copy; ++i) + *ptr++ = buff[i]; + + if (*pwcs == 0x00) + return ptr - s - (n >= bytes); + ++pwcs; + n -= num_to_copy; + } + + return max; +} diff --git a/newlib/libc/stdlib/wctomb.c b/newlib/libc/stdlib/wctomb.c new file mode 100644 index 000000000..a6812508f --- /dev/null +++ b/newlib/libc/stdlib/wctomb.c @@ -0,0 +1,69 @@ +/* +FUNCTION +<>---minimal wide char to multibyte converter + +INDEX + wctomb + +ANSI_SYNOPSIS + #include + int wctomb(char *<[s]>, wchar_t <[wchar]>); + +TRAD_SYNOPSIS + #include + int wctomb(<[s]>, <[wchar]>) + char *<[s]>; + wchar_t <[wchar]>; + +DESCRIPTION +When MB_CAPABLE is not defined, this is a minimal ANSI-conforming +implementation of <>. The +only ``wide characters'' recognized are single bytes, +and they are ``converted'' to themselves. + +When MB_CAPABLE is defined, this routine calls <<_wctomb_r>> to perform +the conversion, passing a state variable to allow state dependent +decoding. The result is based on the locale setting which may +be restricted to a defined set of locales. + +Each call to <> modifies <<*<[s]>>> unless <[s]> is a null +pointer or MB_CAPABLE is defined and <[wchar]> is invalid. + +RETURNS +This implementation of <> returns <<0>> if +<[s]> is <>; it returns <<-1>> if MB_CAPABLE is enabled +and the wchar is not a valid multi-byte character, it returns <<1>> +if MB_CAPABLE is not defined or the wchar is in reality a single +byte character, otherwise it returns the number of bytes in the +multi-byte character. + +PORTABILITY +<> is required in the ANSI C standard. However, the precise +effects vary with the locale. + +<> requires no supporting OS subroutines. +*/ + +#ifndef _REENT_ONLY + +#include + +int +_DEFUN (wctomb, (s, wchar), + char *s _AND + wchar_t wchar) +{ +#ifdef MB_CAPABLE + static int state; + + return _wctomb_r (_REENT, s, wchar, &state); +#else /* not MB_CAPABLE */ + if (s == NULL) + return 0; + + *s = (char) wchar; + return 1; +#endif /* not MB_CAPABLE */ +} + +#endif /* !_REENT_ONLY */ diff --git a/newlib/libc/stdlib/wctomb_r.c b/newlib/libc/stdlib/wctomb_r.c new file mode 100644 index 000000000..8fa6e16db --- /dev/null +++ b/newlib/libc/stdlib/wctomb_r.c @@ -0,0 +1,110 @@ +#include +#include +#include "mbctype.h" + +int +_DEFUN (_wctomb_r, (r, s, wchar, state), + struct _reent *r _AND + char *s _AND + wchar_t wchar _AND + int *state) +{ + if (strlen (r->_current_locale) <= 1) + { /* fall-through */ } + else if (!strcmp (r->_current_locale, "C-SJIS")) + { + unsigned char char2 = (unsigned char)wchar; + unsigned char char1 = (unsigned char)(wchar >> 8); + + if (s == NULL) + return 0; /* not state-dependent */ + + if (char1 != 0x00) + { + /* first byte is non-zero..validate multi-byte char */ + if (_issjis1(char1) && _issjis2(char2)) + { + *s++ = (char)char1; + *s = (char)char2; + return 2; + } + else + return -1; + } + } + else if (!strcmp (r->_current_locale, "C-EUCJP")) + { + unsigned char char2 = (unsigned char)wchar; + unsigned char char1 = (unsigned char)(wchar >> 8); + + if (s == NULL) + return 0; /* not state-dependent */ + + if (char1 != 0x00) + { + /* first byte is non-zero..validate multi-byte char */ + if (_iseucjp (char1) && _iseucjp (char2)) + { + *s++ = (char)char1; + *s = (char)char2; + return 2; + } + else + return -1; + } + } + else if (!strcmp (r->_current_locale, "C-JIS")) + { + int cnt = 0; + unsigned char char2 = (unsigned char)wchar; + unsigned char char1 = (unsigned char)(wchar >> 8); + + if (s == NULL) + return 1; /* state-dependent */ + + if (char1 != 0x00) + { + /* first byte is non-zero..validate multi-byte char */ + if (_isjis (char1) && _isjis (char2)) + { + if (*state == 0) + { + /* must switch from ASCII to JIS state */ + *state = 1; + *s++ = ESC_CHAR; + *s++ = '$'; + *s++ = 'B'; + cnt = 3; + } + *s++ = (char)char1; + *s = (char)char2; + return cnt + 2; + } + else + return -1; + } + else + { + if (*state != 0) + { + /* must switch from JIS to ASCII state */ + *state = 0; + *s++ = ESC_CHAR; + *s++ = '('; + *s++ = 'B'; + cnt = 3; + } + *s = (char)char2; + return cnt + 1; + } + } + + if (s == NULL) + return 0; + + /* otherwise we are dealing with a single byte character */ + *s = (char) wchar; + return 1; +} + + diff --git a/newlib/libc/string/Makefile.am b/newlib/libc/string/Makefile.am new file mode 100644 index 000000000..26d4b8952 --- /dev/null +++ b/newlib/libc/string/Makefile.am @@ -0,0 +1,66 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + bcmp.c \ + bcopy.c \ + bzero.c \ + index.c \ + memchr.c \ + memcmp.c \ + memcpy.c \ + memmove.c \ + memset.c \ + rindex.c \ + strcat.c \ + strchr.c \ + strcmp.c \ + strcasecmp.c \ + strcoll.c \ + strcpy.c \ + strcspn.c \ + strerror.c \ + strlen.c \ + strlwr.c \ + strncat.c \ + strncmp.c \ + strncasecmp.c \ + strncpy.c \ + strpbrk.c \ + strrchr.c \ + strspn.c \ + strtok.c \ + strtok_r.c \ + strupr.c \ + strxfrm.c \ + strstr.c \ + u_strerr.c + +CHEWOUT_FILES=\ +bcmp.def memcpy.def strcmp.def strncat.def strstr.def \ +bcopy.def memmove.def strcoll.def strncmp.def strtok.def \ +bzero.def memset.def strcpy.def strncpy.def strxfrm.def \ +index.def rindex.def strcspn.def strpbrk.def \ +memchr.def strcat.def strerror.def strrchr.def \ +memcmp.def strchr.def strlen.def strspn.def \ +strcasecmp.def strncasecmp.def strlwr.def strupr.def + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +TARGETDOC = ../tmp.texi + +doc: $(CHEWOUT_FILES) + cat $(srcdir)/strings.tex >> $(TARGETDOC) + +CLEANFILES = $(CHEWOUT_FILES) *.ref diff --git a/newlib/libc/string/Makefile.in b/newlib/libc/string/Makefile.in new file mode 100644 index 000000000..29a413c0d --- /dev/null +++ b/newlib/libc/string/Makefile.in @@ -0,0 +1,343 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +CRT0 = @CRT0@ +EXEEXT = @EXEEXT@ +LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@ +LIBC_POSIX_LIB = @LIBC_POSIX_LIB@ +LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@ +LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@ +LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ +LIBC_SYS_LIB = @LIBC_SYS_LIB@ +LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + bcmp.c \ + bcopy.c \ + bzero.c \ + index.c \ + memchr.c \ + memcmp.c \ + memcpy.c \ + memmove.c \ + memset.c \ + rindex.c \ + strcat.c \ + strchr.c \ + strcmp.c \ + strcasecmp.c \ + strcoll.c \ + strcpy.c \ + strcspn.c \ + strerror.c \ + strlen.c \ + strlwr.c \ + strncat.c \ + strncmp.c \ + strncasecmp.c \ + strncpy.c \ + strpbrk.c \ + strrchr.c \ + strspn.c \ + strtok.c \ + strtok_r.c \ + strupr.c \ + strxfrm.c \ + strstr.c \ + u_strerr.c + + +CHEWOUT_FILES = \ +bcmp.def memcpy.def strcmp.def strncat.def strstr.def \ +bcopy.def memmove.def strcoll.def strncmp.def strtok.def \ +bzero.def memset.def strcpy.def strncpy.def strxfrm.def \ +index.def rindex.def strcspn.def strpbrk.def \ +memchr.def strcat.def strerror.def strrchr.def \ +memcmp.def strchr.def strlen.def strspn.def \ +strcasecmp.def strncasecmp.def strlwr.def strupr.def + + +SUFFIXES = .def + +CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str + +TARGETDOC = ../tmp.texi + +CLEANFILES = $(CHEWOUT_FILES) *.ref +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = bcmp.o bcopy.o bzero.o index.o memchr.o memcmp.o \ +memcpy.o memmove.o memset.o rindex.o strcat.o strchr.o strcmp.o \ +strcasecmp.o strcoll.o strcpy.o strcspn.o strerror.o strlen.o strlwr.o \ +strncat.o strncmp.o strncasecmp.o strncpy.o strpbrk.o strrchr.o \ +strspn.o strtok.o strtok_r.o strupr.o strxfrm.o strstr.o u_strerr.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .def .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus string/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = string + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ +check-am installcheck-am installcheck install-info-am install-info \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +.c.def: + $(CHEW) < $< > $*.def 2> $*.ref + touch stmp-def + +doc: $(CHEWOUT_FILES) + cat $(srcdir)/strings.tex >> $(TARGETDOC) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/string/bcmp.c b/newlib/libc/string/bcmp.c new file mode 100644 index 000000000..b6a4d5298 --- /dev/null +++ b/newlib/libc/string/bcmp.c @@ -0,0 +1,50 @@ +/* +FUNCTION + <>---compare two memory areas + +INDEX + bcmp + +ANSI_SYNOPSIS + #include + int bcmp(const char *<[s1]>, const char *<[s2]>, size_t <[n]>); + +TRAD_SYNOPSIS + #include + int bcmp(<[s1]>, <[s2]>, <[n]>) + char *<[s1]>; + char *<[s2]>; + size_t <[n]>; + +DESCRIPTION + This function compares not more than <[n]> characters of the + object pointed to by <[s1]> with the object pointed to by <[s2]>. + + This function is identical to <>. + + + +RETURNS + The function returns an integer greater than, equal to or + less than zero according to whether the object pointed to by + <[s1]> is greater than, equal to or less than the object + pointed to by <[s2]>. + +PORTABILITY +<> requires no supporting OS subroutines. + +QUICKREF + bcmp ansi pure +*/ + +#include + +int +_DEFUN (bcmp, (m1, m2, n), + _CONST char *m1 _AND + _CONST char *m2 _AND + size_t n) + +{ + return memcmp (m1, m2, n); +} diff --git a/newlib/libc/string/bcopy.c b/newlib/libc/string/bcopy.c new file mode 100644 index 000000000..733840b83 --- /dev/null +++ b/newlib/libc/string/bcopy.c @@ -0,0 +1,38 @@ +/* +FUNCTION + <>---copy memory regions + +ANSI_SYNOPSIS + #include + void bcopy(const char *<[in]>, char *<[out]>, size_t <[n]>); + +TRAD_SYNOPSIS + void bcopy(<[in]>, <[out]>, <[n]> + char *<[in]>; + char *<[out]>; + size_t <[n]>; + +DESCRIPTION + This function copies <[n]> bytes from the memory region + pointed to by <[in]> to the memory region pointed to by + <[out]>. + + This function is implemented in term of <>. + +PORTABILITY +<> requires no supporting OS subroutines. + +QUICKREF + bcopy - pure +*/ + +#include + +void +_DEFUN (bcopy, (b1, b2, length), + _CONST char *b1 _AND + char *b2 _AND + size_t length) +{ + memmove ((_PTR) b2, (_PTR) b1, length); +} diff --git a/newlib/libc/string/bzero.c b/newlib/libc/string/bzero.c new file mode 100644 index 000000000..e9e78c938 --- /dev/null +++ b/newlib/libc/string/bzero.c @@ -0,0 +1,42 @@ +/* +FUNCTION +<>---initialize memory to zero + +INDEX + bzero + +ANSI_SYNOPSIS + #include + void bzero(char *<[b]>, size_t <[length]>); + +TRAD_SYNOPSIS + #include + void bzero(<[b]>, <[length]>) + char *<[b]>; + size_t <[length]>; + +DESCRIPTION +<> initializes <[length]> bytes of memory, starting at address +<[b]>, to zero. + +RETURNS +<> does not return a result. + +PORTABILITY +<> is in the Berkeley Software Distribution. +Neither ANSI C nor the System V Interface Definition (Issue 2) require +<>. + +<> requires no supporting OS subroutines. +*/ + +#include + +_VOID +_DEFUN (bzero, (b, length), + char *b _AND + size_t length) +{ + while (length--) + *b++ = 0; +} diff --git a/newlib/libc/string/index.c b/newlib/libc/string/index.c new file mode 100644 index 000000000..6c165f952 --- /dev/null +++ b/newlib/libc/string/index.c @@ -0,0 +1,44 @@ +/* +FUNCTION + <>---search for character in string + +INDEX + index + +ANSI_SYNOPSIS + #include + char * index(const char *<[string]>, int <[c]>); + +TRAD_SYNOPSIS + #include + char * index(<[string]>, <[c]>); + char *<[string]>; + int *<[c]>; + +DESCRIPTION + This function finds the first occurence of <[c]> (converted to + a char) in the string pointed to by <[string]> (including the + terminating null character). + + This function is identical to <>. + +RETURNS + Returns a pointer to the located character, or a null pointer + if <[c]> does not occur in <[string]>. + +PORTABILITY +<> requires no supporting OS subroutines. + +QUICKREF + index - pure +*/ + +#include + +char * +_DEFUN (index, (s, c), + _CONST char *s _AND + int c) +{ + return strchr (s, c); +} diff --git a/newlib/libc/string/memchr.c b/newlib/libc/string/memchr.c new file mode 100644 index 000000000..2fd3c861d --- /dev/null +++ b/newlib/libc/string/memchr.c @@ -0,0 +1,143 @@ +/* +FUNCTION + <>---find character in memory + +INDEX + memchr + +ANSI_SYNOPSIS + #include + void *memchr(const void *<[src]>, int <[c]>, size_t <[length]>); + +TRAD_SYNOPSIS + #include + void *memchr(<[src]>, <[c]>, <[length]>) + void *<[src]>; + void *<[c]>; + size_t <[length]>; + +DESCRIPTION + This function searches memory starting at <<*<[src]>>> for the + character <[c]>. The search only ends with the first + occurrence of <[c]>, or after <[length]> characters; in + particular, <> does not terminate the search. + +RETURNS + If the character <[c]> is found within <[length]> characters + of <<*<[src]>>>, a pointer to the character is returned. If + <[c]> is not found, then <> is returned. + +PORTABILITY +<>> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + memchr ansi pure +*/ + +#include <_ansi.h> +#include +#include + +/* Nonzero if either X or Y is not aligned on a "long" boundary. */ +#define UNALIGNED(X) ((long)X & (sizeof (long) - 1)) + +/* How many bytes are loaded each iteration of the word copy loop. */ +#define LBLOCKSIZE (sizeof (long)) + +/* Threshhold for punting to the bytewise iterator. */ +#define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE) + +#if LONG_MAX == 2147483647L +#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080) +#else +#if LONG_MAX == 9223372036854775807L +/* Nonzero if X (a long int) contains a NULL byte. */ +#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080) +#else +#error long int is not a 32bit or 64bit type. +#endif +#endif + +#ifndef DETECTNULL +#error long int is not a 32bit or 64bit byte +#endif + + +_PTR +_DEFUN (memchr, (src_void, c, length), + _CONST _PTR src_void _AND + int c _AND + size_t length) +{ +#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) + _CONST unsigned char *src = (_CONST unsigned char *) src_void; + + c &= 0xff; + + while (length--) + { + if (*src == c) + return (char *) src; + src++; + } + return NULL; +#else + _CONST unsigned char *src = (_CONST unsigned char *) src_void; + unsigned long *asrc; + unsigned long buffer; + unsigned long mask; + int i, j; + + c &= 0xff; + + /* If the size is small, or src is unaligned, then + use the bytewise loop. We can hope this is rare. */ + if (!TOO_SMALL (length) && !UNALIGNED (src)) + { + /* The fast code reads the ASCII one word at a time and only + performs the bytewise search on word-sized segments if they + contain the search character, which is detected by XORing + the word-sized segment with a word-sized block of the search + character and then detecting for the presence of NULL in the + result. */ + asrc = (unsigned long*) src; + mask = 0; + for (i = 0; i < LBLOCKSIZE; i++) + mask = (mask << 8) + c; + + while (length >= LBLOCKSIZE) + { + buffer = *asrc; + buffer ^= mask; + if (DETECTNULL (buffer)) + { + src = (unsigned char*) asrc; + for ( j = 0; j < LBLOCKSIZE; j++ ) + { + if (*src == c) + return (char*) src; + src++; + } + } + length -= LBLOCKSIZE; + asrc++; + } + + /* If there are fewer than LBLOCKSIZE characters left, + then we resort to the bytewise loop. */ + + src = (unsigned char*) asrc; + } + + while (length--) + { + if (*src == c) + return (char*) src; + src++; + } + + return NULL; +#endif /* not PREFER_SIZE_OVER_SPEED */ +} diff --git a/newlib/libc/string/memcmp.c b/newlib/libc/string/memcmp.c new file mode 100644 index 000000000..ac7a194a6 --- /dev/null +++ b/newlib/libc/string/memcmp.c @@ -0,0 +1,113 @@ +/* +FUNCTION + <>---compare two memory areas + +INDEX + memcmp + +ANSI_SYNOPSIS + #include + int memcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>); + +TRAD_SYNOPSIS + #include + int memcmp(<[s1]>, <[s2]>, <[n]>) + void *<[s1]>; + void *<[s2]>; + size_t <[n]>; + +DESCRIPTION + This function compares not more than <[n]> characters of the + object pointed to by <[s1]> with the object pointed to by <[s2]>. + + +RETURNS + The function returns an integer greater than, equal to or + less than zero according to whether the object pointed to by + <[s1]> is greater than, equal to or less than the object + pointed to by <[s2]>. + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + memcmp ansi pure +*/ + +#include + + +/* Nonzero if either X or Y is not aligned on a "long" boundary. */ +#define UNALIGNED(X, Y) \ + (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) + +/* How many bytes are copied each iteration of the word copy loop. */ +#define LBLOCKSIZE (sizeof (long)) + +/* Threshhold for punting to the byte copier. */ +#define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE) + +int +_DEFUN (memcmp, (m1, m2, n), + _CONST _PTR m1 _AND + _CONST _PTR m2 _AND + size_t n) +{ +#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) + unsigned char *s1 = (unsigned char *) m1; + unsigned char *s2 = (unsigned char *) m2; + + while (n--) + { + if (*s1 != *s2) + { + return *s1 - *s2; + } + s1++; + s2++; + } + return 0; +#else + unsigned char *s1 = (unsigned char *) m1; + unsigned char *s2 = (unsigned char *) m2; + unsigned long *a1; + unsigned long *a2; + + /* If the size is too small, or either pointer is unaligned, + then we punt to the byte compare loop. Hopefully this will + not turn up in inner loops. */ + if (!TOO_SMALL(n) && !UNALIGNED(s1,s2)) + { + /* Otherwise, load and compare the blocks of memory one + word at a time. */ + a1 = (unsigned long*) s1; + a2 = (unsigned long*) s2; + while (n >= LBLOCKSIZE) + { + if (*a1 != *a2) + break; + a1++; + a2++; + n -= LBLOCKSIZE; + } + + /* check m mod LBLOCKSIZE remaining characters */ + + s1 = (char*)a1; + s2 = (char*)a2; + } + + while (n--) + { + if (*s1 != *s2) + return *s1 - *s2; + s1++; + s2++; + } + + return 0; +#endif /* not PREFER_SIZE_OVER_SPEED */ +} + diff --git a/newlib/libc/string/memcpy.c b/newlib/libc/string/memcpy.c new file mode 100644 index 000000000..5336f25a9 --- /dev/null +++ b/newlib/libc/string/memcpy.c @@ -0,0 +1,111 @@ +/* +FUNCTION + <>---copy memory regions + +ANSI_SYNOPSIS + #include + void* memcpy(void *<[out]>, const void *<[in]>, size_t <[n]>); + +TRAD_SYNOPSIS + void *memcpy(<[out]>, <[in]>, <[n]> + void *<[out]>; + void *<[in]>; + size_t <[n]>; + +DESCRIPTION + This function copies <[n]> bytes from the memory region + pointed to by <[in]> to the memory region pointed to by + <[out]>. + + If the regions overlap, the behavior is undefined. + +RETURNS + <> returns a pointer to the first byte of the <[out]> + region. + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + memcpy ansi pure + */ + +#include <_ansi.h> +#include +#include + +/* Nonzero if either X or Y is not aligned on a "long" boundary. */ +#define UNALIGNED(X, Y) \ + (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) + +/* How many bytes are copied each iteration of the 4X unrolled loop. */ +#define BIGBLOCKSIZE (sizeof (long) << 2) + +/* How many bytes are copied each iteration of the word copy loop. */ +#define LITTLEBLOCKSIZE (sizeof (long)) + +/* Threshhold for punting to the byte copier. */ +#define TOO_SMALL(LEN) ((LEN) < BIGBLOCKSIZE) + +_PTR +_DEFUN (memcpy, (dst0, src0, len0), + _PTR dst0 _AND + _CONST _PTR src0 _AND + size_t len0) +{ +#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) + char *dst = (char *) dst0; + char *src = (char *) src0; + + _PTR save = dst0; + + while (len0--) + { + *dst++ = *src++; + } + + return save; +#else + char *dst = dst0; + _CONST char *src = src0; + long *aligned_dst; + _CONST long *aligned_src; + int len = len0; + + /* If the size is small, or either SRC or DST is unaligned, + then punt into the byte copy loop. This should be rare. */ + if (!TOO_SMALL(len) && !UNALIGNED (src, dst)) + { + aligned_dst = (long*)dst; + aligned_src = (long*)src; + + /* Copy 4X long words at a time if possible. */ + while (len >= BIGBLOCKSIZE) + { + *aligned_dst++ = *aligned_src++; + *aligned_dst++ = *aligned_src++; + *aligned_dst++ = *aligned_src++; + *aligned_dst++ = *aligned_src++; + len -= BIGBLOCKSIZE; + } + + /* Copy one long word at a time if possible. */ + while (len >= LITTLEBLOCKSIZE) + { + *aligned_dst++ = *aligned_src++; + len -= LITTLEBLOCKSIZE; + } + + /* Pick up any residual with a byte copier. */ + dst = (char*)aligned_dst; + src = (char*)aligned_src; + } + + while (len--) + *dst++ = *src++; + + return dst0; +#endif /* not PREFER_SIZE_OVER_SPEED */ +} diff --git a/newlib/libc/string/memmove.c b/newlib/libc/string/memmove.c new file mode 100644 index 000000000..2528e27d4 --- /dev/null +++ b/newlib/libc/string/memmove.c @@ -0,0 +1,143 @@ +/* +FUNCTION + <>---move possibly overlapping memory + +INDEX + memmove + +ANSI_SYNOPSIS + #include + void *memmove(void *<[dst]>, const void *<[src]>, size_t <[length]>); + +TRAD_SYNOPSIS + #include + void *memmove(<[dst]>, <[src]>, <[length]>) + void *<[dst]>; + void *<[src]>; + size_t <[length]>; + +DESCRIPTION + This function moves <[length]> characters from the block of + memory starting at <<*<[src]>>> to the memory starting at + <<*<[dst]>>>. <> reproduces the characters correctly + at <<*<[dst]>>> even if the two areas overlap. + + +RETURNS + The function returns <[dst]> as passed. + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + memmove ansi pure +*/ + +#include +#include <_ansi.h> +#include +#include + +/* Nonzero if either X or Y is not aligned on a "long" boundary. */ +#define UNALIGNED(X, Y) \ + (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) + +/* How many bytes are copied each iteration of the 4X unrolled loop. */ +#define BIGBLOCKSIZE (sizeof (long) << 2) + +/* How many bytes are copied each iteration of the word copy loop. */ +#define LITTLEBLOCKSIZE (sizeof (long)) + +/* Threshhold for punting to the byte copier. */ +#define TOO_SMALL(LEN) ((LEN) < BIGBLOCKSIZE) + +/*SUPPRESS 20*/ +_PTR +_DEFUN (memmove, (dst_void, src_void, length), + _PTR dst_void _AND + _CONST _PTR src_void _AND + size_t length) +{ +#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) + char *dst = dst_void; + _CONST char *src = src_void; + + if (src < dst && dst < src + length) + { + /* Have to copy backwards */ + src += length; + dst += length; + while (length--) + { + *--dst = *--src; + } + } + else + { + while (length--) + { + *dst++ = *src++; + } + } + + return dst_void; +#else + char *dst = dst_void; + _CONST char *src = src_void; + long *aligned_dst; + _CONST long *aligned_src; + int len = length; + + if (src < dst && dst < src + len) + { + /* Destructive overlap...have to copy backwards */ + src += len; + dst += len; + while (len--) + { + *--dst = *--src; + } + } + else + { + /* Use optimizing algorithm for a non-destructive copy to closely + match memcpy. If the size is small or either SRC or DST is unaligned, + then punt into the byte copy loop. This should be rare. */ + if (!TOO_SMALL(len) && !UNALIGNED (src, dst)) + { + aligned_dst = (long*)dst; + aligned_src = (long*)src; + + /* Copy 4X long words at a time if possible. */ + while (len >= BIGBLOCKSIZE) + { + *aligned_dst++ = *aligned_src++; + *aligned_dst++ = *aligned_src++; + *aligned_dst++ = *aligned_src++; + *aligned_dst++ = *aligned_src++; + len -= BIGBLOCKSIZE; + } + + /* Copy one long word at a time if possible. */ + while (len >= LITTLEBLOCKSIZE) + { + *aligned_dst++ = *aligned_src++; + len -= LITTLEBLOCKSIZE; + } + + /* Pick up any residual with a byte copier. */ + dst = (char*)aligned_dst; + src = (char*)aligned_src; + } + + while (len--) + { + *dst++ = *src++; + } + } + + return dst_void; +#endif /* not PREFER_SIZE_OVER_SPEED */ +} diff --git a/newlib/libc/string/memset.c b/newlib/libc/string/memset.c new file mode 100644 index 000000000..f6ec46b9a --- /dev/null +++ b/newlib/libc/string/memset.c @@ -0,0 +1,110 @@ +/* +FUNCTION + <>---set an area of memory + +INDEX + memset + +ANSI_SYNOPSIS + #include + void *memset(const void *<[dst]>, int <[c]>, size_t <[length]>); + +TRAD_SYNOPSIS + #include + void *memset(<[dst]>, <[c]>, <[length]>) + void *<[dst]>; + int <[c]>; + size_t <[length]>; + +DESCRIPTION + This function converts the argument <[c]> into an unsigned + char and fills the first <[length]> characters of the array + pointed to by <[dst]> to the value. + +RETURNS + <> returns the value of <[m]>. + +PORTABILITY +<> is ANSI C. + + <> requires no supporting OS subroutines. + +QUICKREF + memset ansi pure +*/ + +#include + +#define LBLOCKSIZE (sizeof(long)) +#define UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1)) +#define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE) + +_PTR +_DEFUN (memset, (m, c, n), + _PTR m _AND + int c _AND + size_t n) +{ +#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) + char *s = (char *) m; + + while (n-- != 0) + { + *s++ = (char) c; + } + + return m; +#else + char *s = (char *) m; + int count, i; + unsigned long buffer; + unsigned long *aligned_addr; + unsigned char *unaligned_addr; + + if (!TOO_SMALL (n) && !UNALIGNED (m)) + { + /* If we get this far, we know that n is large and m is word-aligned. */ + + aligned_addr = (unsigned long*)m; + + /* Store C into each char sized location in BUFFER so that + we can set large blocks quickly. */ + c &= 0xff; + if (LBLOCKSIZE == 4) + { + buffer = (c << 8) | c; + buffer |= (buffer << 16); + } + else + { + buffer = 0; + for (i = 0; i < LBLOCKSIZE; i++) + buffer = (buffer << 8) | c; + } + + while (n >= LBLOCKSIZE*4) + { + *aligned_addr++ = buffer; + *aligned_addr++ = buffer; + *aligned_addr++ = buffer; + *aligned_addr++ = buffer; + n -= 4*LBLOCKSIZE; + } + + while (n >= LBLOCKSIZE) + { + *aligned_addr++ = buffer; + n -= LBLOCKSIZE; + } + /* Pick up the remainder with a bytewise loop. */ + s = (char*)aligned_addr; + } + + while (n--) + { + *s++ = (char)c; + } + + return m; +#endif /* not PREFER_SIZE_OVER_SPEED */ +} diff --git a/newlib/libc/string/rindex.c b/newlib/libc/string/rindex.c new file mode 100644 index 000000000..3c6dff909 --- /dev/null +++ b/newlib/libc/string/rindex.c @@ -0,0 +1,44 @@ +/* +FUNCTION + <>---reverse search for character in string + +INDEX + rindex + +ANSI_SYNOPSIS + #include + char * rindex(const char *<[string]>, int <[c]>); + +TRAD_SYNOPSIS + #include + char * rindex(<[string]>, <[c]>); + char *<[string]>; + int *<[c]>; + +DESCRIPTION + This function finds the last occurence of <[c]> (converted to + a char) in the string pointed to by <[string]> (including the + terminating null character). + + This function is identical to <>. + +RETURNS + Returns a pointer to the located character, or a null pointer + if <[c]> does not occur in <[string]>. + +PORTABILITY +<> requires no supporting OS subroutines. + +QUICKREF + rindex - pure +*/ + +#include + +char * +_DEFUN (rindex, (s, c), + _CONST char *s _AND + int c) +{ + return strrchr (s, c); +} diff --git a/newlib/libc/string/strcasecmp.c b/newlib/libc/string/strcasecmp.c new file mode 100644 index 000000000..4dcfc784a --- /dev/null +++ b/newlib/libc/string/strcasecmp.c @@ -0,0 +1,56 @@ +/* +FUNCTION + <>---case insensitive character string compare + +INDEX + strcasecmp + +ANSI_SYNOPSIS + #include + int strcasecmp(const char *<[a]>, const char *<[b]>); + +TRAD_SYNOPSIS + #include + int strcasecmp(<[a]>, <[b]>) + char *<[a]>; + char *<[b]>; + +DESCRIPTION + <> compares the string at <[a]> to + the string at <[b]> in a case-insensitive manner. + +RETURNS + + If <<*<[a]>>> sorts lexicographically after <<*<[b]>>> (after + both are converted to upper case), <> returns a + number greater than zero. If the two strings match, + <> returns zero. If <<*<[a]>>> sorts + lexicographically before <<*<[b]>>>, <> returns a + number less than zero. + +PORTABILITY +<> is in the Berkeley Software Distribution. + +<> requires no supporting OS subroutines. It uses +tolower() from elsewhere in this library. + +QUICKREF + strcasecmp +*/ + +#include +#include + +int +_DEFUN (strcasecmp, (s1, s2), + _CONST char *s1 _AND + _CONST char *s2) +{ + while (*s1 != '\0' && tolower(*s1) == tolower(*s2)) + { + s1++; + s2++; + } + + return tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2); +} diff --git a/newlib/libc/string/strcat.c b/newlib/libc/string/strcat.c new file mode 100644 index 000000000..411eadb85 --- /dev/null +++ b/newlib/libc/string/strcat.c @@ -0,0 +1,104 @@ +/* +FUNCTION + <>---concatenate strings + +INDEX + strcat + +ANSI_SYNOPSIS + #include + char *strcat(char *<[dst]>, const char *<[src]>); + +TRAD_SYNOPSIS + #include + char *strcat(<[dst]>, <[src]>) + char *<[dst]>; + char *<[src]>; + +DESCRIPTION + <> appends a copy of the string pointed to by <[src]> + (including the terminating null character) to the end of the + string pointed to by <[dst]>. The initial character of + <[src]> overwrites the null character at the end of <[dst]>. + +RETURNS + This function returns the initial value of <[dst]> + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + strcat ansi pure +*/ + +#include +#include + +/* Nonzero if X is aligned on a "long" boundary. */ +#define ALIGNED(X) \ + (((long)X & (sizeof (long) - 1)) == 0) + +#if LONG_MAX == 2147483647L +#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080) +#else +#if LONG_MAX == 9223372036854775807L +/* Nonzero if X (a long int) contains a NULL byte. */ +#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080) +#else +#error long int is not a 32bit or 64bit type. +#endif +#endif + +#ifndef DETECTNULL +#error long int is not a 32bit or 64bit byte +#endif + + +/*SUPPRESS 560*/ +/*SUPPRESS 530*/ + +char * +_DEFUN (strcat, (s1, s2), + char *s1 _AND + _CONST char *s2) +{ +#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) + char *s = s1; + + while (*s1) + s1++; + + while (*s1++ = *s2++) + ; + return s; +#else + char *s = s1; + + + /* Skip over the data in s1 as quickly as possible. */ + if (ALIGNED (s1)) + { + unsigned long *aligned_s1 = (unsigned long *)s1; + while (!DETECTNULL (*aligned_s1)) + aligned_s1++; + + s1 = (char *)aligned_s1; + } + + while (*s1) + s1++; + + /* s1 now points to the its trailing null character, we can + just use strcpy to do the work for us now. + + ?!? We might want to just include strcpy here. + Also, this will cause many more unaligned string copies because + s1 is much less likely to be aligned. I don't know if its worth + tweaking strcpy to handle this better. */ + strcpy (s1, s2); + + return s; +#endif /* not PREFER_SIZE_OVER_SPEED */ +} diff --git a/newlib/libc/string/strchr.c b/newlib/libc/string/strchr.c new file mode 100644 index 000000000..de4585f75 --- /dev/null +++ b/newlib/libc/string/strchr.c @@ -0,0 +1,108 @@ +/* +FUNCTION + <>---search for character in string + +INDEX + strchr + +ANSI_SYNOPSIS + #include + char * strchr(const char *<[string]>, int <[c]>); + +TRAD_SYNOPSIS + #include + char * strchr(<[string]>, <[c]>); + char *<[string]>; + int *<[c]>; + +DESCRIPTION + This function finds the first occurence of <[c]> (converted to + a char) in the string pointed to by <[string]> (including the + terminating null character). + +RETURNS + Returns a pointer to the located character, or a null pointer + if <[c]> does not occur in <[string]>. + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + strchr ansi pure +*/ + +#include +#include + +/* Nonzero if X is not aligned on a "long" boundary. */ +#define UNALIGNED(X) ((long)X & (sizeof (long) - 1)) + +/* How many bytes are loaded each iteration of the word copy loop. */ +#define LBLOCKSIZE (sizeof (long)) + +#if LONG_MAX == 2147483647L +#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080) +#else +#if LONG_MAX == 9223372036854775807L +/* Nonzero if X (a long int) contains a NULL byte. */ +#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080) +#else +#error long int is not a 32bit or 64bit type. +#endif +#endif + +/* DETECTCHAR returns nonzero if (long)X contains the byte used + to fill (long)MASK. */ +#define DETECTCHAR(X,MASK) (DETECTNULL(X ^ MASK)) + +char * +_DEFUN (strchr, (s1, i), + _CONST char *s1 _AND + int i) +{ + _CONST unsigned char *s = (_CONST unsigned char *)s1; +#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) + unsigned char c = (unsigned int)i; + + while (*s && *s != c) + { + s++; + } + + if (*s != c) + { + s = NULL; + } + + return (char *) s; +#else + unsigned char c = (unsigned char)i; + unsigned long mask,j; + unsigned long *aligned_addr; + + if (!UNALIGNED (s)) + { + mask = 0; + for (j = 0; j < LBLOCKSIZE; j++) + mask = (mask << 8) | c; + + aligned_addr = (unsigned long*)s; + while (!DETECTNULL (*aligned_addr) && !DETECTCHAR (*aligned_addr, mask)) + aligned_addr++; + + /* The block of bytes currently pointed to by aligned_addr + contains either a null or the target char, or both. We + catch it using the bytewise search. */ + + s = (unsigned char*)aligned_addr; + } + + while (*s && *s != c) + s++; + if (*s == c) + return (char *)s; + return NULL; +#endif /* not PREFER_SIZE_OVER_SPEED */ +} diff --git a/newlib/libc/string/strcmp.c b/newlib/libc/string/strcmp.c new file mode 100644 index 000000000..81d65272e --- /dev/null +++ b/newlib/libc/string/strcmp.c @@ -0,0 +1,106 @@ +/* +FUNCTION + <>---character string compare + +INDEX + strcmp + +ANSI_SYNOPSIS + #include + int strcmp(const char *<[a]>, const char *<[b]>); + +TRAD_SYNOPSIS + #include + int strcmp(<[a]>, <[b]>) + char *<[a]>; + char *<[b]>; + +DESCRIPTION + <> compares the string at <[a]> to + the string at <[b]>. + +RETURNS + If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>, + <> returns a number greater than zero. If the two + strings match, <> returns zero. If <<*<[a]>>> + sorts lexicographically before <<*<[b]>>>, <> returns a + number less than zero. + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + strcmp ansi pure +*/ + +#include +#include + +/* Nonzero if either X or Y is not aligned on a "long" boundary. */ +#define UNALIGNED(X, Y) \ + (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) + +/* DETECTNULL returns nonzero if (long)X contains a NULL byte. */ +#if LONG_MAX == 2147483647L +#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080) +#else +#if LONG_MAX == 9223372036854775807L +#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080) +#else +#error long int is not a 32bit or 64bit type. +#endif +#endif + +#ifndef DETECTNULL +#error long int is not a 32bit or 64bit byte +#endif + +int +_DEFUN (strcmp, (s1, s2), + _CONST char *s1 _AND + _CONST char *s2) +{ +#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) + while (*s1 != '\0' && *s1 == *s2) + { + s1++; + s2++; + } + + return (*(unsigned char *) s1) - (*(unsigned char *) s2); +#else + unsigned long *a1; + unsigned long *a2; + + /* If s1 or s2 are unaligned, then compare bytes. */ + if (!UNALIGNED (s1, s2)) + { + /* If s1 and s2 are word-aligned, compare them a word at a time. */ + a1 = (unsigned long*)s1; + a2 = (unsigned long*)s2; + while (*a1 == *a2) + { + /* To get here, *a1 == *a2, thus if we find a null in *a1, + then the strings must be equal, so return zero. */ + if (DETECTNULL (*a1)) + return 0; + + a1++; + a2++; + } + + /* A difference was detected in last few bytes of s1, so search bytewise */ + s1 = (char*)a1; + s2 = (char*)a2; + } + + while (*s1 != '\0' && *s1 == *s2) + { + s1++; + s2++; + } + return (*(unsigned char *) s1) - (*(unsigned char *) s2); +#endif /* not PREFER_SIZE_OVER_SPEED */ +} diff --git a/newlib/libc/string/strcoll.c b/newlib/libc/string/strcoll.c new file mode 100644 index 000000000..8760b2217 --- /dev/null +++ b/newlib/libc/string/strcoll.c @@ -0,0 +1,48 @@ +/* +FUNCTION + <>---locale specific character string compare + +INDEX + strcoll + +ANSI_SYNOPSIS + #include + int strcoll(const char *<[stra]>, const char * <[strb]>); + +TRAD_SYNOPSIS + #include + int strcoll(<[stra]>, <[strb]>) + char *<[stra]>; + char *<[strb]>; + +DESCRIPTION + <> compares the string pointed to by <[stra]> to + the string pointed to by <[strb]>, using an interpretation + appropriate to the current <> state. + +RETURNS + If the first string is greater than the second string, + <> returns a number greater than zero. If the two + strings are equivalent, <> returns zero. If the first + string is less than the second string, <> returns a + number less than zero. + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + strcoll ansi pure +*/ + +#include + +int +_DEFUN (strcoll, (a, b), + _CONST char *a _AND + _CONST char *b) + +{ + return strcmp (a, b); +} diff --git a/newlib/libc/string/strcpy.c b/newlib/libc/string/strcpy.c new file mode 100644 index 000000000..905b2541c --- /dev/null +++ b/newlib/libc/string/strcpy.c @@ -0,0 +1,99 @@ +/* +FUNCTION + <>---copy string + +INDEX + strcpy + +ANSI_SYNOPSIS + #include + char *strcpy(char *<[dst]>, const char *<[src]>); + +TRAD_SYNOPSIS + #include + char *strcpy(<[dst]>, <[src]>) + char *<[dst]>; + char *<[src]>; + +DESCRIPTION + <> copies the string pointed to by <[src]> + (including the terminating null character) to the array + pointed to by <[dst]>. + +RETURNS + This function returns the initial value of <[dst]>. + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + strcpy ansi pure +*/ + +#include +#include + +/*SUPPRESS 560*/ +/*SUPPRESS 530*/ + +/* Nonzero if either X or Y is not aligned on a "long" boundary. */ +#define UNALIGNED(X, Y) \ + (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) + +#if LONG_MAX == 2147483647L +#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080) +#else +#if LONG_MAX == 9223372036854775807L +/* Nonzero if X (a long int) contains a NULL byte. */ +#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080) +#else +#error long int is not a 32bit or 64bit type. +#endif +#endif + +#ifndef DETECTNULL +#error long int is not a 32bit or 64bit byte +#endif + +char* +_DEFUN (strcpy, (dst0, src0), + char *dst0 _AND + _CONST char *src0) +{ +#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) + char *s = dst0; + + while (*dst0++ = *src0++) + ; + + return s; +#else + char *dst = dst0; + _CONST char *src = src0; + long *aligned_dst; + _CONST long *aligned_src; + + /* If SRC or DEST is unaligned, then copy bytes. */ + if (!UNALIGNED (src, dst)) + { + aligned_dst = (long*)dst; + aligned_src = (long*)src; + + /* SRC and DEST are both "long int" aligned, try to do "long int" + sized copies. */ + while (!DETECTNULL(*aligned_src)) + { + *aligned_dst++ = *aligned_src++; + } + + dst = (char*)aligned_dst; + src = (char*)aligned_src; + } + + while (*dst++ = *src++) + ; + return dst0; +#endif /* not PREFER_SIZE_OVER_SPEED */ +} diff --git a/newlib/libc/string/strcspn.c b/newlib/libc/string/strcspn.c new file mode 100644 index 000000000..fe68b8f51 --- /dev/null +++ b/newlib/libc/string/strcspn.c @@ -0,0 +1,54 @@ +/* +FUNCTION + <>---count chars not in string + +INDEX + strcspn + +ANSI_SYNOPSIS + size_t strcspn(const char *<[s1]>, const char *<[s2]>); + +TRAD_SYNOPSIS + size_t strcspn(<[s1]>, <[s2]>) + char *<[s1]>; + char *<[s2]>; + +DESCRIPTION + This function computes the length of the initial part of + the string pointed to by <[s1]> which consists entirely of + characters <[NOT]> from the string pointed to by <[s2]> + (excluding the terminating null character). + +RETURNS + <> returns the length of the substring found. + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + */ + +#include + +size_t +_DEFUN (strcspn, (s1, s2), + _CONST char *s1 _AND + _CONST char *s2) +{ + _CONST char *s = s1; + _CONST char *c; + + while (*s1) + { + for (c = s2; *c; c++) + { + if (*s1 == *c) + break; + } + if (*c) + break; + s1++; + } + + return s1 - s; +} diff --git a/newlib/libc/string/strerror.c b/newlib/libc/string/strerror.c new file mode 100644 index 000000000..78336595d --- /dev/null +++ b/newlib/libc/string/strerror.c @@ -0,0 +1,650 @@ +/*** +**** CAUTION!!! KEEP DOC CONSISTENT---if you change text of a message +**** here, change two places: +**** 1) the leading doc section (alphabetized by macro) +**** 2) the real text inside switch(errnum) +***/ + +/* +FUNCTION + <>---convert error number to string + +INDEX + strerror + +ANSI_SYNOPSIS + #include + char *strerror(int <[errnum]>); + +TRAD_SYNOPSIS + #include + char *strerror(<[errnum]>) + int <[errnum]>; + +DESCRIPTION +<> converts the error number <[errnum]> into a +string. The value of <[errnum]> is usually a copy of <>. +If <> is not a known error number, the result points to an +empty string. + +This implementation of <> prints out the following strings +for each of the values defined in `<>': + +o+ +o E2BIG +Arg list too long + +o EACCES +Permission denied + +o EADV +Advertise error + +o EAGAIN +No more processes + +o EBADF +Bad file number + +o EBADMSG +Bad message + +o EBUSY +Device or resource busy + +o ECHILD +No children + +o ECOMM +Communication error + +o EDEADLK +Deadlock + +o EEXIST +File exists + +o EDOM +Math argument + +o EFAULT +Bad address + +o EFBIG +File too large + +o EIDRM +Identifier removed + +o EINTR +Interrupted system call + +o EINVAL +Invalid argument + +o EIO +I/O error + +o EISDIR +Is a directory + +o ELIBACC +Cannot access a needed shared library + +o ELIBBAD +Accessing a corrupted shared library + +o ELIBEXEC +Cannot exec a shared library directly + +o ELIBMAX +Attempting to link in more shared libraries than system limit + +o ELIBSCN +<<.lib>> section in a.out corrupted + +o EMFILE +Too many open files + +o EMLINK +Too many links + +o EMULTIHOP +Multihop attempted + +o ENAMETOOLONG +File or path name too long + +o ENFILE +Too many open files in system + +o ENODEV +No such device + +o ENOENT +No such file or directory + +o ENOEXEC +Exec format error + +o ENOLCK +No lock + +o ENOLINK +Virtual circuit is gone + +o ENOMEM +Not enough space + +o ENOMSG +No message of desired type + +o ENONET +Machine is not on the network + +o ENOPKG +No package + +o ENOSPC +No space left on device + +o ENOSR +No stream resources + +o ENOSTR +Not a stream + +o ENOSYS +Function not implemented + +o ENOTBLK +Block device required + +o ENOTDIR +Not a directory + +o ENOTEMPTY +Directory not empty + +o ENOTTY +Not a character device + +o ENXIO +No such device or address + +o EPERM +Not owner + +o EPIPE +Broken pipe + +o EPROTO +Protocol error + +o ERANGE +Result too large + +o EREMOTE +Resource is remote + +o EROFS +Read-only file system + +o ESPIPE +Illegal seek + +o ESRCH +No such process + +o ESRMNT +Srmount error + +o ETIME +Stream ioctl timeout + +o ETXTBSY +Text file busy + +o EXDEV +Cross-device link + +o- + +RETURNS +This function returns a pointer to a string. Your application must +not modify that string. + +PORTABILITY +ANSI C requires <>, but does not specify the strings used +for each error number. + +Although this implementation of <> is reentrant, ANSI C +declares that subsequent calls to <> may overwrite the +result string; therefore portable code cannot depend on the reentrancy +of this subroutine. + +This implementation of <> provides for user-defined +extensibility. <> defines <[__ELASTERROR]>, which can be +used as a base for user-defined error values. If the user supplies a +routine named <<_user_strerror>>, and <[errnum]> passed to +<> does not match any of the supported values, +<<_user_strerror>> is called with <[errnum]> as its argument. + +<<_user_strerror>> takes one argument of type <[int]>, and returns a +character pointer. If <[errnum]> is unknown to <<_user_strerror>>, +<<_user_strerror>> returns <[NULL]>. The default <<_user_strerror>> +returns <[NULL]> for all input values. + +<> requires no supporting OS subroutines. + +QUICKREF + strerror ansi pure +*/ + +#include +#include + +char * +_DEFUN (strerror, (errnum), + int errnum) +{ + char *error; + extern char *_user_strerror _PARAMS ((int)); + + switch (errnum) + { +/* go32 defines EPERM as EACCES */ +#if defined (EPERM) && (!defined (EACCES) || (EPERM != EACCES)) + case EPERM: + error = "Not owner"; + break; +#endif +#ifdef ENOENT + case ENOENT: + error = "No such file or directory"; + break; +#endif +#ifdef ESRCH + case ESRCH: + error = "No such process"; + break; +#endif +#ifdef EINTR + case EINTR: + error = "Interrupted system call"; + break; +#endif +#ifdef EIO + case EIO: + error = "I/O error"; + break; +#endif +/* go32 defines ENXIO as ENODEV */ +#if defined (ENXIO) && (!defined (ENODEV) || (ENXIO != ENODEV)) + case ENXIO: + error = "No such device or address"; + break; +#endif +#ifdef E2BIG + case E2BIG: + error = "Arg list too long"; + break; +#endif +#ifdef ENOEXEC + case ENOEXEC: + error = "Exec format error"; + break; +#endif +#ifdef EBADF + case EBADF: + error = "Bad file number"; + break; +#endif +#ifdef ECHILD + case ECHILD: + error = "No children"; + break; +#endif +#ifdef EAGAIN + case EAGAIN: + error = "No more processes"; + break; +#endif +#ifdef ENOMEM + case ENOMEM: + error = "Not enough space"; + break; +#endif +#ifdef EACCES + case EACCES: + error = "Permission denied"; + break; +#endif +#ifdef EFAULT + case EFAULT: + error = "Bad address"; + break; +#endif +#ifdef ENOTBLK + case ENOTBLK: + error = "Block device required"; + break; +#endif +#ifdef EBUSY + case EBUSY: + error = "Device or resource busy"; + break; +#endif +#ifdef EEXIST + case EEXIST: + error = "File exists"; + break; +#endif +#ifdef EXDEV + case EXDEV: + error = "Cross-device link"; + break; +#endif +#ifdef ENODEV + case ENODEV: + error = "No such device"; + break; +#endif +#ifdef ENOTDIR + case ENOTDIR: + error = "Not a directory"; + break; +#endif +#ifdef EISDIR + case EISDIR: + error = "Is a directory"; + break; +#endif +#ifdef EINVAL + case EINVAL: + error = "Invalid argument"; + break; +#endif +#ifdef ENFILE + case ENFILE: + error = "Too many open files in system"; + break; +#endif +#ifdef EMFILE + case EMFILE: + error = "Too many open files"; + break; +#endif +#ifdef ENOTTY + case ENOTTY: + error = "Not a character device"; + break; +#endif +#ifdef ETXTBSY + case ETXTBSY: + error = "Text file busy"; + break; +#endif +#ifdef EFBIG + case EFBIG: + error = "File too large"; + break; +#endif +#ifdef ENOSPC + case ENOSPC: + error = "No space left on device"; + break; +#endif +#ifdef ESPIPE + case ESPIPE: + error = "Illegal seek"; + break; +#endif +#ifdef EROFS + case EROFS: + error = "Read-only file system"; + break; +#endif +#ifdef EMLINK + case EMLINK: + error = "Too many links"; + break; +#endif +#ifdef EPIPE + case EPIPE: + error = "Broken pipe"; + break; +#endif +#ifdef EDOM + case EDOM: + error = "Math argument"; + break; +#endif +#ifdef ERANGE + case ERANGE: + error = "Result too large"; + break; +#endif +#ifdef ENOMSG + case ENOMSG: + error = "No message of desired type"; + break; +#endif +#ifdef EIDRM + case EIDRM: + error = "Identifier removed"; + break; +#endif +#ifdef EDEADLK + case EDEADLK: + error = "Deadlock"; + break; +#endif +#ifdef ENOLCK + case ENOLCK: + error = "No lock"; + break; +#endif +#ifdef ENOSTR + case ENOSTR: + error = "Not a stream"; + break; +#endif +#ifdef ETIME + case ETIME: + error = "Stream ioctl timeout"; + break; +#endif +#ifdef ENOSR + case ENOSR: + error = "No stream resources"; + break; +#endif +#ifdef ENONET + case ENONET: + error = "Machine is not on the network"; + break; +#endif +#ifdef ENOPKG + case ENOPKG: + error = "No package"; + break; +#endif +#ifdef EREMOTE + case EREMOTE: + error = "Resource is remote"; + break; +#endif +#ifdef ENOLINK + case ENOLINK: + error = "Virtual circuit is gone"; + break; +#endif +#ifdef EADV + case EADV: + error = "Advertise error"; + break; +#endif +#ifdef ESRMNT + case ESRMNT: + error = "Srmount error"; + break; +#endif +#ifdef ECOMM + case ECOMM: + error = "Communication error"; + break; +#endif +#ifdef EPROTO + case EPROTO: + error = "Protocol error"; + break; +#endif +#ifdef EMULTIHOP + case EMULTIHOP: + error = "Multihop attempted"; + break; +#endif +#ifdef EBADMSG + case EBADMSG: + error = "Bad message"; + break; +#endif +#ifdef ELIBACC + case ELIBACC: + error = "Cannot access a needed shared library"; + break; +#endif +#ifdef ELIBBAD + case ELIBBAD: + error = "Accessing a corrupted shared library"; + break; +#endif +#ifdef ELIBSCN + case ELIBSCN: + error = ".lib section in a.out corrupted"; + break; +#endif +#ifdef ELIBMAX + case ELIBMAX: + error = "Attempting to link in more shared libraries than system limit"; + break; +#endif +#ifdef ELIBEXEC + case ELIBEXEC: + error = "Cannot exec a shared library directly"; + break; +#endif +#ifdef ENOSYS + case ENOSYS: + error = "Function not implemented"; + break; +#endif +#ifdef ENMFILE + case ENMFILE: + error = "No more files"; + break; +#endif +#ifdef ENOTEMPTY + case ENOTEMPTY: + error = "Directory not empty"; + break; +#endif +#ifdef ENAMETOOLONG + case ENAMETOOLONG: + error = "File or path name too long"; + break; +#endif +#ifdef ELOOP + case ELOOP: + error = "Too many symbolic links"; + break; +#endif +#ifdef ENOBUFS + case ENOBUFS: + error = "No buffer space available"; + break; +#endif +#ifdef EAFNOSUPPORT + case EAFNOSUPPORT: + error = "Address family not supported by protocol family"; + break; +#endif +#ifdef EPROTOTYPE + case EPROTOTYPE: + error = "Protocol wrong type for socket"; + break; +#endif +#ifdef ENOTSOCK + case ENOTSOCK: + error = "Socket operation on non-socket"; + break; +#endif +#ifdef ENOPROTOOPT + case ENOPROTOOPT: + error = "Protocol not available"; + break; +#endif +#ifdef ESHUTDOWN + case ESHUTDOWN: + error = "Can't send after socket shutdown"; + break; +#endif +#ifdef ECONNREFUSED + case ECONNREFUSED: + error = "Connection refused"; + break; +#endif +#ifdef EADDRINUSE + case EADDRINUSE: + error = "Address already in use"; + break; +#endif +#ifdef ECONNABORTED + case ECONNABORTED: + error = "Software caused connection abort"; + break; +#endif +#if (defined(EWOULDBLOCK) && (!defined (EAGAIN) || (EWOULDBLOCK != EAGAIN))) + case EWOULDBLOCK: + error = "Operation would block"; + break; +#endif +#ifdef ENOTCONN + case ENOTCONN: + error = "Socket is not connected"; + break; +#endif +#ifdef ESOCKTNOSUPPORT + case ESOCKTNOSUPPORT: + error = "Socket type not supported"; + break; +#endif +#ifdef EISCONN + case EISCONN: + error = "Socket is already connected"; + break; +#endif +#ifdef EOPNOTSUPP + case EOPNOTSUPP: + error = "Operation not supported on socket"; + break; +#endif +#ifdef EMSGSIZE + case EMSGSIZE: + error = "Message too long"; + break; +#endif +#ifdef ETIMEDOUT + case ETIMEDOUT: + error = "Connection timed out"; + break; +#endif + default: + if ((error = _user_strerror (errnum)) == 0) + error = ""; + break; + } + + return error; +} diff --git a/newlib/libc/string/strings.tex b/newlib/libc/string/strings.tex new file mode 100644 index 000000000..2d17d1c6f --- /dev/null +++ b/newlib/libc/string/strings.tex @@ -0,0 +1,133 @@ +@node Strings +@chapter Strings and Memory (@file{string.h}) + +This chapter describes string-handling functions and functions for +managing areas of memory. The corresponding declarations are in +@file{string.h}. + +@menu +* bcmp:: Compare two memory areas +* bcopy:: Copy memory regions +* bzero:: Initialize memory to zero +* index:: Search for character in string +* memchr:: Find character in memory +* memcmp:: Compare two memory areas +* memcpy:: Copy memory regions +* memmove:: Move possibly overlapping memory +* memset:: Set an area of memory +* rindex:: Reverse search for character in string +* strcasecmp:: Compare strings ignoring case +* strcat:: Concatenate strings +* strchr:: Search for character in string +* strcmp:: Character string compare +* strcoll:: Locale specific character string compare +* strcpy:: Copy string +* strcspn:: Count chars not in string +* strerror:: Convert error number to string +* strlen:: Character string length +* strlwr:: Convert string to lower case +* strncasecmp:: Compare strings ignoring case +* strncat:: Concatenate strings +* strncmp:: Character string compare +* strncpy:: Counted copy string +* strpbrk:: Find chars in string +* strrchr:: Reverse search for character in string +* strspn:: Find initial match +* strstr:: Find string segment +* strtok:: Get next token from a string +* strupr:: Convert string to upper case +* strxfrm:: Transform string +@end menu + +@page +@include string/bcmp.def + +@page +@include string/bcopy.def + +@page +@include string/bzero.def + +@page +@include string/index.def + +@page +@include string/memchr.def + +@page +@include string/memcmp.def + +@page +@include string/memcpy.def + +@page +@include string/memmove.def + +@page +@include string/memset.def + +@page +@include string/rindex.def + +@page +@include string/strcasecmp.def + +@page +@include string/strcat.def + +@page +@include string/strchr.def + +@page +@include string/strcmp.def + +@page +@include string/strcoll.def + +@page +@include string/strcpy.def + +@page +@include string/strcspn.def + +@page +@include string/strerror.def + +@page +@include string/strlen.def + +@page +@include string/strlwr.def + +@page +@include string/strncasecmp.def + +@page +@include string/strncat.def + +@page +@include string/strncmp.def + +@page +@include string/strncpy.def + +@page +@include string/strpbrk.def + +@page +@include string/strrchr.def + +@page +@include string/strspn.def + +@page +@include string/strstr.def + +@page +@include string/strtok.def + +@page +@include string/strupr.def + +@page +@include string/strxfrm.def diff --git a/newlib/libc/string/strlen.c b/newlib/libc/string/strlen.c new file mode 100644 index 000000000..4249e14c7 --- /dev/null +++ b/newlib/libc/string/strlen.c @@ -0,0 +1,88 @@ +/* +FUNCTION + <>---character string length + +INDEX + strlen + +ANSI_SYNOPSIS + #include + size_t strlen(const char *<[str]>); + +TRAD_SYNOPSIS + #include + size_t strlen(<[str]>) + char *<[src]>; + +DESCRIPTION + The <> function works out the length of the string + starting at <<*<[str]>>> by counting chararacters until it + reaches a <> character. + +RETURNS + <> returns the character count. + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + strlen ansi pure +*/ + +#include <_ansi.h> +#include +#include + +#define LBLOCKSIZE (sizeof (long)) +#define UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1)) + +#if LONG_MAX == 2147483647L +#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080) +#else +#if LONG_MAX == 9223372036854775807L +/* Nonzero if X (a long int) contains a NULL byte. */ +#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080) +#else +#error long int is not a 32bit or 64bit type. +#endif +#endif + +#ifndef DETECTNULL +#error long int is not a 32bit or 64bit byte +#endif + +size_t +_DEFUN (strlen, (str), + _CONST char *str) +{ +#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) + _CONST char *start = str; + + while (*str) + str++; + + return str - start; +#else + _CONST char *start = str; + unsigned long *aligned_addr; + + if (!UNALIGNED (str)) + { + /* If the string is word-aligned, we can check for the presence of + a null in each word-sized block. */ + aligned_addr = (unsigned long*)str; + while (!DETECTNULL (*aligned_addr)) + aligned_addr++; + + /* Once a null is detected, we check each byte in that block for a + precise position of the null. */ + str = (char*)aligned_addr; + } + + while (*str) + str++; + return str - start; +#endif /* not PREFER_SIZE_OVER_SPEED */ +} diff --git a/newlib/libc/string/strlwr.c b/newlib/libc/string/strlwr.c new file mode 100644 index 000000000..cf0d45f71 --- /dev/null +++ b/newlib/libc/string/strlwr.c @@ -0,0 +1,50 @@ +/* +FUNCTION + <>---force string to lower case + +INDEX + strlwr + +ANSI_SYNOPSIS + #include + char *strlwr(char *<[a]>); + +TRAD_SYNOPSIS + #include + char *strlwr(<[a]>) + char *<[a]>; + +DESCRIPTION + <> converts each characters in the string at <[a]> to + lower case. + +RETURNS + <> returns its argument, <[a]>. + +PORTABILITY +<> is not widely portable. + +<> requires no supporting OS subroutines. + +QUICKREF + strlwr +*/ + +#include +#include + +char * +strlwr (a) + char *a; +{ + char *ret = a; + + while (*a != '\0') + { + if (isupper (*a)) + *a = tolower (*a); + ++a; + } + + return ret; +} diff --git a/newlib/libc/string/strncasecmp.c b/newlib/libc/string/strncasecmp.c new file mode 100644 index 000000000..28c6cc44f --- /dev/null +++ b/newlib/libc/string/strncasecmp.c @@ -0,0 +1,64 @@ +/* +FUNCTION + <>---case insensitive character string compare + +INDEX + strncasecmp + +ANSI_SYNOPSIS + #include + int strncasecmp(const char *<[a]>, const char * <[b]>, size_t <[length]>); + +TRAD_SYNOPSIS + #include + int strncasecmp(<[a]>, <[b]>, <[length]>) + char *<[a]>; + char *<[b]>; + size_t <[length]> + +DESCRIPTION + <> compares up to <[length]> characters + from the string at <[a]> to the string at <[b]> in a + case-insensitive manner. + +RETURNS + + If <<*<[a]>>> sorts lexicographically after <<*<[b]>>> (after + both are converted to upper case), <> returns a + number greater than zero. If the two strings are equivalent, + <> returns zero. If <<*<[a]>>> sorts + lexicographically before <<*<[b]>>>, <> returns a + number less than zero. + +PORTABILITY +<> is in the Berkeley Software Distribution. + +<> requires no supporting OS subroutines. It uses +tolower() from elsewhere in this library. + +QUICKREF + strncasecmp +*/ + +#include +#include + +int +_DEFUN (strncasecmp, (s1, s2, n), + _CONST char *s1 _AND + _CONST char *s2 _AND + size_t n) +{ + if (n == 0) + return 0; + + while (n-- != 0 && tolower(*s1) == tolower(*s2)) + { + if (n == 0 || *s1 == '\0' || *s2 == '\0') + break; + s1++; + s2++; + } + + return tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2); +} diff --git a/newlib/libc/string/strncat.c b/newlib/libc/string/strncat.c new file mode 100644 index 000000000..57ca068eb --- /dev/null +++ b/newlib/libc/string/strncat.c @@ -0,0 +1,115 @@ +/* +FUNCTION + <>---concatenate strings + +INDEX + strncat + +ANSI_SYNOPSIS + #include + char *strncat(char *<[dst]>, const char *<[src]>, size_t <[length]>); + +TRAD_SYNOPSIS + #include + char *strncat(<[dst]>, <[src]>, <[length]>) + char *<[dst]>; + char *<[src]>; + size_t <[length]>; + +DESCRIPTION + <> appends not more than <[length]> characters from + the string pointed to by <[src]> (including the terminating + null character) to the end of the string pointed to by + <[dst]>. The initial character of <[src]> overwrites the null + character at the end of <[dst]>. A terminating null character + is always appended to the result + +WARNINGS + Note that a null is always appended, so that if the copy is + limited by the <[length]> argument, the number of characters + appended to <[dst]> is <>. + + +RETURNS + This function returns the initial value of <[dst]> + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + strncat ansi pure +*/ + +#include +#include + +/* Nonzero if X is aligned on a "long" boundary. */ +#define ALIGNED(X) \ + (((long)X & (sizeof (long) - 1)) == 0) + +#if LONG_MAX == 2147483647L +#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080) +#else +#if LONG_MAX == 9223372036854775807L +/* Nonzero if X (a long int) contains a NULL byte. */ +#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080) +#else +#error long int is not a 32bit or 64bit type. +#endif +#endif + +#ifndef DETECTNULL +#error long int is not a 32bit or 64bit byte +#endif + +char * +_DEFUN (strncat, (s1, s2, n), + char *s1 _AND + _CONST char *s2 _AND + size_t n) +{ +#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) + char *s = s1; + + while (*s1) + s1++; + while (n-- != 0 && (*s1++ = *s2++)) + { + if (n == 0) + *s1 = '\0'; + } + + return s; +#else + char *s = s1; + + /* Skip over the data in s1 as quickly as possible. */ + if (ALIGNED (s1)) + { + unsigned long *aligned_s1 = (unsigned long *)s1; + while (!DETECTNULL (*aligned_s1)) + aligned_s1++; + + s1 = (char *)aligned_s1; + } + + while (*s1) + s1++; + + /* s1 now points to the its trailing null character, now copy + up to N bytes from S2 into S1 stopping if a NULL is encountered + in S2. + + It is not safe to use strncpy here since it copies EXACTLY N + characters, NULL padding if necessary. */ + while (n-- != 0 && (*s1++ = *s2++)) + { + if (n == 0) + *s1 = '\0'; + } + + return s; +#endif /* not PREFER_SIZE_OVER_SPEED */ +} diff --git a/newlib/libc/string/strncmp.c b/newlib/libc/string/strncmp.c new file mode 100644 index 000000000..9801b7d92 --- /dev/null +++ b/newlib/libc/string/strncmp.c @@ -0,0 +1,122 @@ +/* +FUNCTION + <>---character string compare + +INDEX + strncmp + +ANSI_SYNOPSIS + #include + int strncmp(const char *<[a]>, const char * <[b]>, size_t <[length]>); + +TRAD_SYNOPSIS + #include + int strncmp(<[a]>, <[b]>, <[length]>) + char *<[a]>; + char *<[b]>; + size_t <[length]> + +DESCRIPTION + <> compares up to <[length]> characters + from the string at <[a]> to the string at <[b]>. + +RETURNS + If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>, + <> returns a number greater than zero. If the two + strings are equivalent, <> returns zero. If <<*<[a]>>> + sorts lexicographically before <<*<[b]>>>, <> returns a + number less than zero. + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + strncmp ansi pure +*/ + +#include +#include + +/* Nonzero if either X or Y is not aligned on a "long" boundary. */ +#define UNALIGNED(X, Y) \ + (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) + +/* DETECTNULL returns nonzero if (long)X contains a NULL byte. */ +#if LONG_MAX == 2147483647L +#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080) +#else +#if LONG_MAX == 9223372036854775807L +#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080) +#else +#error long int is not a 32bit or 64bit type. +#endif +#endif + +#ifndef DETECTNULL +#error long int is not a 32bit or 64bit byte +#endif + +int +_DEFUN (strncmp, (s1, s2, n), + _CONST char *s1 _AND + _CONST char *s2 _AND + size_t n) +{ +#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) + if (n == 0) + return 0; + + while (n-- != 0 && *s1 == *s2) + { + if (n == 0 || *s1 == '\0') + break; + s1++; + s2++; + } + + return (*(unsigned char *) s1) - (*(unsigned char *) s2); +#else + unsigned long *a1; + unsigned long *a2; + + if (n == 0) + return 0; + + /* If s1 or s2 are unaligned, then compare bytes. */ + if (!UNALIGNED (s1, s2)) + { + /* If s1 and s2 are word-aligned, compare them a word at a time. */ + a1 = (unsigned long*)s1; + a2 = (unsigned long*)s2; + while (n >= sizeof (long) && *a1 == *a2) + { + n -= sizeof (long); + + /* If we've run out of bytes or hit a null, return zero + since we already know *a1 == *a2. */ + if (n == 0 || DETECTNULL (*a1)) + return 0; + + a1++; + a2++; + } + + /* A difference was detected in last few bytes of s1, so search bytewise */ + s1 = (char*)a1; + s2 = (char*)a2; + } + + while (n-- > 0 && *s1 == *s2) + { + /* If we've run out of bytes or hit a null, return zero + since we already know *s1 == *s2. */ + if (n == 0 || *s1 == '\0') + return 0; + s1++; + s2++; + } + return (*(unsigned char *) s1) - (*(unsigned char *) s2); +#endif /* not PREFER_SIZE_OVER_SPEED */ +} diff --git a/newlib/libc/string/strncpy.c b/newlib/libc/string/strncpy.c new file mode 100644 index 000000000..7c1973ba6 --- /dev/null +++ b/newlib/libc/string/strncpy.c @@ -0,0 +1,125 @@ +/* +FUNCTION + <>---counted copy string + +INDEX + strncpy + +ANSI_SYNOPSIS + #include + char *strncpy(char *<[dst]>, const char *<[src]>, size_t <[length]>); + +TRAD_SYNOPSIS + #include + char *strncpy(<[dst]>, <[src]>, <[length]>) + char *<[dst]>; + char *<[src]>; + size_t <[length]>; + +DESCRIPTION + <> copies not more than <[length]> characters from the + the string pointed to by <[src]> (including the terminating + null character) to the array pointed to by <[dst]>. If the + string pointed to by <[src]> is shorter than <[length]> + characters, null characters are appended to the destination + array until a total of <[length]> characters have been + written. + +RETURNS + This function returns the initial value of <[dst]>. + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + strncpy ansi pure +*/ + +#include +#include + +/*SUPPRESS 560*/ +/*SUPPRESS 530*/ + +/* Nonzero if either X or Y is not aligned on a "long" boundary. */ +#define UNALIGNED(X, Y) \ + (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1))) + +#if LONG_MAX == 2147483647L +#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080) +#else +#if LONG_MAX == 9223372036854775807L +/* Nonzero if X (a long int) contains a NULL byte. */ +#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080) +#else +#error long int is not a 32bit or 64bit type. +#endif +#endif + +#ifndef DETECTNULL +#error long int is not a 32bit or 64bit byte +#endif + +#define TOO_SMALL(LEN) ((LEN) < sizeof (long)) + +char * +_DEFUN (strncpy, (dst0, src0), + char *dst0 _AND + _CONST char *src0 _AND + size_t count) +{ +#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) + char *dscan; + _CONST char *sscan; + + dscan = dst0; + sscan = src0; + while (count > 0) + { + --count; + if ((*dscan++ = *sscan++) == '\0') + break; + } + while (count-- > 0) + *dscan++ = '\0'; + + return dst0; +#else + char *dst = dst0; + _CONST char *src = src0; + long *aligned_dst; + _CONST long *aligned_src; + + /* If SRC and DEST is aligned and count large enough, then copy words. */ + if (!UNALIGNED (src, dst) && !TOO_SMALL (count)) + { + aligned_dst = (long*)dst; + aligned_src = (long*)src; + + /* SRC and DEST are both "long int" aligned, try to do "long int" + sized copies. */ + while (count >= sizeof (long int) && !DETECTNULL(*aligned_src)) + { + count -= sizeof (long int); + *aligned_dst++ = *aligned_src++; + } + + dst = (char*)aligned_dst; + src = (char*)aligned_src; + } + + while (count > 0) + { + --count; + if ((*dst++ = *src++) == '\0') + break; + } + + while (count-- > 0) + *dst++ = '\0'; + + return dst0; +#endif /* not PREFER_SIZE_OVER_SPEED */ +} diff --git a/newlib/libc/string/strpbrk.c b/newlib/libc/string/strpbrk.c new file mode 100644 index 000000000..e7f2dd2b6 --- /dev/null +++ b/newlib/libc/string/strpbrk.c @@ -0,0 +1,58 @@ +/* +FUNCTION + <>---find chars in string + +INDEX + strpbrk + +ANSI_SYNOPSIS + #include + char *strpbrk(const char *<[s1]>, const char *<[s2]>); + +TRAD_SYNOPSIS + #include + char *strpbrk(<[s1]>, <[s2]>) + char *<[s1]>; + char *<[s2]>; + +DESCRIPTION + This function locates the first occurence in the string + pointed to by <[s1]> of any character in string pointed to by + <[s2]> (excluding the terminating null character). + +RETURNS + <> returns a pointer to the character found in <[s1]>, or a + null pointer if no character from <[s2]> occurs in <[s1]>. + +PORTABILITY +<> requires no supporting OS subroutines. +*/ + +#include + +char * +_DEFUN (strpbrk, (s1, s2), + _CONST char *s1 _AND + _CONST char *s2) +{ + _CONST char *c = s2; + if (!*s1) + return (char *) NULL; + + while (*s1) + { + for (c = s2; *c; c++) + { + if (*s1 == *c) + break; + } + if (*c) + break; + s1++; + } + + if (*c == '\0') + s1 = NULL; + + return (char *) s1; +} diff --git a/newlib/libc/string/strrchr.c b/newlib/libc/string/strrchr.c new file mode 100644 index 000000000..65160f55e --- /dev/null +++ b/newlib/libc/string/strrchr.c @@ -0,0 +1,61 @@ +/* +FUNCTION + <>---reverse search for character in string + +INDEX + strrchr + +ANSI_SYNOPSIS + #include + char * strrchr(const char *<[string]>, int <[c]>); + +TRAD_SYNOPSIS + #include + char * strrchr(<[string]>, <[c]>); + char *<[string]>; + int *<[c]>; + +DESCRIPTION + This function finds the last occurence of <[c]> (converted to + a char) in the string pointed to by <[string]> (including the + terminating null character). + +RETURNS + Returns a pointer to the located character, or a null pointer + if <[c]> does not occur in <[string]>. + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + strrchr ansi pure +*/ + +#include + +char * +_DEFUN (strrchr, (s, i), + _CONST char *s _AND + int i) +{ + _CONST char *last = NULL; + char c = i; + + while (*s) + { + if (*s == c) + { + last = s; + } + s++; + } + + if (*s == c) + { + last = s; + } + + return (char *) last; +} diff --git a/newlib/libc/string/strspn.c b/newlib/libc/string/strspn.c new file mode 100644 index 000000000..32b921b10 --- /dev/null +++ b/newlib/libc/string/strspn.c @@ -0,0 +1,59 @@ +/* +FUNCTION + <>---find initial match + +INDEX + strspn + +ANSI_SYNOPSIS + #include + size_t strspn(const char *<[s1]>, const char *<[s2]>); + +TRAD_SYNOPSIS + #include + size_t strspn(<[s1]>, <[s2]>) + char *<[s1]>; + char *<[s2]>; + +DESCRIPTION + This function computes the length of the initial segment of + the string pointed to by <[s1]> which consists entirely of + characters from the string pointed to by <[s2]> (excluding the + terminating null character). + +RETURNS + <> returns the length of the segment found. + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + strspn ansi pure +*/ + +#include + +size_t +_DEFUN (strspn, (s1, s2), + _CONST char *s1 _AND + _CONST char *s2) +{ + _CONST char *s = s1; + _CONST char *c; + + while (*s1) + { + for (c = s2; *c; c++) + { + if (*s1 == *c) + break; + } + if (*c == '\0') + break; + s1++; + } + + return s1 - s; +} diff --git a/newlib/libc/string/strstr.c b/newlib/libc/string/strstr.c new file mode 100644 index 000000000..dddced3b2 --- /dev/null +++ b/newlib/libc/string/strstr.c @@ -0,0 +1,73 @@ +/* +FUNCTION + <>---find string segment + +INDEX + strstr + +ANSI_SYNOPSIS + #include + char *strstr(const char *<[s1]>, const char *<[s2]>); + +TRAD_SYNOPSIS + #include + char *strstr(<[s1]>, <[s2]>) + char *<[s1]>; + char *<[s2]>; + +DESCRIPTION + Locates the first occurence in the string pointed to by <[s1]> of + the sequence of characters in the string pointed to by <[s2]> + (excluding the terminating null character). + +RETURNS + Returns a pointer to the located string segment, or a null + pointer if the string <[s2]> is not found. If <[s2]> points to + a string with zero length, the <[s1]> is returned. + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + strstr ansi pure +*/ + +#include + +char * +_DEFUN (strstr, (searchee, lookfor), + _CONST char *searchee _AND + _CONST char *lookfor) +{ + if (*searchee == 0) + { + if (*lookfor) + return (char *) NULL; + return (char *) searchee; + } + + while (*searchee) + { + size_t i; + i = 0; + + while (1) + { + if (lookfor[i] == 0) + { + return (char *) searchee; + } + + if (lookfor[i] != searchee[i]) + { + break; + } + i++; + } + searchee++; + } + + return (char *) NULL; +} diff --git a/newlib/libc/string/strtok.c b/newlib/libc/string/strtok.c new file mode 100644 index 000000000..bc11f0df7 --- /dev/null +++ b/newlib/libc/string/strtok.c @@ -0,0 +1,76 @@ +/* +FUNCTION + <>---get next token from a string + +INDEX + strtok + +INDEX + strtok_r + +ANSI_SYNOPSIS + #include + char *strtok(char *<[source]>, const char *<[delimiters]>) + char *strtok_r(char *<[source]>, const char *<[delimiters]>, + char **<[lasts]>) + +TRAD_SYNOPSIS + #include + char *strtok(<[source]>, <[delimiters]>) + char *<[source]>; + char *<[delimiters]>; + + char *strtok_r(<[source]>, <[delimiters]>, <[lasts]>) + char *<[source]>; + char *<[delimiters]>; + char **<[lasts]>; + +DESCRIPTION + The <> function is used to isolate sequential tokens in a + null-terminated string, <<*<[source]>>>. These tokens are delimited + in the string by at least one of the characters in <<*<[delimiters]>>>. + The first time that <> is called, <<*<[source]>>> should be + specified; subsequent calls, wishing to obtain further tokens from + the same string, should pass a null pointer instead. The separator + string, <<*<[delimiters]>>>, must be supplied each time, and may + change between calls. + + The <> function returns a pointer to the beginning of each + subsequent token in the string, after replacing the separator + character itself with a NUL character. When no more tokens remain, + a null pointer is returned. + + The <> function has the same behavior as <>, except + a pointer to placeholder <<*[lasts]>> must be supplied by the caller. + +RETURNS + <> returns a pointer to the next token, or <> if + no more tokens can be found. + +NOTES + <> is unsafe for multi-thread applications. <> + is MT-Safe and should be used instead. + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + strtok ansi impure +*/ + +#include +#include <_ansi.h> +#include + +#ifndef _REENT_ONLY + +char * +_DEFUN (strtok, (s, delim), + register char *s _AND + register const char *delim) +{ + return strtok_r (s, delim, &(_REENT->_new._reent._strtok_last)); +} +#endif diff --git a/newlib/libc/string/strtok_r.c b/newlib/libc/string/strtok_r.c new file mode 100644 index 000000000..ed323369e --- /dev/null +++ b/newlib/libc/string/strtok_r.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +char * +_DEFUN (strtok_r, (s, delim, lasts), + register char *s _AND + register const char *delim _AND + char **lasts) +{ + register char *spanp; + register int c, sc; + char *tok; + + + if (s == NULL && (s = *lasts) == NULL) + return (NULL); + + /* + * Skip (span) leading delimiters (s += strspn(s, delim), sort of). + */ +cont: + c = *s++; + for (spanp = (char *)delim; (sc = *spanp++) != 0;) { + if (c == sc) + goto cont; + } + + if (c == 0) { /* no non-delimiter characters */ + *lasts = NULL; + return (NULL); + } + tok = s - 1; + + /* + * Scan token (scan for delimiters: s += strcspn(s, delim), sort of). + * Note that delim must have one NUL; we stop if we see that, too. + */ + for (;;) { + c = *s++; + spanp = (char *)delim; + do { + if ((sc = *spanp++) == c) { + if (c == 0) + s = NULL; + else + s[-1] = 0; + *lasts = s; + return (tok); + } + } while (sc != 0); + } + /* NOTREACHED */ +} diff --git a/newlib/libc/string/strupr.c b/newlib/libc/string/strupr.c new file mode 100644 index 000000000..d7f7c129d --- /dev/null +++ b/newlib/libc/string/strupr.c @@ -0,0 +1,49 @@ +/* +FUNCTION + <>---force string to uppercase + +INDEX + strupr + +ANSI_SYNOPSIS + #include + char *strupr(char *<[a]>); + +TRAD_SYNOPSIS + #include + char *strupr(<[a]>) + char *<[a]>; + +DESCRIPTION + <> converts each characters in the string at <[a]> to + upper case. + +RETURNS + <> returns its argument, <[a]>. + +PORTABILITY +<> is not widely portable. + +<> requires no supporting OS subroutines. + +QUICKREF + strupr */ + +#include +#include + +char * +strupr (a) + char *a; +{ + char *ret = a; + + while (*a != '\0') + { + if (islower (*a)) + *a = toupper (*a); + ++a; + } + + return ret; +} diff --git a/newlib/libc/string/strxfrm.c b/newlib/libc/string/strxfrm.c new file mode 100644 index 000000000..65ed4f1b1 --- /dev/null +++ b/newlib/libc/string/strxfrm.c @@ -0,0 +1,75 @@ +/* +FUNCTION + <>---transform string + +INDEX + strxfrm + +ANSI_SYNOPSIS + #include + size_t strxfrm(char *<[s1]>, const char *<[s2]>, size_t <[n]>); + +TRAD_SYNOPSIS + #include + size_t strxfrm(<[s1]>, <[s2]>, <[n]>); + char *<[s1]>; + char *<[s2]>; + size_t <[n]>; + +DESCRIPTION + This function transforms the string pointed to by <[s2]> and + places the resulting string into the array pointed to by + <[s1]>. The transformation is such that if the <> + function is applied to the two transformed strings, it returns + a value greater than, equal to, or less than zero, + correspoinding to the result of a <> function applied + to the same two original strings. + + No more than <[n]> characters are placed into the resulting + array pointed to by <[s1]>, including the terminating null + character. If <[n]> is zero, <[s1]> may be a null pointer. If + copying takes place between objects that overlap, the behavior + is undefined. + + With a C locale, this function just copies. + +RETURNS + The <> function returns the length of the transformed string + (not including the terminating null character). If the value returned + is <[n]> or more, the contents of the array pointed to by + <[s1]> are indeterminate. + +PORTABILITY +<> is ANSI C. + +<> requires no supporting OS subroutines. + +QUICKREF + strxfrm ansi pure +*/ + +#include + +size_t +_DEFUN (strxfrm, (s1, s2, n), + char *s1 _AND + _CONST char *s2 _AND + size_t n) +{ + size_t res; + res = 0; + while (n-- > 0) + { + if ((*s1++ = *s2++) != '\0') + ++res; + else + return res; + } + while (*s2) + { + ++s2; + ++res; + } + + return res; +} diff --git a/newlib/libc/string/u_strerr.c b/newlib/libc/string/u_strerr.c new file mode 100644 index 000000000..fa4605c8b --- /dev/null +++ b/newlib/libc/string/u_strerr.c @@ -0,0 +1,8 @@ +#include <_ansi.h> + +char * +_DEFUN(_user_strerror, (errnum), + int errnum) +{ + return 0; +} diff --git a/newlib/libc/sys.tex b/newlib/libc/sys.tex new file mode 100644 index 000000000..44b608b9c --- /dev/null +++ b/newlib/libc/sys.tex @@ -0,0 +1,436 @@ +@c -*- Texinfo -*- +@node Syscalls +@chapter System Calls + +@cindex linking the C library +The C subroutine library depends on a handful of subroutine calls for +operating system services. If you use the C library on a system that +complies with the POSIX.1 standard (also known as IEEE 1003.1), most of +these subroutines are supplied with your operating system. + +If some of these subroutines are not provided with your system---in +the extreme case, if you are developing software for a ``bare board'' +system, without an OS---you will at least need to provide do-nothing +stubs (or subroutines with minimal functionality) to allow your +programs to link with the subroutines in @code{libc.a}. + +@menu +* Stubs:: Definitions for OS interface +* Reentrant Syscalls:: Reentrant covers for OS subroutines +@end menu + +@node Stubs +@section Definitions for OS interface +@cindex stubs + +@cindex subroutines for OS interface +@cindex OS interface subroutines +This is the complete set of system definitions (primarily subroutines) +required; the examples shown implement the minimal functionality +required to allow @code{libc} to link, and fail gracefully where OS +services are not available. + +Graceful failure is permitted by returning an error code. A minor +complication arises here: the C library must be compatible with +development environments that supply fully functional versions of these +subroutines. Such environments usually return error codes in a global +@code{errno}. However, the Cygnus C library provides a @emph{macro} +definition for @code{errno} in the header file @file{errno.h}, as part +of its support for reentrant routines (@pxref{Reentrancy,,Reentrancy}). + +@cindex @code{errno} global vs macro +The bridge between these two interpretations of @code{errno} is +straightforward: the C library routines with OS interface calls +capture the @code{errno} values returned globally, and record them in +the appropriate field of the reentrancy structure (so that you can query +them using the @code{errno} macro from @file{errno.h}). + +This mechanism becomes visible when you write stub routines for OS +interfaces. You must include @file{errno.h}, then disable the macro, +like this: + +@example +#include +#undef errno +extern int errno; +@end example + +@noindent +The examples in this chapter include this treatment of @code{errno}. + +@ftable @code +@item _exit +Exit a program without cleaning up files. If your system doesn't +provide this, it is best to avoid linking with subroutines that require +it (@code{exit}, @code{system}). + +@item close +Close a file. Minimal implementation: + +@example +int close(int file)@{ + return -1; +@} +@end example + +@item environ +A pointer to a list of environment variables and their values. For a +minimal environment, this empty list is adequate: + +@example +char *__env[1] = @{ 0 @}; +char **environ = __env; +@end example + +@item execve +Transfer control to a new process. Minimal implementation (for a system +without processes): + +@example +#include +#undef errno +extern int errno; +int execve(char *name, char **argv, char **env)@{ + errno=ENOMEM; + return -1; +@} +@end example + +@item fork +Create a new process. Minimal implementation (for a system without processes): + +@example +#include +#undef errno +extern int errno; +int fork() @{ + errno=EAGAIN; + return -1; +@} +@end example + +@item fstat +Status of an open file. For consistency with other minimal +implementations in these examples, all files are regarded as character +special devices. The @file{sys/stat.h} header file required is +distributed in the @file{include} subdirectory for this C library. + +@example +#include +int fstat(int file, struct stat *st) @{ + st->st_mode = S_IFCHR; + return 0; +@} +@end example + +@item getpid +Process-ID; this is sometimes used to generate strings unlikely to +conflict with other processes. Minimal implementation, for a system +without processes: + +@example +int getpid() @{ + return 1; +@} +@end example + +@item isatty +Query whether output stream is a terminal. For consistency with the +other minimal implementations, which only support output to +@code{stdout}, this minimal implementation is suggested: + +@example +int isatty(int file)@{ + return 1; +@} +@end example + +@item kill +Send a signal. Minimal implementation: + +@example +#include +#undef errno +extern int errno; +int kill(int pid, int sig)@{ + errno=EINVAL; + return(-1); +@} +@end example + +@item link +Establish a new name for an existing file. Minimal implementation: + +@example +#include +#undef errno +extern int errno; +int link(char *old, char *new)@{ + errno=EMLINK; + return -1; +@} +@end example + +@item lseek +Set position in a file. Minimal implementation: + +@example +int lseek(int file, int ptr, int dir)@{ + return 0; +@} +@end example + +@c FIXME! Why no stub for open? + +@item read +Read from a file. Minimal implementation: + +@example +int read(int file, char *ptr, int len)@{ + return 0; +@} +@end example + +@item sbrk +Increase program data space. As @code{malloc} and related functions +depend on this, it is useful to have a working implementation. The +following suffices for a standalone system; it exploits the symbol +@code{end} automatically defined by the GNU linker. + +@example +@group +caddr_t sbrk(int incr)@{ + extern char end; /* @r{Defined by the linker} */ + static char *heap_end; + char *prev_heap_end; + + if (heap_end == 0) @{ + heap_end = &end; + @} + prev_heap_end = heap_end; + if (heap_end + incr > stack_ptr) + @{ + _write (1, "Heap and stack collision\n", 25); + abort (); + @} + + heap_end += incr; + return (caddr_t) prev_heap_end; +@} +@end group +@end example + +@item stat +Status of a file (by name). Minimal implementation: + +@example +int stat(char *file, struct stat *st) @{ + st->st_mode = S_IFCHR; + return 0; +@} +@end example + +@item times +Timing information for current process. Minimal implementation: + +@example +int times(struct tms *buf)@{ + return -1; +@} +@end example + +@item unlink +Remove a file's directory entry. Minimal implementation: + +@example +#include +#undef errno +extern int errno; +int unlink(char *name)@{ + errno=ENOENT; + return -1; +@} +@end example + +@item wait +Wait for a child process. Minimal implementation: +@example +#include +#undef errno +extern int errno; +int wait(int *status) @{ + errno=ECHILD; + return -1; +@} +@end example + +@item write +Write a character to a file. @file{libc} subroutines will use this +system routine for output to all files, @emph{including} +@code{stdout}---so if you need to generate any output, for example to a +serial port for debugging, you should make your minimal @code{write} +capable of doing this. The following minimal implementation is an +incomplete example; it relies on a @code{writechar} subroutine (not +shown; typically, you must write this in assembler from examples +provided by your hardware manufacturer) to actually perform the output. + +@example +@group +int write(int file, char *ptr, int len)@{ + int todo; + + for (todo = 0; todo < len; todo++) @{ + writechar(*ptr++); + @} + return len; +@} +@end group +@end example + +@end ftable + +@page +@node Reentrant Syscalls +@section Reentrant covers for OS subroutines + +Since the system subroutines are used by other library routines that +require reentrancy, @file{libc.a} provides cover routines (for example, +the reentrant version of @code{fork} is @code{_fork_r}). These cover +routines are consistent with the other reentrant subroutines in this +library, and achieve reentrancy by using a reserved global data block +(@pxref{Reentrancy,,Reentrancy}). + +@c FIXME!!! The following ignored text specifies how this section ought +@c to work; however, both standalone info and Emacs info mode fail when +@c confronted with nodes beginning `_' as of 24may93. Restore when Info +@c readers fixed! +@ignore +@menu +* _open_r:: Reentrant version of open +* _close_r:: Reentrant version of close +* _lseek_r:: Reentrant version of lseek +* _read_r:: Reentrant version of read +* _write_r:: Reentrant version of write +* _link_r:: Reentrant version of link +* _unlink_r:: Reentrant version of unlink +* _stat_r:: Reentrant version of stat +* _fstat_r:: Reentrant version of fstat +* _sbrk_r:: Reentrant version of sbrk +* _fork_r:: Reentrant version of fork +* _wait_r:: Reentrant version of wait +@end menu + +@down +@include reent/filer.def +@include reent/execr.def +@include reent/statr.def +@include reent/fstatr.def +@include reent/linkr.def +@include reent/sbrkr.def +@up +@end ignore + +@ftable @code +@item _open_r +A reentrant version of @code{open}. It takes a pointer +to the global data block, which holds @code{errno}. + +@example +int _open_r(void *@var{reent}, + const char *@var{file}, int @var{flags}, int @var{mode}); +@end example + +@item _close_r +A reentrant version of @code{close}. It takes a pointer to the global +data block, which holds @code{errno}. + +@example +int _close_r(void *@var{reent}, int @var{fd}); +@end example + +@item _lseek_r +A reentrant version of @code{lseek}. It takes a pointer to the global +data block, which holds @code{errno}. + +@example +off_t _lseek_r(void *@var{reent}, + int @var{fd}, off_t @var{pos}, int @var{whence}); +@end example + +@item _read_r +A reentrant version of @code{read}. It takes a pointer to the global +data block, which holds @code{errno}. + +@example +long _read_r(void *@var{reent}, + int @var{fd}, void *@var{buf}, size_t @var{cnt}); +@end example + +@item _write_r +A reentrant version of @code{write}. It takes a pointer to the global +data block, which holds @code{errno}. + +@example +long _write_r(void *@var{reent}, + int @var{fd}, const void *@var{buf}, size_t @var{cnt}); +@end example + +@item _fork_r +A reentrant version of @code{fork}. It takes a pointer to the global +data block, which holds @code{errno}. + +@example +int _fork_r(void *@var{reent}); +@end example + +@item _wait_r +A reentrant version of @code{wait}. It takes a pointer to the global +data block, which holds @code{errno}. + +@example +int _wait_r(void *@var{reent}, int *@var{status}); +@end example + +@item _stat_r +A reentrant version of @code{stat}. It takes a pointer to the global +data block, which holds @code{errno}. + +@example +int _stat_r(void *@var{reent}, + const char *@var{file}, struct stat *@var{pstat}); +@end example + +@item _fstat_r +A reentrant version of @code{fstat}. It takes a pointer to the global +data block, which holds @code{errno}. + +@example +int _fstat_r(void *@var{reent}, + int @var{fd}, struct stat *@var{pstat}); +@end example + +@item _link_r +A reentrant version of @code{link}. It takes a pointer to the global +data block, which holds @code{errno}. + +@example +int _link_r(void *@var{reent}, + const char *@var{old}, const char *@var{new}); +@end example + +@item _unlink_r +A reentrant version of @code{unlink}. It takes a pointer to the global +data block, which holds @code{errno}. + +@example +int _unlink_r(void *@var{reent}, const char *@var{file}); +@end example + +@item _sbrk_r +A reentrant version of @code{sbrk}. It takes a pointer to the global +data block, which holds @code{errno}. + +@example +char *_sbrk_r(void *@var{reent}, size_t @var{incr}); +@end example +@end ftable diff --git a/newlib/libc/sys/Makefile.am b/newlib/libc/sys/Makefile.am new file mode 100644 index 000000000..a3c57d101 --- /dev/null +++ b/newlib/libc/sys/Makefile.am @@ -0,0 +1,33 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +SUBDIRS = $(sys_dir) . + +if HAVE_SYS_DIR +SYSLIB = lib.a +endif + +noinst_LIBRARIES = $(SYSLIB) +noinst_DATA = $(CRT0) + +lib.a: $(sys_dir)/lib.a + rm -f $@ + ln $(sys_dir)/lib.a $@ >/dev/null 2>/dev/null \ + || cp $(sys_dir)/lib.a $@ + +$(sys_dir)/lib.a: ; @true + +crt0.o: $(sys_dir)/crt0.o + rm -f $@ + ln $(sys_dir)/crt0.o $@ >/dev/null 2>/dev/null \ + || cp $(sys_dir)/crt0.o $@ + +$(sys_dir)/crt0.o: ; @true + +CLEANFILES = crt0.o + +doc: + +ACLOCAL_AMFLAGS = -I ../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/sys/Makefile.in b/newlib/libc/sys/Makefile.in new file mode 100644 index 000000000..122b208b1 --- /dev/null +++ b/newlib/libc/sys/Makefile.in @@ -0,0 +1,415 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +CRT0 = @CRT0@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +SUBDIRS = $(sys_dir) . + +@HAVE_SYS_DIR_TRUE@SYSLIB = \ +@HAVE_SYS_DIR_TRUE@lib.a + +noinst_LIBRARIES = $(SYSLIB) +noinst_DATA = $(CRT0) + +CLEANFILES = crt0.o + +ACLOCAL_AMFLAGS = -I ../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_SOURCES = lib.a.c +lib_a_OBJECTS = lib.a.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DATA = $(noinst_DATA) + +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = lib.a.c +OBJECTS = lib.a.o + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in ../../acinclude.m4 \ + ../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive install-info-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +install-info-am: +install-info: install-info-recursive +install-exec-am: +install-exec: install-exec-recursive + +install-data-am: +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: +uninstall: uninstall-recursive +all-am: Makefile $(LIBRARIES) $(DATA) +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-recursive + -rm -f config.status + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile install-data-recursive \ +uninstall-data-recursive install-exec-recursive \ +uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ +all-recursive check-recursive installcheck-recursive info-recursive \ +dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-info-am \ +install-info install-exec-am install-exec install-data-am install-data \ +install-am install uninstall-am uninstall all-redirect all-am all \ +installdirs-am installdirs mostlyclean-generic distclean-generic \ +clean-generic maintainer-clean-generic clean mostlyclean distclean \ +maintainer-clean + + +lib.a: $(sys_dir)/lib.a + rm -f $@ + ln $(sys_dir)/lib.a $@ >/dev/null 2>/dev/null \ + || cp $(sys_dir)/lib.a $@ + +$(sys_dir)/lib.a: ; @true + +crt0.o: $(sys_dir)/crt0.o + rm -f $@ + ln $(sys_dir)/crt0.o $@ >/dev/null 2>/dev/null \ + || cp $(sys_dir)/crt0.o $@ + +$(sys_dir)/crt0.o: ; @true + +doc: + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/sys/a29khif/Makefile.am b/newlib/libc/sys/a29khif/Makefile.am new file mode 100644 index 000000000..48f389695 --- /dev/null +++ b/newlib/libc/sys/a29khif/Makefile.am @@ -0,0 +1,48 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + _alloc.s \ + _close.s \ + _cycles.s \ + _exit.s \ + _getpsiz.s \ + _gettz.s \ + _ioctl.s \ + _iostat.s \ + _iowait.s \ + _lseek.s \ + _open.s \ + _query.s \ + _read.s \ + _setim.s \ + _settrap.s \ + _setvec.s \ + _tmpnam.s \ + _write.s \ + alloc.s \ + clock.s \ + getargs.s \ + getenv.s \ + read.s \ + remove.s \ + rename.s \ + signal.s \ + _sbrk.s \ + _fstat.s \ + _isatty.s \ + systime.s \ + vec.s \ + kill.c \ + getpid.c \ + stubs.s + +all: crt0.o + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/sys/a29khif/Makefile.in b/newlib/libc/sys/a29khif/Makefile.in new file mode 100644 index 000000000..027a83098 --- /dev/null +++ b/newlib/libc/sys/a29khif/Makefile.in @@ -0,0 +1,337 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + _alloc.s \ + _close.s \ + _cycles.s \ + _exit.s \ + _getpsiz.s \ + _gettz.s \ + _ioctl.s \ + _iostat.s \ + _iowait.s \ + _lseek.s \ + _open.s \ + _query.s \ + _read.s \ + _setim.s \ + _settrap.s \ + _setvec.s \ + _tmpnam.s \ + _write.s \ + alloc.s \ + clock.s \ + getargs.s \ + getenv.s \ + read.s \ + remove.s \ + rename.s \ + signal.s \ + _sbrk.s \ + _fstat.s \ + _isatty.s \ + systime.s \ + vec.s \ + kill.c \ + getpid.c \ + stubs.s + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = _alloc.o _close.o _cycles.o _exit.o _getpsiz.o _gettz.o \ +_ioctl.o _iostat.o _iowait.o _lseek.o _open.o _query.o _read.o _setim.o \ +_settrap.o _setvec.o _tmpnam.o _write.o alloc.o clock.o getargs.o \ +getenv.o read.o remove.o rename.o signal.o _sbrk.o _fstat.o _isatty.o \ +systime.o vec.o kill.o getpid.o stubs.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all: crt0.o + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/sys/a29khif/_alloc.s b/newlib/libc/sys/a29khif/_alloc.s new file mode 100644 index 000000000..ecdd1ddb1 --- /dev/null +++ b/newlib/libc/sys/a29khif/_alloc.s @@ -0,0 +1,55 @@ +; @(#)_alloc.s 1.4 90/10/14 21:57:19, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1989, 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; 07/06/89 (JS) Replaced call to const tav,HIF_macro @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 to syscall macro, +; and deleted call to reterr macro as a NULL needs to be +; returned on failure. +; _alloc.s +; void *vp = _sysalloc( int size ); +; + .file "_alloc.s" + .include "sys/sysmac.h" + .text + .word 0x00030000 ; Debugger tag word + .global __sysalloc +__sysalloc: + const tav,HIF_alloc @ asneq V_SYSCALL,gr1,gr1 + jmpti tav, lr0 + const tpc, _errno + consth tpc, _errno + store 0, 0, tav, tpc + jmpi lr0 + const v0, 0 ; return NULL on error. + +; +; int errret = _sysfree( void *addr, int size ); +; + .global __sysfree +__sysfree: + const tav,HIF_free @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/_close.s b/newlib/libc/sys/a29khif/_close.s new file mode 100644 index 000000000..04f52ae00 --- /dev/null +++ b/newlib/libc/sys/a29khif/_close.s @@ -0,0 +1,40 @@ +; @(#)_close.s 1.4 90/10/14 21:57:20, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc.; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _close.s +; int cc = _close( int fd ); +; + .file "_close.s" + .include "sys/sysmac.h" + .text + .word 0x00030000 ; Debugger tag word + .global __close +;; syscalls used now -- .global _close + +__close: +;; syscalls used now -- _close: + const tav,HIF_close @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/_cycles.s b/newlib/libc/sys/a29khif/_cycles.s new file mode 100644 index 000000000..94f9df3b4 --- /dev/null +++ b/newlib/libc/sys/a29khif/_cycles.s @@ -0,0 +1,39 @@ +; @(#)_cycles.s 1.2 90/10/14 21:57:21, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _cycles.s +; struct { unsigned long low_ticks, long hi_ticks } = _cycles( ); +; + .file "_cycles.s" + .include "sys/sysmac.h" + .text + .word 0x00020000 ; Debugger tag word + .global __cycles + +__cycles: + const tav,HIF_cycles @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/_exit.s b/newlib/libc/sys/a29khif/_exit.s new file mode 100644 index 000000000..65b9b83e3 --- /dev/null +++ b/newlib/libc/sys/a29khif/_exit.s @@ -0,0 +1,39 @@ +; @(#)_exit.s 1.2 90/10/14 21:57:22, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _exit.s +; _exit( int rc ); +; + .file "_exit.s" + .include "sys/sysmac.h" + .text + .word 0x00030000 ; Debugger tag word + .global __exit + +__exit: + const tav,HIF_exit @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/_fstat.s b/newlib/libc/sys/a29khif/_fstat.s new file mode 100644 index 000000000..0144d76d9 --- /dev/null +++ b/newlib/libc/sys/a29khif/_fstat.s @@ -0,0 +1,79 @@ + .file "_fstat.c" + .sect .lit,lit +gcc2_compiled.: + .text + .align 4 + .global __fstat +;; syscalls used now -- .global _fstat + .word 0x40000 +__fstat: +;; syscalls used now -- _fstat: + sub gr1,gr1,32 + asgeu V_SPILL,gr1,gr126 + add lr1,gr1,48 + sll lr5,lr10,0 + const gr116,__iostat + consth gr116,__iostat + calli lr0,gr116 + sll lr2,lr5,0 + sll lr10,gr96,0 + jmpt lr10,L8 + sll gr116,lr10,30 + jmpf gr116,L3 + add gr116,lr11,12 + add gr117,lr11,12 + const gr116,4096 + store 0,0,gr116,gr117 + add gr117,lr11,4 + const gr116,1 + jmp L4 + store 0,0,gr116,gr117 +L3: + const gr117,8192 + store 0,0,gr117,gr116 + add gr116,lr11,4 + store 0,0,gr117,gr116 +L4: + add gr117,lr11,20 + const gr116,0 + store 0,0,gr116,gr117 + store 0,0,gr116,lr11 + const gr116,_time + consth gr116,_time + calli lr0,gr116 + const lr2,0 + add gr116,lr11,16 + store 0,0,gr96,gr116 + sll lr2,lr5,0 + const lr3,0 + const lr7,__lseek + consth lr7,__lseek + calli lr0,lr7 + const lr4,1 + sll lr10,gr96,0 + constn lr6,65535 + cpneq gr116,lr10,lr6 + jmpf gr116,L7 + sll lr2,lr5,0 + const lr3,0 + calli lr0,lr7 + const lr4,2 + add gr116,lr11,8 + store 0,0,gr96,gr116 + cpneq gr96,gr96,lr6 + jmpf gr96,L7 + sll lr2,lr5,0 + sll lr3,lr10,0 + calli lr0,lr7 + const lr4,0 + cpneq gr96,gr96,lr6 + jmpt gr96,L8 + const gr96,0 +L7: + constn gr96,65535 +L8: + add gr1,gr1,32 + nop + jmpi lr0 + asleu V_FILL,lr1,gr127 + diff --git a/newlib/libc/sys/a29khif/_getpsiz.s b/newlib/libc/sys/a29khif/_getpsiz.s new file mode 100644 index 000000000..b9949a003 --- /dev/null +++ b/newlib/libc/sys/a29khif/_getpsiz.s @@ -0,0 +1,38 @@ +; @(#)_getpsiz.s 1.2 90/10/14 21:57:23, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _getpsiz.s +; int size = _getpsiz( ); +; + .file "_getpsiz.s" + .include "sys/sysmac.h" + .text + .word 0x00020000 ; Debugger tag word + .global __getpsiz + +__getpsiz: + const tav,HIF_getpagesize @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + .end diff --git a/newlib/libc/sys/a29khif/_gettz.s b/newlib/libc/sys/a29khif/_gettz.s new file mode 100644 index 000000000..36cf1c702 --- /dev/null +++ b/newlib/libc/sys/a29khif/_gettz.s @@ -0,0 +1,39 @@ +; @(#)_gettz.s 2.2 90/10/14 21:57:24, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _gettz.s +; _gettz( void ); +; + .file "_gettz.s" + .include "sys/sysmac.h" + .text + .word 0x00020000 ; Debugger tag word + .global __gettz + +__gettz: + const tav,HIF_gettz @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/_ioctl.s b/newlib/libc/sys/a29khif/_ioctl.s new file mode 100644 index 000000000..0ca51c504 --- /dev/null +++ b/newlib/libc/sys/a29khif/_ioctl.s @@ -0,0 +1,39 @@ +; @(#)_ioctl.s 1.2 90/10/14 21:57:25, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _ioctl.s +; _ioctl( int fd ); +; + .file "_ioctl.s" + .include "sys/sysmac.h" + .text + .word 0x00030000 ; Debugger tag word + .global __ioctl + +__ioctl: + const tav,HIF_ioctl @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/_iostat.s b/newlib/libc/sys/a29khif/_iostat.s new file mode 100644 index 000000000..ae97c5de5 --- /dev/null +++ b/newlib/libc/sys/a29khif/_iostat.s @@ -0,0 +1,43 @@ +;---------------------------------------------------------------------------- +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _iostat.s +; _iostat( int fd ); +; + .file "_iostat.s" + .include "sys/sysmac.h" + .text + .word 0x00030000 ; Debugger tag word + .global __iostat + .global _iostat + +__iostat: +_iostat: + const tav,HIF_iostat @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end + diff --git a/newlib/libc/sys/a29khif/_iowait.s b/newlib/libc/sys/a29khif/_iowait.s new file mode 100644 index 000000000..3e2ad61cd --- /dev/null +++ b/newlib/libc/sys/a29khif/_iowait.s @@ -0,0 +1,39 @@ +; @(#)_iowait.s 1.3 90/10/14 21:57:27, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _iowait.s +; _iowait( int fd ); +; + .file "_iowait.s" + .include "sys/sysmac.h" + .text + .word 0x00030000 ; Debugger tag word + .global __iowait + +__iowait: + const tav,HIF_iowait @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/_isatty.s b/newlib/libc/sys/a29khif/_isatty.s new file mode 100644 index 000000000..55110e2fc --- /dev/null +++ b/newlib/libc/sys/a29khif/_isatty.s @@ -0,0 +1,22 @@ + .file "isatty.c" + .sect .lit,lit +gcc2_compiled.: + .text + .align 4 + .global __isatty + .global _isatty + .word 0x30000 +__isatty: +_isatty: + sub gr1,gr1,16 + asgeu V_SPILL,gr1,gr126 + add lr1,gr1,28 + const gr116,__iostat + consth gr116,__iostat + calli lr0,gr116 + sll lr2,lr6,0 + sll gr96,gr96,30 + add gr1,gr1,16 + srl gr96,gr96,31 + jmpi lr0 + asleu V_FILL,lr1,gr127 diff --git a/newlib/libc/sys/a29khif/_lseek.s b/newlib/libc/sys/a29khif/_lseek.s new file mode 100644 index 000000000..56a7fc6c9 --- /dev/null +++ b/newlib/libc/sys/a29khif/_lseek.s @@ -0,0 +1,42 @@ +; @(#)_lseek.s 1.4 90/10/14 21:57:28, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _lseek.s +; int cc = _lseek( int fd, long offset, int whence ); +; + .file "_lseek.s" + .include "sys/sysmac.h" + .text + .word 0x00050000 ; Debugger tag word + .global __lseek +;; syscalls used now -- .global _lseek + + +__lseek: +;; syscalls used now -- _lseek: + const tav,HIF_lseek @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/_open.s b/newlib/libc/sys/a29khif/_open.s new file mode 100644 index 000000000..3a9ed7e61 --- /dev/null +++ b/newlib/libc/sys/a29khif/_open.s @@ -0,0 +1,39 @@ +; @(#)_open.s 1.4 90/10/14 21:57:30, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _open.s +; int fd = _open( char *path, int oflag [, int mode ] ); +; + .file "_open.s" + .include "sys/sysmac.h" + .text + .word 0x00050000 ; Debugger tag word + .global __open + +__open: + const tav,HIF_open @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/_query.s b/newlib/libc/sys/a29khif/_query.s new file mode 100644 index 000000000..6887bea93 --- /dev/null +++ b/newlib/libc/sys/a29khif/_query.s @@ -0,0 +1,39 @@ +; @(#)_query.s 2.2 90/10/14 21:57:31, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _query.s +; _query( query_code ); +; + .file "_query.s" + .include "sys/sysmac.h" + .text + .word 0x00030000 ; Debugger tag word + .global __query + +__query: + const tav,HIF_query @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/_read.s b/newlib/libc/sys/a29khif/_read.s new file mode 100644 index 000000000..23ebbe732 --- /dev/null +++ b/newlib/libc/sys/a29khif/_read.s @@ -0,0 +1,38 @@ +; @(#)_read.s 1.4 90/10/14 21:57:32, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _read.s +; int nread = _read( int fd, char *buf, int count ); +; + .file "_read.s" + .include "sys/sysmac.h" + .text + .word 0x00050000 ; Debugger tag word + .global __read + +__read: + const tav,HIF_read @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + .end diff --git a/newlib/libc/sys/a29khif/_sbrk.s b/newlib/libc/sys/a29khif/_sbrk.s new file mode 100644 index 000000000..33c1269cd --- /dev/null +++ b/newlib/libc/sys/a29khif/_sbrk.s @@ -0,0 +1,30 @@ + .file "sbrk.c" + .sect .lit,lit +gcc2_compiled.: + .text + .align 4 + .global __sbrk + .word 0x30000 +__sbrk: + sub gr1,gr1,16 + asgeu V_SPILL,gr1,gr126 + add lr1,gr1,28 + sll lr2,lr6,0 + jmpt lr2,L4 + constn gr96,65535 + const gr116,__sysalloc + consth gr116,__sysalloc + calli lr0,gr116 + nop + sll gr117,gr96,0 + cpneq gr116,gr117,0 + jmpf gr116,L4 + constn gr96,65535 + sll gr96,gr117,0 +L4: + add gr1,gr1,16 + nop + jmpi lr0 + asleu V_FILL,lr1,gr127 + + diff --git a/newlib/libc/sys/a29khif/_setim.s b/newlib/libc/sys/a29khif/_setim.s new file mode 100644 index 000000000..0cf86aeda --- /dev/null +++ b/newlib/libc/sys/a29khif/_setim.s @@ -0,0 +1,39 @@ +; @(#)_setim.s 2.2 90/10/14 21:57:33, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _setim.s +; _setim( im, di ); +; + .file "_setim.s" + .include "sys/sysmac.h" + .text + .word 0x00040000 ; Debugger tag word + .global __setim + +__setim: + const tav,HIF_setim @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/_settrap.s b/newlib/libc/sys/a29khif/_settrap.s new file mode 100644 index 000000000..259097288 --- /dev/null +++ b/newlib/libc/sys/a29khif/_settrap.s @@ -0,0 +1,39 @@ +; @(#)_settrap.s 2.2 90/10/14 21:57:34, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _settrap.s +; void *prevaddr = _settrap( int trapno, void *trapaddr ); +; + .file "_settrap.s" + .include "sys/sysmac.h" + .text + .word 0x00040000 ; Debugger tag word + .global __settrap + +__settrap: + const tav,HIF_settrap @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/_setvec.s b/newlib/libc/sys/a29khif/_setvec.s new file mode 100644 index 000000000..09d4076f5 --- /dev/null +++ b/newlib/libc/sys/a29khif/_setvec.s @@ -0,0 +1,38 @@ +; @(#)_setvec.s 1.2 90/10/14 21:57:35, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _setvec.s +; int success = _setvec( int trap_no, void (*handler)( void ) ); +; + .file "_setvec.s" + .include "sys/sysmac.h" + .text + .word 0x00040000 ; Debugger tag word + .global __setvec + +__setvec: + const tav,HIF_setvec @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + .end diff --git a/newlib/libc/sys/a29khif/_tmpnam.s b/newlib/libc/sys/a29khif/_tmpnam.s new file mode 100644 index 000000000..c7795e27a --- /dev/null +++ b/newlib/libc/sys/a29khif/_tmpnam.s @@ -0,0 +1,41 @@ +; @(#)_tmpnam.s 1.2 90/10/14 21:57:36, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _tmpnam.s +; char *cp = _khif_tmpnam( char *bufr ); +; /* same as ANSI tmpnam(), but NULL arg is not allowed */ +; NOTE - Will not work on BSD (no tmpnam sys call) +; + .file "_tmpnam.s" + .include "sys/sysmac.h" + .text + .word 0x00030000 ; Debugger tag word + .global __khif_tmpnam + +__khif_tmpnam: + const tav,HIF_tmpnam @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/_write.s b/newlib/libc/sys/a29khif/_write.s new file mode 100644 index 000000000..21c0e5815 --- /dev/null +++ b/newlib/libc/sys/a29khif/_write.s @@ -0,0 +1,40 @@ +; @(#)_write.s 1.4 90/10/14 21:57:37, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _write.s +; int written = _write( int fd, char *buf, int count ); +; + .file "_write.s" + .include "sys/sysmac.h" + .text + .word 0x00050000 ; Debugger tag word + .global __write +;; syscalls used now -- .global _write + +__write: +;; syscalls used now -- _write: + const tav,HIF_write @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + .end diff --git a/newlib/libc/sys/a29khif/aclocal.m4 b/newlib/libc/sys/a29khif/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/sys/a29khif/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/sys/a29khif/alloc.s b/newlib/libc/sys/a29khif/alloc.s new file mode 100644 index 000000000..cd90022a5 --- /dev/null +++ b/newlib/libc/sys/a29khif/alloc.s @@ -0,0 +1,64 @@ +; +;(#)_alloc.s 1.4 90/10/14 21:57:19, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1989, 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; 07/06/89 (JS) Replaced call to const tav,HIF_macro +; and deleted call to reterr macro as a NULL needs to be +; returned on failure. +; _alloc.s +; void *vp = _sysalloc( int size ); +; + .file "_alloc.s" + .include "sys/sysmac.h" + .text + .word 0x00030000 ; Debugger tag word + .global __sysalloc +__sysalloc: + const tav,HIF_alloc + asneq V_SYSCALL,gr1,gr1 + jmpti tav, lr0 + const tpc, _errno + consth tpc, _errno + store 0, 0, tav, tpc + jmpi lr0 + const v0, 0 ; return NULL on error. + +; +; int errret = _sysfree( void *addr, int size ); +; + .global __sysfree +__sysfree: + const tav,HIF_free + asneq V_SYSCALL,gr1,gr1 + jmpti tav,lr0 + const tpc,_errno + consth tpc,_errno + store 0,0,tav,tpc + jmpi lr0 + constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/clock.s b/newlib/libc/sys/a29khif/clock.s new file mode 100644 index 000000000..5cb26dff0 --- /dev/null +++ b/newlib/libc/sys/a29khif/clock.s @@ -0,0 +1,41 @@ +; @(#)clock.s 1.3 90/10/14 21:57:43, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; clock.s +; long ticks = clock( ); +; + .file "clock.s" + .include "sys/sysmac.h" + .text + .word 0x00020000 ; Debugger tag word + .global _clock + .global __clock + +_clock: +__clock: + const tav,HIF_clock @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/configure b/newlib/libc/sys/a29khif/configure new file mode 100755 index 000000000..0279884f6 --- /dev/null +++ b/newlib/libc/sys/a29khif/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=_alloc.s + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/sys/a29khif/configure.in b/newlib/libc/sys/a29khif/configure.in new file mode 100644 index 000000000..de247d3d3 --- /dev/null +++ b/newlib/libc/sys/a29khif/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/sys/a29khif configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(_alloc.s) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/sys/a29khif/crt0.s b/newlib/libc/sys/a29khif/crt0.s new file mode 100644 index 000000000..8ae79f898 --- /dev/null +++ b/newlib/libc/sys/a29khif/crt0.s @@ -0,0 +1,226 @@ +; @(#)crt0.s 2.7 90/10/15 13:17:57, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1988, 1989, 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + .file "crt0.s" +; crt0.s version 2.1-7 +; +; This module gets control from the OS. +; It saves away the Am29027 Mode register settings and +; then sets up the pointers to the resident spill and fill +; trap handlers. It then establishes argv and argc for passing +; to main. It then calls _main. If main returns, it calls _exit. +; +; void = start( ); +; NOTE - not C callable (no lead underscore) +; + .include "sys/sysmac.h" +; +; + .extern V_SPILL, V_FILL + .comm __29027Mode, 8 ; A shadow of the mode register + .comm __LibInit, 4 + .comm __environ, 4 ; Environment variables, currently none. + .text + .extern _main, _exit + .extern _memset + + .word 0 ; Terminating tag word + .global start +start: + sub gr1, gr1, 6 * 4 + asgeu V_SPILL, gr1, rab ; better not ever happen + add lr1, gr1, 6 * 4 +; +; Initialize the .bss section to zero by using the memset library function. +; The .bss initialization section below has been commented out as it breaks +; XRAY29K that has been released. The operators sizeof and startof create +; new sections that are not recognized by XRAY29k, but will be implemented +; in the next release (2.0). +; +; const lr4, $sizeof(.bss) ; get size of .bss section to zero out +; consth lr4, $sizeof(.bss) +; const lr2, $startof(.bss) ; Get start address of .bss section +; consth lr2, $startof(.bss) +; const lr0, _memset ; address of memset function +; consth lr0, _memset +; calli lr0, lr0 ; call memset function +; const lr3, 0 + +; Save the initial value of the Am29027's Mode register +; If your const tav,HIF_does @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 not enter crt0 with value for Am29027's Mode register +; in gr96 and gr97, and also if the coprocessor is active uncomment the +; next 4 lines. +; const gr96, 0xfc00820 +; consth gr96, 0xfc00820 +; const gr97, 0x1375 +; store 1, 3, gr96, gr97 +; + const gr98, __29027Mode + consth gr98, __29027Mode + store 0, 0, gr96, gr98 + add gr98, gr98, 4 + store 0, 0, gr97, gr98 +; +; Now call the const tav,HIF_to @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 setup the spill and fill trap handlers +; + const lr3, spill + consth lr3, spill + const lr2, V_SPILL + const tav,HIF_setvec @ asneq V_SYSCALL,gr1,gr1 + const lr3, fill + consth lr3, fill + const lr2, V_FILL + const tav,HIF_setvec @ asneq V_SYSCALL,gr1,gr1 +; +; Set up dividu handler, since native one don't work?! +; Set it up by hand (FIXME) since HIF_settrap doesn't work either! +; +; const lr3,Edividu +; consth lr3,Edividu +; +; const lr2,35 +; const tav,HIF_settrap @ asneq V_SYSCALL,gr1,gr1 +; asge 0x50,gr121,0 ; check whether it failed +; const lr2,0x8000008c ; abs addr of dividu trap handler on EB +; consth lr2,0x8000008c +; store 0,0,lr3,lr2 ; Clobber vector FIXME + +; +; Get the argv base address and calculate argc. +; + const tav,HIF_getargs @ asneq V_SYSCALL,gr1,gr1 + add lr3, v0, 0 ; argv + add lr4, v0, 0 + constn lr2, -1 +argcloop: ; scan for NULL terminator + load 0, 0, gr97, lr4 + add lr4, lr4, 4 + cpeq gr97, gr97, 0 + jmpf gr97, argcloop + add lr2, lr2, 1 +; +; Now call LibInit, if there is one. To aid runtime libraries +; that need to do some startup initialization, we have created +; a bss variable called LibInit. If the library doesn't need +; any run-time initialization, the variable is still 0. If the +; library does need run-time initialization, the library will +; contain a definition like +; void (*_LibInit)(void) = LibInitFunction; +; The linker will match up our bss LibInit with this data LibInit +; and the variable will not be 0. +; + const lr0, __LibInit + consth lr0, __LibInit + load 0, 0, lr0, lr0 + cpeq gr96, lr0, 0 + jmpt gr96, NoLibInit + nop + calli lr0, lr0 + nop +NoLibInit: +; +; call main, passing it 2 arguments. main( argc, argv ) +; + const lr0, _main + consth lr0, _main + calli lr0, lr0 + nop +; +; call exit +; + const lr0, _exit + consth lr0, _exit + calli lr0, lr0 + add lr2, gr96, 0 +; +; Should never get here, but just in case +; +loop: + const tav,HIF_exit @ asneq V_SYSCALL,gr1,gr1 + jmp loop + nop + .sbttl "Spill and Fill trap handlers" + .eject +; +; SPILL, FILL trap handlers +; +; Note that these Spill and Fill trap handlers allow the OS to +; assume that the only registers of use are between gr1 and rfb. +; Therefore, if the OS desires to, it may simply preserve from +; lr0 for (rfb-gr1)/4 registers when doing a context save. +; +; +; Here is the spill handler +; +; spill registers from [*gr1..*rab) +; and move rab downto where gr1 points +; +; rab must change before rfb for signals to work +; +; On entry: rfb - rab = windowsize, gr1 < rab +; Near the end: rfb - rab > windowsize, gr1 == rab +; On exit: rfb - rab = windowsize, gr1 == rab +; + .global spill +spill: + sub tav, rab, gr1 ; tav = number of bytes to spill + srl tav, tav, 2 ; change byte count to word count + sub tav, tav, 1 ; make count zero based + mtsr cr, tav ; set Count Remaining register + sub tav, rab, gr1 + sub tav, rfb, tav ; pull down free bound and save it in rab + add rab, gr1, 0 ; first pull down allocate bound + storem 0, 0, lr0, tav ; store lr0..lr(tav) into rfb + jmpi tpc ; return... + add rfb, tav, 0 +; +; Here is the fill handler +; +; fill registers from [*rfb..*lr1) +; and move rfb upto where lr1 points. +; +; rab must change before rfb for signals to work +; +; On entry: rfb - rab = windowsize, lr1 > rfb +; Near the end: rfb - rab < windowsize, lr1 == rab + windowsize +; On exit: rfb - rab = windowsize, lr1 == rfb +; + .global fill +fill: + const tav, 0x80 << 2 + or tav, tav, rfb ; tav = ((rfb>>2) | 0x80)<<2 == [rfb]<<2 + mtsr ipa, tav ; ipa = [rfb]<<2 == 1st reg to fill + ; gr0 is now the first reg to spill + sub tav, lr1, rfb ; tav = number of bytes to spill + add rab, rab, tav ; push up allocate bound + srl tav, tav, 2 ; change byte count to word count + sub tav, tav, 1 ; make count zero based + mtsr cr, tav ; set Count Remaining register + loadm 0, 0, gr0, rfb ; load registers + jmpi tpc ; return... + add rfb, lr1, 0 ; ... first pushing up free bound + + .end diff --git a/newlib/libc/sys/a29khif/getargs.s b/newlib/libc/sys/a29khif/getargs.s new file mode 100644 index 000000000..aa1f9c442 --- /dev/null +++ b/newlib/libc/sys/a29khif/getargs.s @@ -0,0 +1,38 @@ +; @(#)getargs.s 1.2 90/10/14 21:57:44, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _getargs.s +; void _getargs( void ); +; + .file "_getargs.s" + .include "sys/sysmac.h" + .text + .word 0x00020000 ; Debugger tag word + .global __getargs + +__getargs: + const tav,HIF_getargs @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + .end diff --git a/newlib/libc/sys/a29khif/getenv.s b/newlib/libc/sys/a29khif/getenv.s new file mode 100644 index 000000000..4351849a0 --- /dev/null +++ b/newlib/libc/sys/a29khif/getenv.s @@ -0,0 +1,48 @@ +; @(#)getenv.s 1.4 90/10/14 21:57:45, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; getenv.s +; char *value = getenv( const char *name ); +; + .file "getenv.s" + + .include "sys/sysmac.h" + + .text + .word 0x00030000 ; Debugger tag word + .global _getenv + .global __getenv +_getenv: +__getenv: + const tav,HIF_getenv @ asneq V_SYSCALL,gr1,gr1 ; HIF service trap + jmpti tav, lr0 ; If tav is true, were finished, return. + const tpc, _errno + consth tpc, _errno ; Otherwise, + store 0, 0, tav, tpc ; store error code in _errno, + jmpi lr0 ; then return + const v0, 0 ; with a value of 0 (NULL pointer). + + .end diff --git a/newlib/libc/sys/a29khif/getpid.c b/newlib/libc/sys/a29khif/getpid.c new file mode 100644 index 000000000..99d88bd39 --- /dev/null +++ b/newlib/libc/sys/a29khif/getpid.c @@ -0,0 +1,12 @@ +/* Stub for getpid. */ + +#include <_ansi.h> + +/* This should really return pid_t, but that doesn't seem to be in + . */ + +int +_DEFUN_VOID (_getpid) +{ + return 1; +} diff --git a/newlib/libc/sys/a29khif/kill.c b/newlib/libc/sys/a29khif/kill.c new file mode 100644 index 000000000..ff9fe5428 --- /dev/null +++ b/newlib/libc/sys/a29khif/kill.c @@ -0,0 +1,21 @@ +/* Stub for kill. */ + +#include <_ansi.h> +#include + +/* The pid argument should be of type pid_t. */ + +int +_DEFUN (_kill, (pid, sig), + int pid _AND + int sig) +{ + if (pid == 1 || pid < 0) + { + if (sig == 0) + return 0; + return raise (sig); + } + errno = EINVAL; + return -1; +} diff --git a/newlib/libc/sys/a29khif/read.s b/newlib/libc/sys/a29khif/read.s new file mode 100644 index 000000000..1a5daf301 --- /dev/null +++ b/newlib/libc/sys/a29khif/read.s @@ -0,0 +1,54 @@ +; @(#)_read.s 1.4 90/10/14 21:57:32, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _read.s +; int nread = _read( int fd, char *buf, int count ); +; + .file "_read.s" + .include "sys/sysmac.h" + .text + .word 0x00050000 ; Debugger tag word + .global __read +;; syscalls used now -- .global _read + +__read: +;; syscalls used now -- _read: + .ifdef _BSD_OS +; BSD version - uses readv const tav,HIF_call @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + sub msp, msp, 8 + store 0, 0, lr3, msp + add tav, msp, 4 + add lr3, msp, 0 + store 0, 0, lr4, tav + const lr4, 1 + const tav,HIF_readv @ asneq V_SYSCALL,gr1,gr1 + jmpti tav, lr0 + add msp, msp, 8 + const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + .else + const tav,HIF_read @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + .endif + .end diff --git a/newlib/libc/sys/a29khif/remove.s b/newlib/libc/sys/a29khif/remove.s new file mode 100644 index 000000000..948be04c2 --- /dev/null +++ b/newlib/libc/sys/a29khif/remove.s @@ -0,0 +1,43 @@ +; @(#)remove.s 1.3 90/10/14 21:57:53, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; remove.s +; int cc = remove( char *path ); +; + .file "remove.s" + .include "sys/sysmac.h" + .text + .word 0x00030000 ; Debugger tag word + .global _remove + .global __remove + .global __unlink + +_remove: +__remove: +__unlink: + const tav,HIF_remove @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/rename.s b/newlib/libc/sys/a29khif/rename.s new file mode 100644 index 000000000..31da614e3 --- /dev/null +++ b/newlib/libc/sys/a29khif/rename.s @@ -0,0 +1,41 @@ +; @(#)rename.s 1.3 90/10/14 21:57:54, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; rename.s +; int cc = rename( char *from, char *to ); +; + .file "rename.s" + .include "sys/sysmac.h" + .text + .word 0x00040000 ; Debugger tag word + .global _rename + .global __rename + +_rename: +__rename: + const tav,HIF_rename @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 + + .end diff --git a/newlib/libc/sys/a29khif/signal.s b/newlib/libc/sys/a29khif/signal.s new file mode 100644 index 000000000..29273a0d3 --- /dev/null +++ b/newlib/libc/sys/a29khif/signal.s @@ -0,0 +1,452 @@ +;@(#)signal.s 2.15 90/10/14 21:57:55, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + .file "signal.s" + +; SigEntry is the address of an array of C-level user code signal handlers. +; They must return to the top-level before doing a sigret() return function. +; Nested signals are supported. + + .extern V_SPILL, V_FILL + .extern fill ; In crt0.s + + .align 4 + .comm WindowSize, 4 + .data +SigEntry: + .word 0 ; reserved + .word 0 ; adds. of #2 SIGINT handler + .word 0 ; reserved + .word 0 ; reserved + .word 0 ; reserved + .word 0 ; reserved + .word 0 ; reserved + .word 0 ; adds. of #8 SIGFPE handler + + .text + + .reg v0, gr96 + .reg v1, gr97 + .reg v2, gr98 + .reg v3, gr99 + + .reg tav, gr121 + .reg tpc, gr122 + .reg lrp, gr123 + .reg slp, gr124 + .reg msp, gr125 + .reg rab, gr126 + .reg rfb, gr127 + +;=================================================================== setjmp() +; int +; setjmp(label_t jmpbuf) +; { +; *jmpbuf = {gr1, msp, lr0, lr1}; +; return 0; +; } +; + .global _setjmp +_setjmp: + store 0, 0, gr1, lr2 + add lr2, lr2, 4 + store 0, 0, msp, lr2 + add lr2, lr2, 4 + store 0, 0, lr0, lr2 + add lr2, lr2, 4 + store 0, 0, lr1, lr2 + jmpi lr0 + const v0, 0 +; +;==================================================================== longjmp() +; int +; longjmp(label_t jmpbuf, int value) +; { +; /* BUG: check for this +; if (msp > jmpbuf->msp || gr1 > jmpbuf->gr1) +; longjmperror(); +; */ +; +; gr1 = jmpbuf->gr1; +; lr2addr = jmpbuf->gr1 + 8; +; msp = jmpbuf->msp; +; +; /* saved lr1 is invalid if saved lr2addr > rfb */ +; if (lr2addr > rfb) { +; /* +; * None of the registers are useful. +; * Set rfb to lr2addr - 512 & rab to rfb - 512. +; * the FILL assert will take care of filling +; */ +; lr1 = jmpbuf->lr1; +; rab = lr2addr - windowsize; +; rfb = lr2addr; +; } +; +; lr0 = jmpbuf->lr0; +; if (rfb < lr1) +; raise V_FILL; +; return value; +; } +; + .global _longjmp +_longjmp: + load 0, 0, tav, lr2 ; copy in gr1 + add v1, lr2, 4 ; v1 points to msp + ; make sure we return a non-zero value + cpeq v0, lr3, 0 + srl v0, v0, 31 + or v0, lr3, v0 + + add gr1, tav, 0 ; now update gr1 + add tav, tav, 8 ; calculate lr2addr + load 0, 0, msp, v1 ; update msp from jmpbuf + cpleu v3, tav, rfb ; if (lr2addr > rfb) + jmpt v3, $1 ; { + add v1, v1, 4 ; v1 points to lr0 + add v2, v1, 4 ; v2 points to lr1 + load 0, 0, lr1, v2 ; lr1 = value from jmpbuf + sub v3, rfb, rab ; + sub rab, tav, v3 ; rab = lr2addr - windowsize + add rfb, tav, 0 ; rfb = lr2addr +$1: ; } + load 0, 0, lr0, v1 + jmpi lr0 + asgeu V_FILL, rfb, lr1 ; may fill from rfb to lr1 +; +;================================================================== sigcode +; About to deliver a signal to a user mode signal handler. +; msp+(15*4) = signal_number +; msp+(14*4) = gr1 +; msp+(13*4) = rab +; msp+(12*4) = PC0 +; msp+(11*4) = PC1 +; msp+(10*4) = PC2 +; msp+( 9*4) = CHA +; msp+( 8*4) = CHD +; msp+( 7*4) = CHC +; msp+( 6*4) = ALU +; msp+( 5*4) = OPS +; msp+( 4*4) = gr121 +; msp+( 3*4) = gr99 +; msp+( 2*4) = gr98 +; msp+( 1*4) = gr97 +; msp = gr96 +; The state of all the registers (except for msp, chc and rab) +; is the same as when the process was interrupted. +; +; We must make the stack and window consistent before calling the handler +; The orignal rab value is on the stack. The interrupt handler placed +; rfb-Windowsize in rab. This is required to support nested interrupts. +; +; Note that the window becomes incosistent only during certain +; critical sections in spill, fill, longjmp and sigcode. +; rfb - rab > windowsize => we are in spill +; rfb - rab < windowsize => we are in fill +; gr1 + 8 > rfb => we are in long-longjmp case +; In case of spill, fill and lonjmp; rab is modified first, +; so if we are in one of these critical sections, +; we set rab to rfb - WINDOWSIZE. +; + .equ SIGCTX_SIZE, (16)*4 + .equ SIGCTX_SIGNUMB, (15)*4 + .equ SIGCTX_GR1_OFFSET, (14)*4 + .equ SIGCTX_RAB_OFFSET, (13)*4 + .equ SIGCTX_PC0_OFFSET, (12)*4 + .equ SIGCTX_PC1_OFFSET, (11)*4 + .equ SIGCTX_PC2_OFFSET, (10)*4 + .equ SIGCTX_CHC_OFFSET, (7)*4 + .equ SIGCTX_OPS_OFFSET, (5)*4 + .equ SIGCTX_TAV_OFFSET, (4)*4 + .global sigcode +sigcode: +; -------------------------------------------------------- R-Stack fixup + const v0, WindowSize ; get register cache size + consth v0, WindowSize + load 0, 0, v0, v0 + add v2, msp, SIGCTX_RAB_OFFSET + load 0, 0, v2, v2 ; get interrupted rab value + sub v1, rfb, v2 ; determine if rfb-rab <= WINDOW_SIZE + cpgeu v1, v1, v0 ; + jmpt v1, nfill ; jmp if spill or 'normal' interrupt + add v1, gr1, 8 + cpgt v1, v1, rfb ; interrupted longjmp can look like fill + jmpf v1, nfill ; test for long-longjmp interruption + nop ; jmp if gr1+8 <= rfb +; Fixup signal stack to re-start interrupted fill +; backup pc1 -- this is needed for the partial fill case. +; Clear chc so an interrupted load/store does not restart. +; Reset rab to a window distance below rfb, rab shall be +; decremented again on re-starting the interrupted fill. +; The interrupt handler set rab=rfb-WindowSize. +; + add v0, msp, SIGCTX_RAB_OFFSET + store 0, 0, rab, v0 ; re-store (rfb-WindowSize) for rab + const v2, fill + consth v2, fill + add v0, msp, SIGCTX_PC1_OFFSET + store 0, 0, v2, v0 + sub v2, v2, 4 ; determine pc0 + add v0, msp, SIGCTX_PC0_OFFSET + store 0, 0, v2, v0 + const v2, 0 ; clear chc + add v0, msp, SIGCTX_CHC_OFFSET + store 0, 0, v2, v0 + +nfill: + cpgt v0, gr1, rfb ; if gr1 > rfb then gr1 = rfb + jmpt v0, lower + cplt v0, gr1, rab ; if gr1 < rab then gr1 = rab + jmpt v0, raise + nop +; -------------------------------------------------------- save_regs +sig1: sub msp, msp, (4+2+25)*4 ; reserve space for regs + mfsr gr96, ipc + mfsr gr97, ipa + mfsr gr98, ipb + mfsr gr99, q + mtsrim cr, 4-1 + storem 0, 0, gr96, msp +; "push" registers stack support + add gr96, lr1, 0 + add gr97, rfb, 0 + mtsrim cr, 2-1 + add gr99, msp, 2*4 + storem 0, 0, gr96, gr99 +; "push" remaining global registers + mtsrim cr, 25-1 ; gr100-gr124 + add gr96, msp, (4+2)*4 + storem 0, 0, gr100, gr96 +; +; -------------------------------------------------------- Dummy Call + .equ RALLOC, 4*4 ; make space for function calls + add v0, rfb, 0 ; store original rfb + sub gr1, gr1, RALLOC + asgeu V_SPILL, gr1, rab + add lr1, v0, 0 ; set lr1 = original rfb + add v1, msp, (4+2+25)*4 + SIGCTX_SIGNUMB + load 0, 0, lr2, v1 ; restore signal number + sub v1, lr2, 1 ; get handler index + sll v1, v1, 2 ; point to addresses +; +; -------------------------------------------------------- call C-level +; Handler must not use HIF services other than the _sigret() type. + const v0, SigEntry + consth v0, SigEntry + add v0, v0, v1 + load 0, 0, v0, v0 ; determine if handler registered + cpeq v1, v0, 0 + jmpt v1, NoHandler + nop + calli lr0, v0 ; call C-level signal handler + nop +; +; -------------------------------------------------------- default return +NoHandler: + jmp __sigdfl + nop + +; -------------------------------------------------------- support bits +lower: sll gr1, rfb, 0 + jmp sig1 + nop +raise: sll gr1, rab, 0 + jmp sig1 + nop +/* +; -------------------------------------------------------- repair_regs + mtsrim cr, 4-1 + loadm 0, 0, gr96, msp + mtsr ipc, gr96 + mtsr ipa, gr97 + mtsr ipb, gr98 + mtsr Q, gr99 +; "pop" registers stack support + mtsrim cr, 2-1 + add gr99, msp, 2*4 + loadm 0, 0, gr96, gr99 + add lr1, gr96, 0 + add rfb, gr97, 0 +; "pop" remaining global registers + mtsrim cr, 25-1 ; gr100-gr124 + add gr96, msp, (4+2)*4 + loadm 0, 0, gr100, gr96 + add msp, msp, (4+2+25)*4 ; repair msp to save_regs entry value +; -------------------------------------------------------- end repair +*/ + +; ======================================================== _sigret() + .global __sigret +__sigret: +; repair_regs +; -------------------------------------------------------- repair_regs + mtsrim cr, 4-1 + loadm 0, 0, gr96, msp + mtsr ipc, gr96 + mtsr ipa, gr97 + mtsr ipb, gr98 + mtsr q, gr99 +; "pop" registers stack support + mtsrim cr, 2-1 + add gr99, msp, 2*4 + loadm 0, 0, gr96, gr99 + add lr1, gr96, 0 + add rfb, gr97, 0 +; "pop" remaining global registers + mtsrim cr, 25-1 ; gr100-gr124 + add gr96, msp, (4+2)*4 + loadm 0, 0, gr100, gr96 + add msp, msp, (4+2+25)*4 ; repair msp to save_regs entry value +; -------------------------------------------------------- end repair + const tav, 323 ; HIF _sigret + asneq 69, gr1,gr1 + halt ; commit suicide if returns + +; ======================================================== _sigdfl() + .global __sigdfl +__sigdfl: +; repair_regs +; -------------------------------------------------------- repair_regs + mtsrim cr, 4-1 + loadm 0, 0, gr96, msp + mtsr ipc, gr96 + mtsr ipa, gr97 + mtsr ipb, gr98 + mtsr q, gr99 +; "pop" registers stack support + mtsrim cr, 2-1 + add gr99, msp, 2*4 + loadm 0, 0, gr96, gr99 + add lr1, gr96, 0 + add rfb, gr97, 0 +; "pop" remaining global registers + mtsrim cr, 25-1 ; gr100-gr124 + add gr96, msp, (4+2)*4 + loadm 0, 0, gr100, gr96 + add msp, msp, (4+2+25)*4 ; repair msp to save_regs entry value +; -------------------------------------------------------- end repair + const tav, 322 ; HIF _sigdfl + asneq 69, gr1,gr1 + halt ; commit suicide if returns + +; ======================================================== _sigrep() +__sigrep: + .global __sigrep +; repair_regs +; -------------------------------------------------------- repair_regs + mtsrim cr, 4-1 + loadm 0, 0, gr96, msp + mtsr ipc, gr96 + mtsr ipa, gr97 + mtsr ipb, gr98 + mtsr q, gr99 +; "pop" registers stack support + mtsrim cr, 2-1 + add gr99, msp, 2*4 + loadm 0, 0, gr96, gr99 + add lr1, gr96, 0 + add rfb, gr97, 0 +; "pop" remaining global registers + mtsrim cr, 25-1 ; gr100-gr124 + add gr96, msp, (4+2)*4 + loadm 0, 0, gr100, gr96 + add msp, msp, (4+2+25)*4 ; repair msp to save_regs entry value +; -------------------------------------------------------- end repair + const tav, 324 ; HIF _sigrep + asneq 69, gr1,gr1 + halt ; commit suicide if returns + +; ======================================================== _sigskp() + .global __sigskp +__sigskp: +; repair_regs +; -------------------------------------------------------- repair_regs + mtsrim cr, 4-1 + loadm 0, 0, gr96, msp + mtsr ipc, gr96 + mtsr ipa, gr97 + mtsr ipb, gr98 + mtsr q, gr99 +; "pop" registers stack support + mtsrim cr, 2-1 + add gr99, msp, 2*4 + loadm 0, 0, gr96, gr99 + add lr1, gr96, 0 + add rfb, gr97, 0 +; "pop" remaining global registers + mtsrim cr, 25-1 ; gr100-gr124 + add gr96, msp, (4+2)*4 + loadm 0, 0, gr100, gr96 + add msp, msp, (4+2+25)*4 ; repair msp to save_regs entry value +; -------------------------------------------------------- end repair + const tav, 325 ; HIF _sigskp + asneq 69, gr1,gr1 + halt ; commit suicide if returns + +; ======================================================== _sendsig() +; lr2 = signal number + .global _raise + .global __sendsig +_raise: +__sendsig: + const tav, 326 ; HIF sendsig + asneq 69, gr1,gr1 + jmpi lr0 + nop + +; +; ======================================================== signal() +; lr2 = signal number +; lr3 = handler address + .global _signal +_signal: +; the memory variable WindowSize must be initalised at the +; start when rfb and rab are a window size apart. + const v0, WindowSize ; get register cache size + consth v0, WindowSize + load 0, 0, v1, v0 + cpeq v1, v1, 0 + jmpf v1, WindowSizeOK + sub v1, rfb, rab ; rfb-rab = WINDOW_SIZE + store 0, 0, v1, v0 +WindowSizeOK: + const v1, SigEntry + consth v1, SigEntry + sub v3, lr2, 1 ; get handler index + sll v3, v3, 2 ; pointer to addresses + add v1, v1, v3 + store 0,0, lr3, v1 ; save new handler + + const lr2, sigcode + consth lr2, sigcode + ;Fall through to __signal +; ======================================================== _signal() + .global __signal +__signal: + const tav, 321 ; HIF signal + asneq 69, gr1,gr1 + jmpi lr0 + nop diff --git a/newlib/libc/sys/a29khif/stubs.s b/newlib/libc/sys/a29khif/stubs.s new file mode 100644 index 000000000..e0b29bc77 --- /dev/null +++ b/newlib/libc/sys/a29khif/stubs.s @@ -0,0 +1,135 @@ +; +; +; File of stubs so that unix applications can link into a HIF monitor +; +; sac@cygnus.com + + .text + + .global _sysalloc +_sysalloc: + const gr121,__sysalloc + consth gr121,__sysalloc + jmpi gr121 + + .global _sysfree +_sysfree: + const gr121,__sysfree + consth gr121,__sysfree + jmpi gr121 + + + .global _cycles +_cycles: + const gr121,__cycles + consth gr121,__cycles + jmpi gr121 + +; .global _exit +;_exit: +; const gr121,__exit +; consth gr121,__exit +; jmpi gr121 + + .global _getpsiz +_getpsiz: + const gr121,__getpsiz + consth gr121,__getpsiz + jmpi gr121 + + .global _gettz +_gettz: + const gr121,__gettz + consth gr121,__gettz + jmpi gr121 + + .global _ioctl +_ioctl: + const gr121,__ioctl + consth gr121,__ioctl + jmpi gr121 + + + .global _iowait +_iowait: + const gr121,__iowait + consth gr121,__iowait + jmpi gr121 + + +;; syscalls used now -- .global _open +;; syscalls used now -- _open: +;; syscalls used now -- const gr121,__open +;; syscalls used now -- consth gr121,__open +;; syscalls used now -- jmpi gr121 + + .global _query +_query: + const gr121,__query + consth gr121,__query + jmpi gr121 + + + .global _setim +_setim: + const gr121,__setim + consth gr121,__setim + jmpi gr121 + + .global _settrap +_settrap: + const gr121,__settrap + consth gr121,__settrap + jmpi gr121 + + .global _setvec +_setvec: + const gr121,__setvec + consth gr121,__setvec + jmpi gr121 + + .global _getargs +_getargs: + const gr121,__getargs + consth gr121,__getargs + jmpi gr121 + +;; syscalls used now -- .global _unlink +;; syscalls used now -- _unlink: +;; syscalls used now -- const gr121,__unlink +;; syscalls used now -- consth gr121,__unlink +;; syscalls used now -- jmpi gr121 + + .global _sigret +_sigret: + const gr121,__sigret + consth gr121,__sigret + jmpi gr121 + + .global _sigdfl +_sigdfl: + const gr121,__sigdfl + consth gr121,__sigdfl + jmpi gr121 + + .global _sigrep +_sigrep: + const gr121,__sigrep + consth gr121,__sigrep + jmpi gr121 + + .global _sigskp +_sigskp: + const gr121,__sigskp + consth gr121,__sigskp + jmpi gr121 + + .global _sendsig +_sendsig: + const gr121,__sendsig + consth gr121,__sendsig + jmpi gr121 + + ; fill this jmpi delay slot + ; the others are not done since they do not matter + constn lr0,-1 diff --git a/newlib/libc/sys/a29khif/sys/cpudef.h b/newlib/libc/sys/a29khif/sys/cpudef.h new file mode 100644 index 000000000..4ec6ed39c --- /dev/null +++ b/newlib/libc/sys/a29khif/sys/cpudef.h @@ -0,0 +1,270 @@ +; @(#)cpudef.h 2.3 90/10/14 20:55:56, Copyright 1989, 1990 AMD +;----------------------------------------------------------------------- +; Useful equates +;----------------------------------------------------------------------- +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1989, 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + ; Processor status registers OPS (sr1) and CPS (sr2) + .equ CA,0x8000 ; Coprocessor active + .equ IP,0x4000 ; Interrupt pending + .equ TE,0x2000 ; Trace enable + .equ TP,0x1000 ; Trace pending + .equ TU,0x0800 ; Trap unaligned access + .equ FZ,0x0400 ; Freeze + .equ LK,0x0200 ; Lock + .equ RE,0x0100 ; ROM enable + .equ WM,0x0080 ; Wait mode + .equ PD,0x0040 ; No translation for Data + .equ PI,0x0020 ; No translation for Instr + .equ SM,0x0010 ; Supervisor mode + .equ IM,0x000C ; Interrupt mask + .equ IM1,0x0100 ; enable INTR0-1 + .equ IM2,0x1000 ; enable INTR0-2 + .equ IM3,0x1100 ; enable INTR0-3 + .equ DI,0x0002 ; Disable ints + .equ DA,0x0001 ; Disable ints and traps + + ; Configuration register CFG (sr3) + .equ PRL,0xFF000000 ; Processor release level + .equ VF,0x10 ; Vector fetch + .equ RV,0x08 ; ROM Vector area + .equ BO,0x04 ; Byte order + .equ CP,0x02 ; Coprocessor present + .equ CD,0x01 ; BTC disable + + ; Channel control register CHC (sr6) + .equ LS,0x8000 ; Load store + .equ ML,0x4000 ; Multiple operation + .equ ST,0x2000 ; Set + .equ LA,0x1000 ; Lock active + .equ TF,0x0400 ; Transaction faulted + .equ TR,0x03FC ; Target register + .equ NN,0x0002 ; Not needed + .equ CV,0x0001 ; Contents valid + + ; Timer reload register TMR (sr9) + .equ IE,0x01000000 ; timer int enable + .equ IN,0x02000000 ; timer int pending + .equ OV,0x04000000 ; timer Overflow + + ; MMU configuration register MMU (sr13) + .equ PS,0x300 ; Page size + .equ PID,0xFF ; Process identifier + + ; ALU status register ALU (sr132) + .equ DF,0x800 ; Divide flag + .equ V,0x400 ; Overflow + .equ N,0x200 ; Negative + .equ Z,0x100 ; Zero + .equ C,0x080 ; Carry + + ; TLB entry + .equ VTAG,0xFFFF8000 ; Virtual tag + .equ VE,0x4000 ; Valid entry + .equ SR,0x2000 ; Supervisor read + .equ SW,0x1000 ; Supervisor write + .equ SE,0x0800 ; Supervisor execute + .equ UR,0x0400 ; User read + .equ UW,0x0200 ; User write + .equ UE,0x0100 ; User execute + .equ TID,0x00FF ; Task identifier + .equ RPN,0xFFFFFC00 ; Real page number + .equ PGM,0x00C0 ; User programmable + .equ U,0x0002 ; Usage + .equ F,0x0001 ; Flag + +;----------------------------------------------------------------------- +;Global registers +;----------------------------------------------------------------------- + + .reg rsp, gr1 ; local register stack pointer + + ; System-wide statics + .reg s0, gr64 + .reg spillreg, s0 ; pointer to user spill handler + .reg s1, gr65 + .reg fillreg, s1 ; pointer to user fill handler + .reg s2, gr66 + .reg heapptr, s2 ; pointer to heap area + .reg s3, gr67 + .reg s4, gr68 + .reg s5, gr69 + .reg s6, gr70 + .reg s7, gr71 + .reg s8, gr72 + .reg s9, gr73 + .reg s10, gr74 + .reg s11, gr75 + .reg s12, gr76 + .reg s13, gr77 + .reg s14, gr78 + .reg s15, gr79 + + ; Interrupt handler temporaries + .reg i0, gr80 + .reg i1, gr81 + .reg i2, gr82 + .reg i3, gr83 + .reg i4, gr84 + .reg i5, gr85 + .reg i6, gr86 + .reg i7, gr87 + .reg i8, gr88 + .reg i9, gr89 + .reg i10, gr90 + .reg i11, gr91 + .reg i12, gr92 + .reg i13, gr93 + .reg i14, gr94 + .reg i15, gr95 + + ; Subroutine/function temporaries + ; also used for function return values + .reg t0, gr96 + .reg rtn, t0 + .reg t1, gr97 + .reg t2, gr98 + .reg t3, gr99 + .reg t4, gr100 + .reg t5, gr101 + .reg t6, gr102 + .reg t7, gr103 + .reg t8, gr104 + .reg t9, gr105 + .reg t10, gr106 + .reg t11, gr107 + .reg t12, gr108 + .reg t13, gr109 + .reg t14, gr110 + .reg t15, gr111 + + ; User process statics + .reg u0, gr112 + .reg u1, gr113 + .reg u2, gr114 + .reg u3, gr115 + + ; More subroutine/function temporaries + .reg t16, gr116 + .reg t17, gr117 + .reg t18, gr118 + .reg t19, gr119 + .reg t20, gr120 + + ; Older names for the same registers + .reg tmp0, gr116 + .reg tmp1, gr117 + .reg tmp2, gr118 + .reg tmp3, gr119 + .reg tmp4, gr120 + + ; Trap handler temporaries + .reg tav, gr121 ; arg/temp + .reg tpc, gr122 ; rtn/temp + + ; Linkage pointers + .reg lrp, gr123 ; large rtn ptr + .reg slp, gr124 ; static link ptr + .reg msp, gr125 ; memory stack ptr + .reg rab, gr126 ; register allocate bound + .reg rfb, gr127 ; register free bound + +;----------------------------------------------------------------------- +;Local compiler registers +; (only valid if frame has been established) +;----------------------------------------------------------------------- + + .reg p15, lr17 ; outgoing arg 16 + .reg p14, lr16 ; outgoing arg 15 + .reg p13, lr15 ; outgoing arg 14 + .reg p12, lr14 ; outgoing arg 13 + .reg p11, lr13 ; outgoing arg 12 + .reg p10, lr12 ; outgoing arg 11 + .reg p9, lr11 ; outgoing arg 10 + .reg p8, lr10 ; outgoing arg 9 + .reg p7, lr9 ; outgoing arg 8 + .reg p6, lr8 ; outgoing arg 7 + .reg p5, lr7 ; outgoing arg 6 + .reg p4, lr6 ; outgoing arg 5 + .reg p3, lr5 ; outgoing arg 4 + .reg p2, lr4 ; outgoing arg 3 + .reg p1, lr3 ; outgoing arg 2 + .reg p0, lr2 ; outgoing arg 1 + .reg fp, lr1 ; frame pointer + .reg raddr, lr0 ; return address + +;----------------------------------------------------------------------- +; Vectors +;----------------------------------------------------------------------- + + .equ V_ILLEG, 0 ; Illegal opcode + .equ V_ALIGN, 1 ; Unaligned access + .equ V_RANGE, 2 ; Out of range + .equ V_COPRE, 3 ; Coprocessor not present + .equ V_COEXC, 4 ; Coprocessor exception + .equ V_PROT, 5 ; Protection violation + .equ V_INSTR, 6 ; Instruction access exception + .equ V_DATA, 7 ; Data access exception + .equ V_UITLB, 8 ; User-mode instruction TLB miss + .equ V_UDTLB, 9 ; User-mode data TLB miss + .equ V_SITLB, 10 ; Supervisor-mode instr TLB miss + .equ V_SDTLB, 11 ; Supervisor-mode data TLB miss + .equ V_ITLB, 12 ; Instruction TLB violation + .equ V_DTLB, 13 ; Data TLB violation + .equ V_TIMER, 14 ; Timer + .equ V_TRACE, 15 ; Trace + .equ V_INTR0, 16 ; Interrupt 0 + .equ V_INTR1, 17 ; Interrupt 1 + .equ V_INTR2, 18 ; Interrupt 2 + .equ V_INTR3, 19 ; Interrupt 3 + .equ V_TRAP0, 20 ; Trap 0 + .equ V_TRAP1, 21 ; Trap 1 + +;----------------------------------------------------------------------- +;constants for LOAD and STORE operations +;----------------------------------------------------------------------- + +; CE operand values + .equ CE, 0b1 ;coprocessor enable + .equ ME, 0b0 ; memory enable + +; CNTL operand values + .equ IO, 0b1000000 ;set for I/O + .equ PA, 0b0100000 ;force physical addr + .equ SB, 0b0010000 ;set for set BP + .equ UA, 0b0001000 ;force user mode access + .equ ROM, 0b0000100 ;ROM access + .equ HWORD, 0b0000010 ;Half word access + .equ BYTE, 0b0000001 ;Byte access + .equ WORD, 0b0000000 ;Word access + +;----------------------------------------------------------------------- +; stack alignment value +;----------------------------------------------------------------------- + .equ STKALIGN, 8 ; double word align + diff --git a/newlib/libc/sys/a29khif/sys/fpsymbol.h b/newlib/libc/sys/a29khif/sys/fpsymbol.h new file mode 100644 index 000000000..3fc6ac88b --- /dev/null +++ b/newlib/libc/sys/a29khif/sys/fpsymbol.h @@ -0,0 +1,2970 @@ +; @(#)fpsymbol.h 1.4 90/10/14 20:55:59, Copyright 1989, 1990 AMD +; start of fpsymbol.h file +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1989, 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; ______________________________________________________________________ +;|______________________________________________________________________| +;| | +;| SYMBOLS FOR DEFINING THE INSTRUCTION WORD | +;| | +;|______________________________________________________________________| +;|______________________________________________________________________| +; +; +; Revision Information: +;------------------------------------------------------------------------ +; Date: March 31, 1989 +; Author: Roy Carlson per Bob Perlman and Richard Relph +; +; The symbols section describing transactions was modified to contain +; several new symbol values. The reason for the change was to force the +; CA bit to be set--and remain set--once code accesses the coprocessor. +; +; Future operating systems will use the Coprocessor Active (CA) bit in +; the Old Processor Status Register to determine whether or not to save +; coprocessor state, etc.. This means that the instruction control field +; Set Coprocessor Active (SA) bit should be used as follows: +; +; (1) any coprocessor STORE must have its SA bit set to 1, +; so as to set CA, +; +; and (2) any coprocessor LOAD must have its SA bit set to 0, +; so as to prevent clearing CA. +;------------------------------------------------------------------------ +; Date: 89/01/30 12:32:13; author: jim; lines added/del: 5/4 +; Corrected CP_IEEE_GRADUAL_UFLOW_MODE and CP_RMS_MASK. +; Added CP_EXCPS_POSITION, the ls bit of the CP_XXX_EXCP ensemble. +; fixed a few typos in comments. +;------------------------------------------------------------------------ +; Date: 89/01/23 18:00:26; author: jim; lines added/del: 488/468 +; Richard O. Parker +; January 5, 1989 +; +; 1) The _cp_prec_field in the "cp_build_inst", "cp_build_inst_h" +; and "cp_build_inst_l" macros was not being defined in the case +; of Am29K-supported floating-point instructions (e.g., FADD, FSUB, +; DADD, etc.). +; +; 2) The multiplexor select codes in the opcode table entries +; associated with the "cp_build_inst", "cp_build_inst_h" and +; "cp_build_inst_l" macros, pertaining to the CONVERT_F_TO_D +; and CONVERT_D_TO_F instructions were incorrect. +;------------------------------------------------------------------------ +; Date: 88/12/20 14:28:26; author: jim; lines added/del: 1/1 +; Larry Westerman corrected definition of CP_MOVE_P. +; Version required for Release 1.1 of the Intrinsics shipped 12/12/88. +;------------------------------------------------------------------------ +; Date: 88/11/18 15:44:45; author: law; +; Initial revision +; +; +;======================================================================== +; +; The following mnemonics are used to specify the 14 LSBs of the +; instruction word (fields SIP, SIQ, SIT, SIF, IF, and CO). +; +;======================================================================== +; +; floating point operation codes. +; + .equ CP_PASS_P, 0x00000000 ; pass P + .equ CP_MINUSP, 0x00000040 ; -P + .equ CP_ABSP, 0x00000080 ; |P| + .equ CP_SIGNT_TIMES_ABSP, 0x00000C00 ; SIGN(T) * |P| +; + .equ CP_P_PLUS_T, 0x00000001 ; P + T + .equ CP_P_MINUS_T, 0x00000101 ; P - T + .equ CP_MINUSP_PLUS_T, 0x00001001 ; -P + T + .equ CP_MINUSP_MINUS_T, 0x00001101 ; -P - T + .equ CP_ABS_P_PLUS_T, 0x00000081 ; |P + T| + .equ CP_ABS_P_MINUS_T, 0x00000181 ; |P - T| + .equ CP_ABSP_PLUS_ABST, 0x00002201 ; |P| + |T| + .equ CP_ABSP_MINUS_ABST, 0x00002301 ; |P| - |T| + .equ CP_ABS_ABSP_MINUS_ABST, 0x00002381 ; ||P| - |T|| +; + .equ CP_P_TIMES_Q, 0x00000002 ; P * Q + .equ CP_MINUSP_TIMES_Q, 0x00001002 ; -P * Q + .equ CP_ABS_P_TIMES_Q, 0x00000082 ; |P * Q| +; + .equ CP_COMPARE_P_AND_T, 0x00000103 ; compare P and T +; + .equ CP_MAX_P_AND_T, 0x00000104 ; max P,T + .equ CP_MAX_ABSP_AND_ABST, 0x00002304 ; max |P|, |T| +; + .equ CP_MIN_P_AND_T, 0x00001005 ; min P,T + .equ CP_MIN_ABSP_AND_ABST, 0x00003205 ; min |P|,|T| + .equ CP_LIMIT_P_TO_MAGT, 0x00003A05 ; limit P to magnitude of T +; + .equ CP_CONVERT_T_TO_INT, 0x00000006 ; convert T to integer +; + .equ CP_SCALE_T_TO_INT_BY_Q, 0x00000007 ; scale T to integer by Q +; + .equ CP_PQ_PLUS_T, 0x00000008 ; (P * Q) + T + .equ CP_MINUSPQ_PLUS_T, 0x00001008 ; (-P * Q) + T + .equ CP_PQ_MINUS_T, 0x00000108 ; (P * Q) - T + .equ CP_MINUSPQ_MINUS_T, 0x00001108 ; (-P * Q) - T + .equ CP_ABSPQ_PLUS_ABST, 0x00002A08 ; |(P * Q)| + T + .equ CP_MINUSABSPQ_PLUS_ABST, 0x00003A08 ;-|(P * Q)| + T + .equ CP_ABSPQ_MINUS_ABST, 0x00002B08 ; |(P * Q)| - |T| +; + .equ CP_ROUND_T_TO_INT, 0x00000009 ; round T to integral value +; + .equ CP_RECIPROCAL_OF_P, 0x0000000A ; reciprocal of P +; + .equ CP_CONVERT_T_TO_ALT, 0x0000000B ; convert T to alt. f.p. format + .equ CP_CONVERT_T_FROM_ALT, 0x0000000C ; convert T to alt. f.p. format +; +; +; integer operation codes. +; + .equ CP_I_PASS_P, 0x00000020 ; integer pass P + .equ CP_I_MINUSP, 0x00000060 ; integer -P + .equ CP_I_ABSP, 0x000000A0 ; integer |P| + .equ CP_I_SIGNT_TIMES_ABSP, 0x00000C20 ; integer SIGN(T) * |P| +; + .equ CP_I_P_PLUS_T, 0x00000021 ; integer P + T + .equ CP_I_P_MINUS_T, 0x00000121 ; integer P - T + .equ CP_I_MINUSP_PLUS_T, 0x00001021 ; integer -P + T + .equ CP_I_ABS_P_PLUS_T, 0x000000A1 ; integer |P + T| + .equ CP_I_ABS_P_MINUS_T, 0x000001A1 ; integer |P - T| +; + .equ CP_I_P_TIMES_Q, 0x00000022 ; integer P * Q +; + .equ CP_I_COMPARE_P_AND_T, 0x00000123 ; integer compare P and T +; + .equ CP_I_MAX_P_AND_T, 0x00000124 ; integer max P,T +; + .equ CP_I_MIN_P_AND_T, 0x00001025 ; integer min P,T +; + .equ CP_I_CONVERT_T_TO_FLOAT, 0x00000026 ; integer convert T to f.p. +; + .equ CP_I_SCALE_T_TO_FLOAT_BY_Q, 0x00000027 ; integer scale T to f.p. by Q +; + .equ CP_I_P_OR_T, 0x00000030 ; integer P OR T +; + .equ CP_I_P_AND_T, 0x00000031 ; integer P AND T +; + .equ CP_I_P_XOR_T, 0x00000032 ; integer P XOR T +; + .equ CP_I_NOT_T, 0x00000032 ; integer NOT T +; + .equ CP_I_LSHIFT_P_BY_Q, 0x00000033 ; integer logical shift P by Q +; places +; + .equ CP_I_ASHIFT_P_BY_Q, 0x00000034 ; integer arith. shift P by Q +; places +; + .equ CP_I_FSHIFT_PT_BY_Q, 0x00000035 ; integer funnel shift PT by Q +; places +; +; +; move instruction (f.p. or integer) +; + .equ CP_MOVE_P, 0x00000018 ; move operand P +; +; +;======================================================================== +; +; precision codes for the the operands in registers R and S, and for +; the result (instruction word fields IPR, RPR). +; +;======================================================================== +; +; + .equ CP_D_S, 0x00008000 ;Double result, single input(s) + .equ CP_S_D, 0x00004000 ;Single result, double input(s) + .equ CP_D_D, 0x00000000 ;Double result, double input(s) + .equ CP_S_S, 0x0000C000 ;Single result, single input(s) +; +;======================================================================== +; +; The following mnemonics are used to specify the 16 LSBs of an Am29027 +; instruction word for floating-point instructions supported by the +; Am29000 instruction set. +; +;======================================================================== +; + .equ CP_FADD, 0x0000C001 + .equ CP_DADD, 0x00000001 + .equ CP_FSUB, 0x0000C101 + .equ CP_DSUB, 0x00000101 + .equ CP_FMUL, 0x0000C002 + .equ CP_DMUL, 0x00000002 + .equ CP_FEQ, 0x0000C103 + .equ CP_DEQ, 0x00000103 + .equ CP_FGE, 0x0000C103 + .equ CP_DGE, 0x00000103 + .equ CP_FGT, 0x0000C103 + .equ CP_DGT, 0x00000103 + .equ CP_CONVERT_I_TO_F, 0x0000C026 ; CONVERT (int -> s.p.) + .equ CP_CONVERT_I_TO_D, 0x00008026 ; CONVERT (int -> d.p.) + .equ CP_CONVERT_F_TO_I, 0x0000C006 ; CONVERT (s.p.-> int) + .equ CP_CONVERT_D_TO_I, 0x00004006 ; CONVERT (d.p.-> int) + .equ CP_CONVERT_F_TO_D, 0x00008000 ; CONVERT (s.p.-> d.p.) + .equ CP_CONVERT_D_TO_F, 0x00004000 ; CONVERT (d.p.-> s.p.) +; +; +;======================================================================== +; +; operand select codes (instruction word fields PMS, QMS, TMS). +; +;======================================================================== +; +; + .equ CP_P_EQ_R, 0x00000000 + .equ CP_P_EQ_S, 0x01000000 + .equ CP_P_EQ_0, 0x02000000 + .equ CP_P_EQ_ONE_HALF, 0x03000000 + .equ CP_P_EQ_IMINUS1, 0x03000000 + .equ CP_P_EQ_1, 0x04000000 + .equ CP_P_EQ_2, 0x05000000 + .equ CP_P_EQ_3, 0x06000000 + .equ CP_P_EQ_PI, 0x07000000 + .equ CP_P_EQ_IMINUSMAX, 0x07000000 + .equ CP_P_EQ_RF0, 0x08000000 + .equ CP_P_EQ_RF1, 0x09000000 + .equ CP_P_EQ_RF2, 0x0A000000 + .equ CP_P_EQ_RF3, 0x0B000000 + .equ CP_P_EQ_RF4, 0x0C000000 + .equ CP_P_EQ_RF5, 0x0D000000 + .equ CP_P_EQ_RF6, 0x0E000000 + .equ CP_P_EQ_RF7, 0x0F000000 +; + .equ CP_Q_EQ_R, 0x00000000 + .equ CP_Q_EQ_S, 0x00100000 + .equ CP_Q_EQ_0, 0x00200000 + .equ CP_Q_EQ_ONE_HALF, 0x00300000 + .equ CP_Q_EQ_IMINUS1, 0x00300000 + .equ CP_Q_EQ_1, 0x00400000 + .equ CP_Q_EQ_2, 0x00500000 + .equ CP_Q_EQ_3, 0x00600000 + .equ CP_Q_EQ_PI, 0x00700000 + .equ CP_Q_EQ_IMINUSMAX, 0x00700000 + .equ CP_Q_EQ_RF0, 0x00800000 + .equ CP_Q_EQ_RF1, 0x00900000 + .equ CP_Q_EQ_RF2, 0x00A00000 + .equ CP_Q_EQ_RF3, 0x00B00000 + .equ CP_Q_EQ_RF4, 0x00C00000 + .equ CP_Q_EQ_RF5, 0x00D00000 + .equ CP_Q_EQ_RF6, 0x00E00000 + .equ CP_Q_EQ_RF7, 0x00F00000 +; + .equ CP_T_EQ_R, 0x00000000 + .equ CP_T_EQ_S, 0x00010000 + .equ CP_T_EQ_0, 0x00020000 + .equ CP_T_EQ_ONE_HALF, 0x00030000 + .equ CP_T_EQ_IMINUS1, 0x00030000 + .equ CP_T_EQ_1, 0x00040000 + .equ CP_T_EQ_2, 0x00050000 + .equ CP_T_EQ_3, 0x00060000 + .equ CP_T_EQ_PI, 0x00070000 + .equ CP_T_EQ_IMINUSMAX, 0x00070000 + .equ CP_T_EQ_RF0, 0x00080000 + .equ CP_T_EQ_RF1, 0x00090000 + .equ CP_T_EQ_RF2, 0x000A0000 + .equ CP_T_EQ_RF3, 0x000B0000 + .equ CP_T_EQ_RF4, 0x000C0000 + .equ CP_T_EQ_RF5, 0x000D0000 + .equ CP_T_EQ_RF6, 0x000E0000 + .equ CP_T_EQ_RF7, 0x000F0000 +; +; +;======================================================================== +; +; destination select codes (instruction word fields RF, RFS) +; +;======================================================================== +; +; + .equ CP_DEST_EQ_GP, 0x00000000 + .equ CP_DEST_EQ_RF0, 0x80000000 + .equ CP_DEST_EQ_RF1, 0x90000000 + .equ CP_DEST_EQ_RF2, 0xA0000000 + .equ CP_DEST_EQ_RF3, 0xB0000000 + .equ CP_DEST_EQ_RF4, 0xC0000000 + .equ CP_DEST_EQ_RF5, 0xD0000000 + .equ CP_DEST_EQ_RF6, 0xE0000000 + .equ CP_DEST_EQ_RF7, 0xF0000000 +; +; +; ______________________________________________________________________ +;|______________________________________________________________________| +;| | +;| SYMBOLS FOR DEFINING THE MODE REGISTER DOUBLE WORD | +;| | +;|______________________________________________________________________| +;|______________________________________________________________________| +; +; +; + .equ CP_PFF_MASK, 0x00000003 ; primary f.p. format mask + .equ CP_PFF_EQ_IEEE, 0x00000000 ; primary f.p. format = IEEE + .equ CP_PFF_EQ_DECD, 0x00000001 ; primary f.p. format = DEC D + .equ CP_PFF_EQ_DECG, 0x00000002 ; primary f.p. format = DEC G + .equ CP_PFF_EQ_IBM, 0x00000003 ; primary f.p. format = IBM + .equ CP_PFF_POSITION, 0 +; + .equ CP_AFF_MASK, 0x0000000C ; alternate f.p. format mask + .equ CP_AFF_EQ_IEEE, 0x00000000 ; alternate f.p. format = IEEE + .equ CP_AFF_EQ_DECD, 0x00000004 ; alternate f.p. format = DEC D + .equ CP_AFF_EQ_DECG, 0x00000008 ; alternate f.p. format = DEC G + .equ CP_AFF_EQ_IBM, 0x0000000C ; alternate f.p. format = IBM + .equ CP_AFF_POSITION, 2 +; + .equ CP_SAT_MASK, 0x00000010 ; saturate mode (SAT) mask + .equ CP_SATURATE_MODE, 0x00000010 ; enable saturate mode (SAT=1) + .equ CP_SAT_POSITION, 4 +; + .equ CP_AP_MASK, 0x00000020 ; affine/proj. mode (AP) mask + .equ CP_AFFINE_MODE, 0x00000020 ; enable affine mode (AP=1) + .equ CP_PROJECTIVE_MODE, 0x00000000 ; enable projective mode (AP=0) + .equ CP_AP_POSITION, 5 +; + .equ CP_TRP_MASK, 0x00000040 ; IEEE trap mode (TRP) mask + .equ CP_IEEE_TRAPS_ENABLED, 0x00000040 ; IEEE trap mode enabled (TRP=1) + .equ CP_IEEE_TRAPS_DISABLED, 0x00000000 ; IEEE trap mode disabled (TRP=0) + .equ CP_TRP_POSITION, 6 +; + .equ CP_SU_MASK, 0x00000080 ; IEEE sud. uflow (SU) mask + .equ CP_IEEE_SUDDEN_UFLOW_MODE, 0x00000080 ; IEEE sud. uflow mode (SU=1) + .equ CP_IEEE_GRADUAL_UFLOW_MODE,0x00000000 ; IEEE grad uflow mode (SU=0) + .equ CP_SU_POSITION, 7 +; + .equ CP_BS_MASK, 0x00000100 ; IBM sig. mask (BS) + .equ CP_BS_POSITION, 8 +; + .equ CP_BU_MASK, 0x00000200 ; IBM underflow mask (BU) + .equ CP_BU_POSITION, 9 +; + .equ CP_MS_MASK, 0x00000800 ; signed int. mpy (MS) mask + .equ CP_SIGNED_INT_MPY_MODE, 0x00000800 ; signed int. mpy mode (MS=1) + .equ CP_UNSIGNED_INT_MPY_MODE, 0x00000000 ; unsigned int. mpy mode (MS=0) + .equ CP_MS_POSITION, 11 +; + .equ CP_MF_MASK, 0x00003000 ; int. mult. fmt. mode (MF) mask + .equ CP_MF_EQ_LSBS, 0x00000000 ; int. mult. fmt. = LSBs + .equ CP_MF_EQ_LSBSFA, 0x00001000 ; int. mult. fmt. = LSBs,fmt. adj. + .equ CP_MF_EQ_MSBS, 0x00002000 ; int. mult. fmt. = MSBs + .equ CP_MF_EQ_MSBSFA, 0x00003000 ; int. mult. fmt. = MSBs,fmt. adj. + .equ CP_MF_POSITION, 12 +; + .equ CP_RMS_MASK, 0x0001C000 ; round mode (RMS) mask + .equ CP_RMS_EQ_NEAREST, 0x00000000 ; round mode = to nearest + .equ CP_RMS_EQ_MINUS_INF, 0x00004000 ; round mode = toward -oo + .equ CP_RMS_EQ_PLUS_INF, 0x00008000 ; round mode = toward +oo + .equ CP_RMS_EQ_ZERO, 0x0000C000 ; round mode = toward zero + .equ CP_RMS_POSITION, 14 +; + .equ CP_PL_MASK, 0x00100000 ; pipeline mode (PL) mask + .equ CP_FLOWTHROUGH_MODE, 0x00000000 ; select flow-through mode + .equ CP_PIPELINE_MODE, 0x00100000 ; select pipeline mode + .equ CP_PL_POSITION, 20 +; + .equ CP_INVALID_OP_EXCP_MASK, 0x00400000 ; invalid operation excp. mask(IM) + .equ CP_RESERVED_OP_EXCP_MASK,0x00800000 ; reserved operand excp. mask(RM) + .equ CP_OVERFLOW_EXCP_MASK, 0x01000000 ; overflow exception mask (VM) + .equ CP_UNDERFLOW_EXCP_MASK, 0x02000000 ; underflow exception mask(UM) + .equ CP_INEXACT_EXCP_MASK, 0x04000000 ; inexact result excp. mask(XM) + .equ CP_ZERO_EXCP_MASK, 0x08000000 ; zero result exception mask (ZM) + .equ CP_EXCPS_POSITION, 22 +; + .equ CP_PLTC_MASK, 0x0000000F ; pipeline timer count (PLTC) mask + .equ CP_PLTC_EQ_2, 0x00000002 ; pipeline timer count = 2 + .equ CP_PLTC_EQ_3, 0x00000003 ; pipeline timer count = 3 + .equ CP_PLTC_EQ_4, 0x00000004 ; pipeline timer count = 4 + .equ CP_PLTC_EQ_5, 0x00000005 ; pipeline timer count = 5 + .equ CP_PLTC_EQ_6, 0x00000006 ; pipeline timer count = 6 + .equ CP_PLTC_EQ_7, 0x00000007 ; pipeline timer count = 7 + .equ CP_PLTC_EQ_8, 0x00000008 ; pipeline timer count = 8 + .equ CP_PLTC_EQ_9, 0x00000009 ; pipeline timer count = 9 + .equ CP_PLTC_EQ_10, 0x0000000A ; pipeline timer count = 10 + .equ CP_PLTC_EQ_11, 0x0000000B ; pipeline timer count = 11 + .equ CP_PLTC_EQ_12, 0x0000000C ; pipeline timer count = 12 + .equ CP_PLTC_EQ_13, 0x0000000D ; pipeline timer count = 13 + .equ CP_PLTC_EQ_14, 0x0000000E ; pipeline timer count = 14 + .equ CP_PLTC_EQ_15, 0x0000000F ; pipeline timer count = 15 + .equ CP_PLTC_POSITION, 0 +; + .equ CP_MATC_MASK, 0x000000F0 ; mpy-acc timer count (MATC) mask + .equ CP_MATC_EQ_2, 0x00000020 ; mpy-acc timer count = 2 + .equ CP_MATC_EQ_3, 0x00000030 ; mpy-acc timer count = 3 + .equ CP_MATC_EQ_4, 0x00000040 ; mpy-acc timer count = 4 + .equ CP_MATC_EQ_5, 0x00000050 ; mpy-acc timer count = 5 + .equ CP_MATC_EQ_6, 0x00000060 ; mpy-acc timer count = 6 + .equ CP_MATC_EQ_7, 0x00000070 ; mpy-acc timer count = 7 + .equ CP_MATC_EQ_8, 0x00000080 ; mpy-acc timer count = 8 + .equ CP_MATC_EQ_9, 0x00000090 ; mpy-acc timer count = 9 + .equ CP_MATC_EQ_10, 0x000000A0 ; mpy-acc timer count = 10 + .equ CP_MATC_EQ_11, 0x000000B0 ; mpy-acc timer count = 11 + .equ CP_MATC_EQ_12, 0x000000C0 ; mpy-acc timer count = 12 + .equ CP_MATC_EQ_13, 0x000000D0 ; mpy-acc timer count = 13 + .equ CP_MATC_EQ_14, 0x000000E0 ; mpy-acc timer count = 14 + .equ CP_MATC_EQ_15, 0x000000F0 ; mpy-acc timer count = 15 + .equ CP_MATC_POSITION, 4 +; + .equ CP_MVTC_MASK, 0x00000F00 ; MOVE P timer count (MVTC) mask + .equ CP_MVTC_EQ_2, 0x00000200 ; MOVE P timer count = 2 + .equ CP_MVTC_EQ_3, 0x00000300 ; MOVE P timer count = 3 + .equ CP_MVTC_EQ_4, 0x00000400 ; MOVE P timer count = 4 + .equ CP_MVTC_EQ_5, 0x00000500 ; MOVE P timer count = 5 + .equ CP_MVTC_EQ_6, 0x00000600 ; MOVE P timer count = 6 + .equ CP_MVTC_EQ_7, 0x00000700 ; MOVE P timer count = 7 + .equ CP_MVTC_EQ_8, 0x00000800 ; MOVE P timer count = 8 + .equ CP_MVTC_EQ_9, 0x00000900 ; MOVE P timer count = 9 + .equ CP_MVTC_EQ_10, 0x00000A00 ; MOVE P timer count = 10 + .equ CP_MVTC_EQ_11, 0x00000B00 ; MOVE P timer count = 11 + .equ CP_MVTC_EQ_12, 0x00000C00 ; MOVE P timer count = 12 + .equ CP_MVTC_EQ_13, 0x00000D00 ; MOVE P timer count = 13 + .equ CP_MVTC_EQ_14, 0x00000E00 ; MOVE P timer count = 14 + .equ CP_MVTC_EQ_15, 0x00000F00 ; MOVE P timer count = 15 + .equ CP_MVTC_POSITION, 8 +; + .equ CP_AD_MASK, 0x00001000 ; + .equ CP_ADVANCE_DRDY_MODE, 0x00001000 ; + .equ CP_NORMAL_DRDY_MODE, 0x00000000 ; + .equ CP_AD_POSITION, 12 +; + .equ CP_HE_MASK, 0x00002000 ; Halt-on-error mask (HE) + .equ CP_HALT_ON_ERROR_ENABLED, 0x00002000 ; Halt-on-error enabled (HE=1) + .equ CP_HALT_ON_ERROR_DISABLED,0x00000000 ; Halt-on-error disabled (HE=0) + .equ CP_HE_POSITION, 13 +; + .equ CP_EX_MASK, 0x00004000 ; EXCP enable mask (EX) + .equ CP_EXCP_ENABLED, 0x00004000 ; EXCP enabled (EX=1) + .equ CP_EXCP_DISABLED, 0x00000000 ; EXCP disabled (EX=0) + .equ CP_EX_POSITION, 14 +; +; +; +; ______________________________________________________________________ +;|______________________________________________________________________| +;| | +;| SYMBOLS FOR DEFINING THE STATUS REGISTER WORD | +;| | +;|______________________________________________________________________| +;|______________________________________________________________________| +; +; + .equ CP_INVALID_OP_EXCP, 0x00000001 + .equ CP_INVALID_OP_EXCP_POSITION, 0 +; + .equ CP_RESERVED_OP_EXCP, 0x00000002 + .equ CP_RESERVED_OP_EXCP_POSITION, 1 +; + .equ CP_OVERFLOW_EXCP, 0x00000004 + .equ CP_OVERFLOW_EXCP_POSITION, 2 +; + .equ CP_UNDERFLOW_EXCP, 0x00000008 + .equ CP_UNDERFLOW_EXCP_POSITION, 3 +; + .equ CP_INEXACT_EXCP, 0x00000010 + .equ CP_INEXACT_EXCP_POSITION, 4 +; + .equ CP_ZERO_EXCP, 0x00000020 + .equ CP_ZERO_EXCP_POSITION, 5 +; + .equ CP_EXCP_STATUS_MASK, 0x00000040 + .equ CP_EXCP_STATUS_FLAG_POSITION, 6 +; + .equ CP_R_TEMP_VALID_MASK, 0x00000080 + .equ R_TEMP_VALID_POSITION, 7 +; + .equ CP_S_TEMP_VALID_MASK, 0x00000100 + .equ CP_S_TEMP_VALID_POSITION, 8 +; + .equ CP_I_TEMP_VALID_FLAG, 0x00000200 + .equ CP_I_TEMP_VALID_POSITION, 9 +; + .equ CP_OPERATION_PENDING_MASK, 0x00000400 + .equ CP_OPERATION_PENDING_POSITION,10 +; +; +; ______________________________________________________________________ +;|______________________________________________________________________| +;| | +;| SYMBOLS FOR DEFINING THE FLAG REGISTER WORD | +;| | +;|______________________________________________________________________| +;|______________________________________________________________________| +; +; + .equ CP_INVALID_OP_FLAG, 0x00000001 + .equ CP_INVALID_OP_FLAG_POSITION, 0 +; + .equ CP_CARRY_FLAG, 0x00000001 + .equ CP_CARRY_FLAG_POSITION, 0 +; + .equ CP_RESERVED_OP_FLAG, 0x00000002 + .equ CP_RESERVED_OP_FLAG_POSITION, 1 +; + .equ CP_OVERFLOW_FLAG, 0x00000004 + .equ CP_OVERFLOW_FLAG_POSITION, 2 +; + .equ CP_UNORDERED_FLAG, 0x00000004 + .equ CP_UNORDERED_FLAG_POSITION, 2 +; + .equ CP_UNDERFLOW_FLAG, 0x00000008 + .equ CP_UNDERFLOW_FLAG_POSITION, 3 +; + .equ CP_LESS_THAN_FLAG, 0x00000008 + .equ CP_LESS_THAN_POSITION, 3 +; + .equ CP_WINNER_FLAG, 0x00000008 + .equ CP_WINNER_FLAG_POSITION, 3 +; + .equ CP_INEXACT_FLAG, 0x00000010 + .equ CP_INEXACT_FLAG_POSITION, 4 +; + .equ CP_GREATER_THAN_FLAG, 0x00000010 + .equ CP_GREATER_THAN_FLAG_POSITION,4 +; + .equ CP_ZERO_FLAG, 0x00000020 + .equ CP_ZERO_FLAG_POSITION, 5 +; + .equ CP_EQUAL_FLAG, 0x00000020 + .equ CP_EQUAL_FLAG_POSITION, 5 +; + .equ CP_SIGN_FLAG, 0x00000040 + .equ CP_SIGN_FLAG_POSITION, 6 +; +; +; ______________________________________________________________________ +;|______________________________________________________________________| +;| | +;| SYMBOLS FOR TRANSACTION REQUEST TYPES | +;| | +;|______________________________________________________________________| +;|______________________________________________________________________| +; +; +; write requests +; +; Note: Each WRITE_* transaction request, plus ADV_TEMPS sets the CA +; (Coprocessor Active) bit in the 29000 Current Processor Status Register. +; + .equ CP_WRITE_R, 0x20 ;write sing or doub to R register + .equ CP_WRITE_S, 0x21 ;write sing or doub to S register + .equ CP_WRITE_RS, 0x22 ;write sing operands to R and S + .equ CP_WRITE_MODE, 0x23 ;write mode double word to 29027 + .equ CP_WRITE_STATUS, 0x24 ;write status word to 29027 + .equ CP_WRITE_PREC, 0x25 ;write reg. file precision word + ; to 29027 + .equ CP_WRITE_INST, 0x26 ;write instruction to 29027 + .equ CP_ADV_TEMPS, 0x27 ;move R-Temp, S-Temp into R,S +; +; read requests +; + .equ CP_READ_MSBS, 0x00 ;read sing result or MSB of doub + .equ CP_READ_LSBS, 0x01 ;read LSB of doub result + .equ CP_READ_FLAGS, 0x02 ;read 29027 flag register + .equ CP_READ_STATUS, 0x03 ;read 29027 status register + .equ CP_SAVE_STATE, 0x04 ;read one word of 29027 state +; +; "start operation" symbol; this is "OR"ed with a WRITE_R, WRITE_S, +; WRITE_RS, or WRITE_INST symbol. +; + + .equ CP_START, 0b1000000 ;bit to start 29027 operation +; +; "suppress exceptions reporting" symbol; this is "OR"ed with a ed +; +; + + .equ CP_NO_ERR, 0b1000000 ;suppress exception reporting +; ; during load. +; cp_write_r - transfers 32- or 64-bit operand to Am29027 +; register R +; cp_write_s - transfers 32- or 64-bit operand to Am29027 +; register S +; cp_write_rs - transfers two 32-bit floating-point operands to +; Am29027 registers R and S +; cp_write_prec - transfers a word to the Am29027 precision register +; cp_write_status - transfers a word to the Am29027 status register +; cp_write_inst - transfers an instruction to the Am29027 +; instruction register +; cp_advance_temps - transfers the contents of the Am29027 temporary +; registers to the corresponding working registers +; cp_write_mode - transfers a mode specification the the Am29027 +; mode register +; cp_read_dp - read a double-precision floating-point result +; from the Am29027 +; cp_read_sp - read a single-precision floating-point result +; from the Am29027 +; cp_read_int - read an integer result from the Am29027 +; cp_read_flags - read the contents of the Am29027 flag register +; cp_read_status - read the contents of the Am29027 status register +; cp_read_state_wd - read a single Am29027 state word +; cp_save_state - save Am29027 state +; cp_restore_state - restore Am29027 state +; cp_build_inst - build an Am29027 instruction +; cp_build_inst_h - build 16 MSBs of an Am29027 instruction +; cp_build_inst_l - build 16 LSBs of an Am29027 instruction +; +; +; +;============================================================================ +; MACRO NAME: cp_write_r +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 16, 1988 +; +; FUNCTION: Transfers a 32- or 64-bit operand to Am29027 input register R +; +; PARAMETERS: +; reg - the Am29000 g.p. register containing the 32-bit operand to be +; transferred, or the 32 MSBs of the 64-bit operand to be +; transferred. +; +; LSB_reg - the Am29000 g.p. register containing the 32 LSBs of the +; 64-bit operand to be transferred +; +; INT - indicates that the operand to be transferred is a 32-bit +; integer +; +; START - indicates that a new Am29027 operation is to be started +; once the operand has been transferred +; +; +; USAGE: +; +; cp_write_r reg [,LSB_reg] [,START] for floating-point operands +; or cp_write_r reg, INT [,START] for integer operands +; +; Transferring double-precision floating-point operands - Either of +; two forms is acceptable: +; +; cp_write_r reg +; or cp_write_r reg, LSB_reg +; +; If LSB_reg is omitted, the LSBs are taken from the next g.p. +; register. +; +; Ex: cp_write_r lr2 Transfers the contents of lr2 to +; the most-significant half of Am29027 +; register R, and the contents of lr3 +; to the least-significant half. +; +; cp_write_r lr2,lr5 Transfers the contents of lr2 to +; the most-significant half of Am29027 +; register R, and the contents of lr5 +; to the least-significant half. +; +; +; Transferring single-precision floating-point operands - Use the +; form: +; +; cp_write_r reg +; +; +; Ex: cp_write_r lr2 Transfers the contents of lr2 to +; the most-significant half of Am29027 +; register R, (the contents of lr3 +; will be transferred to the least- +; significant half of register R, but +; these bits are don't cares). +; +; +; Transferring integer operands - Use the form: +; +; cp_write_r reg,INT +; +; +; Ex: cp_write_r lr2,INT Transfers the contents of lr2 to +; the least-significant half of Am29027 +; register R, (the contents of lr2 +; will also be transferred to the most- +; significant half of register R, but +; these bits are don't cares). +; +; +; Starting an Am29027 operation - Any of the forms above may be +; appended with parameter START, e.g.: +; +; cp_write_r lr2,START +; +; cp_write_r lr2,lr5,START +; +; cp_write_r lr2,INT,START +; +; +;============================================================================ +; + .macro cp_write_r,p1,p2,p3 +; + .if $narg==0 + .err + .print "cp_WRITE_R: missing parameter(s)" + .endif +; +; + .if $narg==1 + store 1,CP_WRITE_R,p1,%%((&p1)+1) + .exitm + .endif +; +; + .if $narg==2 +; + .ifeqs "@p2@","INT" + store 1,CP_WRITE_R,p1,p1 + .exitm + .endif +; + .ifeqs "@p2@","START" + store 1,CP_WRITE_R|CP_START,p1,%%((&p1)+1) + .exitm + .endif +; + store 1,CP_WRITE_R,p1,p2 + .exitm +; + .endif +; +; + .if $narg==3 +; + .ifeqs "@p2@","START" + .ifeqs "@p3@","INT" + store 1,CP_WRITE_R|CP_START,p1,p1 + .else + .err + .print "cp_write_r: bad parameter list" + .endif + .exitm + .endif +; + .ifeqs "@p2@","INT" + .ifeqs "@p3@","START" + store 1,CP_WRITE_R|CP_START,p1,p1 + .else + .err + .print "cp_write_r: bad parameter list" + .endif + .exitm + .endif +; + .ifeqs "@p3@","START" + store 1,CP_WRITE_R|CP_START,p1,p2 + .else + .err + .print "cp_write_r: bad parameter list" + .endif + .exitm +; + .endif +; +; + .if $narg>=4 + .err + .print "cp_write_r: too many parameters" + .endif +; + .endm +; +; +; +; +; +;============================================================================ +; MACRO NAME: cp_write_s +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 16, 1988 +; +; FUNCTION: Transfers a 32- or 64-bit operand to Am29027 input register S +; +; PARAMETERS: +; reg - the Am29000 g.p. register containing the 32-bit operand to be +; transferred, or the 32 MSBs of the 64-bit operand to be +; transferred. +; +; LSB_reg - the Am29000 g.p. register containing the 32 LSBs of the +; 64-bit operand to be transferred +; +; INT - indicates that the operand to be transferred is a 32-bit +; integer +; +; START - indicates that a new Am29027 operation is to be started +; once the operand has been transferred +; +; +; USAGE: +; +; cp_write_s reg [,LSB_reg] [,START] for floating-point operands +; or cp_write_s reg, INT [,START] for integer operands +; +; Transferring double-precision floating-point operands - Either of +; two forms is acceptable: +; +; cp_write_s reg +; or cp_write_s reg, LSB_reg +; +; If LSB_reg is omitted, the LSBs are taken from the next g.p. +; register. +; +; Ex: cp_write_s lr2 Transfers the contents of lr2 to +; the most-significant half of Am29027 +; register S, and the contents of lr3 +; to the least-significant half. +; +; cp_write_s lr2,lr5 Transfers the contents of lr2 to +; the most-significant half of Am29027 +; register S, and the contents of lr5 +; to the least-significant half. +; +; +; Transferring single-precision floating-point operands - Use the +; form: +; +; cp_write_s reg +; +; +; Ex: cp_write_s lr2 Transfers the contents of lr2 to +; the most-significant half of Am29027 +; register S, (the contents of lr3 +; will be transferred to the least- +; significant half of register S, but +; these bits are don't cares). +; +; +; Transferring integer operands - Use the form: +; +; cp_write_s reg,INT +; +; +; Ex: cp_write_s lr2,INT Transfers the contents of lr2 to +; the least-significant half of Am29027 +; register S, (the contents of lr2 +; will also be transferred to the most- +; significant half of register S, but +; these bits are don't cares). +; +; +; Starting an Am29027 operation - Any of the forms above may be +; appended with parameter START, e.g.: +; +; cp_write_s lr2,START +; +; cp_write_s lr2,lr5,START +; +; cp_write_s lr2,INT,START +; +; +;============================================================================ +; + .macro cp_write_s,p1,p2,p3 +; + .if $narg==0 + .err + .print "cp_write_s: missing parameter(s)" + .endif +; +; + .if $narg==1 + store 1,CP_WRITE_S,p1,%%((&p1)+1) + .exitm + .endif +; +; + .if $narg==2 +; + .ifeqs "@p2@","INT" + store 1,CP_WRITE_S,p1,p1 + .exitm + .endif +; + .ifeqs "@p2@","START" + store 1,CP_WRITE_S|CP_START,p1,%%((&p1)+1) + .exitm + .endif +; + store 1,CP_WRITE_S,p1,p2 + .exitm +; + .endif +; +; + .if $narg==3 +; + .ifeqs "@p2@","START" + .ifeqs "@p3@","INT" + store 1,CP_WRITE_S|CP_START,p1,p1 + .else + .err + .print "cp_write_s: bad parameter list" + .endif + .exitm + .endif +; + .ifeqs "@p2@","INT" + .ifeqs "@p3@","START" + store 1,CP_WRITE_S|CP_START,p1,p1 + .else + .err + .print "cp_write_s: bad parameter list" + .endif + .exitm + .endif +; + .ifeqs "@p3@","START" + store 1,CP_WRITE_S|CP_START,p1,p2 + .else + .err + .print "cp_write_s: bad parameter list" + .endif + .exitm +; + .endif +; +; + .if $narg>=4 + .err + .print "cp_write_s: too many parameters" + .endif +; + .endm +; +; +; +; +;============================================================================ +; MACRO NAME: cp_write_rs +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 16, 1988 +; +; FUNCTION: Transfers two 32-bit floating-point operands to Am29027 +; input registers R and S +; +; PARAMETERS: +; reg1 - the Am29000 g.p. register containing the 32-bit operand to be +; transferred to register R +; +; reg2 - the Am29000 g.p. register containing the 32-bit operand to be +; transferred to register S +; +; START - indicates that a new Am29027 operation is to be started +; once the operands have been transferred +; +; +; USAGE: +; +; cp_write_rs reg1, reg2 [,START] +; +; Ex: cp_write_rs lr2,lr5 Transfers the contents of lr2 to +; the most-significant half of Am29027 +; register R, and the contents of lr5 +; to the most-significant half of Am29027 +; register S. +; +; cp_write_rs lr2,lr5,START Transfers the contents of lr2 to +; the most-significant half of Am29027 +; register R, and the contents of lr5 +; to the most-significant half of Am29027 +; register S; a new operation is started +; once the transfer is complete. +; +; +; +;============================================================================ +; + .macro cp_write_rs,p1,p2,p3 +; +; + .if $narg<=1 + .err + .print "cp_write_rs: missing parameter(s)" + .exitm + .endif +; +; + .if $narg==2 + .ifeqs "@p2@","START" + .err + .print "cp_write_rs: bad parameter list" + .else + store 1,CP_WRITE_RS,p1,p2 + .endif + .exitm + .endif +; +; + .if $narg==3 + .ifeqs "@p3@","START" + store 1,CP_WRITE_RS|CP_START,p1,p2 + .else + .err + .print "cp_write_rs: bad parameter list" + .endif + .exitm + .endif +; +; + .if $narg>=4 + .err + .print "cp_write_rs: too many parameters" + .exitm + .endif +; + .endm +; +; +; +; +; +; +;============================================================================ +; MACRO NAME: cp_write_prec +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 16, 1988 +; +; FUNCTION: Transfers a word to the Am29027 precision register +; +; PARAMETERS: +; reg - the Am29000 g.p. register containing the word to be +; transferred to the Am29027 precision register +; +; USAGE: +; +; cp_write_prec reg +; +; Ex: cp_write_prec lr2 Transfers the contents of lr2 to +; the Am29027 precision register. +; +; +;============================================================================ +; + .macro cp_write_prec,p1 +; +; + .if $narg!=1 + .err + .print "cp_write_prec: bad parameter list" + .else + store 1,CP_WRITE_PREC,p1,0 + .endif +; + .endm +; +; +; +; +; +; +;============================================================================ +; MACRO NAME: cp_write_status +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 16, 1988 +; +; FUNCTION: Transfers a word to the Am29027 precision register +; +; PARAMETERS: +; reg - the Am29000 g.p. register containing the word to be +; transferred to the Am29027 status register +; +; RESTORE - indicates that this is the last step of a state restoration +; sequence (flow-through mode only) +; +; INVALIDATE - indicates that the current contents of the ALU pipeline +; register are to be invalidated (pipeline mode only) +; +; USAGE: +; +; cp_write_status reg [,RESTORE|INVALIDATE] +; +; Ex: cp_write_status lr2 Transfers the contents of lr2 to +; the Am29027 status register. +; +; +; cp_write_status lr2,RESTORE Transfers the contents of lr2 to +; the Am29027 status register, and +; completes the state restore +; sequence +; +; cp_write_status lr2,INVALIDATE Transfers the contents of lr2 to +; the Am29027 status register, and +; invalidates the contents of the +; ALU pipeline. +; +; +;============================================================================ +; + .macro cp_write_status,p1,p2 +; + .if $narg==0 + .err + .print "cp_write_status: missing parameter(s)" + .endif +; +; + .if $narg==1 + store 1,CP_WRITE_STATUS,p1,0 + .exitm + .endif +; +; + .if $narg==2 +; + .ifeqs "@p2@","RESTORE" + store 1,CP_WRITE_STATUS|CP_START,p1,0 + .exitm + .endif +; + .ifeqs "@p2@","INVALIDATE" + store 1,CP_WRITE_STATUS|CP_START,p1,0 + .exitm + .endif +; + .err + .print "cp_write_status: bad parameter list" + .exitm +; + .endif +; +; + .if $narg >=3 + .err + .print "cp_write_status: too many parameters" + .exitm + .endif +; + .endm +; +; +; +; +; +;============================================================================ +; MACRO NAME: cp_write_inst +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 16, 1988 +; +; FUNCTION: Transfers an instruction word to the Am29027 instruction +; register +; +; PARAMETERS: +; reg - the Am29000 g.p. register containing the word to be +; transferred to the Am29027 instruction register +; +; START - indicates that a new Am29027 operation is to be started +; once the instruction word has been transferred +; +; USAGE: +; +; cp_write_inst reg [,START] +; +; Ex: cp_write_inst lr2 Transfers the contents of lr2 to +; the Am29027 instruction register. +; +; +; cp_write_inst lr2,START Transfers the contents of lr2 to +; the Am29027 status register; a +; new operation is started once the +; transfer is complete. +; +; +;============================================================================ +; + .macro cp_write_inst,p1,p2 +; + .if $narg==0 + .err + .print "cp_write_inst: missing parameter(s)" + .endif +; +; + .if $narg==1 + store 1,CP_WRITE_INST,p1,p1 + .exitm + .endif +; +; + .if $narg==2 +; + .ifeqs "@p2@","START" + store 1,CP_WRITE_INST|CP_START,p1,p1 + .else + .err + .print "cp_write_inst: bad parameter list" + .endif + .exitm +; + .endif +; +; + .if $narg >=3 + .err + .print "cp_write_inst: too many parameters" + .exitm + .endif +; + .endm +; +; +; +; +; +; +;============================================================================ +; MACRO NAME: cp_advance_temps +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 17, 1988 +; +; FUNCTION: Transfers the contents of Am29027 registers R-Temp, S-Temp, +; and I-Temp to register R, register S, and the instruction +; register, respectively. +; +; PARAMETERS: none +; +; USAGE: +; +; cp_advance_temps +; +; +; +;============================================================================ +; + .macro cp_advance_temps +; +; + .if $narg!=0 + .err + .print "cp_advance_temp: takes no parameters" + .else + store 1,CP_ADV_TEMPS,gr1,0 ; use gr1 because it's never protected + .endif +; + .endm +; +; +; +; +;============================================================================ +; MACRO NAME: cp_write_mode +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 17, 1988 +; +; FUNCTION: Transfers a 64-bit mode specification to the Am29027 mode +; register +; +; PARAMETERS: +; reg - the Am29000 g.p. register containing the 32 MSBs of the +; 64-bit mode specification to be transferred. +; +; LSB_reg - the Am29000 g.p. register containing the 32 LSBs of the +; 64-bit mode specification to be transferred. +; +; USAGE: +; +; cp_write_mode reg [,LSB_reg] +; +; Either of two forms is acceptable: +; +; cp_write_mode reg +; or cp_write_mode reg, LSB_reg +; +; If LSB_reg is omitted, the LSBs are taken from the next g.p. +; register. +; +; Ex: cp_write_mode lr2 Transfers the contents of lr2 to +; the most-significant half of the Am29027 +; mode register, and the contents of lr3 +; to the least-significant half. +; +; cp_write_mode lr2,lr5 Transfers the contents of lr2 to +; the most-significant half of the Am29027 +; mode register, and the contents of lr5 +; to the least-significant half. +; +; +; +;============================================================================ +; + .macro cp_write_mode,p1,p2 +; + .if $narg==0 + .err + .print "cp_write_mode: missing parameter(s)" + .endif +; +; + .if $narg==1 + store 1,CP_WRITE_MODE,%%((&p1)+1),p1 + .exitm + .endif +; +; + .if $narg==2 + store 1,CP_WRITE_MODE,p2,p1 + .exitm + .endif +; +; + .if $narg>=3 + .err + .print "cp_write_mode: too many parameters" + .endif +; + .endm +; +; +; +;============================================================================ +; MACRO NAME: cp_read_dp +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 17, 1988 +; +; FUNCTION: Transfers the current Am29027 double-precison floating-point +; result to the Am29000 +; +; PARAMETERS: +; reg - the Am29000 g.p. register into which the 32 MSBs of the +; current Am29027 result are to be written. +; +; LSB_reg - the Am29000 g.p. register into which the 32 LSBs of the +; current Am29027 result are to be written. +; +; NO_ERR - indicates that exception reporting is to be suppressed for this +; transfer. +; +; USAGE: +; +; cp_read_dp reg [,LSB_reg] [,START] +; +; Either of two forms is acceptable: +; +; cp_read_dp reg +; or cp_read_dp reg, LSB_reg +; +; If LSB_reg is omitted, the LSBs are written to the next g.p. register. +; +; Ex: cp_read_dp lr2 Transfers the 32 MSBs of the current +; Am29027 result to lr2, and the 32 LSBs +; to lr3. +; +; cp_read_dp lr2,lr5 Transfers the 32 MSBs of the current +; Am29027 result to lr2, and the 32 LSBs +; to lr5. +; +; Exception reporting can be suppressed by appending NO_ERR to either +; of the above, e.g.: +; +; cp_read_dp lr2,NO_ERR +; cp_read_dp lr2,lr5,NO_ERR +; +; +;============================================================================ +; + .macro cp_read_dp,p1,p2,p3 +; + .if $narg==0 + .err + .print "cp_read_dp: missing parameter(s)" + .endif +; +; + .if $narg==1 + load 1,CP_READ_LSBS,%%((&p1)+1),0 + load 1,CP_READ_MSBS,p1,0 + .exitm + .endif +; +; + .if $narg==2 +; + .ifeqs "@p2@","NO_ERR" + load 1,CP_READ_LSBS|CP_NO_ERR,%%((&p1)+1),0 + load 1,CP_READ_MSBS|CP_NO_ERR,p1,0 + .exitm + .endif +; + load 1,CP_READ_LSBS,p2,0 + load 1,CP_READ_MSBS,p1,0 + .exitm +; + .endif +; +; + .if $narg==3 +; + .ifeqs "@p3@","NO_ERR" + load 1,CP_READ_LSBS|CP_NO_ERR,p2,0 + load 1,CP_READ_MSBS|CP_NO_ERR,p1,0 + .else + .err + .print "cp_read_dp: bad parameter list" + .endif + .exitm +; + .endif +; +; + .if $narg>=4 + .err + .print "cp_read_dp: too many parameters" + .endif +; + .endm +; +; +; +;============================================================================ +; MACRO NAME: cp_read_sp +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 17, 1988 +; +; FUNCTION: Transfers the current Am29027 single-precison floating-point +; result to the Am29000 +; +; PARAMETERS: +; reg - the Am29000 g.p. register into which the current Am29027 +; result is to be written. +; +; NO_ERR - indicates that exception reporting is to be suppressed for this +; transfer. +; +; USAGE: +; +; cp_read_sp reg [,START] +; +; Ex: cp_read_sp lr2 Transfers the current Am29027 result +; to lr2. +; +; cp_read_sp lr2,NO_ERR Transfers the current Am29027 result +; to lr2, and suppresses exception +; reporting for this transfer. +; +; +;============================================================================ +; + .macro cp_read_sp,p1,p2 +; + .if $narg==0 + .err + .print "cp_read_sp: missing parameter(s)" + .endif +; +; + .if $narg==1 + load 1,CP_READ_MSBS,p1,0 + .exitm + .endif +; +; + .if $narg==2 +; + .ifeqs "@p2@","NO_ERR" + load 1,CP_READ_MSBS|CP_NO_ERR,p1,0 + .else + .err + .print "cp_read_sp: bad parameter list" + .endif + .exitm +; + .endif +; +; + .if $narg>=3 + .err + .print "cp_read_sp: too many parameters" + .endif +; + .endm +; +; +; +;============================================================================ +; MACRO NAME: cp_read_int +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 17, 1988 +; +; FUNCTION: Transfers the current Am29027 integer result to the Am29000 +; +; PARAMETERS: +; reg - the Am29000 g.p. register into which the current Am29027 +; result is to be written. +; +; NO_ERR - indicates that exception reporting is to be suppressed for this +; transfer. +; +; USAGE: +; +; cp_read_int reg [,START] +; +; Ex: cp_read_int lr2 Transfers the current Am29027 result +; to lr2. +; +; cp_read_int lr2,NO_ERR Transfers the current Am29027 result +; to lr2, and suppresses exception +; reporting for this transfer. +; +; +;============================================================================ +; + .macro cp_read_int,p1,p2 +; + .if $narg==0 + .err + .print "cp_read_int: missing parameter(s)" + .endif +; +; + .if $narg==1 + load 1,CP_READ_LSBS,p1,0 + nop ; leave a cycle for the MSBs to come out + .exitm + .endif +; +; + .if $narg==2 +; + .ifeqs "@p2@","NO_ERR" + load 1,CP_READ_LSBS|CP_NO_ERR,p1,0 + nop ; leave a cycle for the MSBs to come out + .else + .err + .print "cp_read_int: bad parameter list" + .endif + .exitm +; + .endif +; +; + .if $narg>=3 + .err + .print "cp_read_int: too many parameters" + .endif +; + .endm +; +; +; +;============================================================================ +; MACRO NAME: cp_read_flags +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 17, 1988 +; +; FUNCTION: Transfers the contents of the Am29027 flag register +; to the Am29000 +; +; PARAMETERS: +; reg - the Am29000 g.p. register into which the current Am29027 +; flag register contents are to be written. +; +; NO_ERR - indicates that exception reporting is to be suppressed for this +; transfer. +; +; USAGE: +; +; cp_read_flags reg [,START] +; +; Ex: cp_read_flags lr2 Transfers the Am29027 flag register +; contents to lr2. +; +; cp_read_flags lr2,NO_ERR Transfers the Am29027 flag register +; contents to lr2, and suppresses +; exception reporting for this +; transfer. +; +; +;============================================================================ +; + .macro cp_read_flags,p1,p2 +; + .if $narg==0 + .err + .print "cp_read_flags: missing parameter(s)" + .endif +; +; + .if $narg==1 + load 1,CP_READ_FLAGS,p1,0 + .exitm + .endif +; +; + .if $narg==2 +; + .ifeqs "@p2@","NO_ERR" + load 1,CP_READ_FLAGS|CP_NO_ERR,p1,0 + .else + .err + .print "cp_read_flags: bad parameter list" + .endif + .exitm +; + .endif +; +; + .if $narg>=3 + .err + .print "cp_read_flags: too many parameters" + .endif +; + .endm +; +; +; +;============================================================================ +; MACRO NAME: cp_read_status +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 18, 1988 +; +; FUNCTION: Transfers the contents of the Am29027 status register +; to the Am29000 +; +; PARAMETERS: +; reg - the Am29000 g.p. register into which the current Am29027 +; status register contents are to be written. +; +; NO_ERR - indicates that exception reporting is to be suppressed for this +; transfer. +; +; USAGE: +; +; cp_read_status reg [,START] +; +; Ex: cp_read_status lr2 Transfers the Am29027 status register +; contents to lr2. +; +; cp_read_status lr2,NO_ERR Transfers the Am29027 status register +; contents to lr2, and suppresses +; exception reporting for this +; transfer. +; +; +;============================================================================ +; + .macro cp_read_status,p1,p2 +; + .if $narg==0 + .err + .print "cp_read_status: missing parameter(s)" + .endif +; +; + .if $narg==1 + load 1,CP_READ_STATUS,p1,0 + .exitm + .endif +; +; + .if $narg==2 +; + .ifeqs "@p2@","NO_ERR" + load 1,CP_READ_STATUS|CP_NO_ERR,p1,0 + .else + .err + .print "cp_read_status: bad parameter list" + .endif + .exitm +; + .endif +; +; + .if $narg>=3 + .err + .print "cp_read_status: too many parameters" + .endif +; + .endm +; +; +; +;============================================================================ +; MACRO NAME: cp_read_state_wd +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 18, 1988 +; +; FUNCTION: Transfers the next Am29027 state word to the Am29000 +; +; PARAMETERS: +; reg - the Am29000 g.p. register into which the next Am29027 +; state word contents are to be written. +; +; USAGE: +; +; cp_read_state_wd reg +; +; Ex: cp_read_state_wd lr2 Transfers the next Am29027 state word +; to lr2. +; +;============================================================================ +; + .macro cp_read_state_wd,p1 +; + .if $narg==0 + .err + .print "cp_read_state_wd: missing parameter" + .endif +; +; + .if $narg==1 + load 1,CP_SAVE_STATE,p1,0 + .exitm + .endif +; +; + .if $narg>=2 + .err + .print "cp_read_state_wd: too many parameters" + .endif +; + .endm +; +; +; +;============================================================================ +; MACRO NAME: cp_save_state +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 18, 1988 +; +; FUNCTION: Transfers the current Am29027 state to the Am29000 +; +; PARAMETERS: +; reg - the first of 30 Am29000 g.p. registers in which Am29027 state +; is saved. +; +; USAGE: +; +; cp_save_state reg +; +; This macro transfers the current Am29027 state to a block of 30 Am29000 +; registers. State is stored in the following order: +; +; reg instruction register +; reg+1 I-Temp +; reg+2 R MSBs +; reg+3 R LSBs +; reg+4 S MSBs +; reg+5 S LSBs +; reg+6 R-Temp MSBs +; reg+7 R-Temp LSBs +; reg+8 S-Temp MSBs +; reg+9 S-Temp LSBs +; reg+10 status +; reg+11 precision +; reg+12 RF0 MSBs +; reg+13 RF0 LSBs +; . . +; . . +; . . +; reg+26 RF7 MSBs +; reg+27 RF7 LSBs +; reg+28 mode MSBs +; reg+29 mode LSBs +; +; +; Ex: cp_save_state lr2 Transfers the current Am29027 state to +; the Am29000, starting at lr2. +; +; NOTES: +; 1) This macro stores all 64-bit quantities in "big-endian" order, +; i.e. MSBs first. For example, the 32 MSBs of register R are +; stored in reg+2, and the 32 LSBs are stored in reg+3. The Am29027 +; transfers these quantites in "little-endian" order; the macro +; is responsible for swapping MS and LS words. +; +;============================================================================ +; + .macro cp_save_state,p1 +; + .if $narg==0 + .err + .print "cp_save_state: missing parameter" + .endif +; +; + .if $narg==1 + cp_read_sp p1,NO_ERR + ;guarantee that we're at beginning of + ; save state sequence + cp_read_state_wd %%((&p1)+ 0) ; instruction + cp_read_state_wd %%((&p1)+ 1) ; I-Temp + cp_read_state_wd %%((&p1)+ 3) ; R MSBs + cp_read_state_wd %%((&p1)+ 2) ; R LSBs + cp_read_state_wd %%((&p1)+ 5) ; S MSBs + cp_read_state_wd %%((&p1)+ 4) ; S LSBs + cp_read_state_wd %%((&p1)+ 7) ; R-Temp MSBs + cp_read_state_wd %%((&p1)+ 6) ; R-Temp LSBs + cp_read_state_wd %%((&p1)+ 9) ; S-Temp MSBs + cp_read_state_wd %%((&p1)+ 8) ; S-Temp LSBs + cp_read_state_wd %%((&p1)+10) ; status + cp_read_state_wd %%((&p1)+11) ; precision + cp_read_state_wd %%((&p1)+13) ; RF0 MSBs + cp_read_state_wd %%((&p1)+12) ; RF0 LSBs + cp_read_state_wd %%((&p1)+15) ; RF1 MSBs + cp_read_state_wd %%((&p1)+14) ; RF1 LSBs + cp_read_state_wd %%((&p1)+17) ; RF2 MSBs + cp_read_state_wd %%((&p1)+16) ; RF2 LSBs + cp_read_state_wd %%((&p1)+19) ; RF3 MSBs + cp_read_state_wd %%((&p1)+18) ; RF3 LSBs + cp_read_state_wd %%((&p1)+21) ; RF4 MSBs + cp_read_state_wd %%((&p1)+20) ; RF4 LSBs + cp_read_state_wd %%((&p1)+23) ; RF5 MSBs + cp_read_state_wd %%((&p1)+22) ; RF5 LSBs + cp_read_state_wd %%((&p1)+25) ; RF6 MSBs + cp_read_state_wd %%((&p1)+24) ; RF6 LSBs + cp_read_state_wd %%((&p1)+27) ; RF7 MSBs + cp_read_state_wd %%((&p1)+26) ; RF7 LSBs + cp_read_state_wd %%((&p1)+29) ; mode MSBs + cp_read_state_wd %%((&p1)+28) ; mode LSBs + .exitm + .endif +; +; + .if $narg>=2 + .err + .print "cp_save_state: too many parameters" + .endif +; + .endm +; +; +; +; +; +;============================================================================ +; MACRO NAME: cp_restore_state +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 18, 1988 +; +; FUNCTION: Restores Am29027 state +; +; PARAMETERS: +; reg - the first of 30 Am29000 g.p. registers containing Am29027 +; state. +; +; temp - a scratch register used by cp_restore_state +; +; USAGE: +; +; cp_restore_state reg,temp +; +; This macro restores Am29027 state by transferring 30 words to the +; Am29027; these words are taken from a block of Am29000 g.p. registers +; starting at "reg." The words are assumed to be stored in the following +; order: +; +; reg instruction register +; reg+1 I-Temp +; reg+2 R MSBs +; reg+3 R LSBs +; reg+4 S MSBs +; reg+5 S LSBs +; reg+6 R-Temp MSBs +; reg+7 R-Temp LSBs +; reg+8 S-Temp MSBs +; reg+9 S-Temp LSBs +; reg+10 status +; reg+11 precision +; reg+12 RF0 MSBs +; reg+13 RF0 LSBs +; . . +; . . +; . . +; reg+26 RF7 MSBs +; reg+27 RF7 LSBs +; reg+28 mode MSBs +; reg+29 mode LSBs +; +; +; Ex: cp_restore_state lr2,gr70 Restores Am29027 state by +; transferring a block of 30 words +; that begins at lr2. Register gr70 +; is used as scratch storage by this +; macro. +; +; +;============================================================================ +; + .macro cp_restore_state,p1,p2 +; + .if $narg<=1 + .err + .print "cp_restore_state: missing parameter(s)" + .endif +; +; + .if $narg==2 + + const p2,0 ;clear the status register + cp_write_status p2 +; + cp_write_mode %%((&p1)+28) ;restore the mode register +; + const p2,0x80000018 ; restore RF0 + consth p2,0x80000018 + cp_write_inst p2 + cp_write_r %%((&p1)+12),START +; + consth p2,0x90000018 ; restore RF1 + cp_write_inst p2 + cp_write_r %%((&p1)+14),START +; + consth p2,0xA0000018 ; restore RF2 + cp_write_inst p2 + cp_write_r %%((&p1)+16),START +; + consth p2,0xB0000018 ; restore RF3 + cp_write_inst p2 + cp_write_r %%((&p1)+18),START +; + consth p2,0xC0000018 ; restore RF4 + cp_write_inst p2 + cp_write_r %%((&p1)+20),START +; + consth p2,0xD0000018 ; restore RF5 + cp_write_inst p2 + cp_write_r %%((&p1)+22),START +; + consth p2,0xE0000018 ; restore RF6 + cp_write_inst p2 + cp_write_r %%((&p1)+24),START +; + consth p2,0xF0000018 ; restore RF7 + cp_write_inst p2 + cp_write_r %%((&p1)+26),START +; + cp_read_sp p2 ; do a dummy read, to guarantee that + ; the last operation is complete +; + cp_write_prec %%((&p1)+11) ; restore precision +; + cp_write_r %%((&p1)+2) ; restore R + cp_write_s %%((&p1)+4) ; restore S + cp_write_inst %%((&p1)+0) ; restore instruction + cp_advance_temps ; move R,S, and inst. to working registers +; + cp_write_r %%((&p1)+6) ; restore R-Temp + cp_write_s %%((&p1)+8) ; restore S-Temp + cp_write_inst %%((&p1)+1) ; restore I-Temp +; +; restore the status register, retime last operation +; + cp_write_status %%((&p1)+10),RESTORE +; + .exitm + .endif +; +; + .if $narg>=3 + .err + .print "cp_restore_state: too many parameters" + .endif +; + .endm +; +; +; +;============================================================================ +; MACRO NAME: cp_build_inst +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 24, 1988 +; : January 4, 1989 Rich Parker +; +; FUNCTION: Builds a 32-bit Am29027 instruction in an Am29000 g.p. +; register. +; +; PARAMETERS: +; reg - the Am29000 g.p. register into which the instruction word +; is to be written +; +; op_code - mnemonic specifying the operation to be performed +; (e.g. FADD, P_TIMES_Q) +; +; precision - precision specification for destination, source operands: +; D_S - double-prec. result, single-prec. input(s) +; D_D - double-prec. result, double-prec. input(s) +; S_S - single-prec. result, single-prec. input(s) +; S_D - single-prec. result, double-prec. input(s) +; +; dest - destination for the operation result: +; RF0 - store result in Am29027 register file location RF0 +; RF1 - store result in Am29027 register file location RF1 +; RF2 - store result in Am29027 register file location RF2 +; RF3 - store result in Am29027 register file location RF3 +; RF4 - store result in Am29027 register file location RF4 +; RF5 - store result in Am29027 register file location RF5 +; RF6 - store result in Am29027 register file location RF6 +; RF7 - store result in Am29027 register file location RF7 +; GP - result is to be stored in an Am29000 g.p. register +; with a read_dp, read_sp, or read_int macro. +; +; source1, +; source2, +; source3 - source operand specifications: +; R - take source from Am29027 register R +; S - take source from Am29027 register S +; RF0 - take source from Am29027 register file location RF0 +; RF1 - take source from Am29027 register file location RF1 +; RF2 - take source from Am29027 register file location RF2 +; RF3 - take source from Am29027 register file location RF3 +; RF4 - take source from Am29027 register file location RF4 +; RF5 - take source from Am29027 register file location RF5 +; RF6 - take source from Am29027 register file location RF6 +; RF7 - take source from Am29027 register file location RF7 +; 0 - source is 0 +; ONE_HALF - source is constant .5 (f.p. operations only) +; IMINUS1 - source is constant -1 (integer operations only) +; 1 - source is constant 1 +; 2 - source is constant 2 +; 3 - source is constant 3 +; PI - source is constant pi (f.p. operations only) +; IMINUSMAX - source is -(2**63) (integer operations only) +; +; +; USAGE: +; +; cp_build_inst reg,op_code,[precision,]dest,source1[,source2][,source3] +; +; Op-codes fall into two categories: those that correspond to Am29000 +; floating-point op-codes, and for which the precision is implicit (e.g. +; FADD, DMUL); and those that correspond to Am29027 base operations +; (e.g. P_PLUS_T, P_TIMES_Q), and which require an explicit precision +; specification. +; +; Every operation specified must have a destination; if the operation +; does not write a result to the Am29027 register file, destination GP +; must be specified. The number of source operands specified must agree +; with the number of source operands required by the operation specified. +; +; Ex: +; +; cp_build_inst lr2,FADD,RF7,R,S +; Builds an instruction word to +; perform the operation: +; RF7 <- R + S +; where R, S, and RF7 are single- +; precision f.p. operands. The +; instruction word is placed in lr2. +; +; cp_build_inst gr119,DMUL,GP,R,ONE_HALF +; Builds an instruction word to +; perform the operation: +; R * .5 +; where R, .5, and the result +; are double-precision f.p. operands. +; The result is not written to the +; Am29027 register file. The +; instruction word is written to +; gr119. +; +; +; cp_build_inst lr3,MIN_P_AND_T,S_D,RF7,R,S +; Builds an instruction word to +; perform the operation: +; RF7 <- smaller of(R,S) +; where R and S are double-precision +; f.p. operands, and RF7 is a single- +; precison f.p. operand. The +; instruction word is written to +; lr3. +; +; +; cp_build_inst gr97,I_P_TIMES_Q,S_S,GP,R,2 +; Builds an instruction word to +; perform the operation: +; R * 2 +; where R, .5, and the result +; are single-precision integer operands. +; The result is not written to the +; Am29027 register file. The +; instruction word is written to +; gr97 +; +; +; cp_build_inst lr7,ABS_P,D_D,RF6,S +; Builds an instruction word to +; perform the operation: +; RF6 <- |S| +; where S and RF7 are double-precision +; f.p. operands. The instruction +; word is written to gr7. +; +; +; cp_build_inst gr127,PQ_PLUS_T,D_D,RF6,R,S,RF6 +; Builds an instruction word to +; perform the operation: +; RF6 <- (R * S) + RF6 +; where R, S and the result are +; double-precision f.p. operands. +; The instruction word is written +; to gr127. +; +; +; +;============================================================================ +; + .macro cp_build_inst,p1,p2,p3,p4,p5,p6,p7 +; + .if $narg<=3 + .err + .print "cp_build_inst: missing parameter(s)" + .exitm + .endif +; +; classify operation type +; + .set _cp_op_type,255 + + _cp_set_op_params p2,FADD,1,5,4,0,5 + _cp_set_op_params p2,DADD,1,5,4,0,5 + _cp_set_op_params p2,FSUB,1,5,4,0,5 + _cp_set_op_params p2,DSUB,1,5,4,0,5 + _cp_set_op_params p2,FMUL,1,5,4,5,0 + _cp_set_op_params p2,DMUL,1,5,4,5,0 + _cp_set_op_params p2,FEQ,1,5,4,0,5 + _cp_set_op_params p2,DEQ,1,5,4,0,5 + _cp_set_op_params p2,FGE,1,5,4,0,5 + _cp_set_op_params p2,DGE,1,5,4,0,5 + _cp_set_op_params p2,FGT,1,5,4,0,5 + _cp_set_op_params p2,DGT,1,5,4,0,5 + _cp_set_op_params p2,CONVERT_I_TO_F,1,4,0,0,4 + _cp_set_op_params p2,CONVERT_I_TO_D,1,4,0,0,4 + _cp_set_op_params p2,CONVERT_F_TO_I,1,4,0,0,4 + _cp_set_op_params p2,CONVERT_D_TO_I,1,4,0,0,4 +; +; The next two lines were corrected on 1-4-89, Rich Parker +; + _cp_set_op_params p2,CONVERT_F_TO_D,1,4,4,0,0 + _cp_set_op_params p2,CONVERT_D_TO_F,1,4,4,0,0 +; + _cp_set_op_params p2,PASS_P,0,5,5,0,0 + _cp_set_op_params p2,MINUSP,0,5,5,0,0 + _cp_set_op_params p2,ABSP,0,5,5,0,0 + _cp_set_op_params p2,SIGNT_TIMES_ABSP,0,6,6,0,5 + _cp_set_op_params p2,P_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,P_MINUS_T,0,6,5,0,6 + _cp_set_op_params p2,MINUSP_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,MINUSP_MINUS_T,0,6,5,0,6 + _cp_set_op_params p2,ABS_P_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,ABS_P_MINUS_T,0,6,5,0,6 + _cp_set_op_params p2,ABSP_PLUS_ABST,0,6,5,0,6 + _cp_set_op_params p2,ABSP_MINUS_ABST,0,6,5,0,6 + _cp_set_op_params p2,ABS_ABSP_MINUS_ABST,0,6,5,0,6 + _cp_set_op_params p2,P_TIMES_Q,0,6,5,6,0 + _cp_set_op_params p2,MINUSP_TIMES_Q,0,6,5,6,0 + _cp_set_op_params p2,ABS_P_TIMES_Q,0,6,5,6,0 + _cp_set_op_params p2,COMPARE_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,MAX_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,MAX_ABSP_AND_ABST,0,6,5,0,6 + _cp_set_op_params p2,MIN_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,MIN_ABSP_AND_ABST,0,6,5,0,6 + _cp_set_op_params p2,LIMIT_P_TO_MAGT,0,6,5,0,6 + _cp_set_op_params p2,CONVERT_T_TO_INT,0,5,0,0,5 + _cp_set_op_params p2,SCALE_T_TO_INT_BY_Q,0,6,0,6,5 + _cp_set_op_params p2,PQ_PLUS_T,0,7,5,6,7 + _cp_set_op_params p2,MINUSPQ_PLUS_T,0,7,5,6,7 + _cp_set_op_params p2,PQ_MINUS_T,0,7,5,6,7 + _cp_set_op_params p2,MINUSPQ_MINUS_T,0,7,5,6,7 + _cp_set_op_params p2,ABSPQ_PLUS_ABST,0,7,5,6,7 + _cp_set_op_params p2,MINUSABSPQ_PLUS_ABST,0,7,5,6,7 + _cp_set_op_params p2,ABSPQ_MINUS_ABST,0,7,5,6,7 + _cp_set_op_params p2,ROUND_T_TO_INT,0,5,0,0,5 + _cp_set_op_params p2,RECIPROCAL_OF_P,0,5,5,0,0 + _cp_set_op_params p2,CONVERT_T_TO_ALT,0,5,0,0,5 + _cp_set_op_params p2,CONVERT_T_FROM_ALT,0,5,0,0,5 + _cp_set_op_params p2,I_PASS_P,0,5,5,0,0 + _cp_set_op_params p2,I_MINUSP,0,5,5,0,0 + _cp_set_op_params p2,I_ABSP,0,5,5,0,0 + _cp_set_op_params p2,I_SIGNT_TIMES_ABSP,0,6,6,0,5 + _cp_set_op_params p2,I_P_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,I_P_MINUS_T,0,6,5,0,6 + _cp_set_op_params p2,I_MINUSP_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,I_ABS_P_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,I_ABS_P_MINUS_T,0,6,5,0,6 + _cp_set_op_params p2,I_P_TIMES_Q,0,6,5,6,0 + _cp_set_op_params p2,I_COMPARE_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,I_MAX_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,I_MIN_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,I_CONVERT_T_TO_FLOAT,0,5,0,0,5 + _cp_set_op_params p2,I_SCALE_T_TO_FLOAT_BY_Q,0,6,0,6,5 + _cp_set_op_params p2,I_P_OR_T,0,6,5,0,6 + _cp_set_op_params p2,I_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,I_P_XOR_T,0,6,5,0,6 + _cp_set_op_params p2,I_NOT_T,0,5,0,0,5 + _cp_set_op_params p2,I_LSHIFT_P_BY_Q,0,6,5,6,0 + _cp_set_op_params p2,I_ASHIFT_P_BY_Q,0,6,5,6,0 + _cp_set_op_params p2,I_FSHIFT_PT_BY_Q,0,7,5,7,6 + _cp_set_op_params p2,MOVE_P,0,5,5,0,0 +; +; +; if we couldn't find the op_code, flag an error +; + .if _cp_op_type>=2 + .err + .print "cp_build_inst: invalid Am29027 instruction mnemonic" + .exitm + .endif +; +; if number of parameters is incorrect, flag error +; + .if $narg!=_cp_no_params + .err + .print "cp_build_inst: incorrect number of parameters" + .exitm + .endif +; +; find correct value for precision field, if appropriate +; + .set _cp_prec_field,0 ; ** CORRECTION (1/4/89 ROP) + .if _cp_op_type==0 ; need to look for precision + .set _cp_found_precision,0 + .ifeqs "@p3@","D_D" + .set _cp_prec_field,CP_@p3 + .set _cp_found_precision,1 + .endif + .ifeqs "@p3@","D_S" + .set _cp_prec_field,CP_@p3 + .set _cp_found_precision,1 + .endif + .ifeqs "@p3@","S_D" + .set _cp_prec_field,CP_@p3 + .set _cp_found_precision,1 + .endif + .ifeqs "@p3@","S_S" + .set _cp_prec_field,CP_@p3 + .set _cp_found_precision,1 + .endif + .if _cp_found_precision==0 + .err + .print "cp_build_inst: missing precision field" + .exitm + .endif + .endif +; +; find value for destination field +; + .if _cp_op_type==0 + .set _cp_dest_field_val,CP_DEST_EQ_@p4 + .else + .set _cp_dest_field_val,CP_DEST_EQ_@p3 + .endif +; +; find correct value for p select field +; + .if _cp_p_paramno==0 + .set _cp_p_field_val,0x00000000 + .endif + .if _cp_p_paramno==4 + .set _cp_p_field_val,CP_P_EQ_@p4 + .endif + .if _cp_p_paramno==5 + .set _cp_p_field_val,CP_P_EQ_@p5 + .endif + .if _cp_p_paramno==6 + .set _cp_p_field_val,CP_P_EQ_@p6 + .endif + .if _cp_p_paramno==7 + .set _cp_p_field_val,CP_P_EQ_@p7 + .endif + .ifeqs "@p2@","I_NOT_T" + .set _cp_p_field_val,CP_P_EQ_IMINUS1 + .endif +; +; find correct value for q select field +; + .if _cp_q_paramno==0 + .set _cp_q_field_val,0x00000000 + .endif + .if _cp_q_paramno==4 + .set _cp_q_field_val,CP_Q_EQ_@p4 + .endif + .if _cp_q_paramno==5 + .set _cp_q_field_val,CP_Q_EQ_@p5 + .endif + .if _cp_q_paramno==6 + .set _cp_q_field_val,CP_Q_EQ_@p6 + .endif + .if _cp_q_paramno==7 + .set _cp_q_field_val,CP_Q_EQ_@p7 + .endif +; +; find correct value for t select field +; + .if _cp_t_paramno==0 + .set _cp_t_field_val,0x00000000 + .endif + .if _cp_t_paramno==4 + .set _cp_t_field_val,CP_T_EQ_@p4 + .endif + .if _cp_t_paramno==5 + .set _cp_t_field_val,CP_T_EQ_@p5 + .endif + .if _cp_t_paramno==6 + .set _cp_t_field_val,CP_T_EQ_@p6 + .endif + .if _cp_t_paramno==7 + .set _cp_t_field_val,CP_T_EQ_@p7 + .endif +; +; + .set _cp_inst_word,CP_@p2@|_cp_prec_field|_cp_dest_field_val + .set _cp_inst_word,_cp_inst_word|_cp_p_field_val + .set _cp_inst_word,_cp_inst_word|_cp_q_field_val + .set _cp_inst_word,_cp_inst_word|_cp_t_field_val + + const p1,_cp_inst_word + consth p1,_cp_inst_word +; + .endm +; +; +; + .macro _cp_set_op_params,par1,par2,par3,par4,par5,par6,par7 + .ifeqs "@par1@","@par2@" + .set _cp_op_type,par3 + .set _cp_no_params,par4 + .set _cp_p_paramno,par5 + .set _cp_q_paramno,par6 + .set _cp_t_paramno,par7 + .endif + .endm +; +; +; +;============================================================================ +; MACRO NAME: cp_build_inst_h +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 24, 1988 +; : January 4, 1989 Rich Parker +; +; FUNCTION: Builds a 16 MSBs of a 32-bit Am29027 instruction in an +; Am29000 g.p. register. +; +; PARAMETERS: +; reg - the Am29000 g.p. register into which the instruction word +; is to be written +; +; op_code - mnemonic specifying the operation to be performed +; (e.g. FADD, P_TIMES_Q) +; +; precision - precision specification for destination, source operands: +; D_S - double-prec. result, single-prec. input(s) +; D_D - double-prec. result, double-prec. input(s) +; S_S - single-prec. result, single-prec. input(s) +; S_D - single-prec. result, double-prec. input(s) +; +; dest - destination for the operation result: +; RF0 - store result in Am29027 register file location RF0 +; RF1 - store result in Am29027 register file location RF1 +; RF2 - store result in Am29027 register file location RF2 +; RF3 - store result in Am29027 register file location RF3 +; RF4 - store result in Am29027 register file location RF4 +; RF5 - store result in Am29027 register file location RF5 +; RF6 - store result in Am29027 register file location RF6 +; RF7 - store result in Am29027 register file location RF7 +; GP - result is to be stored in an Am29000 g.p. register +; with a read_dp, read_sp, or read_int macro. +; +; source1, +; source2, +; source3 - source operand specifications: +; R - take source from Am29027 register R +; S - take source from Am29027 register S +; RF0 - take source from Am29027 register file location RF0 +; RF1 - take source from Am29027 register file location RF1 +; RF2 - take source from Am29027 register file location RF2 +; RF3 - take source from Am29027 register file location RF3 +; RF4 - take source from Am29027 register file location RF4 +; RF5 - take source from Am29027 register file location RF5 +; RF6 - take source from Am29027 register file location RF6 +; RF7 - take source from Am29027 register file location RF7 +; 0 - source is 0 +; ONE_HALF - source is constant .5 (f.p. operations only) +; IMINUS1 - source is constant -1 (integer operations only) +; 1 - source is constant 1 +; 2 - source is constant 2 +; 3 - source is constant 3 +; PI - source is constant pi (f.p. operations only) +; IMINUSMAX - source is -(2**63) (integer operations only) +; +; +; USAGE: +; +; cp_build_inst_h reg,op_code,[precision,]dest,source1[,source2][,source3] +; +; This macro is similar to cp_build_inst, but creates only the 16 MSBs +; of the 32-bit Am29027 instruction word. This macro is useful in cases +; where the 16 LSBs of instruction word, which specify the operation +; to be performed, already exist in an Am29000 g.p. register, but where +; the 16 MSBs, which specify operand sources and destination, must be +; changed. In such cases, one Am29000 instruction can be saved by using +; cp_build_inst_h instead of cp_build_inst. +; +; Syntax and usage are identical to that of cp_build_inst. +; +; NOTE: This macro references macro _cp_set_op_params, which appears +; in the assembly listing for macro _cp_build_inst. +; +; +; +; +;============================================================================ +; + .macro cp_build_inst_h,p1,p2,p3,p4,p5,p6,p7 +; + .if $narg<=3 + .err + .print "cp_build_inst_h: missing parameter(s)" + .exitm + .endif +; +; classify operation type +; + .set _cp_op_type,255 + + _cp_set_op_params p2,FADD,1,5,4,0,5 + _cp_set_op_params p2,DADD,1,5,4,0,5 + _cp_set_op_params p2,FSUB,1,5,4,0,5 + _cp_set_op_params p2,DSUB,1,5,4,0,5 + _cp_set_op_params p2,FMUL,1,5,4,5,0 + _cp_set_op_params p2,DMUL,1,5,4,5,0 + _cp_set_op_params p2,FEQ,1,5,4,0,5 + _cp_set_op_params p2,DEQ,1,5,4,0,5 + _cp_set_op_params p2,FGE,1,5,4,0,5 + _cp_set_op_params p2,DGE,1,5,4,0,5 + _cp_set_op_params p2,FGT,1,5,4,0,5 + _cp_set_op_params p2,DGT,1,5,4,0,5 + _cp_set_op_params p2,CONVERT_I_TO_F,1,4,0,0,4 + _cp_set_op_params p2,CONVERT_I_TO_D,1,4,0,0,4 + _cp_set_op_params p2,CONVERT_F_TO_I,1,4,0,0,4 + _cp_set_op_params p2,CONVERT_D_TO_I,1,4,0,0,4 +; +; The next two lines were corrected on 1-4-89, Rich Parker +; + _cp_set_op_params p2,CONVERT_F_TO_D,1,4,4,0,0 + _cp_set_op_params p2,CONVERT_D_TO_F,1,4,4,0,0 +; + _cp_set_op_params p2,PASS_P,0,5,5,0,0 + _cp_set_op_params p2,MINUSP,0,5,5,0,0 + _cp_set_op_params p2,ABSP,0,5,5,0,0 + _cp_set_op_params p2,SIGNT_TIMES_ABSP,0,6,6,0,5 + _cp_set_op_params p2,P_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,P_MINUS_T,0,6,5,0,6 + _cp_set_op_params p2,MINUSP_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,MINUSP_MINUS_T,0,6,5,0,6 + _cp_set_op_params p2,ABS_P_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,ABS_P_MINUS_T,0,6,5,0,6 + _cp_set_op_params p2,ABSP_PLUS_ABST,0,6,5,0,6 + _cp_set_op_params p2,ABSP_MINUS_ABST,0,6,5,0,6 + _cp_set_op_params p2,ABS_ABSP_MINUS_ABST,0,6,5,0,6 + _cp_set_op_params p2,P_TIMES_Q,0,6,5,6,0 + _cp_set_op_params p2,MINUSP_TIMES_Q,0,6,5,6,0 + _cp_set_op_params p2,ABS_P_TIMES_Q,0,6,5,6,0 + _cp_set_op_params p2,COMPARE_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,MAX_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,MAX_ABSP_AND_ABST,0,6,5,0,6 + _cp_set_op_params p2,MIN_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,MIN_ABSP_AND_ABST,0,6,5,0,6 + _cp_set_op_params p2,LIMIT_P_TO_MAGT,0,6,5,0,6 + _cp_set_op_params p2,CONVERT_T_TO_INT,0,5,0,0,5 + _cp_set_op_params p2,SCALE_T_TO_INT_BY_Q,0,6,0,6,5 + _cp_set_op_params p2,PQ_PLUS_T,0,7,5,6,7 + _cp_set_op_params p2,MINUSPQ_PLUS_T,0,7,5,6,7 + _cp_set_op_params p2,PQ_MINUS_T,0,7,5,6,7 + _cp_set_op_params p2,MINUSPQ_MINUS_T,0,7,5,6,7 + _cp_set_op_params p2,ABSPQ_PLUS_ABST,0,7,5,6,7 + _cp_set_op_params p2,MINUSABSPQ_PLUS_ABST,0,7,5,6,7 + _cp_set_op_params p2,ABSPQ_MINUS_ABST,0,7,5,6,7 + _cp_set_op_params p2,ROUND_T_TO_INT,0,5,0,0,5 + _cp_set_op_params p2,RECIPROCAL_OF_P,0,5,5,0,0 + _cp_set_op_params p2,CONVERT_T_TO_ALT,0,5,0,0,5 + _cp_set_op_params p2,CONVERT_T_FROM_ALT,0,5,0,0,5 + _cp_set_op_params p2,I_PASS_P,0,5,5,0,0 + _cp_set_op_params p2,I_MINUSP,0,5,5,0,0 + _cp_set_op_params p2,I_ABSP,0,5,5,0,0 + _cp_set_op_params p2,I_SIGNT_TIMES_ABSP,0,6,6,0,5 + _cp_set_op_params p2,I_P_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,I_P_MINUS_T,0,6,5,0,6 + _cp_set_op_params p2,I_MINUSP_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,I_ABS_P_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,I_ABS_P_MINUS_T,0,6,5,0,6 + _cp_set_op_params p2,I_P_TIMES_Q,0,6,5,6,0 + _cp_set_op_params p2,I_COMPARE_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,I_MAX_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,I_MIN_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,I_CONVERT_T_TO_FLOAT,0,5,0,0,5 + _cp_set_op_params p2,I_SCALE_T_TO_FLOAT_BY_Q,0,6,0,6,5 + _cp_set_op_params p2,I_P_OR_T,0,6,5,0,6 + _cp_set_op_params p2,I_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,I_P_XOR_T,0,6,5,0,6 + _cp_set_op_params p2,I_NOT_T,0,5,0,0,5 + _cp_set_op_params p2,I_LSHIFT_P_BY_Q,0,6,5,6,0 + _cp_set_op_params p2,I_ASHIFT_P_BY_Q,0,6,5,6,0 + _cp_set_op_params p2,I_FSHIFT_PT_BY_Q,0,7,5,7,6 + _cp_set_op_params p2,MOVE_P,0,5,5,0,0 +; +; +; if we couldn't find the op_code, flag an error +; + .if _cp_op_type>=2 + .err + .print "cp_build_inst_h: invalid Am29027 instruction mnemonic" + .exitm + .endif +; +; if number of parameters is incorrect, flag error +; + .if $narg!=_cp_no_params + .err + .print "cp_build_inst_h: incorrect number of parameters" + .exitm + .endif +; +; find correct value for precision field, if appropriate +; + .set _cp_prec_field,0 ; ** CORRECTION (1-4-89 Rich Parker) + .if _cp_op_type==0 ; need to look for precision + .set _cp_found_precision,0 + .ifeqs "@p3@","D_D" + .set _cp_prec_field,CP_@p3 + .set _cp_found_precision,1 + .endif + .ifeqs "@p3@","D_S" + .set _cp_prec_field,CP_@p3 + .set _cp_found_precision,1 + .endif + .ifeqs "@p3@","S_D" + .set _cp_prec_field,CP_@p3 + .set _cp_found_precision,1 + .endif + .ifeqs "@p3@","S_S" + .set _cp_prec_field,CP_@p3 + .set _cp_found_precision,1 + .endif + .if _cp_found_precision==0 + .err + .print "cp_build_inst_h: missing precision field" + .exitm + .endif + .endif +; +; find value for destination field +; + .if _cp_op_type==0 + .set _cp_dest_field_val,CP_DEST_EQ_@p4 + .else + .set _cp_dest_field_val,CP_DEST_EQ_@p3 + .endif +; +; find correct value for p select field +; + .if _cp_p_paramno==0 + .set _cp_p_field_val,0x00000000 + .endif + .if _cp_p_paramno==4 + .set _cp_p_field_val,CP_P_EQ_@p4 + .endif + .if _cp_p_paramno==5 + .set _cp_p_field_val,CP_P_EQ_@p5 + .endif + .if _cp_p_paramno==6 + .set _cp_p_field_val,CP_P_EQ_@p6 + .endif + .if _cp_p_paramno==7 + .set _cp_p_field_val,CP_P_EQ_@p7 + .endif + .ifeqs "@p2@","I_NOT_T" + .set _cp_p_field_val,CP_P_EQ_IMINUS1 + .endif +; +; find correct value for q select field +; + .if _cp_q_paramno==0 + .set _cp_q_field_val,0x00000000 + .endif + .if _cp_q_paramno==4 + .set _cp_q_field_val,CP_Q_EQ_@p4 + .endif + .if _cp_q_paramno==5 + .set _cp_q_field_val,CP_Q_EQ_@p5 + .endif + .if _cp_q_paramno==6 + .set _cp_q_field_val,CP_Q_EQ_@p6 + .endif + .if _cp_q_paramno==7 + .set _cp_q_field_val,CP_Q_EQ_@p7 + .endif +; +; find correct value for t select field +; + .if _cp_t_paramno==0 + .set _cp_t_field_val,0x00000000 + .endif + .if _cp_t_paramno==4 + .set _cp_t_field_val,CP_T_EQ_@p4 + .endif + .if _cp_t_paramno==5 + .set _cp_t_field_val,CP_T_EQ_@p5 + .endif + .if _cp_t_paramno==6 + .set _cp_t_field_val,CP_T_EQ_@p6 + .endif + .if _cp_t_paramno==7 + .set _cp_t_field_val,CP_T_EQ_@p7 + .endif +; +; + .set _cp_inst_word,CP_@p2@|_cp_prec_field|_cp_dest_field_val + .set _cp_inst_word,_cp_inst_word|_cp_p_field_val + .set _cp_inst_word,_cp_inst_word|_cp_q_field_val + .set _cp_inst_word,_cp_inst_word|_cp_t_field_val +; + consth p1,_cp_inst_word +; + .endm +; +; +; +; +;============================================================================ +; MACRO NAME: cp_build_inst_l +; +; WRITTEN BY: Bob Perlman +; +; MOST RECENT UPDATE: April 24, 1988 +; : January 4, 1989 Rich Parker +; +; FUNCTION: Builds a 16 LSBs of a 32-bit Am29027 instruction in an +; Am29000 g.p. register; the 16 MSBs of the register are +; set to 0.. +; +; PARAMETERS: +; reg - the Am29000 g.p. register into which the instruction word +; is to be written +; +; op_code - mnemonic specifying the operation to be performed +; (e.g. FADD, P_TIMES_Q) +; +; precision - precision specification for destination, source operands: +; D_S - double-prec. result, single-prec. input(s) +; D_D - double-prec. result, double-prec. input(s) +; S_S - single-prec. result, single-prec. input(s) +; S_D - single-prec. result, double-prec. input(s) +; +; dest - destination for the operation result: +; RF0 - store result in Am29027 register file location RF0 +; RF1 - store result in Am29027 register file location RF1 +; RF2 - store result in Am29027 register file location RF2 +; RF3 - store result in Am29027 register file location RF3 +; RF4 - store result in Am29027 register file location RF4 +; RF5 - store result in Am29027 register file location RF5 +; RF6 - store result in Am29027 register file location RF6 +; RF7 - store result in Am29027 register file location RF7 +; GP - result is to be stored in an Am29000 g.p. register +; with a read_dp, read_sp, or read_int macro. +; +; source1, +; source2, +; source3 - source operand specifications: +; R - take source from Am29027 register R +; S - take source from Am29027 register S +; RF0 - take source from Am29027 register file location RF0 +; RF1 - take source from Am29027 register file location RF1 +; RF2 - take source from Am29027 register file location RF2 +; RF3 - take source from Am29027 register file location RF3 +; RF4 - take source from Am29027 register file location RF4 +; RF5 - take source from Am29027 register file location RF5 +; RF6 - take source from Am29027 register file location RF6 +; RF7 - take source from Am29027 register file location RF7 +; 0 - source is 0 +; ONE_HALF - source is constant .5 (f.p. operations only) +; IMINUS1 - source is constant -1 (integer operations only) +; 1 - source is constant 1 +; 2 - source is constant 2 +; 3 - source is constant 3 +; PI - source is constant pi (f.p. operations only) +; IMINUSMAX - source is -(2**63) (integer operations only) +; +; +; USAGE: +; +; cp_build_inst_l reg,op_code,[precision,]dest,source1[,source2][,source3] +; +; This macro is similar to cp_build_inst, but creates only the 16 LSBs +; of the 32-bit Am29027 instruction word; the 16 MSBs of the target +; register are set to 0. This macro is useful in cases +; where it is helpful to specify instruction LSBs and MSBs separately, +; to improve instruction scheduling. +; +; Syntax and usage are identical to that of cp_build_inst. +; +; NOTE: This macro references macro _cp_set_op_params, which appears +; in the assembly listing for macro _cp_build_inst. +; +; +;============================================================================ +; + .macro cp_build_inst_l,p1,p2,p3,p4,p5,p6,p7 +; + .if $narg<=3 + .err + .print "cp_build_inst_h: missing parameter(s)" + .exitm + .endif +; +; classify operation type +; + .set _cp_op_type,255 + + _cp_set_op_params p2,FADD,1,5,4,0,5 + _cp_set_op_params p2,DADD,1,5,4,0,5 + _cp_set_op_params p2,FSUB,1,5,4,0,5 + _cp_set_op_params p2,DSUB,1,5,4,0,5 + _cp_set_op_params p2,FMUL,1,5,4,5,0 + _cp_set_op_params p2,DMUL,1,5,4,5,0 + _cp_set_op_params p2,FEQ,1,5,4,0,5 + _cp_set_op_params p2,DEQ,1,5,4,0,5 + _cp_set_op_params p2,FGE,1,5,4,0,5 + _cp_set_op_params p2,DGE,1,5,4,0,5 + _cp_set_op_params p2,FGT,1,5,4,0,5 + _cp_set_op_params p2,DGT,1,5,4,0,5 + _cp_set_op_params p2,CONVERT_I_TO_F,1,4,0,0,4 + _cp_set_op_params p2,CONVERT_I_TO_D,1,4,0,0,4 + _cp_set_op_params p2,CONVERT_F_TO_I,1,4,0,0,4 + _cp_set_op_params p2,CONVERT_D_TO_I,1,4,0,0,4 +; +; The next two lines were corrected on 1-4-89, Rich Parker +; + _cp_set_op_params p2,CONVERT_F_TO_D,1,4,4,0,0 + _cp_set_op_params p2,CONVERT_D_TO_F,1,4,4,0,0 +; + _cp_set_op_params p2,PASS_P,0,5,5,0,0 + _cp_set_op_params p2,MINUSP,0,5,5,0,0 + _cp_set_op_params p2,ABSP,0,5,5,0,0 + _cp_set_op_params p2,SIGNT_TIMES_ABSP,0,6,6,0,5 + _cp_set_op_params p2,P_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,P_MINUS_T,0,6,5,0,6 + _cp_set_op_params p2,MINUSP_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,MINUSP_MINUS_T,0,6,5,0,6 + _cp_set_op_params p2,ABS_P_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,ABS_P_MINUS_T,0,6,5,0,6 + _cp_set_op_params p2,ABSP_PLUS_ABST,0,6,5,0,6 + _cp_set_op_params p2,ABSP_MINUS_ABST,0,6,5,0,6 + _cp_set_op_params p2,ABS_ABSP_MINUS_ABST,0,6,5,0,6 + _cp_set_op_params p2,P_TIMES_Q,0,6,5,6,0 + _cp_set_op_params p2,MINUSP_TIMES_Q,0,6,5,6,0 + _cp_set_op_params p2,ABS_P_TIMES_Q,0,6,5,6,0 + _cp_set_op_params p2,COMPARE_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,MAX_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,MAX_ABSP_AND_ABST,0,6,5,0,6 + _cp_set_op_params p2,MIN_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,MIN_ABSP_AND_ABST,0,6,5,0,6 + _cp_set_op_params p2,LIMIT_P_TO_MAGT,0,6,5,0,6 + _cp_set_op_params p2,CONVERT_T_TO_INT,0,5,0,0,5 + _cp_set_op_params p2,SCALE_T_TO_INT_BY_Q,0,6,0,6,5 + _cp_set_op_params p2,PQ_PLUS_T,0,7,5,6,7 + _cp_set_op_params p2,MINUSPQ_PLUS_T,0,7,5,6,7 + _cp_set_op_params p2,PQ_MINUS_T,0,7,5,6,7 + _cp_set_op_params p2,MINUSPQ_MINUS_T,0,7,5,6,7 + _cp_set_op_params p2,ABSPQ_PLUS_ABST,0,7,5,6,7 + _cp_set_op_params p2,MINUSABSPQ_PLUS_ABST,0,7,5,6,7 + _cp_set_op_params p2,ABSPQ_MINUS_ABST,0,7,5,6,7 + _cp_set_op_params p2,ROUND_T_TO_INT,0,5,0,0,5 + _cp_set_op_params p2,RECIPROCAL_OF_P,0,5,5,0,0 + _cp_set_op_params p2,CONVERT_T_TO_ALT,0,5,0,0,5 + _cp_set_op_params p2,CONVERT_T_FROM_ALT,0,5,0,0,5 + _cp_set_op_params p2,I_PASS_P,0,5,5,0,0 + _cp_set_op_params p2,I_MINUSP,0,5,5,0,0 + _cp_set_op_params p2,I_ABSP,0,5,5,0,0 + _cp_set_op_params p2,I_SIGNT_TIMES_ABSP,0,6,6,0,5 + _cp_set_op_params p2,I_P_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,I_P_MINUS_T,0,6,5,0,6 + _cp_set_op_params p2,I_MINUSP_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,I_ABS_P_PLUS_T,0,6,5,0,6 + _cp_set_op_params p2,I_ABS_P_MINUS_T,0,6,5,0,6 + _cp_set_op_params p2,I_P_TIMES_Q,0,6,5,6,0 + _cp_set_op_params p2,I_COMPARE_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,I_MAX_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,I_MIN_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,I_CONVERT_T_TO_FLOAT,0,5,0,0,5 + _cp_set_op_params p2,I_SCALE_T_TO_FLOAT_BY_Q,0,6,0,6,5 + _cp_set_op_params p2,I_P_OR_T,0,6,5,0,6 + _cp_set_op_params p2,I_P_AND_T,0,6,5,0,6 + _cp_set_op_params p2,I_P_XOR_T,0,6,5,0,6 + _cp_set_op_params p2,I_NOT_T,0,5,0,0,5 + _cp_set_op_params p2,I_LSHIFT_P_BY_Q,0,6,5,6,0 + _cp_set_op_params p2,I_ASHIFT_P_BY_Q,0,6,5,6,0 + _cp_set_op_params p2,I_FSHIFT_PT_BY_Q,0,7,5,7,6 + _cp_set_op_params p2,MOVE_P,0,5,5,0,0 +; +; +; if we couldn't find the op_code, flag an error +; + .if _cp_op_type>=2 + .err + .print "cp_build_inst_h: invalid Am29027 instruction mnemonic" + .exitm + .endif +; +; if number of parameters is incorrect, flag error +; + .if $narg!=_cp_no_params + .err + .print "cp_build_inst_h: incorrect number of parameters" + .exitm + .endif +; +; find correct value for precision field, if appropriate +; + .set _cp_prec_field,0 ; CORRECTION (1-4-89 Rich Parker) + .if _cp_op_type==0 ; need to look for precision + .set _cp_found_precision,0 + .ifeqs "@p3@","D_D" + .set _cp_prec_field,CP_@p3 + .set _cp_found_precision,1 + .endif + .ifeqs "@p3@","D_S" + .set _cp_prec_field,CP_@p3 + .set _cp_found_precision,1 + .endif + .ifeqs "@p3@","S_D" + .set _cp_prec_field,CP_@p3 + .set _cp_found_precision,1 + .endif + .ifeqs "@p3@","S_S" + .set _cp_prec_field,CP_@p3 + .set _cp_found_precision,1 + .endif + .if _cp_found_precision==0 + .err + .print "cp_build_inst_h: missing precision field" + .exitm + .endif + .endif +; +; find value for destination field +; + .if _cp_op_type==0 + .set _cp_dest_field_val,CP_DEST_EQ_@p4 + .else + .set _cp_dest_field_val,CP_DEST_EQ_@p3 + .endif +; +; find correct value for p select field +; + .if _cp_p_paramno==0 + .set _cp_p_field_val,0x00000000 + .endif + .if _cp_p_paramno==4 + .set _cp_p_field_val,CP_P_EQ_@p4 + .endif + .if _cp_p_paramno==5 + .set _cp_p_field_val,CP_P_EQ_@p5 + .endif + .if _cp_p_paramno==6 + .set _cp_p_field_val,CP_P_EQ_@p6 + .endif + .if _cp_p_paramno==7 + .set _cp_p_field_val,CP_P_EQ_@p7 + .endif + .ifeqs "@p2@","I_NOT_T" + .set _cp_p_field_val,CP_P_EQ_IMINUS1 + .endif +; +; find correct value for q select field +; + .if _cp_q_paramno==0 + .set _cp_q_field_val,0x00000000 + .endif + .if _cp_q_paramno==4 + .set _cp_q_field_val,CP_Q_EQ_@p4 + .endif + .if _cp_q_paramno==5 + .set _cp_q_field_val,CP_Q_EQ_@p5 + .endif + .if _cp_q_paramno==6 + .set _cp_q_field_val,CP_Q_EQ_@p6 + .endif + .if _cp_q_paramno==7 + .set _cp_q_field_val,CP_Q_EQ_@p7 + .endif +; +; find correct value for t select field +; + .if _cp_t_paramno==0 + .set _cp_t_field_val,0x00000000 + .endif + .if _cp_t_paramno==4 + .set _cp_t_field_val,CP_T_EQ_@p4 + .endif + .if _cp_t_paramno==5 + .set _cp_t_field_val,CP_T_EQ_@p5 + .endif + .if _cp_t_paramno==6 + .set _cp_t_field_val,CP_T_EQ_@p6 + .endif + .if _cp_t_paramno==7 + .set _cp_t_field_val,CP_T_EQ_@p7 + .endif +; +; + .set _cp_inst_word,CP_@p2@|_cp_prec_field|_cp_dest_field_val + .set _cp_inst_word,_cp_inst_word|_cp_p_field_val + .set _cp_inst_word,_cp_inst_word|_cp_q_field_val + .set _cp_inst_word,_cp_inst_word|_cp_t_field_val +; + const p1,_cp_inst_word +; + .endm +; +; end of file fpsymbol.h diff --git a/newlib/libc/sys/a29khif/sys/intrinsi.h b/newlib/libc/sys/a29khif/sys/intrinsi.h new file mode 100644 index 000000000..1ae3a8b5c --- /dev/null +++ b/newlib/libc/sys/a29khif/sys/intrinsi.h @@ -0,0 +1,457 @@ +; @(#)intrinsi.h 1.4 90/10/14 20:56:06, Copyright 1988, 1989, 1990 AMD +; start of file intrinsi.h +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; + .title "QTC Intrinsics Header file" +; +; Floating point library package for AMD 29000 family +; +; Copyright 1988 Advanced Micro Devices, Inc. +; +; All rights reserved +; +; Developed for AMD by Quantitative Technology Corporation +; 8700 SW Creekside Place Suite D +; Beaverton OR 97005 +; (503) 626-3081 +; +; Version information : +; +; Revision 1.6 89/06/29 16:08:51 jimh +; Fixed two bugs regarding compatiblility with the fpsymbol file. The +; definitions of ROUND_TO_PLUS/MINUS_INFINITY were reversed. Set_Rounding +; _Mode was fixed to set the local copy (29000 resident) of rounding mode +; in 29027 mode. +; +; +; Revision 1.5 89/04/17 11:20:49 jim +; replaced emfsr and emtsr macro calls with mfsr and mtsr instructions. +; +; Revision 1.4 89/02/24 15:18:04 jimh +; Added the definitions of FP_ENV_MODE_1_DEFAULT, FP_ENV_MODE_2_DEFAULT, +; FP_FLAGS_DEFAULT. +; Added macro clear_Flags. +; Changed the operation of set_Invalid_Op_flag, set_Reserved_Op_flag. +; +; Revision 1.3 89/02/01 18:30:12 jimh +; Changed the way set_Rounding_Mode, extract_Rounding_Mode, set_Invalid_Op_flag +; and set_Reserved_Op_flag are done. Changed save_FP_regs. +; +; Revision 1.2 89/01/31 10:01:54 jimh +; Updated to the new standard. This includes moving in register +; definitions, changing old symbols to reflect those in fpsymbol.h, +; and changing the include file to smartmac.h. +; +; + .include "../traps/fpenv.h" ; RPD 8/21/89 + .include "sys/smartmac.h" + + .equ DOUBLE_EXP_WIDTH, 11 + .equ DOUBLE_EXTENDED_WIDTH, 56 + + .equ SIGNED, 0 + .equ UNSIGNED, 1 + + .equ ROUND_TO_NEAREST, 0 + .equ ROUND_TO_MINUS_INFINITY, 1 + .equ ROUND_TO_PLUS_INFINITY, 2 + .equ ROUND_TO_ZERO, 3 + .equ ROUNDING_MODE_POSITION, 14 + + .equ FORMAT_INTEGER, 0 + .equ FORMAT_SINGLE, 1 + .equ FORMAT_DOUBLE, 2 + + .equ DOUBLE_MSB_MASK,0x00080000 +; +; The following are definitions used in the smart macro package, defining +; the 29000 shadow registers for the floating-point register file, and +; some temporary registers used during the library routines +; + .reg FP0, gr96 + .reg FP1, gr98 + .reg FP2, gr100 + .reg FP3, gr102 + .reg FP4, gr104 + .reg FP5, gr106 + .reg FP6, gr108 + .reg FP7, gr110 +; +; GR60 through GR6F are used to return the value of a function +; + .reg rtn0, gr96 + .reg rtn1, gr97 + .reg rtn2, gr98 + .reg rtn3, gr99 + .reg rtn4, gr100 + .reg rtn5, gr101 + .reg rtn6, gr102 + .reg rtn7, gr103 + .reg rtn8, gr104 + .reg rtn9, gr105 + .reg rtn10, gr106 + .reg rtn11, gr107 + .reg rtn12, gr108 + .reg rtn13, gr109 + .reg rtn14, gr110 + .reg rtn15, gr111 +; +; GR74..GR78 (116-120) - temporaries +; + .reg t0, gr116 + .reg t1, gr117 + .reg t2, gr118 + .reg t3, gr119 + .reg t4, gr120 +; +; FP_ENV_MODE_1 and FP_ENV_MODE_2 are based on 64-bit 29027 Mode register, +; and thus the fpsymbol.h CP_ constants may be used directly. +; +; FP_ENV_MODE_1 (Bits 0-31) +; +; 0-3 - floating-point format select, always 0 +; 4 - Saturate enable +; 5 - IEEE Affine/Projective mode (ignored by traps code) +; 6 - IEEE Trap enable +; 7 - IEEE Sudden underflow / FP Environment Fast Float Select +; 8-10 - ignored +; 11 - Integer multiplication signed/unsigned select +; 12-13 - Integer multiplication format adjust +; 14-16 - Rounding mode select +; 17-19 - ignored +; 20 - Pipeline mode select +; 21 - ignored +; 22 - Invalid operation mask bit +; 23 - Reserved operand mask bit +; 24 - Overflow mask bit +; 25 - Underflow mask bit +; 26 - Inexact result mask bit +; 27 - Zero mask bit +; 28-31 - ignored +; +; FP_ENV_MODE_2 (Bits 32-63) [Hardware configuration register, rarely modified] +; +; 32-35 - Pipeline timer count +; 36-39 - Timer count for multiply-accumulate operation +; 40-43 - Timer count for save state transaction request +; 44-63 - ignored +; +; FP_ENV_MODE_1 definitions +; + .set FP_ENV_MODE_1_DEFAULT, CP_PFF_EQ_IEEE + .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_AFF_EQ_IEEE + .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_AFFINE_MODE + .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_IEEE_TRAPS_DISABLED + .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_IEEE_GRADUAL_UFLOW_MODE + .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_UNSIGNED_INT_MPY_MODE + .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_MF_EQ_LSBS + .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_RMS_EQ_NEAREST + .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_FLOWTHROUGH_MODE + .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_INVALID_OP_EXCP_MASK + .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_RESERVED_OP_EXCP_MASK + .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_OVERFLOW_EXCP_MASK + .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_UNDERFLOW_EXCP_MASK + .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_INEXACT_EXCP_MASK + .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_ZERO_EXCP_MASK +; +; FP_ENV_MODE_2 definitions +; + .set FP_ENV_MODE_2_DEFAULT, CP_PLTC_EQ_6 + .set FP_ENV_MODE_2_DEFAULT,FP_ENV_MODE_2_DEFAULT|CP_MATC_EQ_9 + .set FP_ENV_MODE_2_DEFAULT,FP_ENV_MODE_2_DEFAULT|CP_MVTC_EQ_3 + .set FP_ENV_MODE_2_DEFAULT,FP_ENV_MODE_2_DEFAULT|CP_NORMAL_DRDY_MODE + .set FP_ENV_MODE_2_DEFAULT,FP_ENV_MODE_2_DEFAULT|CP_HALT_ON_ERROR_DISABLED + .set FP_ENV_MODE_2_DEFAULT,FP_ENV_MODE_2_DEFAULT|CP_EXCP_DISABLED +; +; FP_FLAGS_DEFAULT definitions +; + .equ FP_FLAGS_DEFAULT, 0x00000000 ; No flags set +; +; The following macros are used by transcendentals to access the environment. +; +; MACRO NAME: clear_Flags +; +; FUNCTION: to clear the flags on entry to a transcendental routine. +; +; INPUT PARAMETERS: reg - temporary working register +; reg2 - temporary working register +; + .macro clear_Flags,reg,reg2 + .endm +; +; MACRO NAME: set_Invalid_Op_flag +; +; FUNCTION: to set the Invalid operation flag in the floating-point status +; register +; +; INPUT PARAMETERS: reg - temporary working register +; reg2 - 2nd temporary working register +; + .macro set_Invalid_Op_flag,reg,reg2 + .endm + +; +; MACRO NAME: set_Reserved_Op_flag +; +; FUNCTION: to set the Reserved Op flag in the floating-point status register +; +; INPUT PARAMETERS: reg - temporary working register +; reg2 - 2nd temporary working register +; + .macro set_Reserved_Op_flag,reg,reg2 + .endm + +; +; MACRO NAME: extract_Rounding_Mode +; +; FUNCTION: to extract the Rounding Mode portion of the floating-point +; invironment mode register, shift the value to the range of +; 0-7, and leave it in a register +; +; INPUT PARAMETERS: reg - destination for the mode +; + .macro extract_Rounding_Mode,reg + .ifdef _29027_MODE + .extern __29027Mode + const reg,__29027Mode + consth reg,__29027Mode + load 0,0,reg,reg + srl reg,reg,CP_RMS_POSITION + and reg,reg,CP_RMS_MASK >> CP_RMS_POSITION + .else + mfsr reg,FPE + and reg,reg,FPE_FPRND_MASK + srl reg,reg,FPE_FPRND_POSITION + .endif + .endm + +; +; MACRO NAME: set_Rounding_Mode +; +; FUNCTION: to set the 29027 Rounding Mode to a given value +; +; INPUT PARAMETERS: reg - working register +; reg2 - second working register +; rounding_mode - value of the rounding mode +; 0 - round to nearest +; 1 - round to minus infinity +; 2 - round to plus infinity +; 3 - round to zero +; +; NOTES: rounding_mode value is not checked +; 29027 Mode register is NOT written by this macro +; + .macro set_Rounding_Mode,reg,reg2,mode + .ifdef _29027_MODE + .extern __29027Mode + const reg2,__29027Mode + consth reg2,__29027Mode + load 0,0,reg,reg2 + const reg2,CP_RMS_MASK + consth reg2,CP_RMS_MASK + andn reg,reg,reg2 + const reg2,mode + sll reg2,reg2,CP_RMS_POSITION + or reg,reg,reg2 + const reg2,__29027Mode + consth reg2,__29027Mode + store 0,0,reg,reg2 + add reg2,reg2,4 + load 0,0,reg2,reg2 + cp_write_mode reg2,reg + .else + mfsr reg,FPE + andn reg,reg,FPE_FPRND_MASK + const reg2,mode + sll reg2,reg2,FPE_FPRND_POSITION + or reg,reg,reg2 + mtsr FPE,reg + .endif + .endm +; +; +; NOTE: The 29027 is the floating point coprocessor for the 29000. +; It contains 8 floating point registers FP0 to FP7. Three of +; these, FP0, FP1, and FP2, are currently designated as scratch, +; that is, they will not be preserved across calls. The other +; five contain values that must be saved whenever they are used +; in code, and restored before the exit of the routine. The 29027 +; registers are tagged with a single bit indicating the precision +; of the current value. When numbers are read into the 29027, +; they are always stored in double precision, so that single +; precision values are converted on input. Only the MOVE instruction +; fails to do this automatic widening. If the result from calculations +; in the 29027 ALU (determined by the result precision bit in the +; instruction word) is to be single precision and the result saved in +; an FP reg, the result precision bit from the instruction gets copied +; into the precision bit for the register. If a single precision +; SNaN is saved from the 29027, it will be converted to a double +; precision QNaN. Along the way it will cause an unmasked exception +; when read off the chip and cause changes to the status register. +; So the preservation routine will need to modify the mode register to +; mask off the exceptions, save the state of the status register before +; saving the FP regs, and restore the status and mode registers to their +; original settings when the save is complete. +; +; REFERENCE: The instructions to drive the Am29027 are described in the +; Am29027 manual beginning on page 17. Table 4 describes the +; operation codes and table 3 the multiplexer codes. Communication +; with the 29000 is described on pages 11 and 12 of the Am29027 +; manual and chapters 6 and 8 of the Am29000 User's Manual +; +; MACRO NAME: save_FP_regs +; +; FUNCTION: to save the AMD 29027 floating point register values in the +; 29000 general purpose registers +; +; INPUT PARAMETERS: fp_register, one of the 29027 registers FP3 - FP7 +; +; REGISTER USAGE: the following registers are used in save_FP_regs +; +; rtn0 this register is used in setting the mode and status registers +; rtn1 this register is used in setting the mode and status registers +; rtn6 this register is used to store the MSW when FP3 is saved +; rtn7 this register is used to store the LSW when FP3 is saved +; rtn8 this register is used to store the MSW when FP4 is saved +; rtn9 this register is used to store the LSW when FP4 is saved +; + + .macro save_FP_regs,fp_register + .ifdef _29027_MODE + ; + ; For 29027 mode, expand the macro into 29027 code to preserve FP register + ; + .ifeqs "@fp_register@","FP3" + const rtn6,__29027Mode ; Load the address of FP mode + consth rtn6,__29027Mode + load 0,0,rtn0,rtn6 ; Load MSW of FP mode into rtn0 + add rtn6,rtn6,4 ; Increment rtn6 + 4 + load 0,0,rtn1,rtn6 ; Load LSW of FP mode into rtn1 + const rtn6,CP_RESERVED_OP_EXCP_MASK ; Load mask to disable exception + consth rtn6,CP_RESERVED_OP_EXCP_MASK + or rtn0,rtn0,rtn6 ; OR in disable of exception mask + cp_write_mode rtn1, rtn0 ; Reset mode w/exception disabled + cp_read_status rtn0 ; Read status and save in rtn1 + const rtn6,CP_PASS_P | CP_P_EQ_RF3 ; Instruction is PASS_P from RF3 + consth rtn6,CP_PASS_P | CP_P_EQ_RF3 + ; Load & execute the instruction + ; + store 1,CP_WRITE_INST | CP_START,rtn6,rtn6 + load 1,CP_READ_MSBS,rtn6,rtn6 ; Read the MSW to first register + load 1,CP_READ_LSBS,rtn7,rtn7 ; Read the LSW to second register + cp_write_status rtn0 ; Restore the original status + const rtn1,__29027Mode ; Load the address of FP mode + consth rtn1,__29027Mode + load 0,0,rtn0,rtn1 ; Load MSW of FP mode into rtn0 + add rtn1,rtn1,4 ; Increment rtn6 to __29027Mode+4 + load 0,0,rtn1,rtn1 ; Load LSW of FP mode into rtn1 + cp_write_mode rtn1, rtn0 ; Restore the original write mode + .endif + .ifeqs "@fp_register@","FP4" + const rtn8,__29027Mode ; Load the address of FP mode + consth rtn8,__29027Mode + load 0,0,rtn0,rtn8 ; Load MSW of FP mode into rtn0 + add rtn8,rtn8,4 ; Increment rtn6 + 4 + load 0,0,rtn1,rtn8 ; Load LSW of FP mode into rtn1 + const rtn8,CP_RESERVED_OP_EXCP_MASK ; Load mask to disable exception + consth rtn8,CP_RESERVED_OP_EXCP_MASK + or rtn0,rtn0,rtn8 ; OR in disable of exception mask + cp_write_mode rtn1, rtn0 ; Reset mode w/exception disabled + cp_read_status rtn0 ; Read status and save in rtn1 + const rtn8,CP_PASS_P | CP_P_EQ_RF4 ; Instruction is PASS_P from RF4 + consth rtn8,CP_PASS_P | CP_P_EQ_RF4 + ; Load & execute the instruction + ; + store 1,CP_WRITE_INST | CP_START,rtn8,rtn8 + load 1,CP_READ_MSBS,rtn8,rtn8 ; Read the MSW to first register + load 1,CP_READ_LSBS,rtn9,rtn9 ; Read the LSW to second register + cp_write_status rtn0 ; Restore the original status + const rtn1,__29027Mode ; Load the address of FP mode + consth rtn1,__29027Mode + load 0,0,rtn0,rtn1 ; Load MSW of FP mode into rtn0 + add rtn1,rtn1,4 ; Increment rtn6 + 4 + load 0,0,rtn1,rtn1 ; Load LSW of FP mode into rtn1 + cp_write_mode rtn1, rtn0 ; Restore the original write mode + .endif + .else + ; + ; For 29000 mode, do nothing + ; + .endif + .endm +; +; MACRO NAME: restore_FP_regs +; +; FUNCTION: to restore the AMD 29027 floating point register values from the +; 29000 general purpose registers +; +; INPUT PARAMETERS: fp_register, one of the 29027 registers FP3 - FP7 +; +; REGISTER USAGE: the following registers are used in restore_FP_regs +; +; rtn0 this register is used in setting the mode and status registers +; rtn6 the value in this register is stored as the MSW of FP3 +; rtn7 the value in this register is stored as the LSW of FP3 +; rtn8 the value in this register is stored as the MSW of FP4 +; rtn9 the value in this register is stored as the LSW of FP4 +; + .macro restore_FP_regs,fp_register + .ifdef _29027_MODE + ; + ; For 29027 mode, move data from return registers to the correct FP register + ; + .ifeqs "@fp_register@","FP3" + store 1,CP_WRITE_R ,rtn6,rtn7 ; Move the data to the R register + ; Then create the instruction + ; + const rtn0,CP_MOVE_P|CP_D_D|CP_P_EQ_R|CP_DEST_EQ_RF3 + consth rtn0,CP_MOVE_P|CP_D_D|CP_P_EQ_R|CP_DEST_EQ_RF3 + ; + ; Perform the write + ; + store 1,(CP_WRITE_INST | CP_START),rtn0,0 + .endif + .ifeqs "@fp_register@","FP4" + store 1,CP_WRITE_R ,rtn8,rtn9 ; Move the data to the R register + ; Then create the instruction + ; + const rtn0,CP_MOVE_P|CP_D_D|CP_P_EQ_R|CP_DEST_EQ_RF4 + consth rtn0,CP_MOVE_P|CP_D_D|CP_P_EQ_R|CP_DEST_EQ_RF4 + ; + ; Perform the write + ; + store 1,(CP_WRITE_INST | CP_START),rtn0,0 + .endif + .else + ; + ; For 29000 mode, do nothing. + ; + .endif + .endm +; +; end of file intrinsi.h diff --git a/newlib/libc/sys/a29khif/sys/macros.h b/newlib/libc/sys/a29khif/sys/macros.h new file mode 100644 index 000000000..3c832f033 --- /dev/null +++ b/newlib/libc/sys/a29khif/sys/macros.h @@ -0,0 +1,37 @@ +; @(#)macros.h 1.3 90/10/14 20:56:10, Copyright 1989, 1990 AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1989, 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; macros.h +; Short macros of general utility + + .macro mov, dest,src + add dest, src, 0 + .endm + + .macro not, dest,src + nand dest, src, src + .endm diff --git a/newlib/libc/sys/a29khif/sys/proreg.h b/newlib/libc/sys/a29khif/sys/proreg.h new file mode 100644 index 000000000..ca16b708c --- /dev/null +++ b/newlib/libc/sys/a29khif/sys/proreg.h @@ -0,0 +1,60 @@ +; @(#)proreg.h 1.3 90/10/14 20:56:11, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1989, 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; proreg.h +; + ; 16 function value return regs + .reg v0, gr96 + .reg v1, gr97 + .reg v2, gr98 + .reg v3, gr99 + .reg v4, gr100 + .reg v5, gr101 + .reg v6, gr102 + .reg v7, gr103 + .reg v8, gr104 + .reg v9, gr105 + .reg v10, gr106 + .reg v11, gr107 + .reg v12, gr108 + .reg v13, gr109 + .reg v14, gr110 + .reg v15, gr111 +; + .reg rsp, gr1 ; Register Stack Pointer + .reg ret, gr96 ; First word of return value + .reg rp0, gr112 ; Reserved for Programmer, #0 + .reg rp1, gr113 ; Reserved for Programmer, #1 + .reg rp2, gr114 ; Reserved for Programmer, #2 + .reg rp3, gr115 ; Reserved for Programmer, #3 + .reg tav, gr121 ; Temporary, Argument for Trap Handlers + .reg tpc, gr122 ; Temporary, Return PC for Trap Handlers + .reg lrp, gr123 ; Large Return Pointer + .reg slp, gr124 ; Static Link Pointer + .reg msp, gr125 ; Memory Stack Pointer + .reg rab, gr126 ; Register Allocate Bound + .reg rfb, gr127 ; Register Free Bound diff --git a/newlib/libc/sys/a29khif/sys/romdcl.h b/newlib/libc/sys/a29khif/sys/romdcl.h new file mode 100644 index 000000000..d52ca0598 --- /dev/null +++ b/newlib/libc/sys/a29khif/sys/romdcl.h @@ -0,0 +1,392 @@ +; @(#)romdcl.h 1.4 90/10/14 20:56:12, Copyright 1988, 1989, 1990 AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + .sbttl "Register, Constant and Macro Declarations - v1.4" + +; Copyright 1988, Advanced Micro Devices +; Written by Gibbons and Associates, Inc. + +;v1.4 JG correct FUNCTION macro - fault in register padding to even + +;----------------------------------------------------------------------- +;Global registers +;----------------------------------------------------------------------- + .reg rsp, gr1 ;local reg. var. stack pointer + + .equ SYS_TEMP, 64 ;system temp registers + + .reg st0, gr64 + .reg st1, gr65 + .reg st2, gr66 + .reg st3, gr67 + .reg st4, gr68 + .reg st5, gr69 + .reg st6, gr70 + .reg st7, gr71 + .reg st8, gr72 + .reg st9, gr73 + .reg st10, gr74 + .reg st11, gr75 + .reg st12, gr76 + .reg st13, gr77 + .reg st14, gr78 + .reg st15, gr79 + + .equ SYS_STAT, 80 ;system static registers + + .reg ss0, gr80 + .reg ss1, gr81 + .reg ss2, gr82 + .reg ss3, gr83 + .reg ss4, gr84 + .reg ss5, gr85 + .reg ss6, gr86 + .reg ss7, gr87 + .reg ss8, gr88 + .reg ss9, gr89 + .reg ss10, gr90 + .reg ss11, gr91 + .reg ss12, gr92 + .reg ss13, gr93 + .reg ss14, gr94 + .reg ss15, gr95 + + .equ RET_VAL, 96 ;return registers + + .reg v0, gr96 + .reg v1, gr97 + .reg v2, gr98 + .reg v3, gr99 + .reg v4, gr100 + .reg v5, gr101 + .reg v6, gr102 + .reg v7, gr103 + .reg v8, gr104 + .reg v9, gr105 + .reg v10, gr106 + .reg v11, gr107 + .reg v12, gr108 + .reg v13, gr109 + .reg v14, gr110 + .reg v15, gr111 + + .equ TEMP_REG, 96 ;temp registers + + .reg t0, gr96 + .reg t1, gr97 + .reg t2, gr98 + .reg t3, gr99 + .reg t4, gr100 + .reg t5, gr101 + .reg t6, gr102 + .reg t7, gr103 + .reg t8, gr104 + .reg t9, gr105 + .reg t10, gr106 + .reg t11, gr107 + .reg t12, gr108 + .reg t13, gr109 + .reg t14, gr110 + .reg t15, gr111 + + .equ RES_REG, 112 ;reserved (for user) + + .reg r0, gr112 + .reg r1, gr113 + .reg r2, gr114 + .reg r3, gr115 + + .equ TEMP_EXT, 116 ;temp extension (and shared) + + .reg x0, gr116 + .reg x1, gr117 + .reg x2, gr118 + .reg x3, gr119 + .reg x4, gr120 + .reg x5, gr121 + .reg x6, gr122 + .reg x7, gr123 + .reg x8, gr124 + +;----------------------------------------------------------------------- +;Global registers with special calling convention uses +;----------------------------------------------------------------------- + + .reg tav, gr121 ;trap handler argument (also x6) + .reg tpc, gr122 ;trap handler return (also x7) + .reg lsrp, gr123 ;large return pointer (also x8) + .reg slp, gr124 ;static link pointer (also x9) + .reg msp, gr125 ;memory stack pointer + .reg rab, gr126 ;register alloc bound + .reg rfb, gr127 ;register frame bound + +;----------------------------------------------------------------------- +;Local compiler registers - output parameters, etc. +; (only valid if frame has been established) +;----------------------------------------------------------------------- + + .reg p15, lr17 ;parameter registers + .reg p14, lr16 + .reg p13, lr15 + .reg p12, lr14 + .reg p11, lr13 + .reg p10, lr12 + .reg p9, lr11 + .reg p8, lr10 + .reg p7, lr9 + .reg p6, lr8 + .reg p5, lr7 + .reg p4, lr6 + .reg p3, lr5 + .reg p2, lr4 + .reg p1, lr3 + .reg p0, lr2 + + +;----------------------------------------------------------------------- +;TLB register count +;----------------------------------------------------------------------- + + .equ TLB_CNT, 128 + + .eject + +;----------------------------------------------------------------------- +;constants for general use +;----------------------------------------------------------------------- + .equ WRD_SIZ, 4 ;word size + .equ TRUE, 0x80000000 ;logical true -- bit 31 + .equ FALSE, 0x00000000 ;logical false -- 0 + .equ CHKPAT_a5, 0xa5a5a5a5 ;check pattern + +;----------------------------------------------------------------------- +;constants for data access control +;----------------------------------------------------------------------- + .equ CE, 0b1 ;coprocessor enable + .equ CD, 0b0 ;coprocessor disable + + .equ AS, 0b1000000 ;set for I/O + .equ PA, 0b0100000 ;set for physical ad + .equ SB, 0b0010000 ;set for set BP + .equ UA, 0b0001000 ;set for user access + + .equ ROM_OPT, 0b100 ;OPT values for acc + .equ DATA_OPT, 0b000 + .equ INST_OPT, 0b000 + + .equ ROM_CTL, (PA + ROM_OPT) ;control field + .equ DATA_CTL, (PA + DATA_OPT) + .equ INST_CTL, (PA + INST_OPT) + .equ IO_CTL, (AS + PA + DATA_OPT) + + + .eject + +;----------------------------------------------------------------------- +;defined vectors +;----------------------------------------------------------------------- + + .equ V_IllegalOp, 0 + .equ V_Unaligned, 1 + .equ V_OutOfRange, 2 + .equ V_NoCoProc, 3 + .equ V_CoProcExcept, 4 + .equ V_ProtViol, 5 + .equ V_InstAccExcept, 6 + .equ V_DataAccExcept, 7 + .equ V_UserInstTLB, 8 + .equ V_UserDataTLB, 9 + .equ V_SupInstTLB, 10 + .equ V_SupDataTLB, 11 + .equ V_InstTLBProt, 12 + .equ V_DataTLBProt, 13 + .equ V_Timer, 14 + .equ V_Trace, 15 + .equ V_INTR0, 16 + .equ V_INTR1, 17 + .equ V_INTR2, 18 + .equ V_INTR3, 19 + .equ V_TRAP0, 20 + .equ V_TRAP1, 21 + + ; 22 - 31 reserved + + .equ V_MULTIPLY, 32 + .equ V_DIVIDE, 33 + .equ V_MULTIPLU, 34 + .equ V_DIVIDU, 35 + .equ V_CONVERT, 36 + + ; 37 - 41 reserved + + .equ V_FEQ, 42 + .equ V_DEQ, 43 + .equ V_FGT, 44 + .equ V_DGT, 45 + .equ V_FGE, 46 + .equ V_DGE, 47 + .equ V_FADD, 48 + .equ V_DADD, 49 + .equ V_FSUB, 50 + .equ V_DSUB, 51 + .equ V_FMUL, 52 + .equ V_DMUL, 53 + .equ V_FDIV, 54 + .equ V_DDIV, 55 + + ; 56 - 63 reserved + + .equ V_SPILL, 64 + .equ V_FILL, 65 + .equ V_BSDCALL, 66 + .equ V_SYSVCALL, 67 + .equ V_BRKPNT, 68 + .equ V_EPI_OS, 69 + + .eject + + .macro R_LEFT,REGVAR + + ;Rotate left + ; + ; Parameters: REGVAR register to rotate + + add REGVAR, REGVAR, REGVAR ;shift left by 1 bit, C = MSB + addc REGVAR, REGVAR, 0 ;add C to LSB + + .endm +;---------------------------------------------------------------------- + + + .macro FUNCTION,NAME,INCNT,LOCCNT,OUTCNT + + ;Introduces a non-leaf routine. + ; + ;This macro defines the standard tag word before the function, + ;then establishes the statement label with the function's name + ;and finally allocates a register stack frame. It may not be used + ;if a memory stack frame is required. + ; + ;Note also that the size of the register stack frame is limited. + ;Neither this nor the lack of a memory frame is considered to be + ;a severe restriction in an assembly language environment. The + ;assembler will report errors if the requested frame is too large + ;for this macro. + ; + ;It may be good practice to allocate an even number of both output + ;registers and local registers. This will help in maintaining + ;double word alignment within these groups. The macro will assure + ;double word alignment of the stack frame as a whole as required + ;for correct linkage. + ; + ; Paramters: NAME the function name + ; INCNT input parameter count + ; LOCCNT local register count + ; OUTCNT output parameter count + + .set ALLOC_CNT, ((2 + OUTCNT + LOCCNT) << 2) + .set PAD_CNT, (ALLOC_CNT & 4) + .set ALLOC_CNT, (ALLOC_CNT + PAD_CNT) + .set REG_PAD, (PAD_CNT >> 2) + .if (INCNT) + .set IN_PRM, (4 + OUTCNT + REG_PAD + LOCCNT + 0x80) + .endif + .if (LOCCNT) + .set LOC_REG, (2 + OUTCNT + REG_PAD + 0x80) + .endif + .if (OUTCNT) + .set OUT_PRM, (2 + 0x80) + .endif + + .word ((2 + OUTCNT + LOCCNT) << 16) +NAME: + sub rsp, rsp, ALLOC_CNT + asgeu V_SPILL, rsp, rab + add lr1, rsp, ((4 + OUTCNT + LOCCNT + REG_PAD + INCNT) << 2) + + .endm +;---------------------------------------------------------------------- + + + .macro LEAF,NAME,INCNT + + ;Introduces a leaf routine + ; + ;This macro defines the standard tag word before the function, + ;then establishes the statement label with the function's name. + ; + ; Paramters: NAME the function name + ; INCNT input parameter count + + .if (INCNT) + .set IN_PRM, (2 + 0x80) + .endif + .set ALLOC_CNT, 0 + + .word 0 +NAME: + + .endm +;---------------------------------------------------------------------- + + + .macro EPILOGUE + + ;De-allocates register stack frame (only and only if necessary). + + .if (ALLOC_CNT) + + add rsp, rsp, ALLOC_CNT + nop + jmpi lr0 + asleu V_FILL, lr1, rfb + + .else + + jmpi lr0 + nop + + .endif + + .set IN_PRM, (1024) ;illegal, to cause err on ref + .set LOC_REG, (1024) ;illegal, to cause err on ref + .set OUT_PRM, (1024) ;illegal, to cause err on ref + .set ALLOC_CNT, (1024) ;illegal, to cause err on ref + + .endm +;---------------------------------------------------------------------- + + +;Initial values for macro set variables to guard against misuse + + .set IN_PRM, (1024) ;illegal, to cause err on ref + .set LOC_REG, (1024) ;illegal, to cause err on ref + .set OUT_PRM, (1024) ;illegal, to cause err on ref + .set ALLOC_CNT, (1024) ;illegal, to cause err on ref + +;...................................................................... +; end of romdcl.h diff --git a/newlib/libc/sys/a29khif/sys/smartmac.h b/newlib/libc/sys/a29khif/sys/smartmac.h new file mode 100644 index 000000000..2c870fa2a --- /dev/null +++ b/newlib/libc/sys/a29khif/sys/smartmac.h @@ -0,0 +1,1491 @@ +; @(#)smartmac.h 1.2 90/10/14 20:56:14, AMD +; start of smartmac.h file +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1988, 1989, 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; + .title "AM29000 Smart Macro Package" +; +; Floating point package for AMD 29000 family +; +; Copyright 1988 Advanced Micro Devices, Inc. +; +; All rights reserved +; +; Developed for AMD by Quantitative Technology Corporation +; 8700 SW Creekside Place Suite D +; Beaverton OR 97005 +; (503) 626-3081 +; +; Version information : +; +; Version 1.0 - 1 June 1988 - Larry Westerman (smart_macros.h) +; +; Revision 1.4 89/02/01 18:26:03 jimh +; Changed to relect the new symbols from Bob Perlman, and the new include file.s +; +; Revision 1.3 89/01/31 10:13:34 jimh +; Updated to use symbols from Bob Perlmans fpsymbol.h file. This is +; an extensive change. +; +; Revision 1.2 89/01/26 09:23:50 jimh +; This version checked in previous to substituting Bob Perlman's floating +; point symbols. +; +; Revision 1.1 89/01/24 13:23:29 jim +; Initial revision +; Replaces smart_macros.h ver 1.11. +; +; +; +; +; NOTES: +; +; This package makes the following assumptions about the use of these +; smart macros: +; +; 1. These macros will be after the entry code for a transcendental +; routine. This entry code will move the original function arguments +; (by value, if the target language is FORTRAN) into the global +; registers t0/t1 and t2/t3 (t0 and t2 for single precision +; routines). +; 2. The sources of all operands will be one register from the +; following list: +; t0 or t2 - the source is one of the original input operands +; rtn0 - the source is rtn0, which should be used as the +; source for all constant values to be sent to the +; AM29027 (when used) +; FP0 - FP7 - the source is one of the fp registers +; 3. The destination of all operations will be a register from the +; following list: +; rtn0 - the destination is the function return value +; FP0 - FP7 - the destination is one of the fp registers +; 4. The additional registers available for temporary use are +; t4, lrp, and slp. +; +; These register definitions are all taken from the file "proregs.a" +; which was supplied by AMD. NOTE that the FP0-FP7 registers, for the +; Am29000 version of the file, overlap with the rtn0-rtn15 registers, so +; that FP0 corresponds to rtn0/rtn1, FP1 to rtn2/rtn3, and so forth. +; + .equ ERROR,0 + .equ NO_ERROR,1 + + .equ DOUBLE_FUNCTION,0 + .equ SINGLE_FUNCTION,1 + + .equ T_OPERATION,0 + .equ Q_OPERATION,1 + + .equ R_SOURCE_29000,0 + .equ R_SOURCE_29027,1 + + .equ S_SOURCE_29000,0 + .equ S_SOURCE_29027,1 + + .equ DESTINATION_29000, 0 + .equ DESTINATION_29027, 1 + +; +; SMART MACRO : mfadd +; +; FUNCTION : single-precision floating point addition +; +; Required arguments : destination - one of possible destinations +; operand1 - one of possible sources +; operand2 - one of possible sources +; + .macro mfadd,destination,operand1,operand2 + + .if $narg!=3 + .err + .print "mfadd: missing parameter(s)" + .exitm + .endif + + .ifdef _29027_MODE + ; + ; For 29027 mode, perform full suite of checking + ; + initialize_previous_instruction + .set CURRENT_INSTRUCTION, CP_S_S | CP_P_PLUS_T + .set OPERATION_TYPE, T_OPERATION + perform_single_operation destination,operand1,operand2 + read_single_result destination + ; + ; Save the instruction for the next macro invocation + ; + .set PREVIOUS_INSTRUCTION, CURRENT_INSTRUCTION + + .else + ; + ; For 29000 mode, simply produce equivalent trap-inducing instruction + ; + fadd destination,operand1,operand2 + + .endif + + .endm ; end of mfadd macro definition + +; +; SMART MACRO : mfsub +; +; FUNCTION : single-precision floating point subtraction +; +; Required arguments : destination - one of possible destinations +; operand1 - one of possible sources +; operand2 - one of possible sources +; + .macro mfsub,destination,operand1,operand2 + + .if $narg!=3 + .err + .print "mfsub: missing parameter(s)" + .exitm + .endif + + .ifdef _29027_MODE + ; + ; For 29027 mode, perform full suite of checking + ; + initialize_previous_instruction + .set CURRENT_INSTRUCTION, CP_S_S | CP_P_MINUS_T + .set OPERATION_TYPE, T_OPERATION + perform_single_operation destination,operand1,operand2 + read_single_result destination + ; + ; Save the instruction for the next macro invocation + ; + .set PREVIOUS_INSTRUCTION, CURRENT_INSTRUCTION + + .else + ; + ; For 29000 mode, simply produce equivalent trap-inducing instruction + ; + fsub destination,operand1,operand2 + + .endif + + .endm ; end of mfsub macro definition + +; +; SMART MACRO : mfmul +; +; FUNCTION : single-precision floating point multiplication +; +; Required arguments : destination - one of possible destinations +; operand1 - one of possible sources +; operand2 - one of possible sources +; + .macro mfmul,destination,operand1,operand2 + + .if $narg!=3 + .err + .print "mfmul: missing parameter(s)" + .exitm + .endif + + .ifdef _29027_MODE + ; + ; For 29027 mode, perform full suite of checking + ; + initialize_previous_instruction + .set CURRENT_INSTRUCTION, CP_S_S | CP_P_TIMES_Q + .set OPERATION_TYPE, Q_OPERATION + perform_single_operation destination,operand1,operand2 + read_single_result destination + ; + ; Save the instruction for the next macro invocation + ; + .set PREVIOUS_INSTRUCTION, CURRENT_INSTRUCTION + + .else + ; + ; For 29000 mode, simply produce equivalent trap-inducing instruction + ; + fmul destination,operand1,operand2 + + .endif + + .endm ; end of mfmul macro definition + +; +; SMART MACRO : mfdiv +; +; FUNCTION : single-precision floating point divide +; +; Required arguments : destination - one of possible destinations +; operand1 - one of possible sources +; operand2 - one of possible sources +; + .macro mfdiv,destination,operand1,operand2 + + .if $narg!=3 + .err + .print "mfdiv: missing parameter(s)" + .exitm + .endif + + ; + ; Generate the trap instruction in all cases + ; + fdiv destination, operand1, operand2 + + .endm ; end of mfdiv macro definition + + +; +; SMART MACRO : mdadd +; +; FUNCTION : double-precision floating point addition +; +; Required arguments : destination - one of possible destinations +; operand1 - one of possible sources +; operand2 - one of possible sources +; + .macro mdadd,destination,operand1,operand2 + + .if $narg!=3 + .err + .print "mdadd: missing parameter(s)" + .exitm + .endif + + .ifdef _29027_MODE + ; + ; For 29027 mode, perform full suite of checking + ; + initialize_previous_instruction + .set CURRENT_INSTRUCTION, CP_D_D | CP_P_PLUS_T + .set OPERATION_TYPE, T_OPERATION + perform_double_operation destination,operand1,operand2 + read_double_result destination + ; + ; Save the instruction for the next macro invocation + ; + .set PREVIOUS_INSTRUCTION, CURRENT_INSTRUCTION + + .else + ; + ; For 29000 mode, simply produce equivalent trap-inducing instruction + ; + dadd destination,operand1,operand2 + + .endif + + .endm ; end of mdadd macro definition + +; +; SMART MACRO : mdsub +; +; FUNCTION : double-precision floating point subtraction +; +; Required arguments : destination - one of possible destinations +; operand1 - one of possible sources +; operand2 - one of possible sources +; + .macro mdsub,destination,operand1,operand2 + + .if $narg!=3 + .err + .print "mdsub: missing parameter(s)" + .exitm + .endif + + .ifdef _29027_MODE + ; + ; For 29027 mode, perform full suite of checking + ; + initialize_previous_instruction + .set CURRENT_INSTRUCTION, CP_D_D | CP_P_MINUS_T + .set OPERATION_TYPE, T_OPERATION + perform_double_operation destination,operand1,operand2 + read_double_result destination + ; + ; Save the instruction for the next macro invocation + ; + .set PREVIOUS_INSTRUCTION, CURRENT_INSTRUCTION + + .else + ; + ; For 29000 mode, simply produce equivalent trap-inducing instruction + ; + dsub destination,operand1,operand2 + + .endif + + .endm ; end of mdsub macro definition + +; +; SMART MACRO : mdmul +; +; FUNCTION : double-precision floating point multiplication +; +; Required arguments : destination - one of possible destinations +; operand1 - one of possible sources +; operand2 - one of possible sources +; + .macro mdmul,destination,operand1,operand2 + + .if $narg!=3 + .err + .print "mdmul: missing parameter(s)" + .exitm + .endif + + .ifdef _29027_MODE + ; + ; For 29027 mode, perform full suite of checking + ; + initialize_previous_instruction + .set CURRENT_INSTRUCTION, CP_D_D | CP_P_TIMES_Q + .set OPERATION_TYPE, Q_OPERATION + perform_double_operation destination,operand1,operand2 + read_double_result destination + ; + ; Save the instruction for the next macro invocation + ; + .set PREVIOUS_INSTRUCTION, CURRENT_INSTRUCTION + + .else + ; + ; For 29000 mode, simply produce equivalent trap-inducing instruction + ; + dmul destination,operand1,operand2 + + .endif + + .endm ; end of mdmul macro definition + +; +; SMART MACRO : mddiv +; +; FUNCTION : double-precision floating point divide +; +; Required arguments : destination - one of possible destinations +; operand1 - one of possible sources +; operand2 - one of possible sources +; + .macro mddiv,destination,operand1,operand2 + + .if $narg!=3 + .err + .print "mddiv: missing parameter(s)" + .exitm + .endif + + ; + ; Generate the trap instruction in all cases + ; + ddiv destination, operand1, operand2 + + .endm ; end of mfdiv macro definition + +; +; SMART MACRO: mconvert +; +; FUNCTION: Floating point/integer conversion +; +; PARAMETERS: destination - one of the possible destinations +; source - one of the possible sources +; sign_flag - one of SIGNED or UNSIGNED +; rounding_mode - one of ROUND_TO_NEAREST, ROUND_TO_PLUS, +; ROUND_TO_MINUS, ROUND_TO_ZERO +; destination_precision - one of FORMAT_INTEGER, FORMAT_DOUBLE, +; or FORMAT_SINGLE +; source_precision - one of FORMAT_INTEGER, FORMAT_DOUBLE, +; or FORMAT_SINGLE +; + .macro mconvert, destination, source, sign_flag, rounding_mode, destination_precision, source_precision + + .if $narg!=6 + .err + .print "mconvert: missing parameter(s)" + .exitm + .endif + + .ifdef _29027_MODE + ; + ; Generate in line 29027 code + ; + initialize_previous_instruction + .if ( destination_precision == FORMAT_INTEGER ) + .set CURRENT_INSTRUCTION, CP_CONVERT_T_TO_INT + select_T_operand source + .if ( source_precision == FORMAT_DOUBLE ) + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_S_D + .else + .if ( source_precision == FORMAT_SINGLE ) + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_S_S + .else + .err + .print "mconvert: invalid source type" + .exitm + .endif + .endif + .else + .if ( destination_precision == FORMAT_DOUBLE ) + .if ( source_precision == FORMAT_SINGLE ) + .set CURRENT_INSTRUCTION, CP_PASS_P | CP_P_EQ_R | CP_D_S + select_P_operand source + .else + .if ( source_precision == FORMAT_INTEGER ) + .set CURRENT_INSTRUCTION, CP_I_CONVERT_T_TO_FLOAT | CP_D_S + select_T_operand source + .else + .err + .print "mconvert: invalid source type" + .exitm + .endif + .endif + .else + .if ( destination_precision == FORMAT_SINGLE ) + .if ( source_precision == FORMAT_DOUBLE ) + .set CURRENT_INSTRUCTION, CP_PASS_P | CP_P_EQ_R | CP_S_D + select_P_operand source + .else + .if ( source_precision == FORMAT_INTEGER ) + .set CURRENT_INSTRUCTION, CP_I_CONVERT_T_TO_FLOAT | CP_S_S + select_T_operand source + .else + .err + .print "mconvert: invalid source type" + .exitm + .endif + .endif + .else + .err + .print "mconvert: invalid destination type " + .exitm + .endif + .endif + .endif + ; + ; Perform the operation, using a 29027 dummy register as the second + ; source operand, to avoid writing any data inappropriately to the + ; 29027 + ; + select_destination destination + .set S_SOURCE, S_SOURCE_29027 + .if ( source_precision == FORMAT_DOUBLE ) + write_and_execute_double_operation source, FP0 + .else + write_and_execute_single_operation source, FP0 + .endif + .if ( destination_precision == FORMAT_DOUBLE ) + read_double_result destination + .else + .if ( destination_precision == FORMAT_SINGLE ) + read_single_result destination + .else + read_integer_result destination + .endif + .endif + .else + ; + ; For 29000 mode (the default) just invoke the trap-inducing instruction + ; + convert destination,source,sign_flag,rounding_mode,destination_precision,source_precision + + .endif + + .endm ; end of mfeq macro definition + +; +; SMART MACRO: mfeq +; +; FUNCTION: Single precision, floating point compare +; +; PARAMETERS: destination - one of the possible destinations +; operand1 - one of the possible sources +; operand2 - one of the possible sources +; + .macro mfeq, destination, operand1, operand2 + + .if $narg!=3 + .err + .print "mfeq: missing parameter(s)" + .exitm + .endif + + .ifdef _29027_MODE + ; + ; Generate in line 29027 code + ; + initialize_previous_instruction + .set CURRENT_INSTRUCTION, CP_S_S | CP_COMPARE_P_AND_T + .set OPERATION_TYPE, T_OPERATION + select_destination destination + ; + ; 29027 registers are not valid destinations for compare operations + ; If the destination is a 29000 register, write the appropriate + ; Boolean value to that register. + ; + .if ( DESTINATION == DESTINATION_29027 ) + .err + .print "29027 destinations invalid for compares - @destination@" + .exitm + .else + perform_single_operation destination, operand1, operand2 + cp_read_flags destination + srl destination, destination, CP_EQUAL_FLAG_POSITION + sll destination, destination, 31 + .endif + + .else + ; + ; For 29000 mode (the default) just invoke the trap-inducing instruction + ; + feq destination,operand1,operand2 + + .endif + + .endm ; end of mfeq macro definition + +; +; SMART MACRO: mfge +; +; FUNCTION: Single precision, floating point compare +; +; PARAMETERS: destination - one of the possible destinations +; operand1 - one of the possible sources +; operand2 - one of the possible sources +; + .macro mfge, destination, operand1, operand2 + + .if $narg!=3 + .err + .print "mfge: missing parameter(s)" + .exitm + .endif + + .ifdef _29027_MODE + ; + ; Generate in line 29027 code + ; + initialize_previous_instruction + .set CURRENT_INSTRUCTION, CP_S_S | CP_COMPARE_P_AND_T + .set OPERATION_TYPE, T_OPERATION + select_destination destination + ; + ; 29027 registers are not valid destinations for compare operations + ; If the destination is a 29000 register, write the appropriate + ; Boolean value to that register. + ; + .if ( DESTINATION == DESTINATION_29027 ) + .err + .print "29027 destinations invalid for compares - @destination@" + .exitm + .else + perform_single_operation destination, operand1, operand2 + cp_read_flags destination + and destination, destination, CP_EQUAL_FLAG | CP_GREATER_THAN_FLAG + cpneq destination, destination, 0x0 + .endif + + .else + ; + ; For 29000 mode (the default) just invoke the trap-inducing instruction + ; + fge destination,operand1,operand2 + + .endif + + .endm ; end of mfge macro definition + +; +; SMART MACRO: mfgt +; +; FUNCTION: Single precision, floating point compare +; +; PARAMETERS: destination - one of the possible destinations +; operand1 - one of the possible sources +; operand2 - one of the possible sources +; + .macro mfgt, destination, operand1, operand2 + + .if $narg!=3 + .err + .print "mfgt: missing parameter(s)" + .exitm + .endif + + .ifdef _29027_MODE + ; + ; Generate in line 29027 code + ; + initialize_previous_instruction + .set CURRENT_INSTRUCTION, CP_S_S | CP_COMPARE_P_AND_T + .set OPERATION_TYPE, T_OPERATION + select_destination destination + ; + ; 29027 registers are not valid destinations for compare operations + ; If the destination is a 29000 register, write the appropriate + ; Boolean value to that register. + ; + .if ( DESTINATION == DESTINATION_29027 ) + .err + .print "29027 destinations invalid for compares - @destination@" + .exitm + .else + perform_single_operation destination, operand1, operand2 + cp_read_flags destination + srl destination, destination, CP_GREATER_THAN_FLAG_POSITION + sll destination, destination, 31 + .endif + + .else + ; + ; For 29000 mode (the default) just invoke the trap-inducing instruction + ; + fgt destination,operand1,operand2 + + .endif + + .endm ; end of mfgt macro definition + +; +; SMART MACRO: mdeq +; +; FUNCTION: Double precision, floating point compare +; +; PARAMETERS: destination - one of the possible destinations +; operand1 - one of the possible sources +; operand2 - one of the possible sources +; + .macro mdeq, destination, operand1, operand2 + + .if $narg!=3 + .err + .print "mdeq: missing parameter(s)" + .exitm + .endif + + + .ifdef _29027_MODE + ; + ; Generate in line 29027 code + ; + initialize_previous_instruction + .set CURRENT_INSTRUCTION, CP_D_D | CP_COMPARE_P_AND_T + .set OPERATION_TYPE, T_OPERATION + select_destination destination + ; + ; 29027 registers are not valid destinations for compare operations + ; If the destination is a 29000 register, write the appropriate + ; Boolean value to that register. + ; + .if ( DESTINATION == DESTINATION_29027 ) + .err + .print "29027 destinations invalid for compare - @destination@" + .exitm + .else + perform_double_operation destination, operand1, operand2 + cp_read_flags destination + srl destination, destination, CP_EQUAL_FLAG_POSITION + sll destination, destination, 31 + .endif + .else + ; + ; For 29000 mode (the default) just invoke the trap-inducing instruction + ; + deq destination,operand1,operand2 + + .endif + + .endm ; end of mdeq macro definition + +; +; SMART MACRO: mdge +; +; FUNCTION: Double precision, floating point compare +; +; PARAMETERS: destination - one of the possible destinations +; operand1 - one of the possible sources +; operand2 - one of the possible sources +; + .macro mdge, destination, operand1, operand2 + + .if $narg!=3 + .err + .print "mdge: missing parameter(s)" + .exitm + .endif + + + .ifdef _29027_MODE + ; + ; Generate in line 29027 code + ; + initialize_previous_instruction + .set CURRENT_INSTRUCTION, CP_D_D | CP_COMPARE_P_AND_T + .set OPERATION_TYPE, T_OPERATION + select_destination destination + ; + ; 29027 registers are not valid destinations for compare operations + ; If the destination is a 29000 register, write the appropriate + ; Boolean value to that register. + ; + .if ( DESTINATION == DESTINATION_29027 ) + .err + .print "29027 destinations invalid for compare - @destination@" + .exitm + .else + perform_double_operation destination, operand1, operand2 + cp_read_flags destination + and destination, destination, CP_EQUAL_FLAG | CP_GREATER_THAN_FLAG + cpneq destination, destination, 0x0 + .endif + .else + ; + ; For 29000 mode (the default) just invoke the trap-inducing instruction + ; + dge destination,operand1,operand2 + + .endif + + .endm ; end of mdge macro definition + +; +; SMART MACRO: mdgt +; +; FUNCTION: Double precision, floating point compare +; +; PARAMETERS: destination - one of the possible destinations +; operand1 - one of the possible sources +; operand2 - one of the possible sources +; + .macro mdgt, destination, operand1, operand2 + + .if $narg!=3 + .err + .print "mdgt: missing parameter(s)" + .exitm + .endif + + + .ifdef _29027_MODE + ; + ; Generate in line 29027 code + ; + initialize_previous_instruction + .set CURRENT_INSTRUCTION, CP_D_D | CP_COMPARE_P_AND_T + .set OPERATION_TYPE, T_OPERATION + select_destination destination + ; + ; 29027 registers are not valid destinations for compare operations + ; If the destination is a 29000 register, write the appropriate + ; Boolean value to that register. + ; + .if ( DESTINATION == DESTINATION_29027 ) + .err + .print "29027 destinations invalid for compare - @destination@" + .exitm + .else + perform_double_operation destination, operand1, operand2 + cp_read_flags destination + srl destination, destination, CP_GREATER_THAN_FLAG_POSITION + sll destination, destination, 31 + .endif + .else + ; + ; For 29000 mode (the default) just invoke the trap-inducing instruction + ; + dgt destination,operand1,operand2 + + .endif + + .endm ; end of mdgt macro definition + +; +; MACRO NAME : perform_double_operation +; +; FUNCTION : After the instruction base is set up, do the appropriate checking +; to send the instruction if necessary, send the double-precision +; operands if necessary, and start the operation +; +; PARAMETERS : destination - one of possible destination operands +; operand1 - one of possible source operands +; operand2 - one of possible source operands +; + .macro perform_double_operation,destination,operand1,operand2 + + .if $narg!=3 + .err + .print "perform_double_operation: missing parameter(s)" + .exitm + .endif + + ; + ; Start defining the instruction + ; + select_destination destination + select_P_operand operand1 + select_S_operand operand2 + + write_and_execute_double_operation operand1, operand2 + + .endm ; End of perform_double_operation macro definition + +; +; MACRO NAME : perform_single_operation +; +; FUNCTION : After the instruction base is set up, do the appropriate checking +; to send the instruction if necessary, send the single-precision +; operands if necessary and start the operation +; +; PARAMETERS : destination - one of possible destination operands +; operand1 - one of possible source operands +; operand2 - one of possible source operands +; + .macro perform_single_operation,destination,operand1,operand2 + + ; + ; Start defining the instruction + ; + select_destination destination + select_P_operand operand1 + select_S_operand operand2 + write_and_execute_single_operation operand1,operand2 + + .endm ; End of perform_single_operation macro definition + +; +; MACRO NAME : write_and_execute_double_operation +; +; FUNCTION : Write the instruction and operands for a double-precision +; operation, and start the operation +; +; PARAMETER : operand1 - first operand of double-precision operation +; operand2 - second operand of operation +; + .macro write_and_execute_double_operation,operand1,operand2 + .if ( ( R_SOURCE == R_SOURCE_29027 ) && ( S_SOURCE == S_SOURCE_29027 ) ) + ; + ; If both sources are within the 29027, write the instruction + ; and start the operation + ; + const t4, CURRENT_INSTRUCTION + consth t4, CURRENT_INSTRUCTION + cp_write_inst t4, START + .else + ; + ; One or both of the sources must be written first, so check the + ; previous instruction + ; + const t4, CURRENT_INSTRUCTION + consth t4, CURRENT_INSTRUCTION + cp_write_inst t4 + .if ( R_SOURCE == R_SOURCE_29000 ) && ( S_SOURCE == S_SOURCE_29027 ) + .ifeqs "@operand1@","t0" + cp_write_r t0, t1, START + .else + .ifeqs "@operand1@","t2" + cp_write_r t2, t3, START + .else + .ifeqs "@operand1@","rtn0" + cp_write_r rtn0, rtn1, START + .else + .err + .print "Invalid source for double operation - @operand1@" + .exitm + .endif + .endif + .endif + .endif + .if ( R_SOURCE == R_SOURCE_29027 ) && ( S_SOURCE == S_SOURCE_29000 ) + .ifeqs "@operand2@","t0" + cp_write_s t0, t1, START + .else + .ifeqs "@operand2@","t2" + cp_write_s t2, t3, START + .else + .ifeqs "@operand2@","rtn0" + cp_write_s rtn0, rtn1, START + .else + .err + .print "Invalid source for double operation - @operand1@" + .exitm + .endif + .endif + .endif + .endif + .if ( R_SOURCE == R_SOURCE_29000 ) && ( S_SOURCE == S_SOURCE_29000 ) + .ifeqs "@operand1@","t0" + cp_write_r t0, t1 + .else + .ifeqs "@operand1@","t2" + cp_write_r t2, t3 + .else + .ifeqs "@operand1@","rtn0" + cp_write_r rtn0, rtn1 + .else + .err + .print "Invalid source for double operation - @operand1@" + .exitm + .endif + .endif + .endif + .ifeqs "@operand2@","t0" + cp_write_s t0, t1, START + .else + .ifeqs "@operand2@","t2" + cp_write_s t2, t3, START + .else + .ifeqs "@operand2@","rtn0" + cp_write_s rtn0, rtn1, START + .else + .err + .print "Invalid source for double operation - @operand1@" + .exitm + .endif + .endif + .endif + .endif + .endif + + .endm ; end of write_and_execute_double_operation macro definition + +; +; MACRO NAME : write_and_execute_single_operation +; +; FUNCTION : If necessary, read the result from the 29027 into a +; register on the 29000 +; +; PARAMETER : operand1 - first source for single-precision operation +; operand2 - second source for operation +; + .macro write_and_execute_single_operation,operand1,operand2 + + .if ( ( R_SOURCE == R_SOURCE_29027 ) && ( S_SOURCE == S_SOURCE_29027 ) ) + ; + ; If both sources are within the 29027, write the instruction + ; and start the operation + ; + const t4, CURRENT_INSTRUCTION + consth t4, CURRENT_INSTRUCTION + cp_write_inst t4, START + .else + ; + ; One or both of the sources must be written first, so check the + ; previous instruction + ; + const t4,CURRENT_INSTRUCTION + consth t4,CURRENT_INSTRUCTION + cp_write_inst t4, START + .if ( R_SOURCE == R_SOURCE_29000 ) && ( S_SOURCE == S_SOURCE_29027 ) + cp_write_r operand1, operand1, START + .endif + .if ( R_SOURCE == R_SOURCE_29027 ) && ( S_SOURCE == S_SOURCE_29000 ) + cp_write_s operand2, operand2, START + .endif + .if ( R_SOURCE == R_SOURCE_29000 ) && ( S_SOURCE == S_SOURCE_29000 ) + cp_write_rs operand1, operand2, START + .endif + .endif + + .endm ; End of write_and_execute_single_operation macro definition + +; +; MACRO NAME : read_double_result +; +; FUNCTION : If necessary, read the result from the 29027 into a +; register on the 29000 +; +; PARAMETER : destination - one of the possible destination registers +; + .macro read_double_result,destination + .if ( DESTINATION == DESTINATION_29000 ) + ; + ; If the destination is not within the 29027 register file, read + ; the result and store it into the correct register in the 29000 + ; + .ifeqs "@destination@","rtn0" + cp_read_dp rtn0, rtn1 + .else + .err + .print "Invalid destination for double result - @destination@" + .exitm + .endif + .endif + + .endm ; End of read_double_result macro definition + +; +; MACRO NAME : read_single_result +; +; FUNCTION : If necessary, read the result from the 29027 into a +; register on the 29000 +; +; PARAMETER : destination +; + .macro read_single_result,destination + + .if ( DESTINATION == DESTINATION_29000 ) + ; + ; If the destination is not within the 29027 register file, read + ; the result and store it into the correct register in the 29000 + ; + .ifeqs "@destination@","rtn0" + cp_read_sp rtn0 + .else + .err + .print "Invalid destination for single result - @destination@" + .exitm + .endif + .endif + + .endm ; End of read_single_result macro definition + +; +; MACRO NAME : read_integer_result +; +; FUNCTION : If necessary, read the result from the 29027 into a +; register on the 29000 +; +; PARAMETER : destination +; + .macro read_integer_result,destination + + .if ( DESTINATION == DESTINATION_29000 ) + ; + ; If the destination is not within the 29027 register file, read + ; the result and store it into the correct register in the 29000 + ; + .ifeqs "@destination@","rtn0" + cp_read_int rtn0 + .else + .err + .print "Invalid destination for single result - @destination@" + .exitm + .endif + .endif + + .endm ; End of read_integer_result macro definition + +; +; MACRO NAME : select_P_operand +; +; FUNCTION : Given an operand, determine if the operand is from the +; register file, and if so, set the appropriate bits in +; the current instruction word. In addition, set the +; variable R_SOURCE to 0 for local register file, or 1 for +; floating-point register file. +; +; PARAMETER : operand1 - one of the possible source operands +; + .macro select_P_operand,operand1 + .ifeqs "@operand1@","t0" + .set R_SOURCE,R_SOURCE_29000 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_R + .exitm + .endif + .ifeqs "@operand1@","t2" + .set R_SOURCE,R_SOURCE_29000 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_R + .exitm + .endif + .ifeqs "@operand1@","rtn0" + .set R_SOURCE,R_SOURCE_29000 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_R + .exitm + .endif + .ifeqs "@operand1@","FP0" + .set R_SOURCE,R_SOURCE_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_RF0 + .exitm + .endif + .ifeqs "@operand1@","FP1" + .set R_SOURCE,R_SOURCE_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_RF1 + .exitm + .endif + .ifeqs "@operand1@","FP2" + .set R_SOURCE,R_SOURCE_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_RF2 + .exitm + .endif + .ifeqs "@operand1@","FP3" + .set R_SOURCE,R_SOURCE_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_RF3 + .exitm + .endif + .ifeqs "@operand1@","FP4" + .set R_SOURCE,R_SOURCE_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_RF4 + .exitm + .endif + .ifeqs "@operand1@","FP5" + .set R_SOURCE,R_SOURCE_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_RF5 + .exitm + .endif + .ifeqs "@operand1@","FP6" + .set R_SOURCE,R_SOURCE_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_RF6 + .exitm + .endif + .ifeqs "@operand1@","FP7" + .set R_SOURCE,R_SOURCE_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_RF7 + .exitm + .endif + .err + .print "@operand1@ - Invalid operand" + + .endm ; end of select_P_operand macro definition + +; +; MACRO NAME : select_S_operand +; +; FUNCTION : Given an operand, determine if the operand is from the +; register file, and if so, set the appropriate bits in +; the current instruction word. In addition, set the +; variable S_SOURCE to S_SOURCE_29000 or S_SOURCE_29027 +; as appropriate +; +; PARAMETER : operand2 - one of the possible source operands +; + .macro select_S_operand,operand2 + .ifeqs "@operand2@","t0" + .set S_SOURCE,S_SOURCE_29000 + .if ( OPERATION_TYPE == T_OPERATION ) + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_S + .else + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_S + .endif + .exitm + .endif + .ifeqs "@operand2@","t2" + .set S_SOURCE,S_SOURCE_29000 + .if ( OPERATION_TYPE == T_OPERATION ) + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_S + .else + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_S + .endif + .exitm + .endif + .ifeqs "@operand2@","rtn0" + .set S_SOURCE,S_SOURCE_29000 + .if ( OPERATION_TYPE == T_OPERATION ) + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_S + .else + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_S + .endif + .exitm + .endif + .ifeqs "@operand2@","FP0" + .set S_SOURCE,S_SOURCE_29027 + .if ( OPERATION_TYPE == T_OPERATION ) + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF0 + .else + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_RF0 + .endif + .exitm + .endif + .ifeqs "@operand2@","FP1" + .set S_SOURCE,S_SOURCE_29027 + .if ( OPERATION_TYPE == T_OPERATION ) + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF1 + .else + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_RF1 + .endif + .exitm + .endif + .ifeqs "@operand2@","FP2" + .set S_SOURCE,S_SOURCE_29027 + .if ( OPERATION_TYPE == T_OPERATION ) + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF2 + .else + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_RF2 + .endif + .exitm + .endif + .ifeqs "@operand2@","FP3" + .set S_SOURCE,S_SOURCE_29027 + .if ( OPERATION_TYPE == T_OPERATION ) + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF3 + .else + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_RF3 + .endif + .exitm + .endif + .ifeqs "@operand2@","FP4" + .set S_SOURCE,S_SOURCE_29027 + .if ( OPERATION_TYPE == T_OPERATION ) + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF4 + .else + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_RF4 + .endif + .exitm + .endif + .ifeqs "@operand2@","FP5" + .set S_SOURCE,S_SOURCE_29027 + .if ( OPERATION_TYPE == T_OPERATION ) + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF5 + .else + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_RF5 + .endif + .exitm + .endif + .ifeqs "@operand2@","FP6" + .set S_SOURCE,S_SOURCE_29027 + .if ( OPERATION_TYPE == T_OPERATION ) + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF6 + .else + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_RF6 + .endif + .exitm + .endif + .ifeqs "@operand2@","FP7" + .set S_SOURCE,S_SOURCE_29027 + .if ( OPERATION_TYPE == T_OPERATION ) + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF7 + .else + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_RF7 + .endif + .exitm + .endif + .err + .print "@operand2@ - Invalid operand" + + .endm ; end of select_S_operand macro definition + +; +; MACRO NAME : select_T_operand +; +; FUNCTION : Given an operand, determine if the operand is from the +; register file, and if so, set the appropriate bits in +; the current instruction word, to read the corresponding +; source into the T operand. In addition, set the +; variable R_SOURCE to 0 for local register file, or 1 for +; floating-point register file. +; +; PARAMETER : operand1 - one of the possible source operands +; + .macro select_T_operand,operand1 + .ifeqs "@operand1@","t0" + .set R_SOURCE,R_SOURCE_29000 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_R + .exitm + .endif + .ifeqs "@operand1@","t2" + .set R_SOURCE,R_SOURCE_29000 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_R + .exitm + .endif + .ifeqs "@operand1@","rtn0" + .set R_SOURCE,R_SOURCE_29000 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_R + .exitm + .endif + .ifeqs "@operand1@","FP0" + .set R_SOURCE,R_SOURCE_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF0 + .exitm + .endif + .ifeqs "@operand1@","FP1" + .set R_SOURCE,R_SOURCE_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF1 + .exitm + .endif + .ifeqs "@operand1@","FP2" + .set R_SOURCE,R_SOURCE_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF2 + .exitm + .endif + .ifeqs "@operand1@","FP3" + .set R_SOURCE,R_SOURCE_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF3 + .exitm + .endif + .ifeqs "@operand1@","FP4" + .set R_SOURCE,R_SOURCE_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF4 + .exitm + .endif + .ifeqs "@operand1@","FP5" + .set R_SOURCE,R_SOURCE_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF5 + .exitm + .endif + .ifeqs "@operand1@","FP6" + .set R_SOURCE,R_SOURCE_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF6 + .exitm + .endif + .ifeqs "@operand1@","FP7" + .set R_SOURCE,R_SOURCE_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF7 + .exitm + .endif + .err + .print "@operand1@ - Invalid operand" + + .endm ; end of select_T_operand macro definition + +; +; MACRO NAME : select_destination +; +; FUNCTION : Given a destination, determine if the operand is from the +; register file, and if so, set the appropriate bits in +; the current instruction word. In addition, set the +; variable DESTINATION to DESTINATION_29000 or +; DESTINATION_29027 as appropriate +; +; PARAMETER : destination - one of the possible destination operands +; + .macro select_destination,destination + .ifeqs "@destination@","rtn0" + .set DESTINATION,DESTINATION_29000 + .exitm + .endif + .ifeqs "@destination@","FP0" + .set DESTINATION,DESTINATION_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_DEST_EQ_RF0 + .exitm + .endif + .ifeqs "@destination@","FP1" + .set DESTINATION,DESTINATION_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_DEST_EQ_RF1 + .exitm + .endif + .ifeqs "@destination@","FP2" + .set DESTINATION,DESTINATION_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_DEST_EQ_RF2 + .exitm + .endif + .ifeqs "@destination@","FP3" + .set DESTINATION,DESTINATION_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_DEST_EQ_RF3 + .exitm + .endif + .ifeqs "@destination@","FP4" + .set DESTINATION,DESTINATION_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_DEST_EQ_RF4 + .exitm + .endif + .ifeqs "@destination@","FP5" + .set DESTINATION,DESTINATION_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_DEST_EQ_RF5 + .exitm + .endif + .ifeqs "@destination@","FP6" + .set DESTINATION,DESTINATION_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_DEST_EQ_RF6 + .exitm + .endif + .ifeqs "@destination@","FP7" + .set DESTINATION,DESTINATION_29027 + .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_DEST_EQ_RF7 + .exitm + .endif + .err + .print "@destination@ - Invalid operand" + + .endm ; end of select_destination macro definition + +; MACRO NAME : initialize_previous_instruction +; +; FUNCTION : Make sure the previous instruction is defined and set to zero +; + .macro initialize_previous_instruction + + .ifndef PREVIOUS_INSTRUCTION + ; + ; Make sure that the previous instruction variable is initialized + ; + .set PREVIOUS_INSTRUCTION,0 + .endif + + .endm ; end of initialize_previous_instruction macro definition + + +; MACRO NAME : prepare_function_parameters +; +; FUNCTION : To place the input parameters into the correct position for +; use by the function body. When the target language is +; FORTRAN, the values of the input arguments are read from the +; supplied addresses and moved to the t0-t3 temporary area. +; When the target language is C or Pascal, the values of the +; input arguments are simply moved to the t0-t3 temporary area. +; + .macro prepare_function_parameters,arg1,arg2 + + .if $narg==0 + .err + .print "Missing function argument(s)" + .exitm + .endif + + .if $narg>2 + .err + .print "Too many function arguments + .exitm + .endif + + .if $narg>=1 + .if $isreg(@arg1) + .ifdef FORTRAN + load 0,0,t0,arg1 + .if ( FUNCTION_TYPE == DOUBLE_FUNCTION ) + add t1,arg1,4 + load 0,0,t1,t1 + .endif + .else + add t0,arg1,0 + .if ( FUNCTION_TYPE == DOUBLE_FUNCTION ) + add t1,%%(&arg1+1),0 + .endif + .endif + .else + .err + .print "Function argument not register - @arg1@" + .endif + .endif + .if $narg==2 + .if $isreg (@arg2) + .ifdef FORTRAN + load 0,0,t2,arg2 + .if ( FUNCTION_TYPE == DOUBLE_FUNCTION ) + add t3,arg2,4 + load 0,0,t3,t3 + .endif + .else + add t2,arg2,0 + .if ( FUNCTION_TYPE == DOUBLE_FUNCTION ) + add t3,%%(&arg2+1),0 + .endif + .endif + .else + .err + .print "Function argument not register - @arg2@" + .endif + .endif + + .endm ; end of prepare_function_parameters macro definition + +; end of smartmac.h file diff --git a/newlib/libc/sys/a29khif/sys/sysmac.h b/newlib/libc/sys/a29khif/sys/sysmac.h new file mode 100644 index 000000000..01ff9eec2 --- /dev/null +++ b/newlib/libc/sys/a29khif/sys/sysmac.h @@ -0,0 +1,165 @@ +; @(#)sysmac.h 1.7 90/10/14 20:56:17, Copyright 1988, 1989, 1990 AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1988, 1989, 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; sysmac.h +; + .include "sys/proreg.h" + +; Supported system call function numbers - BSD emulation + + .equ BSD_exit, 1 + .equ BSD_open, 5 + .equ BSD_close, 6 + .equ BSD_remove, 10 + .equ BSD_lseek, 19 + .equ BSD_sbrk, 69 + .equ BSD_readv, 120 + .equ BSD_writev, 121 + .equ BSD_rename, 128 +; Functions above 0x100 are handled by Am29000 code + .equ BSD_alloc, 0x101 + .equ BSD_free, 0x102 + .equ BSD_getpagesize, 0x103 + + .equ BSD_clock, 0x111 + +; Supported system call function numbers - HIF version 2.0 + + .equ HIF_exit, 0x01 + + .equ HIF_open, 0x11 + .equ HIF_close, 0x12 + .equ HIF_read, 0x13 + .equ HIF_write, 0x14 + .equ HIF_lseek, 0x15 + .equ HIF_remove, 0x16 + .equ HIF_rename, 0x17 + .equ HIF_ioctl, 0x18 + .equ HIF_iowait, 0x19 + .equ HIF_iostat, 0x1a + + .equ HIF_tmpnam, 0x21 + + .equ HIF_time, 0x31 + + .equ HIF_getenv, 0x41 + .equ HIF_gettz, 0x43 + + .equ HIF_sysalloc, 0x101 + .equ HIF_alloc, HIF_sysalloc ;Synonym. + .equ HIF_sysfree, 0x102 + .equ HIF_free, HIF_sysfree ;Synonym. + .equ HIF_getpsize, 0x103 + .equ HIF_getpagesize,HIF_getpsize ;Synonym. + .equ HIF_getargs, 0x104 + + .equ HIF_clock, 0x111 + .equ HIF_cycles, 0x112 + + .equ HIF_setvec, 0x121 + .equ HIF_settrap, 0x122 + .equ HIF_setim, 0x123 + + .equ HIF_query, 0x131 + + .equ HIF_signal, 0x141 + .equ HIF_sigdfl, 0x142 + .equ HIF_sigret, 0x143 + .equ HIF_sigrep, 0x144 + .equ HIF_sigskp, 0x145 + .equ HIF_sendsig, 0x146 + +;Maintain compatibility with HIF 1.0 code. + + .equ EPI_exit, HIF_exit + + .equ EPI_open, HIF_open + .equ EPI_close, HIF_close + .equ EPI_read, HIF_read + .equ EPI_write, HIF_write + .equ EPI_lseek, HIF_lseek + .equ EPI_remove, HIF_remove + .equ EPI_rename, HIF_rename + + .equ EPI_tmpnam, HIF_tmpnam + + .equ EPI_time, HIF_time + + .equ EPI_getenv, HIF_getenv + .equ EPI_gettz, HIF_gettz + .equ EPI_alloc, HIF_sysalloc + .equ EPI_free, HIF_sysfree + .equ EPI_getpagesize, HIF_getpsize + .equ EPI_getargs, HIF_getargs + + .equ EPI_clock, HIF_clock + .equ EPI_cycles, HIF_cycles + + .equ EPI_setvec, HIF_setvec + + .equ V_SYSCALL, 69 + +; System call macros +/* Now that source files have been sed'd to avoid these macros, they + are just commented out. -- gnu@cygnus.com Oct 90 + + .ifdef _BSD_OS + .equ V_SYSCALL, 66 + .else + .equ V_SYSCALL, 69 + .endif + + .macro syscall, name + .ifdef _BSD_OS + const tav, SYS_@name + .else + const tav, HIF_@name + .endif + asneq V_SYSCALL, gr1, gr1 + .endm + +; error return +; set errno to the error value in tav. +; return -1 +; + .macro returnerr +;; .extern _errno ; rather have undef'd sym than multiple def's + const tpc, _errno + consth tpc, _errno + store 0, 0, tav, tpc + jmpi lr0 + constn v0, -1 + .endm + +; package the most common case in one macro +; + .macro system, name + syscall name + jmpti tav, lr0 + returnerr + .endm + */ diff --git a/newlib/libc/sys/a29khif/systime.s b/newlib/libc/sys/a29khif/systime.s new file mode 100644 index 000000000..95b193360 --- /dev/null +++ b/newlib/libc/sys/a29khif/systime.s @@ -0,0 +1,44 @@ +; @(#)systime.s 1.2 90/10/14 21:57:59, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; _time.s +; time_t secs = time( time_t *secs ); +; +; NOTE - Will not work on BSD (no time sys call) +; + .file "systime.s" + .include "sys/sysmac.h" + .text + .word 0x00030000 ; Debugger tag word + .global _time +_time: + const tav,HIF_time @ asneq V_SYSCALL,gr1,gr1 + cpeq gr97, lr2, 0 + jmpti gr97, lr0 + nop + jmpi lr0 + store 0, 0, gr96, lr2 + .end diff --git a/newlib/libc/sys/a29khif/vec.s b/newlib/libc/sys/a29khif/vec.s new file mode 100644 index 000000000..5a7083a3c --- /dev/null +++ b/newlib/libc/sys/a29khif/vec.s @@ -0,0 +1,35 @@ +; @(#)vec.s 1.2 90/10/14 21:58:01, AMD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Copyright 1990 Advanced Micro Devices, Inc. +; +; This software is the property of Advanced Micro Devices, Inc (AMD) which +; specifically grants the user the right to modify, use and distribute this +; software provided this notice is not removed or altered. All other rights +; are reserved by AMD. +; +; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS +; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL +; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR +; USE OF THIS SOFTWARE. +; +; So that all may benefit from your experience, please report any problems +; or suggestions about this software to the 29K Technical Support Center at +; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or +; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118. +; +; Advanced Micro Devices, Inc. +; 29K Support Products +; Mail Stop 573 +; 5900 E. Ben White Blvd. +; Austin, TX 78741 +; 800-292-9263 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + .global V_SPILL, V_FILL + .global V_EPI_OS, V_BSD_OS + + .equ V_SPILL, 64 + .equ V_FILL, 65 + + .equ V_BSD_OS, 66 + .equ V_EPI_OS, 69 + .end diff --git a/newlib/libc/sys/aclocal.m4 b/newlib/libc/sys/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/sys/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/sys/arm/Makefile.am b/newlib/libc/sys/arm/Makefile.am new file mode 100644 index 000000000..1af0f8ddd --- /dev/null +++ b/newlib/libc/sys/arm/Makefile.am @@ -0,0 +1,14 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = syscalls.c libcfunc.c trap.S setjmp.S + +all: crt0.o + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/sys/arm/Makefile.in b/newlib/libc/sys/arm/Makefile.in new file mode 100644 index 000000000..ac2d41036 --- /dev/null +++ b/newlib/libc/sys/arm/Makefile.in @@ -0,0 +1,320 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = syscalls.c libcfunc.c trap.S setjmp.S + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = syscalls.o libcfunc.o trap.o setjmp.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in \ + ../../../acinclude.m4 ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + -rm -f config.status + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ +check-am installcheck-am installcheck install-info-am install-info \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all: crt0.o + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/sys/arm/aclocal.m4 b/newlib/libc/sys/arm/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/sys/arm/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/sys/arm/configure b/newlib/libc/sys/arm/configure new file mode 100755 index 000000000..3a28b7179 --- /dev/null +++ b/newlib/libc/sys/arm/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=trap.S + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/sys/arm/configure.in b/newlib/libc/sys/arm/configure.in new file mode 100644 index 000000000..eeac4889f --- /dev/null +++ b/newlib/libc/sys/arm/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/sys/arm configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(trap.S) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/sys/arm/crt0.S b/newlib/libc/sys/arm/crt0.S new file mode 100644 index 000000000..174c88971 --- /dev/null +++ b/newlib/libc/sys/arm/crt0.S @@ -0,0 +1,244 @@ +#include "swi.h" + +/* ANSI concatenation macros. */ +#define CONCAT(a, b) CONCAT2(a, b) +#define CONCAT2(a, b) a ## b + +#ifdef __USER_LABEL_PREFIX__ +#define FUNCTION( name ) CONCAT (__USER_LABEL_PREFIX__, name) +#else +#error __USER_LABEL_PREFIX is not defined +#endif + +/* .text is used instead of .section .text so it works with arm-aout too. */ + .text + .code 32 + .align 0 + + .global _mainCRTStartup + .global _start + .global start +start: +_start: +_mainCRTStartup: + +/* Start by setting up a stack */ +#ifdef ARM_RDP_MONITOR + /* Issue Demon SWI to read stack info */ + swi SWI_GetEnv /* Returns command line in r0 */ + mov sp,r1 /* and the highest memory address in r1 */ + ldr sl, .LC2 /* stack limit is at end of data */ + add sl, sl, #256 /* allow slop for stack overflow handling */ + /* and small frames */ +#else +#ifdef ARM_RDI_MONITOR + /* Issue Angel SWI to read stack info */ + mov r0, #AngelSWI_Reason_HeapInfo + adr r1, .LC0 /* point at ptr to 4 words to receive data */ + swi AngelSWI_ARM /* We are always in ARM mode for startup */ + ldr r0, .LC0 /* point at values read */ + ldr sp, [r0, #8] + ldr sl, [r0, #12] + add sl, sl, #256 /* allow slop for stack overflow handling */ + /* and small frames */ +#else + /* Set up the stack pointer to a fixed value */ + ldr r3, .LC0 + mov sp, r3 + /* Setup a default stack-limit in-case the code has been + compiled with "-mapcs-stack-check". Hard-wiring this value + is not ideal, since there is currently no support for + checking that the heap and stack have not collided, or that + this default 64k is enough for the program being executed. + However, it ensures that this simple crt0 world will not + immediately cause an overflow event: */ + sub sl, sp, #64 << 10 /* Still assumes 256bytes below sl */ +#endif +#endif + mov a2, #0 /* Second arg: fill value */ + mov fp, a2 /* Null frame pointer */ + mov r7, a2 /* Null frame pointer for Thumb */ + + ldr a1, .LC1 /* First arg: start of memory block */ + ldr a3, .LC2 + sub a3, a3, a1 /* Third arg: length of block */ + + +#ifdef __thumb__ /* Enter Thumb mode.... */ + + add a4, pc, #1 /* Get the address of the Thumb block */ + bx a4 /* Go there and start Thumb decoding */ + + .code 16 + .global __change_mode + .thumb_func +__change_mode: +#endif + + bl FUNCTION (memset) +#if !defined (ARM_RDP_MONITOR) && !defined (ARM_RDI_MONITOR) + mov r0, #0 /* no arguments */ + mov r1, #0 /* no argv either */ +#else + /* Need to set up standard file handles */ + bl FUNCTION (initialise_monitor_handles) + +#ifdef ARM_RDP_MONITOR + swi SWI_GetEnv /* sets r0 to point to the command line */ + mov r1, r0 +#else + mov r0, #AngelSWI_Reason_GetCmdLine + adr r1, .LC30 /* Space for command line */ + swi AngelSWI + ldr r1, .LC30 +#endif + /* Parse string at r1 */ + mov r0, #0 /* count of arguments so far */ +.LC10: +/* Skip leading blanks */ +#ifdef __thumb__ + ldrb r3, [r1] + add r1, #1 +#else + ldrb r3, [r1], #1 +#endif + cmp r3, #0 + beq .LC12 + cmp r3, #' ' + beq .LC10 + +/* See whether we are scanning a string */ + cmp r3, #'"' +#ifdef __thumb__ + beq .LC20 + cmp r3, #'\'' + bne .LC21 +.LC20: + mov r2, r3 + b .LC22 + +.LC21: + mov r2, #' ' /* terminator type */ + sub r1, r1, #1 /* adjust back to point at start char */ +.LC22: +#else + cmpne r3, #'\'' + moveq r2, r3 + movne r2, #' ' /* terminator type */ + subne r1, r1, #1 /* adjust back to point at start char */ +#endif + +/* Stack a pointer to the current argument */ +#ifdef __thumb__ + push {r1} +#else + stmfd sp!, {r1} +#endif + add r0, r0, #1 +.LC11: +#ifdef __thumb__ + ldrb r3, [r1] + add r1, #1 +#else + ldrb r3, [r1], #1 +#endif + cmp r3, #0 + beq .LC12 + cmp r2, r3 /* reached terminator? */ + bne .LC11 + mov r2, #0 + sub r3, r1, #1 + strb r2, [r3] /* terminate the arg string */ + b .LC10 + +.LC12: + mov r1, sp /* point at stacked arg pointers */ + /* We've now got the stacked args in order reverse the */ +#ifdef __thumb__ + mov r2, r0 + lsl r2, #2 + add r2, sp + mov r3, sp +.LC15: cmp r2, r3 + bls .LC14 + sub r2, #4 + ldr r4, [r2] + ldr r5, [r3] + str r5, [r2] + str r4, [r3] + add r3, #4 + b .LC15 +.LC14: +#else + add r2, sp, r0, LSL #2 /* End of args */ + mov r3, sp /* Start of args */ +.LC13: cmp r2, r3 + ldrhi r4,[r2, #-4] /* Reverse ends of list */ + ldrhi r5, [r3] + strhi r5, [r2, #-4]! + strhi r4, [r3], #4 + bhi .LC13 +#endif + +#endif + bl FUNCTION (main) + + bl FUNCTION (exit) /* Should not return */ + +#ifdef __thumb__ + /* Come out of Thumb mode... This code should be redundant... */ + + mov a4, pc + bx a4 + + .code 32 + .global change_back +change_back: + /* Halt the execution. This code should never be executed. */ + /* + ** With no debug monitor, this probably aborts (eventually). + ** With a Demon debug monitor, this halts cleanly. + ** With an Angel debug monitor, this will report 'Unknown SWI'. + */ + swi SWI_Exit +#endif + + /* For Thumb, constants must be after the code since only + positive offsets are supported for PC relative addresses. */ + + .align 0 +.LC0: +#ifdef ARM_RDI_MONITOR + .word HeapBase +#else +#ifndef ARM_RDP_MONITOR +#ifdef __pe__ + .word 0x800000 +#else +/* .word 0x80000 */ /* Top of RAM on the PIE board */ +#endif +#endif +#endif +.LC1: + .word __bss_start__ +.LC2: + .word __bss_end__ + +#ifdef ARM_RDI_MONITOR +.LC30: .word CommandLine + +/* Workspace for Angel calls. */ + .data +/* Data returned by monitor SWI */ +HeapBase: .word 0 +HeapLimit: .word 0 +StackBase: .word 0 +StackLimit: .word 0 +CommandLine: .space 256,0 /* Maximum length of 255 chars handled */ +#endif + +#ifdef __pe__ + .section .idata$3 + .long 0,0,0,0,0,0,0,0 +#endif + diff --git a/newlib/libc/sys/arm/libcfunc.c b/newlib/libc/sys/arm/libcfunc.c new file mode 100644 index 000000000..ddc611f34 --- /dev/null +++ b/newlib/libc/sys/arm/libcfunc.c @@ -0,0 +1,40 @@ +/* Support files for GNU libc. Files in the C namespace go here. + Files in the system namespace (ie those that start with an underscore) + go in syscalls.c. + + Note: These functions are in a seperate file so that OS providers can + overrride the system call stubs (defined in syscalls.c) without having + to provide libc funcitons as well. */ +#include "swi.h" + +#ifdef ARM_RDI_MONITOR + +static inline int +do_AngelSWI (int reason, void * arg) +{ + int value; + asm volatile ("mov r0, %1; mov r1, %2; swi %a3; mov %0, r0" + : "=r" (value) /* Outputs */ + : "r" (reason), "r" (arg), "i" (AngelSWI) /* Inputs */ + : "r0", "r1", "lr" + /* Clobbers r0 and r1, and lr if in supervisor mode */); + return value; +} +#endif /* ARM_RDI_MONITOR */ + + +void +abort (void) +{ +#ifdef ARM_RDI_MONITOR + do_AngelSWI (AngelSWI_Reason_ReportException, + (void *) ADP_Stopped_RunTimeError); +#else + asm ("mov r0,#17\nswi %a0" :: "i" (SWI_Exit)); +#endif +} + +void +alarm (void) +{ +} diff --git a/newlib/libc/sys/arm/setjmp.S b/newlib/libc/sys/arm/setjmp.S new file mode 100644 index 000000000..eab8e214a --- /dev/null +++ b/newlib/libc/sys/arm/setjmp.S @@ -0,0 +1,102 @@ +/* This is a simple version of setjmp and longjmp. + + Nick Clifton, Cygnus Solutions, 13 June 1997. */ + +/* ANSI concatenation macros. */ +#define CONCAT(a, b) CONCAT2(a, b) +#define CONCAT2(a, b) a ## b + +#ifdef __USER_LABEL_PREFIX__ +#define FUNCTION( name ) CONCAT (__USER_LABEL_PREFIX__, name) +#else +#error __USER_LABEL_PREFIX__ is not defined +#endif + + + .text + .code 32 + .align 2 + +/* int setjmp (jmp_buf); */ + .globl FUNCTION(setjmp) +FUNCTION(setjmp): + + /* Save all the callee-preserved registers into the jump buffer. */ + stmea a1!, { v1-v7, fp, ip, sp, lr } + +#if 0 /* Simulator does not cope with FP instructions yet.... */ +#ifndef __SOFTFP__ + /* Save the floating point registers */ + sfmea f4, 4, [a1] +#endif +#endif + /* When setting up the jump buffer return 0. */ + mov a1, #0 + + /* Return to caller, see comment in longjmp below */ +#ifdef __APCS_26__ + movs pc, lr +#else + tst lr, #1 + moveq pc, lr +.word 0xe12fff1e /* bx lr */ +#endif + + +/* volatile void longjmp (jmp_buf, int); */ + .globl FUNCTION(longjmp) +FUNCTION(longjmp): + + /* If we have stack extension code it ought to be handled here. */ + + /* Restore the registers, retrieving the state when setjmp() was called. */ + ldmfd a1!, { v1-v7, fp, ip, sp, lr } + +#if 0 /* Simulator does not cope with FP instructions yet.... */ +#ifndef __SOFTFP__ + /* Restore floating point registers as well */ + lfmfd f4, 4, [a1] +#endif +#endif + /* Put the return value into the integer result register. + But if it is zero then return 1 instead. */ + movs a1, a2 + moveq a1, #1 + + /* Arm/Thumb interworking support: + + The interworking scheme expects functions to use a BX instruction + to return control to their parent. Since we need this code to work + in both interworked and non-interworked environments as well as with + older processors which do not have the BX instruction we do the + following: + Test the return address. + If the bottom bit is clear perform an "old style" function exit. + (We know that we are in ARM mode and returning to an ARM mode caller). + Otherwise use the BX instruction to perform the function exit. + + We know that we will never attempt to perform the BX instruction on + an older processor, because that kind of processor will never be + interworked, and a return address with the bottom bit set will never + be generated. + + In addition, we do not actually assemble the BX instruction as this would + require us to tell the assembler that the processor is an ARM7TDMI and + it would store this information in the binary. We want this binary to be + able to be linked with binaries compiled for older processors however, so + we do not want such information stored there. + + If we are running using the APCS-26 convention however, then we never + test the bottom bit, because this is part of the processor status. + Instead we just do a normal return, since we know that we cannot be + returning to a Thumb caller - the Thumb doe snot support APCS-26 + */ + +#ifdef __APCS_26__ + movs pc, lr +#else + tst lr, #1 + moveq pc, lr +.word 0xe12fff1e /* bx lr */ +#endif + diff --git a/newlib/libc/sys/arm/swi.h b/newlib/libc/sys/arm/swi.h new file mode 100644 index 000000000..91fad5912 --- /dev/null +++ b/newlib/libc/sys/arm/swi.h @@ -0,0 +1,65 @@ + +/***************************************************************************\ +* SWI numbers * +\***************************************************************************/ + +/* SWI numbers for RDP (Demon) monitor */ +#define SWI_WriteC 0x0 +#define SWI_Write0 0x2 +#define SWI_ReadC 0x4 +#define SWI_CLI 0x5 +#define SWI_GetEnv 0x10 +#define SWI_Exit 0x11 +#define SWI_EnterOS 0x16 + +#define SWI_GetErrno 0x60 +#define SWI_Clock 0x61 +#define SWI_Time 0x63 +#define SWI_Remove 0x64 +#define SWI_Rename 0x65 +#define SWI_Open 0x66 + +#define SWI_Close 0x68 +#define SWI_Write 0x69 +#define SWI_Read 0x6a +#define SWI_Seek 0x6b +#define SWI_Flen 0x6c + +#define SWI_IsTTY 0x6e +#define SWI_TmpNam 0x6f +#define SWI_InstallHandler 0x70 +#define SWI_GenerateError 0x71 + + +/* Now the SWI numbers and reason codes for RDI (Angel) monitors */ +#define AngelSWI_ARM (0x123456) +#ifdef __thumb__ +#define AngelSWI (0xAB) +#else +#define AngelSWI AngelSWI_ARM +#endif + +/* The reason codes: */ +#define AngelSWI_Reason_Open (0x01) +#define AngelSWI_Reason_Close (0x02) +#define AngelSWI_Reason_WriteC (0x03) +#define AngelSWI_Reason_Write0 (0x04) +#define AngelSWI_Reason_Write (0x05) +#define AngelSWI_Reason_Read (0x06) +#define AngelSWI_Reason_ReadC (0x07) +#define AngelSWI_Reason_IsTTY (0x09) +#define AngelSWI_Reason_Seek (0x0A) +#define AngelSWI_Reason_FLen (0x0C) +#define AngelSWI_Reason_TmpNam (0x0D) +#define AngelSWI_Reason_Remove (0x0E) +#define AngelSWI_Reason_Rename (0x0F) +#define AngelSWI_Reason_Clock (0x10) +#define AngelSWI_Reason_Time (0x11) +#define AngelSWI_Reason_System (0x12) +#define AngelSWI_Reason_Errno (0x13) +#define AngelSWI_Reason_GetCmdLine (0x15) +#define AngelSWI_Reason_HeapInfo (0x16) +#define AngelSWI_Reason_EnterSVC (0x17) +#define AngelSWI_Reason_ReportException (0x18) +#define ADP_Stopped_ApplicationExit ((2 << 16) + 38) +#define ADP_Stopped_RunTimeError ((2 << 16) + 34) diff --git a/newlib/libc/sys/arm/sys/param.h b/newlib/libc/sys/arm/sys/param.h new file mode 100644 index 000000000..968c8ef14 --- /dev/null +++ b/newlib/libc/sys/arm/sys/param.h @@ -0,0 +1,10 @@ +/* ARM configuration file; HZ is 100 rather than the default 60 */ + +#ifndef _SYS_PARAM_H +# define _SYS_PARAM_H + +# define HZ (100) +# define NOFILE (60) +# define PATHSIZE (1024) + +#endif diff --git a/newlib/libc/sys/arm/syscalls.c b/newlib/libc/sys/arm/syscalls.c new file mode 100644 index 000000000..fb190e11b --- /dev/null +++ b/newlib/libc/sys/arm/syscalls.c @@ -0,0 +1,575 @@ +/* Support files for GNU libc. Files in the system namespace go here. + Files in the C namespace (ie those that do not start with an + underscore) go in .c. */ + +#include <_ansi.h> +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "swi.h" + +/* Forward prototypes. */ +#ifndef _PARAMS +#error UGG +#endif +int isatty _PARAMS ((int)); +clock_t _times _PARAMS ((struct tms *)); +int _gettimeofday _PARAMS ((struct timeval *, struct timezone *)); +void _raise _PARAMS ((void)); +int _unlink _PARAMS ((void)); +int _link _PARAMS ((void)); +int _fstat _PARAMS ((int, struct stat *)); +caddr_t _sbrk _PARAMS ((int)); +int _getpid _PARAMS ((int)); +int _kill _PARAMS ((int, int)); +void _exit _PARAMS ((int)); +int _close _PARAMS ((int)); +int _swiclose _PARAMS ((int)); +int _open _PARAMS ((const char *, int, ...)); +int _swiopen _PARAMS ((const char *, int)); +int _write _PARAMS ((int, char *, int)); +int _swiwrite _PARAMS ((int, char *, int)); +int _lseek _PARAMS ((int, int, int)); +int _swilseek _PARAMS ((int, int, int)); +int _read _PARAMS ((int, char *, int)); +int _swiread _PARAMS ((int, char *, int)); +void initialise_monitor_handles _PARAMS ((void)); + +static int wrap _PARAMS ((int)); +static int error _PARAMS ((int)); +static int get_errno _PARAMS ((void)); +static int remap_handle _PARAMS ((int)); +static int do_AngelSWI _PARAMS ((int, void *)); +static int findslot _PARAMS ((int)); + +/* Register name faking - works in collusion with the linker. */ +register char * stack_ptr asm ("sp"); + + +/* following is copied from libc/stdio/local.h to check std streams */ +extern void _EXFUN(__sinit,(struct _reent *)); +#define CHECK_INIT(fp) \ + do \ + { \ + if ((fp)->_data == 0) \ + (fp)->_data = _REENT; \ + if (!(fp)->_data->__sdidinit) \ + __sinit ((fp)->_data); \ + } \ + while (0) + +/* Adjust our internal handles to stay away from std* handles */ +#define FILE_HANDLE_OFFSET (0x20) + +static int std_files_checked; +static int monitor_stdin; +static int monitor_stdout; +static int monitor_stderr; + +/* Struct used to keep track of the file position, just so we + can implement fseek(fh,x,SEEK_CUR). */ +typedef struct +{ + int handle; + int pos; +} +poslog; + +#define MAX_OPEN_FILES 20 +static poslog openfiles [MAX_OPEN_FILES]; + +static int +findslot (int fh) +{ + int i; + for (i = 0; i < MAX_OPEN_FILES; i ++) + if (openfiles[i].handle == fh) + break; + return i; +} + +#ifdef ARM_RDI_MONITOR + +static inline int +do_AngelSWI (int reason, void * arg) +{ + int value; + asm volatile ("mov r0, %1; mov r1, %2; swi %a3; mov %0, r0" + : "=r" (value) /* Outputs */ + : "r" (reason), "r" (arg), "i" (AngelSWI) /* Inputs */ + : "r0", "r1", "lr" + /* Clobbers r0 and r1, and lr if in supervisor mode */); + return value; +} +#endif /* ARM_RDI_MONITOR */ + +/* Function to convert std(in|out|err) handles to internal versions */ +static int +remap_handle (int fh) +{ + if (!std_files_checked) + { + CHECK_INIT(stdin); + CHECK_INIT(stdout); + CHECK_INIT(stderr); + std_files_checked = 1; + } + if (fh == __sfileno (stdin)) + return monitor_stdin; + if (fh == __sfileno (stdout)) + return monitor_stdout; + if (fh == __sfileno (stderr)) + return monitor_stderr; + + return fh - FILE_HANDLE_OFFSET; +} + +void +initialise_monitor_handles (void) +{ + int i; + +#ifdef ARM_RDI_MONITOR + int volatile block[3]; + + block[0] = (int) ":tt"; + block[2] = 3; /* length of filename */ + block[1] = 0; /* mode "r" */ + monitor_stdin = do_AngelSWI (AngelSWI_Reason_Open, (void *) block); + + block[0] = (int) ":tt"; + block[2] = 3; /* length of filename */ + block[1] = 4; /* mode "w" */ + monitor_stdout = monitor_stderr = do_AngelSWI (AngelSWI_Reason_Open, (void *) block); +#else + int fh; + const char * name; + + name = ":tt"; + asm ("mov r0,%2; mov r1, #0; swi %a1; mov %0, r0" + : "=r"(fh) + : "i" (SWI_Open),"r"(name) + : "r0","r1"); + monitor_stdin = fh; + + name = ":tt"; + asm ("mov r0,%2; mov r1, #4; swi %a1; mov %0, r0" + : "=r"(fh) + : "i" (SWI_Open),"r"(name) + : "r0","r1"); + monitor_stdout = monitor_stderr = fh; +#endif + + for (i = 0; i < MAX_OPEN_FILES; i ++) + openfiles[i].handle = -1; + + openfiles[0].handle = monitor_stdin; + openfiles[0].pos = 0; + openfiles[1].handle = monitor_stdout; + openfiles[1].pos = 0; +} + +static int +get_errno (void) +{ +#ifdef ARM_RDI_MONITOR + return do_AngelSWI (AngelSWI_Reason_Errno, NULL); +#else + asm ("swi %a0" :: "i" (SWI_GetErrno)); +#endif +} + +static int +error (int result) +{ + errno = get_errno (); + return result; +} + +static int +wrap (int result) +{ + if (result == -1) + return error (-1); + return result; +} + +/* Returns # chars not! written */ + +int +_swiread (int file, + char * ptr, + int len) +{ + int fh = remap_handle (file); +#ifdef ARM_RDI_MONITOR + int block[3]; + + block[0] = fh; + block[1] = (int) ptr; + block[2] = len; + + return do_AngelSWI (AngelSWI_Reason_Read, block); +#else + asm ("mov r0, %1; mov r1, %2;mov r2, %3; swi %a0" + : /* No outputs */ + : "i"(SWI_Read), "r"(fh), "r"(ptr), "r"(len) + : "r0","r1","r2"); +#endif +} + +int +_read (int file, + char * ptr, + int len) +{ + int slot = findslot (remap_handle (file)); + int x = _swiread (file, ptr, len); + + if (x < 0) + return error (-1); + + if (slot != MAX_OPEN_FILES) + openfiles [slot].pos += len - x; + + /* x == len is not an error, at least if we want feof() to work */ + return len - x; +} + +int +_swilseek (int file, + int ptr, + int dir) +{ + int res; + int fh = remap_handle (file); + int slot = findslot (fh); +#ifdef ARM_RDI_MONITOR + int block[2]; +#endif + + if (dir == SEEK_CUR) + { + if (slot == MAX_OPEN_FILES) + return -1; + ptr = openfiles[slot].pos + ptr; + dir = SEEK_SET; + } + +#ifdef ARM_RDI_MONITOR + if (dir == SEEK_END) + { + block[0] = fh; + ptr += do_AngelSWI (AngelSWI_Reason_FLen, block); + } + + /* This code only does absolute seeks */ + block[0] = remap_handle (file); + block[1] = ptr; + res = do_AngelSWI (AngelSWI_Reason_Seek, block); +#else + if (dir == SEEK_END) + { + asm ("mov r0, %2; swi %a1; mov %0, r0" + : "=r" (res) + : "i" (SWI_Flen), "r" (fh) + : "r0"); + ptr += res; + } + + /* This code only does absolute seeks */ + asm ("mov r0, %2; mov r1, %3; swi %a1; mov %0, r0" + : "=r" (res) + : "i" (SWI_Seek), "r" (fh), "r" (ptr) + : "r0", "r1"); +#endif + + if (slot != MAX_OPEN_FILES && res == 0) + openfiles[slot].pos = ptr; + + /* This is expected to return the position in the file */ + return res == 0 ? ptr : -1; +} + +int +_lseek (int file, + int ptr, + int dir) +{ + return wrap (_swilseek (file, ptr, dir)); +} + +/* Returns #chars not! written */ +int +_swiwrite ( + int file, + char * ptr, + int len) +{ + int fh = remap_handle (file); +#ifdef ARM_RDI_MONITOR + int block[3]; + + block[0] = fh; + block[1] = (int) ptr; + block[2] = len; + + return do_AngelSWI (AngelSWI_Reason_Write, block); +#else + asm ("mov r0, %1; mov r1, %2;mov r2, %3; swi %a0" + : /* No outputs */ + : "i"(SWI_Write), "r"(fh), "r"(ptr), "r"(len) + : "r0","r1","r2"); +#endif +} + +int +_write (int file, + char * ptr, + int len) +{ + int slot = findslot (remap_handle (file)); + int x = _swiwrite (file, ptr,len); + + if (x == -1 || x == len) + return error (-1); + + if (slot != MAX_OPEN_FILES) + openfiles[slot].pos += len - x; + + return len - x; +} + +int +_swiopen (const char * path, + int flags) +{ + int aflags = 0, fh; +#ifdef ARM_RDI_MONITOR + int block[3]; +#endif + + int i = findslot (-1); + + if (i == MAX_OPEN_FILES) + return -1; + + /* The flags are Unix-style, so we need to convert them */ +#ifdef O_BINARY + if (flags & O_BINARY) + aflags |= 1; +#endif + + if (flags & O_RDWR) + aflags |= 2; + + if (flags & O_CREAT) + aflags |= 4; + + if (flags & O_TRUNC) + aflags |= 4; + + if (flags & O_APPEND) + { + aflags &= ~4; /* Can't ask for w AND a; means just 'a' */ + aflags |= 8; + } + +#ifdef ARM_RDI_MONITOR + block[0] = (int) path; + block[2] = strlen (path); + block[1] = aflags; + + fh = do_AngelSWI (AngelSWI_Reason_Open, block); + +#else + asm ("mov r0,%2; mov r1, %3; swi %a1; mov %0, r0" + : "=r"(fh) + : "i" (SWI_Open),"r"(path),"r"(aflags) + : "r0","r1"); +#endif + + if (fh >= 0) + { + openfiles[i].handle = fh; + openfiles[i].pos = 0; + } + + return fh >= 0 ? fh + FILE_HANDLE_OFFSET : error (fh); +} + +int +_open (const char * path, + int flags, + ...) +{ + return wrap (_swiopen (path, flags)); +} + +int +_swiclose (int file) +{ + int myhan = remap_handle (file); + int slot = findslot (myhan); + + if (slot != MAX_OPEN_FILES) + openfiles[slot].handle = -1; + +#ifdef ARM_RDI_MONITOR + return do_AngelSWI (AngelSWI_Reason_Close, & myhan); +#else + asm ("mov r0, %1; swi %a0" :: "i" (SWI_Close),"r"(myhan):"r0"); +#endif +} + +int +_close (int file) +{ + return wrap (_swiclose (file)); +} + +void +_exit (int n) +{ + /* FIXME: return code is thrown away. */ + +#ifdef ARM_RDI_MONITOR + do_AngelSWI (AngelSWI_Reason_ReportException, + (void *) ADP_Stopped_ApplicationExit); +#else + asm ("swi %a0" :: "i" (SWI_Exit)); +#endif +} + +int +_kill (int n, int m) +{ +#ifdef ARM_RDI_MONITOR + return do_AngelSWI (AngelSWI_Reason_ReportException, + (void *) ADP_Stopped_ApplicationExit); +#else + asm ("swi %a0" :: "i" (SWI_Exit)); +#endif +} + +int +_getpid (int n) +{ + return 1; +} + +caddr_t +_sbrk (int incr) +{ + extern char end asm ("end"); /* Defined by the linker */ + static char * heap_end; + char * prev_heap_end; + + if (heap_end == NULL) + heap_end = & end; + + prev_heap_end = heap_end; + + if (heap_end + incr > stack_ptr) + { + _write (1, "_sbrk: Heap and stack collision\n", 32); + abort (); + } + + heap_end += incr; + + return (caddr_t) prev_heap_end; +} + +int +_fstat (int file, struct stat * st) +{ + memset (st, 0, sizeof (* st)); + st->st_mode = S_IFCHR; + st->st_blksize = 1024; + return 0; +} + +int +_link (void) +{ + return -1; +} + +int +_unlink (void) +{ + return -1; +} + +void +_raise (void) +{ + return; +} + +int +_gettimeofday (struct timeval * tp, struct timezone * tzp) +{ + + if (tp) + { + /* Ask the host for the seconds since the Unix epoch */ +#ifdef ARM_RDI_MONITOR + tp->tv_sec = do_AngelSWI (AngelSWI_Reason_Time,NULL); +#else + { + int value; + asm ("swi %a1; mov %0, r0" : "=r" (value): "i" (SWI_Time) : "r0"); + tp->tv_sec = value; + } +#endif + tp->tv_usec = 0; + } + + /* Return fixed data for the timezone */ + if (tzp) + { + tzp->tz_minuteswest = 0; + tzp->tz_dsttime = 0; + } + + return 0; +} + +/* Return a clock that ticks at 100Hz. */ +clock_t +_times (struct tms * tp) +{ + clock_t timeval; + +#ifdef ARM_RDI_MONITOR + timeval = do_AngelSWI (AngelSWI_Reason_Clock,NULL); +#else + asm ("swi %a1; mov %0, r0" : "=r" (timeval): "i" (SWI_Clock) : "r0"); +#endif + + if (tp) + { + tp->tms_utime = timeval; /* user time */ + tp->tms_stime = 0; /* system time */ + tp->tms_cutime = 0; /* user time, children */ + tp->tms_cstime = 0; /* system time, children */ + } + + return timeval; +}; + + +int +isatty (int fd) +{ + return 1; +} + diff --git a/newlib/libc/sys/arm/trap.S b/newlib/libc/sys/arm/trap.S new file mode 100644 index 000000000..328fabca5 --- /dev/null +++ b/newlib/libc/sys/arm/trap.S @@ -0,0 +1,93 @@ + /* Run-time exception support */ +#include "swi.h" + +/* .text is used instead of .section .text so it works with arm-aout too. */ + .text + .align 0 + .global __rt_stkovf_split_big + .global __rt_stkovf_split_small + +/* The following functions are provided for software stack checking. + If hardware stack-checking is being used then the code can be + compiled without the PCS entry checks, and simply rely on VM + management to extend the stack for a thread. + + The stack extension event occurs when the PCS function entry code + would result in a stack-pointer beneath the stack-limit register + value. The system relies on the following map: + + +-----------------------------------+ <-- end of stack block + | ... | + | ... | + | active stack | + | ... | <-- sp (stack-pointer) somewhere in here + | ... | + +-----------------------------------+ <-- sl (stack-limit) + | stack-extension handler workspace | + +-----------------------------------+ <-- base of stack block + + The "stack-extension handler workspace" is an amount of memory in + which the stack overflow support code must execute. It must be + large enough to deal with the worst case path through the extension + code. At the moment the compiler expects this to be AT LEAST + 256bytes. It uses this fact to code functions with small local + data usage within the overflow space. + + In a true target environment We may need to increase the space + between sl and the true limit to allow for the stack extension + code, SWI handlers and for undefined instruction handlers of the + target environment. */ + +__rt_stkovf_split_small: + mov ip,sp @ Ensure we can calculate the stack required + @ and fall through to... +__rt_stkovf_split_big: + @ in: sp = current stack-pointer (beneath stack-limit) + @ sl = current stack-limit + @ ip = low stack point we require for the current function + @ lr = return address into the current function + @ fp = frame-pointer + @ original sp --> +----------------------------------+ + @ | pc (12 ahead of PCS entry store) | + @ current fp ---> +----------------------------------+ + @ | lr (on entry) pc (on exit) | + @ +----------------------------------+ + @ | sp ("original sp" on entry) | + @ +----------------------------------+ + @ | fp (on entry to function) | + @ +----------------------------------+ + @ | | + @ | ..argument and work registers.. | + @ | | + @ current sp ---> +----------------------------------+ + @ + @ The "current sl" is somewhere between "original sp" and "current sp" + @ but above "true sl". The "current sl" should be at least 256bytes + @ above the "true sl". The 256byte stack guard should be large enough + @ to deal with the worst case function entry stacking (160bytes) plus + @ the stack overflow handler stacking requirements, plus the stack + @ required for the memory allocation routines. + @ + @ Normal PCS entry (before stack overflow check) can stack 16 + @ standard registers (64bytes) and 8 floating point registers + @ (96bytes). This gives a minimum stack guard of 160bytes (excluding + @ the stack required for the code). (Actually only a maximum of + @ 14standard registers are ever stacked on entry to a function). + @ + @ NOTE: Structure returns are performed by the caller allocating a + @ dummy space on the stack and passing in a "phantom" arg1 into + @ the function. This means that we do not need to worry about + @ preserving the stack under "sp" even on function return. + @ + @ Code should never poke values beneath sp. The sp register + @ should always be "dropped" first to cover the data. This + @ protects the data against any events that may try and use + @ the stack. + + SUB ip, sp, ip @ extra stack required for function + @ Add stack extension code here. If desired a new stack chunk + @ can be allocated, and the register state updated suitably. + + @ We now know how much extra stack the function requires. + @ Terminate the program for the moment: + swi SWI_Exit diff --git a/newlib/libc/sys/configure b/newlib/libc/sys/configure new file mode 100755 index 000000000..a62edf598 --- /dev/null +++ b/newlib/libc/sys/configure @@ -0,0 +1,1809 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=a29khif + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../.. $srcdir/../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../.. $srcdir/../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../.." + fi +else + newlib_basedir="${srcdir}/../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +if test -n "${sys_dir}"; then + subdirs="${sys_dir}" + +fi + +CRT0= +if test -n "${sys_dir}"; then + CRT0=crt0.o +fi + + + + +if test x${sys_dir} != x; then + HAVE_SYS_DIR_TRUE= + HAVE_SYS_DIR_FALSE='#' +else + HAVE_SYS_DIR_TRUE='#' + HAVE_SYS_DIR_FALSE= +fi + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g +s%@subdirs@%$subdirs%g +s%@CRT0@%$CRT0%g +s%@HAVE_SYS_DIR_TRUE@%$HAVE_SYS_DIR_TRUE%g +s%@HAVE_SYS_DIR_FALSE@%$HAVE_SYS_DIR_FALSE%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + +if test "$no_recursion" != yes; then + + # Remove --cache-file and --srcdir arguments so they do not pile up. + ac_sub_configure_args= + ac_prev= + for ac_arg in $ac_configure_args; do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case "$ac_arg" in + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; + esac + done + + for ac_config_dir in ${sys_dir}; do + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + if test ! -d $srcdir/$ac_config_dir; then + continue + fi + + echo configuring in $ac_config_dir + + case "$srcdir" in + .) ;; + *) + if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :; + else + { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; } + fi + ;; + esac + + ac_popdir=`pwd` + cd $ac_config_dir + + # A "../" for each directory in /$ac_config_dir. + ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` + + case "$srcdir" in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + /*) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_config_dir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure; then + ac_sub_configure=$ac_sub_srcdir/configure + elif test -f $ac_sub_srcdir/configure.in; then + ac_sub_configure=$ac_configure + else + echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2 + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + + # Make the cache file name correct relative to the subdirectory. + case "$cache_file" in + /*) ac_sub_cache_file=$cache_file ;; + *) # Relative path. + ac_sub_cache_file="$ac_dots$cache_file" ;; + esac + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir" + # The eval makes quoting arguments work. + if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir + then : + else + { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; } + fi + fi + + cd $ac_popdir + done +fi + diff --git a/newlib/libc/sys/configure.in b/newlib/libc/sys/configure.in new file mode 100644 index 000000000..ea6749041 --- /dev/null +++ b/newlib/libc/sys/configure.in @@ -0,0 +1,24 @@ +dnl This is the newlib/libc/sys configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(a29khif) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../..) + +NEWLIB_CONFIGURE(../..) + +if test -n "${sys_dir}"; then + AC_CONFIG_SUBDIRS(${sys_dir}) +fi + +CRT0= +if test -n "${sys_dir}"; then + CRT0=crt0.o +fi +AC_SUBST(CRT0) + +AM_CONDITIONAL(HAVE_SYS_DIR, test x${sys_dir} != x) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/sys/cygwin/Makefile.am b/newlib/libc/sys/cygwin/Makefile.am new file mode 100644 index 000000000..f55a90adb --- /dev/null +++ b/newlib/libc/sys/cygwin/Makefile.am @@ -0,0 +1,19 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = + +# This is a hack to force automake to include a definition for +# COMPILE. +EXTRA_LIBRARIES = libfoo.a +libfoo_a_SOURCES = crt0.c + +all: crt0.o + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/sys/cygwin/Makefile.in b/newlib/libc/sys/cygwin/Makefile.in new file mode 100644 index 000000000..21f4afa28 --- /dev/null +++ b/newlib/libc/sys/cygwin/Makefile.in @@ -0,0 +1,311 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = + +# This is a hack to force automake to include a definition for +# COMPILE. +EXTRA_LIBRARIES = libfoo.a +libfoo_a_SOURCES = crt0.c + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +libfoo_a_LIBADD = +libfoo_a_OBJECTS = crt0.o +lib_a_LIBADD = +lib_a_OBJECTS = +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(libfoo_a_SOURCES) $(lib_a_SOURCES) +OBJECTS = $(libfoo_a_OBJECTS) $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +libfoo.a: $(libfoo_a_OBJECTS) $(libfoo_a_DEPENDENCIES) + -rm -f libfoo.a + $(AR) cru libfoo.a $(libfoo_a_OBJECTS) $(libfoo_a_LIBADD) + $(RANLIB) libfoo.a + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all: crt0.o + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/sys/cygwin/aclocal.m4 b/newlib/libc/sys/cygwin/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/sys/cygwin/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/sys/cygwin/configure b/newlib/libc/sys/cygwin/configure new file mode 100755 index 000000000..1690b2708 --- /dev/null +++ b/newlib/libc/sys/cygwin/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=crt0.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/sys/cygwin/configure.in b/newlib/libc/sys/cygwin/configure.in new file mode 100644 index 000000000..a7179a298 --- /dev/null +++ b/newlib/libc/sys/cygwin/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/sys/cygwin32 configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(crt0.c) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/sys/cygwin/crt0.c b/newlib/libc/sys/cygwin/crt0.c new file mode 100644 index 000000000..d6bdd5a57 --- /dev/null +++ b/newlib/libc/sys/cygwin/crt0.c @@ -0,0 +1,49 @@ + +#ifdef __PPC__ +/* For the PowerPC, we want to make this function have its structured + exception table exception function point to something we control. */ + +extern void __cygwin_exception_handler(); +extern void mainCRTStartup(void) __attribute__((__exception__(__cygwin_exception_handler))); +#endif + +/* In the following ifdef'd i386 code, the FPU precision is set to 80 bits + and all FPU exceptions are masked. The former is needed to make long + doubles work correctly. The latter causes the FPU to generate NaNs and + Infinities instead of signals for certain operations. +*/ + +#ifdef __i386__ +#define FPU_RESERVED 0xF0C0 +#define FPU_DEFAULT 0x033f + +/* For debugging on *#!$@ windbg. bp for breakpoint. */ +int __cygwin_crt0_bp = 0; +#endif + +extern int main (int argc, char **argv); + +void +mainCRTStartup () +{ +#ifdef __i386__ + if (__cygwin_crt0_bp) + asm volatile ("int3"); + + { + volatile unsigned short cw; + + /* Get Control Word */ + __asm__ volatile ("fnstcw %0" : "=m" (cw) : ); + + /* mask in */ + cw &= FPU_RESERVED; + cw |= FPU_DEFAULT; + + /* set cw */ + __asm__ volatile ("fldcw %0" :: "m" (cw)); + } +#endif + + cygwin_crt0 (main); +} diff --git a/newlib/libc/sys/cygwin/sys/dirent.h b/newlib/libc/sys/cygwin/sys/dirent.h new file mode 100644 index 000000000..3c0ec4e77 --- /dev/null +++ b/newlib/libc/sys/cygwin/sys/dirent.h @@ -0,0 +1,58 @@ +/* Posix dirent.h for WIN32. */ + +/* Including this file should not require any Windows headers. */ + +#ifndef _SYS_DIRENT_H +#define _SYS_DIRENT_H + +#include + +struct dirent +{ + long __d_reserved[4]; + ino_t d_ino; /* Just for compatibility, it's junk */ + char d_name[256]; /* FIXME: use NAME_MAX? */ +}; + +#define __DIRENT_COOKIE 0xdede4242 + +typedef struct +{ + /* This is first to set alignment in non _COMPILING_NEWLIB case. */ + unsigned long __d_cookie; + struct dirent *__d_dirent; + char *__d_dirname; /* directory name with trailing '*' */ + off_t __d_position; /* used by telldir/seekdir */ + unsigned long __d_dirhash; /* hash of directory name for use by + readdir */ + union + { +#ifdef _COMPILING_NEWLIB + struct + { + HANDLE __handle; + char __open_p; + } __d_data; +#endif + char __d_filler[16]; + } __d_u; +} DIR; + +DIR *opendir (const char *); +struct dirent *readdir (DIR *); +void rewinddir (DIR *); +int closedir (DIR *); + +#ifndef _POSIX_SOURCE +off_t telldir (DIR *); +void seekdir (DIR *, off_t loc); + +int scandir (const char *__dir, + struct dirent ***__namelist, + int (*select) (const struct dirent *), + int (*compar) (const struct dirent **, const struct dirent **)); + +int alphasort (const struct dirent **__a, const struct dirent **__b); +#endif /* _POSIX_SOURCE */ + +#endif diff --git a/newlib/libc/sys/cygwin/sys/param.h b/newlib/libc/sys/cygwin/sys/param.h new file mode 100644 index 000000000..42bb019d1 --- /dev/null +++ b/newlib/libc/sys/cygwin/sys/param.h @@ -0,0 +1,43 @@ +#ifndef _SYS_PARAM_H +#define _SYS_PARAM_H + +#include +/* Linux includes limits.h, but this is not universally done. */ +#include + +/* Max number of open files. The Posix version is OPEN_MAX. */ +/* Number of fds is virtually unlimited in cygwin, but we must provide + some reasonable value for Posix conformance */ +#define NOFILE 8192 + +/* Max number of groups; must keep in sync with NGROUPS_MAX in limits.h */ +#define NGROUPS 16 + +/* Ticks/second for system calls such as times() */ +/* FIXME: is this the appropriate value? */ +#define HZ 1000 + +/* Max hostname size that can be dealt with */ +/* FIXME: is this the appropriate value? */ +#define MAXHOSTNAMELEN 64 + +/* This is defined to be the same as MAX_PATH which is used internally. + The Posix version is PATH_MAX. */ +#define MAXPATHLEN (260 - 1 /*NUL*/) + +/* Some autoconf'd packages check for endianness. When cross-building we + can't run programs on the target. Fortunately, autoconf supports the + definition of byte order in sys/param.h (that's us!). + The values here are the same as used in gdb/defs.h (are the more + appropriate values?). */ +#define BIG_ENDIAN 4321 +#define LITTLE_ENDIAN 1234 + +/* All known win32 systems are little endian. */ +#define BYTE_ORDER LITTLE_ENDIAN + +#ifndef NULL +#define NULL 0L +#endif + +#endif diff --git a/newlib/libc/sys/cygwin/sys/utime.h b/newlib/libc/sys/cygwin/sys/utime.h new file mode 100644 index 000000000..196b0891e --- /dev/null +++ b/newlib/libc/sys/cygwin/sys/utime.h @@ -0,0 +1,22 @@ +#ifndef _SYS_UTIME_H +#define _SYS_UTIME_H + +#ifdef __cplusplus +extern "C" { +#endif +#include <_ansi.h> +#include + +struct utimbuf +{ + time_t actime; + time_t modtime; +}; + +int _EXFUN(utime, (const char *__path, struct utimbuf *__buf)); + +#ifdef __cplusplus +}; +#endif + +#endif /* _SYS_UTIME_H */ diff --git a/newlib/libc/sys/cygwin/sys/utmp.h b/newlib/libc/sys/cygwin/sys/utmp.h new file mode 100644 index 000000000..1c1c9aa0a --- /dev/null +++ b/newlib/libc/sys/cygwin/sys/utmp.h @@ -0,0 +1,49 @@ +#ifndef UTMP_H +#define UTMP_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define UT_LINESIZE 16 +#define UT_NAMESIZE 16 +#define UT_HOSTSIZE 256 +#define ut_name ut_user + +struct utmp +{ + short ut_type; + pid_t ut_pid; + char ut_line[UT_LINESIZE]; + char ut_id[2]; + time_t ut_time; + char ut_user[UT_NAMESIZE]; + char ut_host[UT_HOSTSIZE]; + long ut_addr; +}; + +#define INIT_PROCESS 5 +#define LOGIN_PROCESS 6 +#define USER_PROCESS 7 +#define DEAD_PROCESS 8 + +extern struct utmp *_getutline (struct utmp *); +extern struct utmp *getutent (void); +extern struct utmp *getutid (struct utmp *); +extern struct utmp *getutline (struct utmp *); +extern void endutent (void); +extern void pututline (struct utmp *); +extern void setutent (void); +extern void utmpname (const char *); + +void login (struct utmp *); +int logout (char *); + +#ifdef __cplusplus +} +#endif +#endif /* UTMP_H */ diff --git a/newlib/libc/sys/d10v/Makefile.am b/newlib/libc/sys/d10v/Makefile.am new file mode 100644 index 000000000..da89f1198 --- /dev/null +++ b/newlib/libc/sys/d10v/Makefile.am @@ -0,0 +1,14 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = syscalls.c trap.S creat.c + +all: crt0.o + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/sys/d10v/Makefile.in b/newlib/libc/sys/d10v/Makefile.in new file mode 100644 index 000000000..d6fc79a93 --- /dev/null +++ b/newlib/libc/sys/d10v/Makefile.in @@ -0,0 +1,320 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = syscalls.c trap.S creat.c + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = syscalls.o trap.o creat.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in \ + ../../../acinclude.m4 ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + +distclean: distclean-am + -rm -f config.status + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ +check-am installcheck-am installcheck install-info-am install-info \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all: crt0.o + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/sys/d10v/aclocal.m4 b/newlib/libc/sys/d10v/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/sys/d10v/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/sys/d10v/configure b/newlib/libc/sys/d10v/configure new file mode 100755 index 000000000..d861d17e1 --- /dev/null +++ b/newlib/libc/sys/d10v/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=creat.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/sys/d10v/configure.in b/newlib/libc/sys/d10v/configure.in new file mode 100644 index 000000000..5559c87c8 --- /dev/null +++ b/newlib/libc/sys/d10v/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/sys/d10v configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(creat.c) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/sys/d10v/creat.c b/newlib/libc/sys/d10v/creat.c new file mode 100644 index 000000000..62ec5ead8 --- /dev/null +++ b/newlib/libc/sys/d10v/creat.c @@ -0,0 +1,7 @@ +int +creat(path, mode) + const char *path; + int mode; +{ + return _creat (path, mode); +} diff --git a/newlib/libc/sys/d10v/crt0.S b/newlib/libc/sys/d10v/crt0.S new file mode 100644 index 000000000..9a2ed02fb --- /dev/null +++ b/newlib/libc/sys/d10v/crt0.S @@ -0,0 +1,63 @@ + .text + .global _start + .type _start,@function + .stabs "crt0.S",100,0,0,_start + .stabs "int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0 + .stabs "_start:F(0,1)",36,0,1,_start + +_start: + +; R14 always contains memory base address (0) + + ldi r14,0 + +; Set the USER and SYSTEM stack pointers. + + ldi r0, 0 ; zero arguments + ldi r1, 0 + mvtc r0, psw ; select SPI and set it + ldi sp, _stack + ldi r10, 0x8000 ; select SPU/FP and set it + mvtc r10, psw || ldi r11, 0; clear stack frame + ldi sp, _stack - 0x200 + ldi r13, 0 + +; Clear the BSS. Do it in two parts for efficiency: longwords first +; for most of it, then the remaining 0 to 3 bytes. + + ldi r2, __bss_start ; R2 = start of BSS + ldi r3, _end ; R3 = end of BSS + 1 + sub r3, r2 ; R3 = BSS size in bytes + mv r4, r3 + srli r4, 2 ; R4 = BSS size in longwords (rounded down) +loop1: + cmpeqi r4, 0 ; more longords to zero out? + brf0t.s endloop1 ; nope + st2w r0, @r2+ ; yep, zero out another longword + subi r4, 1 ; decrement count + bra.l loop1 ; go do some more + +endloop1: + and3 r4, r3, 3 ; get no. of remaining BSS bytes to clear +loop2: + cmpeqi r4, 0 ; more bytes to zero out? + brf0t.s endloop2 ; nope + stb r0, @r2 ; yep, zero out another byte + addi r2, 1 ; bump address + subi r4, 1 ; decrement count + bra.s loop2 ; go do some more +endloop2: +; Call main, then stop simulator + st r11, @-sp + st r13, @-sp + mv r11, sp + + bl main + bl exit + stop +.Lstart: + .size _start,.Lstart-_start + .stabs "",36,0,0,.Lstart-_start + + .section .stack +_stack: .long 1 diff --git a/newlib/libc/sys/d10v/sys/syscall.h b/newlib/libc/sys/d10v/sys/syscall.h new file mode 100644 index 000000000..64e53a3d9 --- /dev/null +++ b/newlib/libc/sys/d10v/sys/syscall.h @@ -0,0 +1,38 @@ +/* syscall.h - definitions of system calls for D10V. + * + * This file must contain only pre-processor directives, and no C code, + * because it's included by assembly language sources as well as C. + */ + +#define SYS_exit 1 +#define SYS_fork 2 + +#define SYS_read 3 +#define SYS_write 4 +#define SYS_open 5 +#define SYS_close 6 +#define SYS_wait4 7 +#define SYS_creat 8 +#define SYS_link 9 +#define SYS_unlink 10 +#define SYS_execv 11 +#define SYS_chdir 12 +#define SYS_mknod 14 +#define SYS_chmod 15 +#define SYS_chown 16 +#define SYS_lseek 19 +#define SYS_getpid 20 +#define SYS_isatty 21 +#define SYS_fstat 22 +#define SYS_time 23 + + +#define SYS_ARG 24 +#define SYS_stat 38 + +#define SYS_pipe 42 +#define SYS_execve 59 +#define SYS_kill 60 + +#define SYS_utime 201 /* not really a system call */ +#define SYS_wait 202 /* nor is this */ diff --git a/newlib/libc/sys/d10v/syscalls.c b/newlib/libc/sys/d10v/syscalls.c new file mode 100644 index 000000000..11192074a --- /dev/null +++ b/newlib/libc/sys/d10v/syscalls.c @@ -0,0 +1,216 @@ +/* syscalls.c - non-trap system calls for D10V + * + * This file contains system calls that cannot be implemented with + * a simple "trap 15" instruction. The ones that can are in trap.S. + */ + +#include <_ansi.h> +#include +#include +#include +#undef errno + +void _exit (int n); /* in trap.S */ + +extern int _write (int fd, const void *ptr, size_t len); + +int errno; + +register char *stack_ptr asm ("sp"); + +caddr_t +_sbrk (int incr) +{ + extern char end; /* Defined by the linker */ + static char *heap_end; + char *prev_heap_end; + char *sp = (char *)stack_ptr; + + if (heap_end == 0) + { + heap_end = (char *)((((unsigned short) &end) + 7) & ~7); + } + prev_heap_end = heap_end; + if (heap_end + incr > sp) + { + _write (2, "Heap and stack collision\n", sizeof ("Heap and stack collision\n")-1); + abort (); + } + heap_end += incr; + if ((unsigned short)heap_end > 0xbfff + || (heap_end < prev_heap_end && incr > 0) + || (heap_end < (char *)((((unsigned short) &end) + 7) & ~7))) + { + _write (2, "Too much memory was allocated\n", sizeof ("Too much memory was allocated\n")-1); + abort (); + } + + return (caddr_t) prev_heap_end; +} + +int +_fstat (int file, + struct stat *st) +{ + st->st_mode = S_IFCHR; + return 0; +} + +int +_unlink () +{ + errno = ENOSYS; + return -1; +} + +int +isatty (int fd) +{ + return 1; +} + +void +_raise () +{ +} + +/* If this library is compiled with -mint32, provide conversion functions for + the system call traps. */ + +#if __INT__==32 +extern short _read16 (short fd, void *ptr, short len); +int +_read (int fd, void *ptr, size_t len) +{ + return _read16 ((short)fd, ptr, (short)len); +} + +extern short _write16 (short fd, const void *ptr, short len); +int +_write (int fd, const void *ptr, size_t len) +{ + return _write16 ((short)fd, ptr, (short)len); +} + +extern short _lseek16 (short fd, long offset, short whence); +int +_lseek (int fd, off_t offset, int whence) +{ + return _lseek16 ((short)fd, offset, (short)whence); +} + +extern short _close16 (short fd); +int +_close (int fd) +{ + return _close16 ((short)fd); +} + +extern short _open16 (const char *name, short flags, short mode); +int +_open (const char *name, int flags, mode_t mode) +{ + return _open16 (name, (short)flags, (short)mode); +} + +extern short _creat16 (const char *name, mode_t mode); +int +_creat (const char *name, mode_t mode) +{ + return _creat16 (name, mode); +} + +extern void _exit16 (short status); +void +_exit (int status) +{ + _exit16 ((short)status); +} + +extern short _stat16 (const char *name, struct stat *stat_pkt); +int +_stat (const char *name, struct stat *stat_pkt) +{ + return _stat16 (name, stat_pkt); +} + +extern short _chmod16 (const char *name, short mode); +int +_chmod (const char *name, mode_t mode) +{ + return _chmod16 (name, (short)mode); +} + +extern short _chown16 (const char *name, short uid, short gid); +int +_chown (const char *name, uid_t uid, gid_t gid) +{ + return _chown16 (name, (short)uid, (short)gid); +} + +extern short _fork16 (void); +int +_fork (void) +{ + return _fork16 (); +} + +extern short _wait16 (short *status); +int +_wait (int *status) +{ + if (status) + { + short status16; + short ret = _wait16 (&status16); + if (ret >= 0) + *status = status16; + return ret; + } + else + return _wait16 ((short *)0); +} + +extern short _execve16 (const char *filename, const char *argv [], const char *envp[]); +int +_execve (const char *filename, const char *argv [], const char *envp[]) +{ + return _execve16 (filename, argv, envp); +} + +extern short _execv16 (const char *filename, const char *argv []); +int +_execv (const char *filename, const char *argv []) +{ + return _execv16 (filename, argv); +} + +extern short _pipe16 (short fds[]); +int +_pipe (int fds[]) +{ + short fds16[2]; + short ret = _pipe16 (fds16); + if (ret >= 0) + { + fds[0] = fds16[0]; + fds[1] = fds16[1]; + } + + return ret; +} + +extern short _getpid16 (void); +int +_getpid (void) +{ + return _getpid16 (); +} + +extern short _kill16 (short pid, short sig); +int +_kill (int pid, int sig) +{ + return _kill16 ((short)pid, (short)sig); +} +#endif diff --git a/newlib/libc/sys/d10v/trap.S b/newlib/libc/sys/d10v/trap.S new file mode 100644 index 000000000..9aca42913 --- /dev/null +++ b/newlib/libc/sys/d10v/trap.S @@ -0,0 +1,296 @@ +#include "sys/syscall.h" + +#define SYSCALL(name) \ + .global name ; \ +name: ; \ + ldi r4, SYS ## name ; \ + bra __trap0 + + .text + .stabs "trap.S",100,0,0,__trap0 + .stabs "int:t(0,1)=r(0,1);-65536;65535;",128,0,0,0 + .stabs "long int:t(0,2)=r(0,1);0020000000000;0017777777777;",128,0,0,0 + .stabs "_trap0:F(0,1)",36,0,1,__trap0 + .stabs "arg1:P(0,1)",64,0,1,0 + .stabs "arg2:P(0,1)",64,0,1,1 + .stabs "arg3:P(0,1)",64,0,1,2 + .stabs "arg4:P(0,1)",64,0,1,3 + .stabs "number:P(0,1)",64,0,1,4 + .global __trap0 + .type __trap0,@function +__trap0: + trap 15 /* trap 15 returns result in r0, error code in r4 */ + cmpeqi r4,0 /* is error code zero? */ + brf0t ret /* yes, skip setting errno */ +#if __INT__==32 + st r4,@(errno+2,r14) /* no, set errno */ + srai r4,15 /* sign extend high word */ + st r4,@(errno,r14) +#else + st r4,@(errno,r14) /* no, set errno */ +#endif + +ret: + jmp r13 /* return to caller */ +.Ltrap0: + .size __trap0,.Ltrap0-__trap0 + .stabs "",36,0,0,.Ltrap0-__trap0 + +#define CONCAT(a,b) a ## b +#define STRING(a) #a +#define XSTRING(a) STRING(a) +#define XSTRING2(a,b) XSTRING(CONCAT(a,b)) + +#if __INT__==32 +#define _read _read16 +#define _lseek _lseek16 +#define _write _write16 +#define _close _close16 +#define _open _open16 +#define _creat _creat16 +#define _exit _exit16 +#define _stat _stat16 +#define _chmod _chmod16 +#define _chown _chown16 +#define _fork _fork16 +#define _wait _wait16 +#define _execve _execve16 +#define _execv _execv16 +#define _pipe _pipe16 +#define _kill _kill16 +#define _getpid _getpid16 +#endif + +/* Until the assembler allows semicolon as a statement separator, */ +/* we cannot use the SYSCALL macro. So expand it manually for now. */ + +/* #SYSCALL(_read) */ +/* #SYSCALL(_lseek) */ +/* #SYSCALL(_write) */ +/* #SYSCALL(_close) */ +/* #SYSCALL(_open) */ +/* #SYSCALL(_creat) */ +/* #SYSCALL(_exit) */ +/* #SYSCALL(_stat) */ +/* #SYSCALL(_chmod) */ +/* #SYSCALL(_chown) */ +/* #SYSCALL(_fork) */ +/* #SYSCALL(_wait) */ +/* #SYSCALL(_execve) */ +/* #SYSCALL(_execv) */ +/* #SYSCALL(_pipe) */ +/* #SYSCALL(_getpid) */ +/* #SYSCALL(_kill) */ + + .global _read + .type _read,@function + .stabs XSTRING2(_read,:F(0,1)),36,0,2,_read + .stabs "fd:P(0,1)",64,0,1,0 + .stabs "ptr:P(0,1)",64,0,1,1 + .stabs "len:P(0,1)",64,0,1,2 +_read: + ldi r4, SYS_read + bra __trap0 +.Lread: + .size _read,.-_read + .stabs "",36,0,0,.Lread-_read + + .global _lseek + .type _lseek,@function + .stabs XSTRING2(_lseek,:F(0,1)),36,0,3,_lseek + .stabs "fd:P(0,1)",64,0,1,0 + .stabs "offset:P(0,1)",64,0,1,2 + .stabs "whence:p(0,1)",160,0,1,0 +_lseek: + ldi r4, SYS_lseek + bra __trap0 +.Llseek: + .size _lseek,.Llseek-_lseek + .stabs "",36,0,0,.Llseek-_lseek + + .global _write + .type _write,@function + .stabs XSTRING2(_write,:F(0,1)),36,0,4,_write + .stabs "fd:P(0,1)",64,0,1,0 + .stabs "ptr:P(0,1)",64,0,1,1 + .stabs "len:P(0,1)",64,0,1,2 +_write: + ldi r4, SYS_write + bra __trap0 +.Lwrite: + .size _write,.Lwrite-_write + .stabs "",36,0,0,.Lwrite-_write + + .global _close + .type _close,@function + .stabs XSTRING2(_close,:F(0,1)),36,0,5,_close + .stabs "fd:P(0,1)",64,0,1,0 +_close: + ldi r4, SYS_close + bra __trap0 +.Lclose: + .size _close,.Lclose-_close + .stabs "",36,0,0,.Lclose-_close + + .global _open + .type _open,@function + .stabs XSTRING2(_open,:F(0,1)),36,0,6,_open + .stabs "name:P(0,1)",64,0,1,0 + .stabs "flags:P(0,1)",64,0,1,1 + .stabs "mode:P(0,1)",64,0,1,2 +_open: + ldi r4, SYS_open + bra __trap0 +.Lopen: + .size _open,.Lopen-_open + .stabs "",36,0,0,.Lopen-_open + + .global _creat + .type _creat,@function + .stabs XSTRING2(_creat,:F(0,1)),36,0,7,_creat + .stabs "name:P(0,1)",64,0,1,0 + .stabs "mode:P(0,1)",64,0,1,1 +_creat: + ldi r4, SYS_creat + bra __trap0 +.Lcreat: + .size _creat,.Lcreat-_creat + .stabs "",36,0,0,.Lcreat-_creat + + .global _exit + .type _exit,@function + .stabs XSTRING2(_exit,:F(0,1)),36,0,8,_exit + .stabs "status:P(0,1)",64,0,1,0 +_exit: + ldi r4, SYS_exit + bra __trap0 +.Lexit: + .size _exit,.Lexit-_exit + .stabs "",36,0,0,.Lexit-_exit + + .global _stat + .type _stat,@function + .stabs XSTRING2(_stat,:F(0,1)),36,0,9,_stat + .stabs "name:P(0,1)",64,0,1,0 + .stabs "packet:P(0,1)",64,0,1,1 +_stat: + ldi r4, SYS_stat + bra __trap0 +.Lstat: + .size _stat,.Lstat-_stat + .stabs "",36,0,0,.Lstat-_stat + + .global _chmod + .type _chmod,@function + .stabs XSTRING2(_chmod,:F(0,1)),36,0,10,_chmod + .stabs "name:P(0,1)",64,0,1,0 + .stabs "mode:P(0,1)",64,0,1,1 +_chmod: + ldi r4, SYS_chmod + bra __trap0 +.Lchmod: + .size _chmod,.Lchmod-_chmod + .stabs "",36,0,0,.Lchmod-_chmod + + .global _chown + .type _chown,@function + .stabs XSTRING2(_chown,:F(0,1)),36,0,11,_chown + .stabs "name:P(0,1)",64,0,1,0 + .stabs "uid:P(0,1)",64,0,1,1 + .stabs "gid:P(0,1)",64,0,1,2 +_chown: + ldi r4, SYS_chown + bra __trap0 +.Lchown: + .size _chown,.Lchown-_chown + .stabs "",36,0,0,.Lchown-_chown + + .global _fork + .type _fork,@function + .stabs XSTRING2(_fork,:F(0,1)),36,0,12,_fork +_fork: + ldi r4, SYS_fork + bra __trap0 +.Lfork: + .size _fork,.Lfork-_fork + .stabs "",36,0,0,.Lfork-_fork + + .global _wait + .type _wait,@function + .stabs "status:P(0,1)",64,0,1,0 + .stabs XSTRING2(_wait,:F(0,1)),36,0,13,_wait +_wait: + ldi r4, SYS_wait + bra __trap0 +.Lwait: + .size _wait,.Lwait-_wait + .stabs "",36,0,0,.Lwait-_wait + + .global _execve + .type _execve,@function + .stabs "name:P(0,1)",64,0,1,0 + .stabs "argv:P(0,1)",64,0,1,1 + .stabs "envp:P(0,1)",64,0,1,2 + .stabs XSTRING2(_execve,:F(0,1)),36,0,14,_execve +_execve: + ldi r4, SYS_execve + bra __trap0 +.Lexecve: + .size _execve,.Lexecve-_execve + .stabs "",36,0,0,.Lexecve-_execve + + .global _execv + .type _execv,@function + .stabs XSTRING2(_execv,:F(0,1)),36,0,15,_execv + .stabs "name:P(0,1)",64,0,1,0 + .stabs "argv:P(0,1)",64,0,1,1 +_execv: + ldi r4, SYS_execv + bra __trap0 +.Lexecv: + .size _execv,.Lexecv-_execv + .stabs "",36,0,0,.Lexecv-_execv + + .global _pipe + .type _pipe,@function + .stabs XSTRING2(_pipe,:F(0,1)),36,0,16,_pipe + .stabs "fds:P(0,1)",64,0,1,0 +_pipe: + ldi r4, SYS_pipe + bra __trap0 +.Lpipe: + .size _pipe,.Lpipe-_pipe + .stabs "",36,0,0,.Lpipe-_pipe + + .global time + .type time,@function + .stabs XSTRING2(time,:F(0,1)),36,0,17,time + .stabs "ptr:P(0,1)",64,0,1,0 +time: + ldi r4, SYS_time + bra __trap0 +.Ltime: + .size time,.Ltime-time + .stabs "",36,0,0,.Ltime-time + + .global _kill + .type _kill,@function + .stabs XSTRING2(_kill,:F(0,1)),36,0,18,_kill + .stabs "pid:P(0,1)",64,0,1,0 + .stabs "sig:P(0,1)",64,0,1,1 +_kill: + ldi r4, SYS_kill + bra __trap0 +.Lkill: + .size _kill,.Lkill-_kill + .stabs "",36,0,0,.Lkill-_kill + + .global _getpid + .type _getpid,@function + .stabs XSTRING2(_getpid,:F(0,1)),36,0,19,_getpid +_getpid: + ldi r4, SYS_getpid + bra __trap0 +.Lgetpid: + .size _getpid,.Lgetpid-_getpid + .stabs "",36,0,0,.Lgetpid-_getpid diff --git a/newlib/libc/sys/decstation/Makefile.am b/newlib/libc/sys/decstation/Makefile.am new file mode 100644 index 000000000..ad289976f --- /dev/null +++ b/newlib/libc/sys/decstation/Makefile.am @@ -0,0 +1,45 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +COPYOFILES = \ + read.o \ + open.o \ + _exit.o \ + write.o \ + lseek.o \ + close.o \ + sbrk.o \ + cerror.o \ + fork.o \ + isatty.o \ + ioctl.o \ + getpid.o \ + time.o \ + kill.o \ + wait.o \ + execve.o \ + gettimeofday.o \ + link.o \ + unlink.o \ + fstat.o \ + times.o \ + getrusage.o + +lib_a_SOURCES = _main.c +lib_a_LIBADD = $(COPYOFILES) + +$(COPYOFILES): + ar x /lib/libc.a $(COPYOFILES) + +all: crt0.o + +crt0.o: + cp /lib/crt0.o crt0.o + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/sys/decstation/Makefile.in b/newlib/libc/sys/decstation/Makefile.in new file mode 100644 index 000000000..8fc5c67c2 --- /dev/null +++ b/newlib/libc/sys/decstation/Makefile.in @@ -0,0 +1,332 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +COPYOFILES = \ + read.o \ + open.o \ + _exit.o \ + write.o \ + lseek.o \ + close.o \ + sbrk.o \ + cerror.o \ + fork.o \ + isatty.o \ + ioctl.o \ + getpid.o \ + time.o \ + kill.o \ + wait.o \ + execve.o \ + gettimeofday.o \ + link.o \ + unlink.o \ + fstat.o \ + times.o \ + getrusage.o + +lib_a_SOURCES = _main.c +lib_a_LIBADD = $(COPYOFILES) + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_DEPENDENCIES = read.o open.o _exit.o write.o lseek.o close.o \ +sbrk.o cerror.o fork.o isatty.o ioctl.o getpid.o time.o kill.o wait.o \ +execve.o gettimeofday.o link.o unlink.o fstat.o times.o getrusage.o +lib_a_OBJECTS = _main.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +$(COPYOFILES): + ar x /lib/libc.a $(COPYOFILES) + +all: crt0.o + +crt0.o: + cp /lib/crt0.o crt0.o + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/sys/decstation/_main.c b/newlib/libc/sys/decstation/_main.c new file mode 100644 index 000000000..64878088d --- /dev/null +++ b/newlib/libc/sys/decstation/_main.c @@ -0,0 +1,6 @@ + +__main() +{ + + +} diff --git a/newlib/libc/sys/decstation/aclocal.m4 b/newlib/libc/sys/decstation/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/sys/decstation/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/sys/decstation/configure b/newlib/libc/sys/decstation/configure new file mode 100755 index 000000000..7508f7624 --- /dev/null +++ b/newlib/libc/sys/decstation/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=_main.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/sys/decstation/configure.in b/newlib/libc/sys/decstation/configure.in new file mode 100644 index 000000000..e2e2738bb --- /dev/null +++ b/newlib/libc/sys/decstation/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/sys/decstation configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(_main.c) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/sys/decstation/sys/dirent.h b/newlib/libc/sys/decstation/sys/dirent.h new file mode 100644 index 000000000..c5a90e9fe --- /dev/null +++ b/newlib/libc/sys/decstation/sys/dirent.h @@ -0,0 +1,46 @@ +/* FIXME: From sys/sysvi386/sys */ +#ifndef _SYS_DIRENT_H +# define _SYS_DIRENT_H + +/* + * This file was written to be compatible with the BSD directory + * routines, so it looks like it. But it was written from scratch. + * Sean Eric Fagan, sef@Kithrup.COM + * + * Modified by dje@cygnus.com for sun. + * Modified by eichin@cygnus.com for decstation (ultrix 4.2) + */ + +typedef struct __dirdesc { + int dd_fd; + long dd_loc; + long dd_size; + long dd_bbase; + long dd_entno; + long dd_bsize; + char *dd_buf; +} DIR; + +# define __dirfd(dp) ((dp)->dd_fd) + +DIR *opendir (const char *); +struct dirent *readdir (DIR *); +void rewinddir (DIR *); +int closedir (DIR *); + +#include + +#define MAXNAMLEN 255 + +#define d_ino d_fileno /* compatibility */ + +struct dirent { + unsigned long d_fileno; + unsigned short d_reclen; + unsigned short d_namlen; + char d_name[MAXNAMLEN + 1]; +}; + +/* FIXME: include definition of DIRSIZ() ? */ + +#endif diff --git a/newlib/libc/sys/go32/Makefile.am b/newlib/libc/sys/go32/Makefile.am new file mode 100644 index 000000000..4ccd669da --- /dev/null +++ b/newlib/libc/sys/go32/Makefile.am @@ -0,0 +1,105 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + _exit.s \ + _main.c \ + abort.c \ + access.c \ + bdos.c \ + bdosptr.c \ + brk.s \ + chdir.s \ + chmod.c \ + chown.c \ + clock.S \ + close.s \ + creat.s \ + crlf2nl.c \ + dir.c \ + dosmem.S \ + dpmi.c \ + dup.s \ + dup2.s \ + exec.c \ + fchmod.c \ + findfirs.s \ + findnext.s \ + fixpath.c \ + fstat.s \ + fsync.s \ + ftruncat.c \ + gerrno.s \ + getcwd.c \ + getdate.c \ + getdtabl.c \ + getgid.c \ + getkey.s \ + getpages.c \ + getpid.c \ + getrusag.c \ + gettime.c \ + gettimeo.c \ + getuid.c \ + getwd.s \ + go32func.c \ + infoblk.c \ + inportb.s \ + inportl.s \ + inportsb.s \ + inportsl.s \ + inportsw.s \ + inportw.s \ + int86x.s \ + intdos.c \ + intdosx.c \ + isatty.s \ + kbhit.s \ + kill.c \ + link.s \ + longjmp.S \ + lseek.s \ + lstat.s \ + mkdir.s \ + open.s \ + outportb.s \ + outportl.s \ + outportw.s \ + outprtsb.s \ + outprtsl.s \ + outprtsw.s \ + read.s \ + readv.c \ + rename.s \ + rmdir.s \ + sbrk.s \ + screen.S \ + setjmp.S \ + setmode.s \ + setstack.S \ + settimeo.s \ + sleep.c \ + stat.c \ + stat_ast.s \ + syserr.c \ + system.s \ + tell.s \ + time.c \ + truncate.c \ + turbo.s \ + umask.c \ + unlink.s \ + utime.c \ + utimes.c \ + write.s \ + writev.c + +all: crt0.o + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/sys/go32/Makefile.in b/newlib/libc/sys/go32/Makefile.in new file mode 100644 index 000000000..eb0fb8f29 --- /dev/null +++ b/newlib/libc/sys/go32/Makefile.in @@ -0,0 +1,402 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ +machine_dir = @machine_dir@ +newlib_basedir = @newlib_basedir@ +sys_dir = @sys_dir@ + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = \ + _exit.s \ + _main.c \ + abort.c \ + access.c \ + bdos.c \ + bdosptr.c \ + brk.s \ + chdir.s \ + chmod.c \ + chown.c \ + clock.S \ + close.s \ + creat.s \ + crlf2nl.c \ + dir.c \ + dosmem.S \ + dpmi.c \ + dup.s \ + dup2.s \ + exec.c \ + fchmod.c \ + findfirs.s \ + findnext.s \ + fixpath.c \ + fstat.s \ + fsync.s \ + ftruncat.c \ + gerrno.s \ + getcwd.c \ + getdate.c \ + getdtabl.c \ + getgid.c \ + getkey.s \ + getpages.c \ + getpid.c \ + getrusag.c \ + gettime.c \ + gettimeo.c \ + getuid.c \ + getwd.s \ + go32func.c \ + infoblk.c \ + inportb.s \ + inportl.s \ + inportsb.s \ + inportsl.s \ + inportsw.s \ + inportw.s \ + int86x.s \ + intdos.c \ + intdosx.c \ + isatty.s \ + kbhit.s \ + kill.c \ + link.s \ + longjmp.S \ + lseek.s \ + lstat.s \ + mkdir.s \ + open.s \ + outportb.s \ + outportl.s \ + outportw.s \ + outprtsb.s \ + outprtsl.s \ + outprtsw.s \ + read.s \ + readv.c \ + rename.s \ + rmdir.s \ + sbrk.s \ + screen.S \ + setjmp.S \ + setmode.s \ + setstack.S \ + settimeo.s \ + sleep.c \ + stat.c \ + stat_ast.s \ + syserr.c \ + system.s \ + tell.s \ + time.c \ + truncate.c \ + turbo.s \ + umask.c \ + unlink.s \ + utime.c \ + utimes.c \ + write.s \ + writev.c + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +lib_a_LIBADD = +lib_a_OBJECTS = _exit.o _main.o abort.o access.o bdos.o bdosptr.o brk.o \ +chdir.o chmod.o chown.o clock.o close.o creat.o crlf2nl.o dir.o \ +dosmem.o dpmi.o dup.o dup2.o exec.o fchmod.o findfirs.o findnext.o \ +fixpath.o fstat.o fsync.o ftruncat.o gerrno.o getcwd.o getdate.o \ +getdtabl.o getgid.o getkey.o getpages.o getpid.o getrusag.o gettime.o \ +gettimeo.o getuid.o getwd.o go32func.o infoblk.o inportb.o inportl.o \ +inportsb.o inportsl.o inportsw.o inportw.o int86x.o intdos.o intdosx.o \ +isatty.o kbhit.o kill.o link.o longjmp.o lseek.o lstat.o mkdir.o open.o \ +outportb.o outportl.o outportw.o outprtsb.o outprtsl.o outprtsw.o \ +read.o readv.o rename.o rmdir.o sbrk.o screen.o setjmp.o setmode.o \ +setstack.o settimeo.o sleep.o stat.o stat_ast.o syserr.o system.o \ +tell.o time.o truncate.o turbo.o umask.o unlink.o utime.o utimes.o \ +write.o writev.o +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(lib_a_SOURCES) +OBJECTS = $(lib_a_OBJECTS) + +all: Makefile $(LIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \ + ../../../aclocal.m4 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) + -rm -f lib.a + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @echo "========================"; \ + echo "$(distdir).tar.gz is ready for distribution"; \ + echo "========================" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: + $(MAKE) $(AM_MAKEFLAGS) +installcheck: +install-info: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean + +distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \ + distclean-generic clean + -rm -f config.status + +maintainer-clean: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + -rm -f config.status + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all: crt0.o + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/sys/go32/_exit.s b/newlib/libc/sys/go32/_exit.s new file mode 100644 index 000000000..8c135976e --- /dev/null +++ b/newlib/libc/sys/go32/_exit.s @@ -0,0 +1,20 @@ +# /* This is file _EXIT.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl __exit +__exit: + movb 4(%esp),%al + movb $0x4c,%ah + int $0x21 diff --git a/newlib/libc/sys/go32/_main.c b/newlib/libc/sys/go32/_main.c new file mode 100644 index 000000000..c8c6136f7 --- /dev/null +++ b/newlib/libc/sys/go32/_main.c @@ -0,0 +1,3 @@ +__main() +{ +} diff --git a/newlib/libc/sys/go32/abort.c b/newlib/libc/sys/go32/abort.c new file mode 100644 index 000000000..f2466c84c --- /dev/null +++ b/newlib/libc/sys/go32/abort.c @@ -0,0 +1,8 @@ + +void +abort() +{ + + exit(1); + +} diff --git a/newlib/libc/sys/go32/access.c b/newlib/libc/sys/go32/access.c new file mode 100644 index 000000000..ad368caa1 --- /dev/null +++ b/newlib/libc/sys/go32/access.c @@ -0,0 +1,34 @@ +/* This is file ACCESS.C */ +/* +** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#include +#include +#include + +int access(const char *fn, int flags) +{ + struct stat s; + if (stat(fn, &s)) + return -1; + if (s.st_mode & S_IFDIR) + return 0; + if (flags & W_OK) + { + if (s.st_mode & S_IWRITE) + return 0; + return -1; + } + return 0; +} + diff --git a/newlib/libc/sys/go32/aclocal.m4 b/newlib/libc/sys/go32/aclocal.m4 new file mode 100644 index 000000000..70d481020 --- /dev/null +++ b/newlib/libc/sys/go32/aclocal.m4 @@ -0,0 +1,282 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This provides configure definitions used by all the newlib +dnl configure.in files. + +dnl Basic newlib configury. This calls basic introductory stuff, +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs +dnl configure.host. The only argument is the relative path to the top +dnl newlib directory. + +AC_DEFUN(NEWLIB_CONFIGURE, +[ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes])dnl + +dnl Support --enable-target-optspace +AC_ARG_ENABLE(target-optspace, +[ --enable-target-optspace optimize for space], +[case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;; + esac], [target_optspace=])dnl + +dnl Support --enable-newlib-mb +AC_ARG_ENABLE(newlib-mb, +[ --enable-newlib-mb enable multibyte support], +[case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;; + esac], [newlib_mb=no])dnl + +dnl We may get other options which we don't document: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +test -z "[$]{with_target_subdir}" && with_target_subdir=. + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + else + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + fi +else + newlib_basedir="[$]{srcdir}/$1" +fi +AC_SUBST(newlib_basedir) + +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE(newlib, 1.8.1) + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +AC_CANONICAL_BUILD + +AC_CHECK_TOOL(AS, as) +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +AC_PROG_INSTALL + +AM_MAINTAINER_MODE + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + AC_EXEEXT +fi + +. [$]{newlib_basedir}/configure.host + +case [$]{newlib_basedir} in +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;; +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;; +esac + +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="[$]{newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} +AC_SUBST(NEWLIB_CFLAGS) + +AC_SUBST(machine_dir) +AC_SUBST(sys_dir) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/newlib/libc/sys/go32/bdos.c b/newlib/libc/sys/go32/bdos.c new file mode 100644 index 000000000..523f73aa6 --- /dev/null +++ b/newlib/libc/sys/go32/bdos.c @@ -0,0 +1,12 @@ +#include +#include "dos.h" + +bdos(int func, unsigned dx, unsigned al) +{ + union REGS r; + r.x.dx = dx; + r.h.ah = func; + r.h.al = al; + int86(0x21, &r, &r); + return r.x.ax; +} diff --git a/newlib/libc/sys/go32/bdosptr.c b/newlib/libc/sys/go32/bdosptr.c new file mode 100644 index 000000000..214d40baf --- /dev/null +++ b/newlib/libc/sys/go32/bdosptr.c @@ -0,0 +1,12 @@ +#include +#include "dos.h" + +bdosptr(int func, void *dx, unsigned al) +{ + union REGS r; + r.x.dx = dx; + r.h.ah = func; + r.h.al = al; + int86(0x21, &r, &r); + return r.x.ax; +} diff --git a/newlib/libc/sys/go32/brk.s b/newlib/libc/sys/go32/brk.s new file mode 100644 index 000000000..c9d8db0e9 --- /dev/null +++ b/newlib/libc/sys/go32/brk.s @@ -0,0 +1,27 @@ +# /* This is file BRK.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _brk +_brk: + pushl %ebx + pushl %esi + pushl %edi + movw $0x4a00,%ax + movl 16(%esp),%ebx + int $0x21 + popl %edi + popl %esi + popl %ebx + ret diff --git a/newlib/libc/sys/go32/chdir.s b/newlib/libc/sys/go32/chdir.s new file mode 100644 index 000000000..a494408e7 --- /dev/null +++ b/newlib/libc/sys/go32/chdir.s @@ -0,0 +1,27 @@ +# /* This is file CHDIR.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _chdir +_chdir: + pushl %ebx + pushl %esi + pushl %edi + movl 16(%esp),%edx + movb $0x3b,%ah + int $0x21 + popl %edi + popl %esi + popl %ebx + jmp syscall_check diff --git a/newlib/libc/sys/go32/chmod.c b/newlib/libc/sys/go32/chmod.c new file mode 100644 index 000000000..72f5f5716 --- /dev/null +++ b/newlib/libc/sys/go32/chmod.c @@ -0,0 +1,15 @@ +/* This is file CHMOD.C */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +chmod(){} diff --git a/newlib/libc/sys/go32/chown.c b/newlib/libc/sys/go32/chown.c new file mode 100644 index 000000000..a780510ed --- /dev/null +++ b/newlib/libc/sys/go32/chown.c @@ -0,0 +1,15 @@ +/* This is file CHOWN.C */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +chown(){} diff --git a/newlib/libc/sys/go32/clock.S b/newlib/libc/sys/go32/clock.S new file mode 100644 index 000000000..e6ac06ed2 --- /dev/null +++ b/newlib/libc/sys/go32/clock.S @@ -0,0 +1,45 @@ +/* This is file CLOCK.S */ +/* +** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +** +** Modified by C. Sandmann for DPMI support (sandmann@clio.rice.edu) +*/ + .data +clock_init: + .long 0 + + .text + .globl _clock +_clock: + call _rawclock + imull $54931,%eax,%eax + ret + + .align 4,0x90 + .globl _rawclock +_rawclock: + movzwl __core_select,%eax + testl %eax,%eax + je old_clock /* Image run with pre-DPMI extender */ + movw %ax,%gs + movl %gs:0x46c(,1),%eax + jmp check_initted +old_clock: + movl 0xe000046c,%eax +check_initted: + cmp $0,clock_init + jne clock_initted + movl %eax,clock_init +clock_initted: + subl clock_init,%eax + ret + diff --git a/newlib/libc/sys/go32/close.s b/newlib/libc/sys/go32/close.s new file mode 100644 index 000000000..3b0797ddf --- /dev/null +++ b/newlib/libc/sys/go32/close.s @@ -0,0 +1,27 @@ +# /* This is file CLOSE.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _close +_close: + pushl %ebx + pushl %esi + pushl %edi + movl 16(%esp),%ebx + movb $0x3e,%ah + int $0x21 + popl %edi + popl %esi + popl %ebx + jmp syscall_check diff --git a/newlib/libc/sys/go32/configure b/newlib/libc/sys/go32/configure new file mode 100755 index 000000000..398652cb7 --- /dev/null +++ b/newlib/libc/sys/go32/configure @@ -0,0 +1,1687 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multilib build many library versions (default)" +ac_help="$ac_help + --enable-target-optspace optimize for space" +ac_help="$ac_help + --enable-newlib-mb enable multibyte support" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=djtime.h + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../.. $srcdir/../../../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:578: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:631: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:721: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:754: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + +# Check whether --enable-multilib or --disable-multilib was given. +if test "${enable_multilib+set}" = set; then + enableval="$enable_multilib" + case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace or --disable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then + enableval="$enable_target_optspace" + case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;; + esac +else + target_optspace= +fi + +# Check whether --enable-newlib-mb or --disable-newlib-mb was given. +if test "${enable_newlib_mb+set}" = set; then + enableval="$enable_newlib_mb" + case "${enableval}" in + yes) newlib_mb=yes ;; + no) newlib_mb=no ;; + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;; + esac +else + newlib_mb=no +fi + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + + +PACKAGE=newlib + +VERSION=1.8.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:881: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:894: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:907: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:920: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:933: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:958: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:988: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1037: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't +# run it explicitly here, it will be run implicitly before +# NEWLIB_CONFIGURE, which doesn't work because that means that it will +# be run before AC_CANONICAL_HOST. +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1094: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1115: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1147: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1211: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1256: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1344: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +fi + +. ${newlib_basedir}/configure.host + +case ${newlib_basedir} in +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;; +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;; +esac + +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include" +case "${host}" in + *-*-cygwin*) + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include" + ;; +esac + +newlib_cflags="${newlib_cflags} -fno-builtin" + +NEWLIB_CFLAGS=${newlib_cflags} + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@newlib_basedir@%$newlib_basedir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@RANLIB@%$RANLIB%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@EXEEXT@%$EXEEXT%g +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@machine_dir@%$machine_dir%g +s%@sys_dir@%$sys_dir%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/newlib/libc/sys/go32/configure.in b/newlib/libc/sys/go32/configure.in new file mode 100644 index 000000000..5706733f0 --- /dev/null +++ b/newlib/libc/sys/go32/configure.in @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/sys/go32 configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.5) +AC_INIT(djtime.h) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) diff --git a/newlib/libc/sys/go32/copying.dj b/newlib/libc/sys/go32/copying.dj new file mode 100644 index 000000000..79b4f700b --- /dev/null +++ b/newlib/libc/sys/go32/copying.dj @@ -0,0 +1,63 @@ +This is the file "copying.dj". + + Copyright Information for sources and executables that are marked + Copyright (C) DJ Delorie + 24 Kirsten Ave + Rochester NH 03867-2954 + +This document is Copyright (C) DJ Delorie and may be distributed +verbatim, but changing it is not allowed. + +Source code copyright DJ Delorie is distributed under the terms of the +GNU General Public Licence, with the following exceptions: + + +* Source code copyright DJ Delorie is distributed under the terms of the + GNU General Public Licence, with the following exceptions: + ("go32.exe" refers to go32.exe and debug32.exe) + + * There are no conditions on distributing copies of stub.exe as + it is originally distributed in this software package, prepended + onto a binary or otherwise. This is the recommended distribution + mechanism for applications. + + * Binaries of emu387 may be distributed with no restrictions. + + * If a user creates an application, prepends a copy of go32.exe onto + the beginning of it, and distributes it free of charge, then the + user is under no obligations to distribute source or pay royalties. + Note that the copyright terms of the FSF and/or UCB must be + obeyed regardless of this. + + * If a user creates an application, prepends a copy of go32.exe onto + the beginning of it, and charges a fee for the software, then a + royalty of $5 or 5% of the selling price per copy sold must be paid + to DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954. Note that + shareware programs are not considered "sold" until payment is rendered + for them. + + * For all other cases, source code for go32.exe must be distributed + with any distributed copies of go32.exe. + + * Software that requires go32.exe to run, but is not distributed with + a copy of go32.exe, incurs no obligations with regards to the + above sections. + + * Contact me for special terms if none of the above are suitable. + + * Donations are always appreciated. + + The intent of this copyright is this: If you make money by using the + programs I wrote, I get some of it. If you use your sources to + teach others how to write programs, I'll support you. + +Changes to source code copyright BSD or FSF are copyright DJ Delorie, but +fall under the terms of the original copyright. + +A copy of the file "COPYING" is included with this document. If you did not +receive a copy of "COPYING", you may obtain one from whence this document +was obtained, or by writing: + Free Software Foundation + 675 Mass Ave + Cambridge, MA 02139 + USA diff --git a/newlib/libc/sys/go32/creat.s b/newlib/libc/sys/go32/creat.s new file mode 100644 index 000000000..4c02e72f4 --- /dev/null +++ b/newlib/libc/sys/go32/creat.s @@ -0,0 +1,19 @@ +# /* This is file CREAT.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _creat +_creat: + movb $1,%al + jmp turbo_assist diff --git a/newlib/libc/sys/go32/crlf2nl.c b/newlib/libc/sys/go32/crlf2nl.c new file mode 100644 index 000000000..18b7061cc --- /dev/null +++ b/newlib/libc/sys/go32/crlf2nl.c @@ -0,0 +1,69 @@ +/* This is file CRLF2NL.C */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +unsigned crlf2nl(char *buf, unsigned len) +{ + char *bp = buf; + int i=0; + while (len--) + { + if (*bp != 13) + { + *buf++ = *bp; + i++; + } + bp++; + } + return i; +} + +unsigned readcr(int fd, char *buf, unsigned len) +{ + unsigned i; + i = read(fd, buf, len); + if (i <= 0) + return i; + return crlf2nl(buf, i); +} + +static char *sbuf = 0; +#define BUFSIZE 4096 + +unsigned writecr(int fd, char *buf, unsigned len) +{ + unsigned bufp=0, sbufp=0, crcnt=0, rlen=0; + int rv; + if (sbuf == 0) + sbuf = (char *)malloc(BUFSIZE+1); + while (len--) + { + if (buf[bufp] == 10) + { + crcnt++; + sbuf[sbufp++] = 13; + } + sbuf[sbufp++] = buf[bufp++]; + if ((sbufp >= BUFSIZE) || (len == 0)) + { + rv = write(fd, sbuf, sbufp); + if (rv < 0) + return rv; + rlen += rv - crcnt; + crcnt = 0; + sbufp = 0; + } + } + return rlen; +} + diff --git a/newlib/libc/sys/go32/crt0.S b/newlib/libc/sys/go32/crt0.S new file mode 100644 index 000000000..5fc6cf77c --- /dev/null +++ b/newlib/libc/sys/go32/crt0.S @@ -0,0 +1,233 @@ + +/* +** Called as start(argc, argv, envp) +*/ + +/* gs:edx points to prog_info structure. All other registers are OBSOLETE +** but included for backwards compatibility +*/ + +/* These symbols are for global constructors and destructors */ +#if 0 + .section .ctor + .globl ___go32_first_ctor +___go32_first_ctor: + .section .dtor + .globl ___go32_last_ctor +___go32_last_ctor: + .globl ___go32_first_dtor +___go32_first_dtor: + .data + .globl ___go32_last_dtor +___go32_last_dtor: +#endif + .text + .globl _start +_start: + .globl start +start: +#ifdef EMU387 + pusha + push %gs +#endif + movl %eax,__hard_master + movl %esi,___pid + movl %edi,___transfer_buffer + movl %ebx,_ScreenPrimary + movl %ebp,_ScreenSecondary + + cmpl $0, %edx + je Lcopy_none + movw %gs,%cx + movw %ds,%ax + cmpw %cx,%ax + je Lcopy_none + + movl %gs:(%edx), %ecx + cmpl __go32_info_block, %ecx + jbe Lcopy_less + movl __go32_info_block, %ecx +Lcopy_less: + movl $__go32_info_block, %edi + addl $3, %ecx + andl $0xfffffffc, %ecx + movl %ecx, (%edi) + addl $4, %edi + addl $4, %edx + subl $4, %ecx +Lcopy_more: + movl %gs:(%edx), %eax + movl %eax, (%edi) + addl $4, %edx + addl $4, %edi + subl $4, %ecx + jnz Lcopy_more + + movl __go32_info_block+4, %eax + movl %eax, _ScreenPrimary + movl __go32_info_block+8, %eax + movl %eax, _ScreenSecondary +/* Backward compatibility - do not copy this one! +** movl __go32_info_block+12, %eax +** movl %eax, ___transfer_buffer +*/ + movl __go32_info_block+20, %eax + movl %eax, ___pid + movl __go32_info_block+24, %eax + movl %eax, __hard_master + + jmp Lcopy_done + +Lcopy_none: + movl %ebx,__go32_info_block+4 + movl %ebp,__go32_info_block+8 + movl %edi,__go32_info_block+12 + movl $4096,__go32_info_block+16 + movl %esi,__go32_info_block+20 + movl %eax,__go32_info_block+24 + movl $28, __go32_info_block +Lcopy_done: + +#ifndef EMU387 + call __setstack +#endif + xorl %esi,%esi + xorl %edi,%edi + xorl %ebp,%ebp + xorl %ebx,%ebx + + movl %esp,%ebx +#ifdef MAKE_GCRT0 + call mcount_init /* initialize the profiler */ +#endif + movl 8(%ebx),%eax + pushl %eax + movl %eax,_environ + pushl 4(%ebx) + pushl (%ebx) + call ___main + call _main + addl $12,%esp +#ifdef EMU387 + pop %gs + popa +#else + pushl %eax + call _exit + +exit_again: + movl $0x4c00,%eax + int $0x21 + jmp exit_again +#endif + + ret + + +#ifdef MAKE_GCRT0 + .globl __exit +__exit: + call mcount_write /* make sure we dump the output */ +exit_again2: + movb 4(%esp),%al + movb $0x4c,%ah + int $0x21 + jmp exit_again2 + +/* Here is where we initialize the timer interrupt - specific to go32 */ +/* In this case, the timer calls mcount_isr */ + .globl mcount_isr_init +mcount_isr_init: + movw __go32_info_block+36, %ax /* run mode */ + cmp $1,%ax + jb skip_mcount + cmp $3,%ax + ja skip_mcount + + movw $16,%ax + movw %ax,%gs + + movzbl __hard_master,%eax /* timer is on irq 0 */ + shll $3,%eax /* times 8 bpv */ +/* movl $960,%eax vector 0x78 * 8 bpv */ + movw %gs:(%eax),%cx + movw %cx,mc_chain + movw %gs:6(%eax),%cx + movw %cx,mc_chain_hi + movw %gs:2(%eax),%cx + movw %cx,mc_chain_sel + + movl $mcount_isr,%ecx + movw %cx,%gs:(%eax) + movw $0xd8,%gs:2(%eax) /* selector 27 == 32-bit code */ + movw $0x8f00,%gs:4(%eax) + rorl $16,%ecx + movw %cx,%gs:6(%eax) + movw %ds,%ax + movw %ax,%gs +skip_mcount: + movl mcount_histogram,%eax + movl $1,(%eax) + ret + +/* Obtain the PC where we interrupted, and bump the histogram. We should */ +/* do error checking here, but we don't. This routine is specific to go32 */ +/* in some spots */ +mcount_isr: + pushl %eax + cmpl $1,mcount_skip + je L0 + movl 4(%esp),%eax /* get the PC */ + subl $0x1020,%eax /* to fit in low..high */ + andl $0xfffffffc,%eax + shrl $1,%eax /* now points to one 4-byte entry */ + addl mcount_histogram,%eax + incw (%eax) +L0: + popl %eax + ljmp mc_chain /* chain to the next timer vector */ + iret +#endif + + .data + + .globl _environ +_environ: + .long 0 + + .globl ___pid +___pid: + .long 42 + + .globl ___transfer_buffer +___transfer_buffer: + .long 0 + + .globl _ScreenPrimary +_ScreenPrimary: + .long 0 + + .globl _ScreenSecondary +_ScreenSecondary: + .long 0 + + .globl __hard_master + .globl __hard_slave + .globl __core_select +__hard_master: + .byte 0 +__hard_slave: + .byte 0 +__core_select: + .short 0 + +#ifdef MAKE_GCRT0 +mc_chain: + .short 0 +mc_chain_hi: + .short 0 +mc_chain_sel: + .short 0 +#endif + + diff --git a/newlib/libc/sys/go32/dir.c b/newlib/libc/sys/go32/dir.c new file mode 100644 index 000000000..ba3831a82 --- /dev/null +++ b/newlib/libc/sys/go32/dir.c @@ -0,0 +1,95 @@ +#include + +#include "sys/dir.h" +#include "sys/dirent.h" +#include + +DIR *opendir(char *name) +{ + int length; + DIR *dir = (DIR *)malloc(sizeof(DIR)); + dir->num_read = 0; + dir->name = (char *)malloc(strlen(name)+6); + strcpy(dir->name, name); + + /* Append a "." if we got only the device name */ + if (dir->name[1] == ':' && strlen(dir->name) == 2) + strcat(dir->name, "."); + + /* Strip trailing slashes, so we can append "/*.*" */ + while (1) + { + length = strlen(dir->name); + if (length == 0) break; + if (dir->name[length - 1] == '/' || + dir->name[length - 1] == '\\') + dir->name[length - 1] = '\0'; + else + break; + } + + strcat(dir->name, "/*.*"); + return dir; +} + + + +static char *strlwr(char *s) +{ + char *p = s; + while (*s) + { + if ((*s >= 'A') && (*s <= 'Z')) + *s += 'a'-'A'; + s++; + } + return p; +} + +struct dirent *readdir(DIR *dir) +{ + int done; + int oerrno = errno; + if (dir->num_read) + done = findnext(&dir->ff); + else + done = findfirst(dir->name, &dir->ff, + FA_ARCH|FA_RDONLY|FA_DIREC|FA_HIDDEN|FA_SYSTEM); + if (done) + { + if (errno == ENMFILE) + errno = oerrno; + return 0; + } + dir->num_read ++; + dir->de.d_namlen = strlen(dir->ff.ff_name); + strcpy(dir->de.d_name,dir->ff.ff_name); + strlwr(dir->de.d_name); + return &dir->de; +} + +long telldir(DIR *dir) +{ + return dir->num_read; +} + +void seekdir(DIR *dir, long loc) +{ + int i; + rewinddir(dir); + for (i=0; inum_read = 0; +} + +int closedir(DIR *dir) +{ + free(dir->name); + free(dir); + return 0; +} + diff --git a/newlib/libc/sys/go32/dir.h b/newlib/libc/sys/go32/dir.h new file mode 100644 index 000000000..826c4604d --- /dev/null +++ b/newlib/libc/sys/go32/dir.h @@ -0,0 +1,53 @@ +#ifndef _DIR_H_ +#define _DIR_H_ + +struct ffblk { + char ff_reserved[21]; + char ff_attrib; + short ff_ftime; + short ff_fdate; + short ff_filler; + long ff_fsize; + char ff_name[16]; +}; + +#define FA_RDONLY 1 +#define FA_HIDDEN 2 +#define FA_SYSTEM 4 +#define FA_LABEL 8 +#define FA_DIREC 16 +#define FA_ARCH 32 + +/* for fnmerge/fnsplit */ +#define MAXPATH 80 +#define MAXDRIVE 3 +#define MAXDIR 66 +#define MAXFILE 9 +#define MAXEXT 5 + +#define WILDCARDS 0x01 +#define EXTENSION 0x02 +#define FILENAME 0x04 +#define DIRECTORY 0x08 +#define DRIVE 0x10 + +#ifdef __cplusplus +extern "C" { +#endif + +int findfirst(const char *pathname, struct ffblk *ffblk, int attrib); +int findnext(struct ffblk *ffblk); + +void fnmerge (char *path, const char *drive, const char *dir, + const char *name, const char *ext); +int fnsplit (const char *path, char *drive, char *dir, + char *name, char *ext); + +int getdisk(void); +int setdisk(int drive); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/newlib/libc/sys/go32/djtime.h b/newlib/libc/sys/go32/djtime.h new file mode 100644 index 000000000..db28dbe7e --- /dev/null +++ b/newlib/libc/sys/go32/djtime.h @@ -0,0 +1,42 @@ +/* This is file TIME.H */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#ifndef _SYS_TIME_H_ +#define _SYS_TIME_H_ + +#include + +struct timeval { + long tv_sec; + long tv_usec; +}; + +struct timezone { + int tz_minuteswest; + int tz_dsttime; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +int gettimeofday(struct timeval *tp, struct timezone *tzp); + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/newlib/libc/sys/go32/dos.h b/newlib/libc/sys/go32/dos.h new file mode 100644 index 000000000..8b42562d2 --- /dev/null +++ b/newlib/libc/sys/go32/dos.h @@ -0,0 +1,107 @@ +#ifndef _DOS_H_ +#define _DOS_H_ + +#include "pc.h" + +union REGS { + struct { + unsigned long ax; + unsigned long bx; + unsigned long cx; + unsigned long dx; + unsigned long si; + unsigned long di; + unsigned long cflag; + unsigned long flags; + } x; + struct { + unsigned char al; + unsigned char ah; + unsigned short upper_ax; + unsigned char bl; + unsigned char bh; + unsigned short upper_bx; + unsigned char cl; + unsigned char ch; + unsigned short upper_cx; + unsigned char dl; + unsigned char dh; + unsigned short upper_dx; + } h; +}; + +struct SREGS { + unsigned short cs; + unsigned short ds; + unsigned short es; + unsigned short fs; + unsigned short gs; + unsigned short ss; +}; + +struct ftime { + unsigned ft_tsec:5; /* 0-29, double to get real seconds */ + unsigned ft_min:6; /* 0-59 */ + unsigned ft_hour:5; /* 0-23 */ + unsigned ft_day:5; /* 1-31 */ + unsigned ft_month:4; /* 1-12 */ + unsigned ft_year:7; /* since 1980 */ +}; + +struct date { + short da_year; + char da_day; + char da_mon; +}; + +struct time { + unsigned char ti_min; + unsigned char ti_hour; + unsigned char ti_hund; + unsigned char ti_sec; +}; + +struct dfree { + unsigned df_avail; + unsigned df_total; + unsigned df_bsec; + unsigned df_sclus; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +int bdos(int func, unsigned dx, unsigned al); +int bdosptr(int func, void *dx, unsigned al); +int int86(int ivec, union REGS *in, union REGS *out); +int int86x(int ivec, union REGS *in, union REGS *out, struct SREGS *seg); +int intdos(union REGS *in, union REGS *out); +int intdosx(union REGS *in, union REGS *out, struct SREGS *seg); + +int enable(void); +int disable(void); + +int getftime(int handle, struct ftime *ftimep); +int setftime(int handle, struct ftime *ftimep); + +int getcbrk(void); +int setcbrk(int new_value); + +void getdate(struct date *); +void gettime(struct time *); +void setdate(struct date *); +void settime(struct time *); + +void getdfree(unsigned char drive, struct dfree *ptr); + +void delay(unsigned msec); +int _get_default_drive(void); +void _fixpath(const char *, char *); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/newlib/libc/sys/go32/dosmem.S b/newlib/libc/sys/go32/dosmem.S new file mode 100644 index 000000000..c1956f767 --- /dev/null +++ b/newlib/libc/sys/go32/dosmem.S @@ -0,0 +1,120 @@ +/* DOSMEM.S */ +/* +** Copyright (C) 1993 C.W. Sandmann +** +** This file may be freely distributed as long as the author's name remains. +** Extender environment independent way to set up Real area 1Mb access. +** Procedure takes a single argument %eax which contains the real area offset. +** After call, access may be made with "%gs:(%eax)" +*/ + .text + .align 2 + .globl dosmemsetup +dosmemsetup: /* no params, expected ASM call only */ + pushl %eax + movzwl __core_select,%eax + testl %eax,%eax + je old_go32 /* Image run with pre-DPMI extender */ + movw %ax,%gs /* Use real area selector */ + popl %eax /* Plus real offset */ + andl $0x0fffffff,%eax /* Clear any linear access bits */ + ret + .align 2,0x90 +old_go32: + push %ds + pop %gs /* Use arena selector */ + popl %eax + orl $0xe0000000,%eax /* Plus linear access area */ + ret + + .align 2 + .globl _dosmemget +_dosmemget: /* long offset, long len, long *buf */ + push %gs + movl 8(%esp),%eax /* offset */ + call dosmemsetup + movl 12(%esp),%ecx /* length */ + movl 16(%esp),%edx /* arena offset */ + pushl %esi + pushl %edi + movl %eax,%esi + movl %edx,%edi + push %ds + push %es + push %ds + pop %es + push %gs + pop %ds + cld + rep + movsb /* move ECX bytes from Real area */ + pop %es + pop %ds + popl %edi + popl %esi + pop %gs + ret + + .align 2 + .globl _dosmemput +_dosmemput: /* long *buf, long len, long offset */ + push %gs + movl 16(%esp),%eax /* offset */ + call dosmemsetup + movl 12(%esp),%ecx /* length */ + movl 8(%esp),%edx /* arena offset */ + pushl %esi + pushl %edi + movl %eax,%edi + movl %edx,%esi + push %es + push %gs + pop %es + cld + rep + movsb /* move ECX bytes to Real area */ + pop %es + popl %edi + popl %esi + pop %gs + ret + + .align 2 /* 8(bp) 12(bp) 16(bp) 20(bp) 24(bp) */ + .globl _movedata /* src_sel, src_ofs, dest_sel, dest_ofs, len */ +_movedata: + pushl %ebp + movl %esp,%ebp + pushw %ds + pushw %es + pushl %esi + pushl %edi + + movl 8(%ebp),%eax + movw %ax,%ds + movl 12(%ebp),%esi + + movl 16(%ebp),%eax + movw %ax,%es + movl 20(%ebp),%edi + + movl 24(%ebp),%ecx + pushl %ecx + shrl $2,%ecx + jcxz no_big_move + rep + movsl +no_big_move: + popl %ecx + andl $3,%ecx + jcxz no_little_move + rep + movsb +no_little_move: + + popl %edi + popl %esi + popw %es + popw %ds + leave + ret + diff --git a/newlib/libc/sys/go32/dpmi.c b/newlib/libc/sys/go32/dpmi.c new file mode 100644 index 000000000..5215065e1 --- /dev/null +++ b/newlib/libc/sys/go32/dpmi.c @@ -0,0 +1,413 @@ +#include +#include "dos.h" +#include "go32.h" +#include +#include "dpmi.h" + +static union REGS r; +static struct SREGS s; + +int _go32_dpmi_allocate_dos_memory(_go32_dpmi_seginfo *info) +{ + r.x.ax = 0x0100; + r.x.bx = info->size; + int86(0x31, &r, &r); + if (r.x.flags & 1) + { + info->size = r.x.bx; + return r.x.ax; + } + else + { + info->rm_segment = r.x.ax; + info->pm_selector = r.x.dx; + return 0; + } +} + +int _go32_dpmi_free_dos_memory(_go32_dpmi_seginfo *info) +{ + r.x.ax = 0x0101; + r.x.dx = info->pm_selector; + int86(0x31, &r, &r); + if (r.x.flags & 1) + { + return r.x.ax; + } + else + { + return 0; + } +} + +int _go32_dpmi_resize_dos_memory(_go32_dpmi_seginfo *info) +{ + r.x.ax = 0x0102; + r.x.bx = info->size; + r.x.dx = info->pm_selector; + int86(0x31, &r, &r); + if (r.x.flags & 1) + { + info->size = r.x.bx; + return r.x.ax; + } + else + { + return 0; + } +} + +int _go32_dpmi_get_real_mode_interrupt_vector(int vector, _go32_dpmi_seginfo *info) +{ + r.x.ax = 0x0200; + r.h.bl = vector; + int86(0x31, &r, &r); + info->rm_segment = r.x.cx; + info->rm_offset = r.x.dx; + return 0; +} + +int _go32_dpmi_set_real_mode_interrupt_vector(int vector, _go32_dpmi_seginfo *info) +{ + r.x.ax = 0x0201; + r.h.bl = vector; + r.x.cx = info->rm_segment; + r.x.dx = info->rm_offset; + int86(0x31, &r, &r); + return 0; +} + +int _go32_dpmi_get_protected_mode_interrupt_vector(int vector, _go32_dpmi_seginfo *info) +{ + r.x.ax = 0x0204; + r.h.bl = vector; + int86(0x31, &r, &r); + info->pm_selector = r.x.cx; + info->pm_offset = r.x.dx; + return 0; +} + +int _go32_dpmi_set_protected_mode_interrupt_vector(int vector, _go32_dpmi_seginfo *info) +{ + r.x.ax = 0x0205; + r.h.bl = vector; + r.x.cx = info->pm_selector; + r.x.dx = info->pm_offset; + int86(0x31, &r, &r); + if (r.x.flags & 1) + { + return r.x.ax; + } + else + { + return 0; + } +} + +/* In real DPMI, we enter with only CS known, and SS on a locked 4K stack which + is *NOT* our SS. We must set up everthing, including a stack swap, then + restore it the way we found it. C. Sandmann 4-93 */ + +static unsigned char wrapper_intcommon[] = { +0x1e, /* push ds */ +0x06, /* push es */ +0x0f, 0xa0, /* push fs */ +0x0f, 0xa8, /* push gs */ +0x60, /* pusha */ +0x66, 0xb8, 0x34, 0x12, /* mov ax,0x1234 */ +0x8e, 0xd8, /* mov ds,ax */ +0x8e, 0xc0, /* mov es,ax */ +0x8e, 0xe0, /* mov fs,ax */ +0x8e, 0xe8, /* mov gs,ax */ +0xbb, 0x00, 0x00, 0x00, 0x00, /* mov ebx,_local_stack */ +0xfc, /* cld */ +0x89, 0xe1, /* mov ecx,esp */ +0x8c, 0xd2, /* mov dx,ss */ +0x8e, 0xd0, /* mov ss,ax */ +0x89, 0xdc, /* mov esp,ebx */ +0x52, /* push edx */ +0x51, /* push ecx */ +0xe8, 0x00, 0x00, 0x00, 0x00, /* call _rmih */ +0x58, /* pop eax */ +0x5b, /* pop ebx */ +0x8e, 0xd3, /* mov ss,bx */ +0x89, 0xc4, /* mov esp,eax */ +0x61, /* popa */ +0x0f, 0xa9, /* pop gs */ +0x0f, 0xa1, /* pop fs */ +0x07, /* pop es */ +0x1f /* pop ds */ +}; + +static unsigned char wrapper_intiret[] = { +0xcf /* iret */ +}; + +static unsigned char wrapper_intchain[] = { +0x2e, 0xff, 0x2d, 0x00, 0x00, 0x00, 0x00, /* jmp cs:[_old_int+39] */ +0xcf, /* iret */ +0x78, 0x56, 0x34, 0x12, +0xcd, 0xab +}; + +/* _interrupt_stack_size can be changed globally before calling this routine if + needed. Don't change it between calls or you will mess up the malloc chain ! */ + +unsigned _interrupt_stack_size = 32256; + +int _go32_dpmi_chain_protected_mode_interrupt_vector(int vector, _go32_dpmi_seginfo *info) +{ + char *mystack; + unsigned char *wrapper = (unsigned char *)malloc(sizeof(wrapper_intcommon) + sizeof(wrapper_intchain)); + if (wrapper == 0) + return 0x8015; + mystack = (char *)malloc(_interrupt_stack_size); + if (mystack == 0) + return 0x8015; + + r.x.ax = 0x0204; + r.h.bl = vector; + int86(0x31, &r, &r); + + memcpy(wrapper, wrapper_intcommon, sizeof(wrapper_intcommon)); + memcpy(wrapper+sizeof(wrapper_intcommon), wrapper_intchain, sizeof(wrapper_intchain)); + *(short *)(wrapper+9) = _go32_my_ds(); + *(long *)(wrapper+20) = (int)mystack + _interrupt_stack_size; + *(long *)(wrapper+36) = info->pm_offset - (int)wrapper - 40; + *(long *)(wrapper+sizeof(wrapper_intcommon)+3) = (long)wrapper+sizeof(wrapper_intcommon)+8; + *(long *)(wrapper+sizeof(wrapper_intcommon)+8) = r.x.dx; + *(short *)(wrapper+sizeof(wrapper_intcommon)+12) = r.x.cx; + + r.x.ax = 0x0205; + r.h.bl = vector; + r.x.cx = _go32_my_cs(); + r.x.dx = (int)wrapper; + int86(0x31, &r, &r); + return 0; +} + +int _go32_dpmi_allocate_iret_wrapper(_go32_dpmi_seginfo *info) +{ + char *mystack; + unsigned char *wrapper = (unsigned char *)malloc(sizeof(wrapper_intcommon) + sizeof(wrapper_intiret)); + if (wrapper == 0) + return 0x8015; + mystack = (char *)malloc(_interrupt_stack_size); + if (mystack == 0) + return 0x8015; + + memcpy(wrapper, wrapper_intcommon, sizeof(wrapper_intcommon)); + memcpy(wrapper+sizeof(wrapper_intcommon), wrapper_intiret, sizeof(wrapper_intiret)); + *(short *)(wrapper+9) = _go32_my_ds(); + *(long *)(wrapper+20) = (int)mystack + _interrupt_stack_size; + *(long *)(wrapper+36) = info->pm_offset - (int)wrapper - 40; + + info->pm_offset = (int)wrapper; + return 0; +} + +int _go32_dpmi_free_iret_wrapper(_go32_dpmi_seginfo *info) +{ + char *mystack; + char *wrapper = (char *)info->pm_offset; + mystack = (char *)(*(long *)(wrapper+20) - _interrupt_stack_size); + free(mystack); + free(wrapper); + return 0; +} + +int _go32_dpmi_simulate_int(int vector, _go32_dpmi_registers *regs) +{ + r.h.bl = vector; + r.h.bh = 0; + r.x.cx = 0; + r.x.di = (int)regs; + if (vector == 0x21 && regs->x.ax == 0x4b00) + { + r.x.ax = 0xff0a; + int86(0x21, &r, &r); + } + else + { + r.x.ax = 0x0300; + int86(0x31, &r, &r); + } + if (r.x.flags & 1) + { + return r.x.ax; + } + else + { + return 0; + } +} + +int _go32_dpmi_simulate_fcall(_go32_dpmi_registers *regs) +{ + r.x.ax = 0x0301; + r.h.bh = 0; + r.x.cx = 0; + r.x.di = (int)regs; + int86(0x31, &r, &r); + if (r.x.flags & 1) + { + return r.x.ax; + } + else + { + return 0; + } +} + +int _go32_dpmi_simulate_fcall_iret(_go32_dpmi_registers *regs) +{ + r.x.ax = 0x0302; + r.h.bh = 0; + r.x.cx = 0; + r.x.di = (int)regs; + int86(0x31, &r, &r); + if (r.x.flags & 1) + { + return r.x.ax; + } + else + { + return 0; + } +} + +/* Bug here; this needs to be fixed like above with SS & CLD */ + +static unsigned char wrapper_common[] = { +0x66, 0x06, /* push es */ +0x66, 0x1e, /* push ds */ +0x66, 0x06, /* push es */ +0x66, 0x1f, /* pop ds */ +0x56, /* push esi */ +0x57, /* push edi */ +0xe8, 0x00, 0x00, 0x00, 0x00, /* call _rmcb */ +0x5f, /* pop edi */ +0x5e, /* pop esi */ +0x66, 0x1f, /* pop ds */ +0x66, 0x07, /* pop es */ +0xfc, /* cld */ +0x66, 0x8b, 0x06, /* mov ax,[esi] */ +0x66, 0x26, 0x89, 0x47, 0x2a, /* mov es:[edi+42],ax */ +0x66, 0x8b, 0x46, 0x02, /* mov ax,[esi+2] */ +0x66, 0x26, 0x89, 0x47, 0x2c, /* mov es:[edi+44],ax */ +}; + +static unsigned char wrapper_retf[] = { +0x66, 0x26, 0x83, 0x47, 0x2e, 0x04, /* add es:[edi+46],0x4 */ +0xcf /* iret */ +}; + +static unsigned char wrapper_iret[] = { +0x66, 0x8b, 0x46, 0x04, /* mov ax,[esi+4] */ +0x66, 0x26, 0x89, 0x47, 0x20, /* mov es:[edi+32],ax */ +0x66, 0x26, 0x83, 0x47, 0x2e, 0x06, /* add es:[edi+46],0x6 */ +0xcf /* iret */ +}; + +int _go32_dpmi_allocate_real_mode_callback_retf(_go32_dpmi_seginfo *info, _go32_dpmi_registers *regs) +{ + unsigned char *wrapper = (unsigned char *)malloc(sizeof(wrapper_common) + sizeof(wrapper_retf)); + if (wrapper == 0) + return 0x8015; + + memcpy(wrapper, wrapper_common, sizeof(wrapper_common)); + memcpy(wrapper+sizeof(wrapper_common), wrapper_retf, sizeof(wrapper_retf)); + *(long *)(wrapper+11) = info->pm_offset - (int)wrapper - 15; + info->size = (int)wrapper; + + r.x.ax = 0x0303; + r.x.si = (int)wrapper; + r.x.di = (int)regs; + s.ds = _go32_my_cs(); + s.es = _go32_my_ds(); + s.fs = 0; + s.gs = 0; + int86x(0x31, &r, &r, &s); + if (r.x.flags & 1) + { + return r.x.ax; + } + else + { + info->rm_segment = r.x.cx; + info->rm_offset = r.x.dx; + return 0; + } +} + +int _go32_dpmi_allocate_real_mode_callback_iret(_go32_dpmi_seginfo *info, _go32_dpmi_registers *regs) +{ + unsigned char *wrapper = (unsigned char *)malloc(sizeof(wrapper_common) + sizeof(wrapper_iret)); + if (wrapper == 0) + return 0x8015; + + memcpy(wrapper, wrapper_common, sizeof(wrapper_common)); + memcpy(wrapper+sizeof(wrapper_common), wrapper_iret, sizeof(wrapper_iret)); + *(long *)(wrapper+11) = info->pm_offset - (int)wrapper - 15; + info->size = (int)wrapper; + + r.x.ax = 0x0303; + r.x.si = (int)wrapper; + r.x.di = (int)regs; + s.ds = _go32_my_cs(); + s.es = _go32_my_ds(); + s.fs = 0; + s.gs = 0; + int86x(0x31, &r, &r, &s); + if (r.x.flags & 1) + { + return r.x.ax; + } + else + { + info->rm_segment = r.x.cx; + info->rm_offset = r.x.dx; + return 0; + } +} + +int _go32_dpmi_free_real_mode_callback(_go32_dpmi_seginfo *info) +{ + free((char *)info->size); + r.x.ax = 0x0304; + r.x.cx = info->rm_segment; + r.x.dx = info->rm_offset; + int86(0x31, &r, &r); + if (r.x.flags & 1) + { + return r.x.ax; + } + else + { + return 0; + } +} + +int _go32_dpmi_get_free_memory_information(_go32_dpmi_meminfo *info) +{ + r.x.ax = 0x0500; + r.x.di = (int)info; + int86(0x31, &r, &r); + return 0; +} + +u_long _go32_dpmi_remaining_physical_memory() +{ + _go32_dpmi_meminfo info; + _go32_dpmi_get_free_memory_information(&info); + if (info.available_physical_pages) + return info.available_physical_pages * 4096; + return info.available_memory; +} + +u_long _go32_dpmi_remaining_virtual_memory() +{ + _go32_dpmi_meminfo info; + _go32_dpmi_get_free_memory_information(&info); + return info.available_memory; +} diff --git a/newlib/libc/sys/go32/dpmi.h b/newlib/libc/sys/go32/dpmi.h new file mode 100644 index 000000000..7a2cb13af --- /dev/null +++ b/newlib/libc/sys/go32/dpmi.h @@ -0,0 +1,151 @@ +/* This is file dpmi.h */ +/* +** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#ifndef _DPMI_H_ +#define _DPMI_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef union { + struct { + u_long edi; + u_long esi; + u_long ebp; + u_long res; + u_long ebx; + u_long edx; + u_long ecx; + u_long eax; + } d; + struct { + u_short di, di_hi; + u_short si, si_hi; + u_short bp, bp_hi; + u_short res, res_hi; + u_short bx, bx_hi; + u_short dx, dx_hi; + u_short cx, cx_hi; + u_short ax, ax_hi; + u_short flags; + u_short es; + u_short ds; + u_short fs; + u_short gs; + u_short ip; + u_short cs; + u_short sp; + u_short ss; + } x; + struct { + u_char edi[4]; + u_char esi[4]; + u_char ebp[4]; + u_char res[4]; + u_char bl, bh, ebx_b2, ebx_b3; + u_char dl, dh, edx_b2, edx_b3; + u_char cl, ch, ecx_b2, ecx_b3; + u_char al, ah, eax_b2, eax_b3; + } h; +} _go32_dpmi_registers; + +typedef struct { + u_long size; + u_long pm_offset; + u_short pm_selector; + u_short rm_offset; + u_short rm_segment; +} _go32_dpmi_seginfo; + +typedef struct { + u_long available_memory; + u_long available_pages; + u_long available_lockable_pages; + u_long linear_space; + u_long unlocked_pages; + u_long available_physical_pages; + u_long total_physical_pages; + u_long free_linear_space; + u_long max_pages_in_paging_file; + u_long reserved[3]; +} _go32_dpmi_meminfo; + +/* returns zero if success, else dpmi error and info->size is max size */ +int _go32_dpmi_allocate_dos_memory(_go32_dpmi_seginfo *info); + /* set size to bytes/16, call, use rm_segment. Do not + change anthing but size until the memory is freed. + If error, max size is returned in size as bytes/16. */ +int _go32_dpmi_free_dos_memory(_go32_dpmi_seginfo *info); + /* set new size to bytes/16, call. If error, max size + is returned in size as bytes/16 */ +int _go32_dpmi_resize_dos_memory(_go32_dpmi_seginfo *info); + /* uses pm_selector to free memory */ + +/* These both use the rm_segment:rm_offset fields only */ +int _go32_dpmi_get_real_mode_interrupt_vector(int vector, _go32_dpmi_seginfo *info); +int _go32_dpmi_set_real_mode_interrupt_vector(int vector, _go32_dpmi_seginfo *info); + +/* These do NOT wrap the function in pm_offset in an iret handler. + You must provide an assembler interface yourself, or alloc one below. + You may NOT longjmp out of an interrupt handler. */ +int _go32_dpmi_get_protected_mode_interrupt_vector(int vector, _go32_dpmi_seginfo *info); + /* puts vector in pm_selector:pm_offset. */ +int _go32_dpmi_set_protected_mode_interrupt_vector(int vector, _go32_dpmi_seginfo *info); + /* sets vector from pm_offset and pm_selector */ +int _go32_dpmi_chain_protected_mode_interrupt_vector(int vector, _go32_dpmi_seginfo *info); + /* sets up wrapper that calls function in pm_offset, chaining to old + handler when it returns */ + +/* These can be used to generate assember IRET-style wrappers for functions */ +int _go32_dpmi_allocate_iret_wrapper(_go32_dpmi_seginfo *info); + /* Put function ptr in pm_offset, call, returns wrapper entry in pm_offset. */ +int _go32_dpmi_free_iret_wrapper(_go32_dpmi_seginfo *info); + /* assumes pm_offset points to wrapper, frees it */ + +/* simulate real mode calls. CS:IP from regs for non-interrupt */ +int _go32_dpmi_simulate_int(int vector, _go32_dpmi_registers *regs); +int _go32_dpmi_simulate_fcall(_go32_dpmi_registers *regs); +int _go32_dpmi_simulate_fcall_iret(_go32_dpmi_registers *regs); + +/* These automatically handle the tasks of restructuring the + real-mode stack for the proper return type. The callback + (info->pm_offset) is called as (*pmcb)(_go32_dpmi_registers *regs); */ +int _go32_dpmi_allocate_real_mode_callback_retf(_go32_dpmi_seginfo *info, _go32_dpmi_registers *regs); + /* points callback at pm_offset, returns seg:ofs of callback addr + in rm_segment:rm_offset. Do not change any fields until freed. + Interface is added to simulate far return */ +int _go32_dpmi_allocate_real_mode_callback_iret(_go32_dpmi_seginfo *info, _go32_dpmi_registers *regs); + /* same, but simulates iret */ +int _go32_dpmi_free_real_mode_callback(_go32_dpmi_seginfo *info); + /* frees callback */ + +/* Only available_memory is guaranteed to be valid. Try + available_physical_pages for phys mem left */ +int _go32_dpmi_get_free_memory_information(_go32_dpmi_meminfo *info); + +/* Convenience functions. These use the above memory info call. + The return value is *bytes* */ +u_long _go32_dpmi_remaining_physical_memory(void); +u_long _go32_dpmi_remaining_virtual_memory(void); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/newlib/libc/sys/go32/dup.s b/newlib/libc/sys/go32/dup.s new file mode 100644 index 000000000..e093baffd --- /dev/null +++ b/newlib/libc/sys/go32/dup.s @@ -0,0 +1,28 @@ +# /* This is file DUP.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _dup +_dup: + pushl %ebx + pushl %esi + pushl %edi + movl 16(%esp),%ebx + movb $0x45,%ah + int $0x21 + popl %edi + popl %esi + popl %ebx + jb syscall_error + ret diff --git a/newlib/libc/sys/go32/dup2.s b/newlib/libc/sys/go32/dup2.s new file mode 100644 index 000000000..e26b48fa1 --- /dev/null +++ b/newlib/libc/sys/go32/dup2.s @@ -0,0 +1,28 @@ +# /* This is file DUP2.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _dup2 +_dup2: + pushl %ebx + pushl %esi + pushl %edi + movl 16(%esp),%ebx + movl 20(%esp),%ecx + movb $0x46,%ah + int $0x21 + popl %edi + popl %esi + popl %ebx + jmp syscall_check diff --git a/newlib/libc/sys/go32/exec.c b/newlib/libc/sys/go32/exec.c new file mode 100644 index 000000000..004666c71 --- /dev/null +++ b/newlib/libc/sys/go32/exec.c @@ -0,0 +1,509 @@ +#include +#include +#include +#include +#include +#include "go32.h" +#include "dpmi.h" +/*#include "process.h"*/ +#if 1 +#define P_WAIT 1 +#define P_NOWAIT 2 /* always generates error */ +#define P_OVERLAY 3 +#endif +extern const char **environ; +#define environ ((const char **)environ) + +#define scan_ptr() \ + char const **ptr; \ + for (ptr = &argv0; *ptr; ptr++); \ + ptr = (char const **)(*++ptr); + +int execl(const char *path, const char *argv0, ...) +{ + return spawnve(P_OVERLAY, path, &argv0, environ); +} + +int execle(const char *path, const char *argv0, ... /*, const char **envp */) +{ + scan_ptr(); + return spawnve(P_OVERLAY, path, &argv0, ptr); +} + +int execlp(const char *path, const char *argv0, ...) +{ + return spawnvpe(P_OVERLAY, path, &argv0, environ); +} + +int execlpe(const char *path, const char *argv0, ... /*, const char **envp */) +{ + scan_ptr(); + return spawnvpe(P_OVERLAY, path, &argv0, ptr); +} + +/*-------------------------------------------------*/ + +int execv(const char *path, const char **argv) +{ + return spawnve(P_OVERLAY, path, argv, environ); +} + +int execve(const char *path, const char **argv, const char **envp) +{ + return spawnve(P_OVERLAY, path, argv, envp); +} + +int execvp(const char *path, const char **argv) +{ + return spawnvpe(P_OVERLAY, path, argv, environ); +} + +int execvpe(const char *path, const char **argv, const char **envp) +{ + return spawnvpe(P_OVERLAY, path, argv, envp); +} + +/*-------------------------------------------------*/ + +int spawnl(int mode, const char *path, const char *argv0, ...) +{ + return spawnve(mode, path, &argv0, environ); +} + +int spawnle(int mode, const char *path, const char *argv0, ... /*, const char **envp */) +{ + scan_ptr(); + return spawnve(mode, path, &argv0, ptr); +} + +int spawnlp(int mode, const char *path, const char *argv0, ...) +{ + return spawnvpe(mode, path, &argv0, environ); +} + +int spawnlpe(int mode, const char *path, const char *argv0, ... /*, const char **envp */) +{ + scan_ptr(); + return spawnvpe(mode, path, &argv0, ptr); +} + +/*-------------------------------------------------*/ + +typedef struct { + u_short eseg; + u_short argoff; + u_short argseg; + u_short fcb1_off; + u_short fcb1_seg; + u_short fcb2_off; + u_short fcb2_seg; +} Execp; + +static Execp parm; + +static u_long tbuf; + +static u_long talloc(size_t amt) +{ + u_long rv = tbuf; + tbuf += amt; + return rv; +} + +static int direct_exec_tail(const char *program, const char *args, const char **envp) +{ + _go32_dpmi_registers r; + u_long program_la; + u_long arg_la; + u_long parm_la; + u_long env_la, env_e_la; + char arg_header[3]; + int i; + + program_la = talloc(strlen(program)+1); + arg_la = talloc(strlen(args)+3); + parm_la = talloc(sizeof(Execp)); + + dosmemput(program, strlen(program)+1, program_la); + + arg_header[0] = strlen(args); + arg_header[1] = '\r'; + dosmemput(arg_header, 1, arg_la); + dosmemput(args, strlen(args), arg_la+1); + dosmemput(arg_header+1, 1, arg_la+1+strlen(args)); + + do { + env_la = talloc(1); + } while (env_la & 15); + talloc(-1); + for (i=0; envp[i]; i++) + { + env_e_la = talloc(strlen(envp[i])+1); + dosmemput(envp[i], strlen(envp[i])+1, env_e_la); + } + arg_header[0] = 0; + arg_header[1] = 1; + arg_header[2] = 0; + dosmemput(arg_header, 3, talloc(3)); + env_e_la = talloc(strlen(program)+1); + dosmemput(program, strlen(program)+1, env_e_la); + + parm.eseg = env_la / 16; + parm.argseg = arg_la / 16; + parm.argoff = arg_la & 15; + dosmemput(&parm, sizeof(parm), parm_la); + + memset(&r, 0, sizeof(r)); + r.x.ax = 0x4b00; + r.x.ds = program_la / 16; + r.x.dx = program_la & 15; + r.x.es = parm_la / 16; + r.x.bx = parm_la & 15; + _go32_dpmi_simulate_int(0x21, &r); + if (r.x.flags & 1) + { + errno = r.x.ax; + return -1; + } + + memset(&r, 0, sizeof(r)); + r.h.ah = 0x4d; + _go32_dpmi_simulate_int(0x21, &r); + + if (r.x.flags & 1) + { + errno = r.x.ax; + return -1; + } + return r.x.ax; +} + +static int direct_exec(const char *program, const char **argv, const char **envp) +{ + int i, arglen; + char *args, *argp; + + tbuf = _go32_info_block.linear_address_of_transfer_buffer; + + arglen = 0; + for (i=1; argv[i]; i++) + arglen += strlen(argv[i]) + 1; + args = (char *)malloc(arglen+1); + argp = args; + for (i=1; argv[i]; i++) + { + const char *p = argv[i]; + if (argp - args > 125) + break; + *argp++ = ' '; + while (*p) + { + if (argp - args > 125) + break; + *argp++ = *p++; + } + } + *argp = 0; + + return direct_exec_tail(program, args, envp); +} + +typedef struct { + char magic[16]; + int struct_length; + char go32[16]; +} StubInfo; +#define STUB_INFO_MAGIC "StubInfoMagic!!" + +static int go32_exec(const char *program, const char **argv, const char **envp) +{ + int is_stubbed = 0; + int found_si = 0; + StubInfo si; + unsigned short header[3]; + int pf, has_dot, i; + char *go32, *sip; + const char *pp, *pe; + char rpath[80], *rp; + int stub_offset, argc; + + int si_la, rm_la, rm_seg; + short *rm_argv; + char cmdline[34]; + + pf = open(program, O_RDONLY|O_BINARY); + + read(pf, header, sizeof(header)); + if (header[0] == 0x010b || header[0] == 0x014c) + { + is_stubbed = 1; + } + else if (header[0] == 0x5a4d) + { + int header_offset = (long)header[2]*512L; + if (header[1]) + header_offset += (long)header[1] - 512L; + lseek(pf, header_offset - 4, 0); + read(pf, &stub_offset, 4); + header[0] = 0; + read(pf, header, sizeof(header)); + if (header[0] == 0x010b) + is_stubbed = 1; + if (header[0] == 0x014c) + is_stubbed = 1; + lseek(pf, stub_offset, 0); + read(pf, &si, sizeof(si)); + if (memcmp(STUB_INFO_MAGIC, si.magic, 16) == 0) + found_si = 1; + } + if (!is_stubbed) + { + close(pf); + return direct_exec(program, argv, envp); + } + + if (found_si) + go32 = si.go32; + else + go32 = "go32.exe"; + has_dot = 0; + for (i=0; go32[i]; i++) + if (go32[i] == '.') + has_dot = 1; + if (!has_dot) + strcpy(go32+i, ".exe"); + for (i=0; envp[i]; i++) + if (strncmp(envp[i], "PATH=", 5) == 0) + pp = envp[i]+5; + strcpy(rpath, go32); + while (access(rpath, 0)) + { + char *ptr; + rp = rpath; + for (pe=pp; *pe && *pe != ';'; pe++) + *rp++ = *pe; + pp = pe+1; + if (rp > rpath && rp[-1] != '/' && rp[-1] != '\\' && rp[-1] != ':') + *rp++ = '/'; + for (ptr = go32; *ptr; ptr++) + *rp++ = *ptr; + *rp = 0; + if (access(rpath, 0) == 0) + break; + if (*pe == 0) + return direct_exec(program, argv, envp); /* give up and just run it */ + } + + if (found_si) + { + lseek(pf, stub_offset, 0); + sip = (char *)malloc(si.struct_length); + read(pf, sip, si.struct_length); + } + close(pf); + + argv[0] = program; /* since that's where we really found it */ + + tbuf = _go32_info_block.linear_address_of_transfer_buffer; + + if (found_si) + { + si_la = talloc(si.struct_length); + dosmemput(sip, si.struct_length, si_la); + free(sip); + } + + for (argc=0; argv[argc]; argc++); + rm_la = talloc(2*(argc+1)); + rm_seg = (_go32_info_block.linear_address_of_transfer_buffer >> 4) & 0xffff; + rm_argv = (short *)malloc((argc+1) * sizeof(short)); + for (i=0; i /* For errno */ +#include /* For strlen() */ + +int +_get_default_drive(void) +{ + union REGS regs; + + regs.h.ah = 0x19; /* DOS Get Default Drive call */ + regs.h.al = 0; + (void) intdos(®s, ®s); + return regs.h.al; +} + +static char * +get_current_directory(char *out, int drive_number) +{ + union REGS regs; + + regs.h.ah = 0x47; + regs.h.dl = drive_number + 1; + regs.x.si = (unsigned long) (out + 1); + (void) intdos(®s, ®s); + if (regs.x.cflag != 0) + { + errno = regs.x.ax; + return out; + } + else + { + /* Root path, don't insert "/", it'll be added later */ + if (*(out + 1) != '\0') + *out = '/'; + else + *out = '\0'; + return out + strlen(out); + } +} + +static int +is_slash(int c) +{ + return c == '/' || c == '\\'; +} + +static int +is_term(int c) +{ + return c == '/' || c == '\\' || c == '\0'; +} + +/* Takes as input an arbitrary path. Fixes up the path by: + 1. Removing consecutive slashes + 2. Removing trailing slashes + 3. Making the path absolute if it wasn't already + 4. Removing "." in the path + 5. Removing ".." entries in the path (and the directory above them) + 6. Adding a drive specification if one wasn't there + 7. Converting all slashes to '/' + */ +void +_fixpath(const char *in, char *out) +{ + int drive_number; + const char *ip = in; + char *op = out; + + /* Add drive specification to output string */ + if (*(ip + 1) == ':' && ((*ip >= 'a' && *ip <= 'z') || + (*ip >= 'A' && *ip <= 'Z'))) + { + if (*ip >= 'a' && *ip <= 'z') + drive_number = *ip - 'a'; + else + drive_number = *ip - 'A'; + *op++ = *ip++; + *op++ = *ip++; + } + else + { + drive_number = _get_default_drive(); + *op++ = drive_number + 'a'; + *op++ = ':'; + } + + /* Convert relative path to absolute */ + if (!is_slash(*ip)) + op = get_current_directory(op, drive_number); + + /* Step through the input path */ + while (*ip) + { + /* Skip input slashes */ + if (is_slash(*ip)) + { + ip++; + continue; + } + + /* Skip "." and output nothing */ + if (*ip == '.' && is_term(*(ip + 1))) + { + ip++; + continue; + } + + /* Skip ".." and remove previous output directory */ + if (*ip == '.' && *(ip + 1) == '.' && is_term(*(ip + 2))) + { + ip += 2; + /* Don't back up over drive spec */ + if (op > out + 2) + /* This requires "/" to follow drive spec */ + while (!is_slash(*--op)); + continue; + } + + /* Copy path component from in to out */ + *op++ = '/'; + while (!is_term(*ip)) *op++ = *ip++; + } + + /* If root directory, insert trailing slash */ + if (op == out + 2) *op++ = '/'; + + /* Null terminate the output */ + *op = '\0'; +} + +#ifdef TEST +#include + +int +main(int argc, char **argv) +{ + char path[90]; + int i; + + for (i = 1; i < argc; i++) + { + _fixpath(argv[i], path); + (void) printf("'%s' -> '%s'\n", argv[i], path); + } + + return 0; +} +#endif diff --git a/newlib/libc/sys/go32/fstat.s b/newlib/libc/sys/go32/fstat.s new file mode 100644 index 000000000..5414eaf38 --- /dev/null +++ b/newlib/libc/sys/go32/fstat.s @@ -0,0 +1,19 @@ +# /* This is file FSTAT.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _fstat +_fstat: + movb $3,%al + jmp turbo_assist diff --git a/newlib/libc/sys/go32/fsync.s b/newlib/libc/sys/go32/fsync.s new file mode 100644 index 000000000..5f246f057 --- /dev/null +++ b/newlib/libc/sys/go32/fsync.s @@ -0,0 +1,27 @@ +# /* This is file FSYNC.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _fsync +_fsync: + pushl %ebx + pushl %esi + pushl %edi + movl 16(%esp),%ebx + movb $0x68,%ah + int $0x21 + popl %edi + popl %esi + popl %ebx + ret diff --git a/newlib/libc/sys/go32/ftruncat.c b/newlib/libc/sys/go32/ftruncat.c new file mode 100644 index 000000000..1e2544f25 --- /dev/null +++ b/newlib/libc/sys/go32/ftruncat.c @@ -0,0 +1,25 @@ +/* This is file FTRUNCAT.C */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#include + +/* +** Note: this only works right if you close the file right after truncating! +*/ + +ftruncate(int fd, unsigned long where) +{ + lseek(fd, where, 0); + write(fd, 0, 0); +} diff --git a/newlib/libc/sys/go32/gerrno.s b/newlib/libc/sys/go32/gerrno.s new file mode 100644 index 000000000..ff6b6da93 --- /dev/null +++ b/newlib/libc/sys/go32/gerrno.s @@ -0,0 +1,33 @@ +# /* This is file GERRNO.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + +# Modified to use newlib's reent mechanism, 960414, dje. +# Reentrancy isn't really supported of course, the purpose is to +# record `errno' in the normal place. + + .text + .globl syscall_error +syscall_error: + pushl %eax + call ___errno + popl %edx + mov %edx,(%eax) + mov $-1,%eax + ret + + .globl syscall_check +syscall_check: + jb syscall_error + mov $0,%eax + ret diff --git a/newlib/libc/sys/go32/getcwd.c b/newlib/libc/sys/go32/getcwd.c new file mode 100644 index 000000000..1dd4dcbcd --- /dev/null +++ b/newlib/libc/sys/go32/getcwd.c @@ -0,0 +1,37 @@ +/* This is file GETCWD.C */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#include + +char *getcwd(char *buf, int n) +{ + char tmp[90]; + getwd(tmp); + if (strlen(tmp)+1 > n) + { + errno = ERANGE; + return 0; + } + if (buf == 0) + { + buf = malloc(n); + if (buf == 0) + { + errno = ENOMEM; + return 0; + } + } + strcpy(buf, tmp); + return buf; +} diff --git a/newlib/libc/sys/go32/getdate.c b/newlib/libc/sys/go32/getdate.c new file mode 100644 index 000000000..7593b0af0 --- /dev/null +++ b/newlib/libc/sys/go32/getdate.c @@ -0,0 +1,11 @@ +#include "dos.h" + +void getdate( struct date *dateblk) +{ + union REGS regs; + regs.h.ah = 0x2a; + intdos( ®s, ®s); + dateblk-> da_year = regs.x.cx; + dateblk-> da_mon = regs.h.dh; + dateblk-> da_day = regs.h.dl; +} diff --git a/newlib/libc/sys/go32/getdtabl.c b/newlib/libc/sys/go32/getdtabl.c new file mode 100644 index 000000000..b266c23b9 --- /dev/null +++ b/newlib/libc/sys/go32/getdtabl.c @@ -0,0 +1,18 @@ +/* This is file GETDTABL.C */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +getdtablesize() +{ + return 50; /* really depends on FILES= in config.sys */ +} diff --git a/newlib/libc/sys/go32/getgid.c b/newlib/libc/sys/go32/getgid.c new file mode 100644 index 000000000..a0cd7b988 --- /dev/null +++ b/newlib/libc/sys/go32/getgid.c @@ -0,0 +1,9 @@ + +#include + +getgid() +{ + + return 20; + +} diff --git a/newlib/libc/sys/go32/getkey.s b/newlib/libc/sys/go32/getkey.s new file mode 100644 index 000000000..876483ea9 --- /dev/null +++ b/newlib/libc/sys/go32/getkey.s @@ -0,0 +1,59 @@ +/* This is file GETKEY.S */ +/* +** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +Modified by J. Alan Eldridge, Liberty Brokerage, 77 Water St, NYC 10005 + +Changed handling of characters starting with 0xE0: + Now calls interrupt 16, function 10 + if leading byte was 0x00, ah = 0x01 + if leading byte was 0xE0, ah = 0x02 + + The main function is now called getxkey()... + getkey is provided to maintain compatibility with + already written software +*/ + + .globl _getxkey +_getxkey: + pushl %ebx + pushl %esi + pushl %edi + movb $0x10,%ah + int $0x16 + mov $1,%bl + cmpb $0,%al + je L0 + cmpb $0xE0,%al + jne L1 + inc %bl +L0: + movb %ah,%al + movb %bl,%ah + jmp L2 +L1: + movb $0,%ah +L2: + andl $0xffff,%eax + popl %edi + popl %esi + popl %ebx + ret + + .globl _getkey +_getkey: + call _getxkey + testb $0x02,%ah + jz L3 + movb $0x01,%ah +L3: + ret diff --git a/newlib/libc/sys/go32/getpages.c b/newlib/libc/sys/go32/getpages.c new file mode 100644 index 000000000..8218b154e --- /dev/null +++ b/newlib/libc/sys/go32/getpages.c @@ -0,0 +1,18 @@ +/* This is file GETPAGES.C */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +getpagesize() +{ + return 4096; +} diff --git a/newlib/libc/sys/go32/getpid.c b/newlib/libc/sys/go32/getpid.c new file mode 100644 index 000000000..60f6e6d66 --- /dev/null +++ b/newlib/libc/sys/go32/getpid.c @@ -0,0 +1,18 @@ +/* This is file GETPID.C */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +getpid() +{ + return 42; /* Why not? */ +} diff --git a/newlib/libc/sys/go32/getrusag.c b/newlib/libc/sys/go32/getrusag.c new file mode 100644 index 000000000..15722c5dd --- /dev/null +++ b/newlib/libc/sys/go32/getrusag.c @@ -0,0 +1,35 @@ +/* This is file GETRUSAG.C */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#include +#include + +static struct timeval old_time = {0,0}; + +int getrusage(int who, struct rusage *rusage) +{ + struct timeval now; + bzero(rusage, sizeof(struct rusage)); + if (old_time.tv_sec == 0) + gettimeofday(&old_time, 0); + gettimeofday(&now, 0); + rusage->ru_utime.tv_usec = now.tv_usec - old_time.tv_usec; + rusage->ru_utime.tv_sec = now.tv_sec - old_time.tv_sec; + if (rusage->ru_utime.tv_usec < 0) + { + rusage->ru_utime.tv_usec += 1000000; + rusage->ru_utime.tv_sec -= 1; + } + return 0; +} diff --git a/newlib/libc/sys/go32/gettime.c b/newlib/libc/sys/go32/gettime.c new file mode 100644 index 000000000..ba8116119 --- /dev/null +++ b/newlib/libc/sys/go32/gettime.c @@ -0,0 +1,12 @@ +#include "dos.h" + +void gettime( struct time *tp) +{ + union REGS regs; + regs.h.ah = 0x2c; + intdos( ®s, ®s); + tp->ti_hour = regs.h.ch; + tp->ti_min = regs.h.cl; + tp->ti_sec = regs.h.dh; + tp->ti_hund = regs.h.dl; +} diff --git a/newlib/libc/sys/go32/gettimeo.c b/newlib/libc/sys/go32/gettimeo.c new file mode 100644 index 000000000..7f4f7c874 --- /dev/null +++ b/newlib/libc/sys/go32/gettimeo.c @@ -0,0 +1,61 @@ +/* + (c) Copyright 1992 Eric Backus + + This software may be used freely so long as this copyright notice is + left intact. There is no warrantee on this software. +*/ + +#include +#include +#include "dos.h" + +static int daylight, gmtoffset; + +int +gettimeofday (struct timeval *tp, struct timezone *tzp) +{ + + if (tp) + { + struct time t; + struct date d; + struct tm tmrec; + + gettime (&t); + getdate (&d); + tmrec.tm_year = d.da_year - 1900; + tmrec.tm_mon = d.da_mon - 1; + tmrec.tm_mday = d.da_day; + tmrec.tm_hour = t.ti_hour; + tmrec.tm_min = t.ti_min; + tmrec.tm_sec = t.ti_sec; +/* tmrec.tm_gmtoff = gmtoffset;*/ + tmrec.tm_isdst = daylight; + tp->tv_sec = mktime (&tmrec); + tp->tv_usec = t.ti_hund * (1000000 / 100); + } + if (tzp) + { + tzp->tz_minuteswest = gmtoffset; + tzp->tz_dsttime = daylight; + } + + return 0; +} + +void +__gettimeofday_init () +{ + time_t ltm, gtm; + struct tm *lstm; + + daylight = 0; + gmtoffset = 0; + ltm = gtm = time (NULL); + ltm = mktime (lstm = localtime (<m)); + gtm = mktime (gmtime (>m)); + daylight = lstm->tm_isdst; + gmtoffset = (int)(gtm - ltm) / 60; + +} + diff --git a/newlib/libc/sys/go32/gettimeo.s b/newlib/libc/sys/go32/gettimeo.s new file mode 100644 index 000000000..7e85adf1f --- /dev/null +++ b/newlib/libc/sys/go32/gettimeo.s @@ -0,0 +1,19 @@ +# /* This is file GETTIMEO.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _gettimeofday +_gettimeofday: + movb $4,%al + jmp turbo_assist diff --git a/newlib/libc/sys/go32/getuid.c b/newlib/libc/sys/go32/getuid.c new file mode 100644 index 000000000..4ce9a46c1 --- /dev/null +++ b/newlib/libc/sys/go32/getuid.c @@ -0,0 +1,9 @@ + +#include + +getuid() +{ + + return 10; + +} diff --git a/newlib/libc/sys/go32/getwd.s b/newlib/libc/sys/go32/getwd.s new file mode 100644 index 000000000..15d856ef8 --- /dev/null +++ b/newlib/libc/sys/go32/getwd.s @@ -0,0 +1,31 @@ +# /* This is file GETWD.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _getwd +_getwd: + pushl %ebx + pushl %esi + pushl %edi + movl 16(%esp),%esi + movb $47,(%esi) + incl %esi + movb $0,%dl + movb $0x47,%ah + int $0x21 + movl 16(%esp),%eax + popl %edi + popl %esi + popl %ebx + ret diff --git a/newlib/libc/sys/go32/go32.h b/newlib/libc/sys/go32/go32.h new file mode 100644 index 000000000..32afc0ebe --- /dev/null +++ b/newlib/libc/sys/go32/go32.h @@ -0,0 +1,70 @@ +/* This is file go32.h */ +/* +** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#ifndef _GO32_H_ +#define _GO32_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* This must match go32/proginfo.h */ + +typedef struct { + u_long size_of_this_structure_in_bytes; + u_long linear_address_of_primary_screen; + u_long linear_address_of_secondary_screen; + u_long linear_address_of_transfer_buffer; + u_long size_of_transfer_buffer; /* >= 4k */ + u_long pid; + u_char master_interrupt_controller_base; + u_char slave_interrupt_controller_base; + u_short selector_for_linear_memory; + u_long linear_address_of_stub_info_structure; + u_long linear_address_of_original_psp; + u_short run_mode; + u_short run_mode_info; +} Go32_Info_Block; + +extern Go32_Info_Block _go32_info_block; + +#define _GO32_RUN_MODE_UNDEF 0 +#define _GO32_RUN_MODE_RAW 1 +#define _GO32_RUN_MODE_XMS 2 +#define _GO32_RUN_MODE_VCPI 3 +#define _GO32_RUN_MODE_DPMI 4 + +void dosmemget(int offset, int length, void *buffer); +void dosmemput(const void *buffer, int length, int offset); +void movedata(unsigned source_selector, unsigned source_offset, + unsigned dest_selector, unsigned dest_offset, + size_t length); + +/* returns number of times hit since last call. (zero first time) */ +u_long _go32_was_ctrl_break_hit(); +void _go32_want_ctrl_break(int yes); /* auto-yes if call above function */ + +u_short _go32_my_cs(); +u_short _go32_my_ds(); +u_short _go32_my_ss(); +u_short _go32_conventional_mem_selector(); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/newlib/libc/sys/go32/go32func.c b/newlib/libc/sys/go32/go32func.c new file mode 100644 index 000000000..ec3853ba1 --- /dev/null +++ b/newlib/libc/sys/go32/go32func.c @@ -0,0 +1,69 @@ +#include +#include "go32.h" +#include "dpmi.h" +#include "dos.h" + +u_short _go32_my_cs() +{ + asm("movw %cs,%ax"); +} + +u_short _go32_my_ds() +{ + asm("movw %ds,%ax"); +} + +u_short _go32_my_ss() +{ + asm("movw %ss,%ax"); +} + +u_short _go32_conventional_mem_selector() +{ + return _go32_info_block.selector_for_linear_memory; +} + +static _go32_dpmi_registers regs; +static volatile u_long ctrl_break_count = 0; +static int ctrl_break_hooked = 0; +static _go32_dpmi_seginfo old_vector; +static _go32_dpmi_seginfo new_vector; + +static ctrl_break_isr(_go32_dpmi_registers *regs) +{ + ctrl_break_count ++; +} + +u_long _go32_was_ctrl_break_hit() +{ + u_long cnt; + _go32_want_ctrl_break(1); + cnt = ctrl_break_count; + ctrl_break_count = 0; + return cnt; +} + +void _go32_want_ctrl_break(int yes) +{ + if (yes) + { + if (ctrl_break_hooked) + return; + _go32_dpmi_get_real_mode_interrupt_vector(0x1b, &old_vector); + + new_vector.pm_offset = (int)ctrl_break_isr; + _go32_dpmi_allocate_real_mode_callback_iret(&new_vector, ®s); + _go32_dpmi_set_real_mode_interrupt_vector(0x1b, &new_vector); + ctrl_break_count = 0; + ctrl_break_hooked = 1; + } + else + { + if (!ctrl_break_hooked) + return; + _go32_dpmi_set_real_mode_interrupt_vector(0x1b, &old_vector); + _go32_dpmi_free_real_mode_callback(&new_vector); + ctrl_break_count = 0; + ctrl_break_hooked = 0; + } +} diff --git a/newlib/libc/sys/go32/infoblk.c b/newlib/libc/sys/go32/infoblk.c new file mode 100644 index 000000000..0a54b6b18 --- /dev/null +++ b/newlib/libc/sys/go32/infoblk.c @@ -0,0 +1,4 @@ +#include "go32.h" + +Go32_Info_Block _go32_info_block = { sizeof(Go32_Info_Block) }; + diff --git a/newlib/libc/sys/go32/inportb.s b/newlib/libc/sys/go32/inportb.s new file mode 100644 index 000000000..d2425fc55 --- /dev/null +++ b/newlib/libc/sys/go32/inportb.s @@ -0,0 +1,21 @@ +#/* This is file INPORTB.S */ +#/* +#** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +#** +#** This file is distributed under the terms listed in the document +#** "copying.dj", available from DJ Delorie at the address above. +#** A copy of "copying.dj" should accompany this file; if not, a copy +#** should be available from where this file was obtained. This file +#** may not be distributed without a verbatim copy of "copying.dj". +#** +#** This file is distributed WITHOUT ANY WARRANTY; without even the implied +#** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#*/ + + .globl _inportb +_inportb: + movl 4(%esp),%edx +# inb %dx,%al + .byte 0xec + movzb %al,%eax + ret diff --git a/newlib/libc/sys/go32/inportl.s b/newlib/libc/sys/go32/inportl.s new file mode 100644 index 000000000..477dec19d --- /dev/null +++ b/newlib/libc/sys/go32/inportl.s @@ -0,0 +1,19 @@ +#/* This is file INPORTL.S */ +#/* +#** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +#** +#** This file is distributed under the terms listed in the document +#** "copying.dj", available from DJ Delorie at the address above. +#** A copy of "copying.dj" should accompany this file; if not, a copy +#** should be available from where this file was obtained. This file +#** may not be distributed without a verbatim copy of "copying.dj". +#** +#** This file is distributed WITHOUT ANY WARRANTY; without even the implied +#** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#*/ + + .globl _inportl +_inportl: + movl 4(%esp),%edx + inl %dx,%eax + ret diff --git a/newlib/libc/sys/go32/inportsb.s b/newlib/libc/sys/go32/inportsb.s new file mode 100644 index 000000000..db7dc37f8 --- /dev/null +++ b/newlib/libc/sys/go32/inportsb.s @@ -0,0 +1,25 @@ +#/* This is file INPORTSB.S */ +#/* +#** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +#** +#** This file is distributed under the terms listed in the document +#** "copying.dj", available from DJ Delorie at the address above. +#** A copy of "copying.dj" should accompany this file; if not, a copy +#** should be available from where this file was obtained. This file +#** may not be distributed without a verbatim copy of "copying.dj". +#** +#** This file is distributed WITHOUT ANY WARRANTY; without even the implied +#** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#*/ + + .globl _inportsb +_inportsb: + pushl %edi + movl 8(%esp),%edx + movl 12(%esp),%edi + movl 16(%esp),%ecx + rep + insb + popl %edi + ret + diff --git a/newlib/libc/sys/go32/inportsl.s b/newlib/libc/sys/go32/inportsl.s new file mode 100644 index 000000000..d4a8d5507 --- /dev/null +++ b/newlib/libc/sys/go32/inportsl.s @@ -0,0 +1,24 @@ +#/* This is file INPORTSL.S */ +#/* +#** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +#** +#** This file is distributed under the terms listed in the document +#** "copying.dj", available from DJ Delorie at the address above. +#** A copy of "copying.dj" should accompany this file; if not, a copy +#** should be available from where this file was obtained. This file +#** may not be distributed without a verbatim copy of "copying.dj". +#** +#** This file is distributed WITHOUT ANY WARRANTY; without even the implied +#** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#*/ + + .globl _inportsl +_inportsl: + pushl %edi + movl 8(%esp),%edx + movl 12(%esp),%edi + movl 16(%esp),%ecx + rep + insl + popl %edi + ret diff --git a/newlib/libc/sys/go32/inportsw.s b/newlib/libc/sys/go32/inportsw.s new file mode 100644 index 000000000..31880d717 --- /dev/null +++ b/newlib/libc/sys/go32/inportsw.s @@ -0,0 +1,24 @@ +#/* This is file INPORTSW.S */ +#/* +#** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +#** +#** This file is distributed under the terms listed in the document +#** "copying.dj", available from DJ Delorie at the address above. +#** A copy of "copying.dj" should accompany this file; if not, a copy +#** should be available from where this file was obtained. This file +#** may not be distributed without a verbatim copy of "copying.dj". +#** +#** This file is distributed WITHOUT ANY WARRANTY; without even the implied +#** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#*/ + + .globl _inportsw +_inportsw: + pushl %edi + movl 8(%esp),%edx + movl 12(%esp),%edi + movl 16(%esp),%ecx + rep + insw + popl %edi + ret diff --git a/newlib/libc/sys/go32/inportw.s b/newlib/libc/sys/go32/inportw.s new file mode 100644 index 000000000..fdb58aa26 --- /dev/null +++ b/newlib/libc/sys/go32/inportw.s @@ -0,0 +1,21 @@ +#/* This is file INPORTW.S */ +#/* +#** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +#** +#** This file is distributed under the terms listed in the document +#** "copying.dj", available from DJ Delorie at the address above. +#** A copy of "copying.dj" should accompany this file; if not, a copy +#** should be available from where this file was obtained. This file +#** may not be distributed without a verbatim copy of "copying.dj". +#** +#** This file is distributed WITHOUT ANY WARRANTY; without even the implied +#** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#*/ + + .globl _inportw +_inportw: + movl 4(%esp),%edx +# inw (%dx),%ax + .byte 0x66, 0xed + movzwl %ax,%eax + ret diff --git a/newlib/libc/sys/go32/int86x.s b/newlib/libc/sys/go32/int86x.s new file mode 100644 index 000000000..7b49bcd12 --- /dev/null +++ b/newlib/libc/sys/go32/int86x.s @@ -0,0 +1,103 @@ + .data +ds: + .word 0 +es: + .word 0 +fs: + .word 0 +gs: + .word 0 + + .globl int86 +int86: + .byte 0x2e + push ds + pop %ds + .byte 0x2e + push es + pop %es + .byte 0x2e + push fs + pop %fs + .byte 0x2e + push gs + pop %gs + + .byte 0xcd +int86_vec: + .byte 0x03 + ret + + .text + .globl _int86x +_int86x: + movl 16(%esp), %eax + + movw 2(%eax), %cx + movw %cx, ds + movw 4(%eax), %cx + movw %cx, es + movw 6(%eax), %cx + movw %cx, fs + movw 8(%eax), %cx + movw %cx, gs + + jmp int86_common + + .globl _int86 +_int86: + movw %ds, %ax + movw %ax, ds + movw %ax, es + movw %ax, fs + movw %ax, gs + jmp int86_common + +int86_common: + pushl %ebp + movl %esp,%ebp + pushl %ebx + pushl %esi + pushl %edi + pushf + + movl 8(%ebp),%eax + movb %al,int86_vec + + movl 12(%ebp),%eax + movl 4(%eax),%ebx + movl 8(%eax),%ecx + movl 12(%eax),%edx + movl 16(%eax),%esi + movl 20(%eax),%edi + movl (%eax),%eax + + push %ds + push %es + call int86 + pop %es + pop %ds + + pushf + pushl %eax + movl %esp,%ebp + addl $24,%ebp + movl 16(%ebp),%eax + popl (%eax) + movl %ebx,4(%eax) + movl %ecx,8(%eax) + movl %edx,12(%eax) + movl %esi,16(%eax) + movl %edi,20(%eax) + popl %ebx /* flags */ + movl %ebx,28(%eax) + andl $1,%ebx + movl %ebx,24(%eax) + movl (%eax),%eax + + popf + popl %edi + popl %esi + popl %ebx + popl %ebp + ret diff --git a/newlib/libc/sys/go32/intdos.c b/newlib/libc/sys/go32/intdos.c new file mode 100644 index 000000000..a13f38ec8 --- /dev/null +++ b/newlib/libc/sys/go32/intdos.c @@ -0,0 +1,7 @@ +#include + +int +intdos(union REGS *in, union REGS *out) +{ + return int86(0x21, in, out); +} diff --git a/newlib/libc/sys/go32/intdosx.c b/newlib/libc/sys/go32/intdosx.c new file mode 100644 index 000000000..ec3e9fbc2 --- /dev/null +++ b/newlib/libc/sys/go32/intdosx.c @@ -0,0 +1,6 @@ +#include + +intdosx(union REGS *in, union REGS *out, struct SREGS *seg) +{ + return int86x(0x21, in, out, seg); +} diff --git a/newlib/libc/sys/go32/isatty.s b/newlib/libc/sys/go32/isatty.s new file mode 100644 index 000000000..9086b073c --- /dev/null +++ b/newlib/libc/sys/go32/isatty.s @@ -0,0 +1,33 @@ +# /* This is file ISATTY.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _isatty +_isatty: + pushl %ebx + pushl %esi + pushl %edi + movl 16(%esp),%ebx + movw $0x4400,%ax + int $0x21 + popl %edi + popl %esi + popl %ebx + movl $0,%eax + jb tf + testl $0x80,%edx + jz tf + movl $1,%eax +tf: + ret diff --git a/newlib/libc/sys/go32/kbhit.s b/newlib/libc/sys/go32/kbhit.s new file mode 100644 index 000000000..0f34e1b76 --- /dev/null +++ b/newlib/libc/sys/go32/kbhit.s @@ -0,0 +1,51 @@ +/* This is file KBHIT.S */ +/* +** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + + .globl _kbhit +_kbhit: + pushl %ebp + movl %esp,%ebp + pushl %ebx + pushl %esi + pushl %edi + +try_again: + movl $0x41a,%eax + call dosmemsetup + movzwl %gs:(%eax),%ebx + movzwl %gs:2(%eax),%ecx + cmp %ebx,%ecx + je key_not_hit + + movb $0x11,%ah + int $0x16 + jz key_not_hit + cmp $0,%eax + jne key_hit + movb $0x10,%ah + int $0x16 + jmp try_again + +key_not_hit: + movl $0,%eax + jmp L1 + +key_hit: + movl $1,%eax +L1: + popl %edi + popl %esi + popl %ebx + leave + ret diff --git a/newlib/libc/sys/go32/kill.c b/newlib/libc/sys/go32/kill.c new file mode 100644 index 000000000..3335f1a56 --- /dev/null +++ b/newlib/libc/sys/go32/kill.c @@ -0,0 +1,6 @@ +kill() +{ + + +} + diff --git a/newlib/libc/sys/go32/link.s b/newlib/libc/sys/go32/link.s new file mode 100644 index 000000000..f1cc133a0 --- /dev/null +++ b/newlib/libc/sys/go32/link.s @@ -0,0 +1,28 @@ +# /* This is file LINK.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _link +_link: + pushl %ebx + pushl %esi + pushl %edi + movl 16(%esp),%edx + movl 20(%esp),%edi + movb $0x56,%ah + int $0x21 + pop %edi + pop %esi + pop %ebx + jmp syscall_check diff --git a/newlib/libc/sys/go32/longjmp.S b/newlib/libc/sys/go32/longjmp.S new file mode 100644 index 000000000..d29eebbee --- /dev/null +++ b/newlib/libc/sys/go32/longjmp.S @@ -0,0 +1,65 @@ +/* This is file LONGJMP.S */ +/* +** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/* +** jmp_buf: +** eax ebx ecx edx esi edi ebp esp eip es fs gs ss +** 0 4 8 12 16 20 24 28 32 36 38 40 42 +*/ + + .globl _longjmp /* jmp_buf, int */ +_longjmp: + pushl %ebp + movl %esp,%ebp + + movl 8(%ebp),%edi /* get jmp_buf */ + movl 12(%ebp),%eax /* store retval in j->eax */ + testl %eax,%eax + jne 0f + incl %eax +0: + movl %eax,0(%edi) + + movl 24(%edi),%ebp + + pushfl /* get flags so will only re-enable */ + popl %ebx /* interrupts if they were previously */ + /* enabled */ + + cli + movw 42(%edi),%ax + movw %ax,%ss + movl 28(%edi),%esp + + pushl 32(%edi) /* for a ret! */ + + pushl %ebx /* save flags that contain previous */ + /* interrupt state */ + + movw 36(%edi),%ax + movw %ax,%es + movw 38(%edi),%ax + movw %ax,%fs + movw 40(%edi),%ax + movw %ax,%gs + movl 0(%edi),%eax + movl 4(%edi),%ebx + movl 8(%edi),%ecx + movl 12(%edi),%edx + movl 16(%edi),%esi + movl 20(%edi),%edi + + popfl /* restore previous interrupt state */ + + ret /* actually jump to new eip */ diff --git a/newlib/libc/sys/go32/lseek.s b/newlib/libc/sys/go32/lseek.s new file mode 100644 index 000000000..34609d088 --- /dev/null +++ b/newlib/libc/sys/go32/lseek.s @@ -0,0 +1,36 @@ +# /* This is file LSEEK.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _lseek +_lseek: + pushl %ebx + pushl %esi + pushl %edi + movl 16(%esp),%ebx + movl 20(%esp),%ecx + shrl $16,%ecx + movl 20(%esp),%edx + andl $0xffff,%edx + movb 24(%esp),%al + movb $0x42,%ah + int $0x21 + popl %edi + popl %esi + popl %ebx + jb syscall_error + shll $16,%edx + andl $0xffff,%eax + orl %edx,%eax + ret diff --git a/newlib/libc/sys/go32/lstat.s b/newlib/libc/sys/go32/lstat.s new file mode 100644 index 000000000..2585b354f --- /dev/null +++ b/newlib/libc/sys/go32/lstat.s @@ -0,0 +1,19 @@ +# /* This is file LSTAT.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _lstat +_lstat: + movb $6,%al + jmp turbo_assist diff --git a/newlib/libc/sys/go32/mkdir.s b/newlib/libc/sys/go32/mkdir.s new file mode 100644 index 000000000..e8fe19447 --- /dev/null +++ b/newlib/libc/sys/go32/mkdir.s @@ -0,0 +1,27 @@ +# /* This is file MKDIR.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _mkdir +_mkdir: + pushl %ebx + pushl %esi + pushl %edi + movl 16(%esp),%edx + movb $0x39,%ah + int $0x21 + popl %edi + popl %esi + popl %ebx + jmp syscall_check diff --git a/newlib/libc/sys/go32/open.s b/newlib/libc/sys/go32/open.s new file mode 100644 index 000000000..5fd8a04b0 --- /dev/null +++ b/newlib/libc/sys/go32/open.s @@ -0,0 +1,31 @@ +# /* This is file OPEN.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .data + .globl __fmode +__fmode: + .long 0x4000 + + .text + .globl _open +_open: + testl $0xc000,8(%esp) + jnz L0 + andl $0xc000,__fmode + movl __fmode,%eax + orl %eax,8(%esp) +L0: + movb $2,%al + jmp turbo_assist + diff --git a/newlib/libc/sys/go32/outportb.s b/newlib/libc/sys/go32/outportb.s new file mode 100644 index 000000000..10c4342f8 --- /dev/null +++ b/newlib/libc/sys/go32/outportb.s @@ -0,0 +1,21 @@ +#/* This is file OUTPORTB.S */ +#/* +#** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +#** +#** This file is distributed under the terms listed in the document +#** "copying.dj", available from DJ Delorie at the address above. +#** A copy of "copying.dj" should accompany this file; if not, a copy +#** should be available from where this file was obtained. This file +#** may not be distributed without a verbatim copy of "copying.dj". +#** +#** This file is distributed WITHOUT ANY WARRANTY; without even the implied +#** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#*/ + + .globl _outportb +_outportb: + movl 4(%esp),%edx + movl 8(%esp),%eax +# outb %al,%dx + .byte 0xee + ret diff --git a/newlib/libc/sys/go32/outportl.s b/newlib/libc/sys/go32/outportl.s new file mode 100644 index 000000000..61204b4bc --- /dev/null +++ b/newlib/libc/sys/go32/outportl.s @@ -0,0 +1,20 @@ +#/* This is file OUTPORTL.S */ +#/* +#** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +#** +#** This file is distributed under the terms listed in the document +#** "copying.dj", available from DJ Delorie at the address above. +#** A copy of "copying.dj" should accompany this file; if not, a copy +#** should be available from where this file was obtained. This file +#** may not be distributed without a verbatim copy of "copying.dj". +#** +#** This file is distributed WITHOUT ANY WARRANTY; without even the implied +#** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#*/ + + .globl _outportl +_outportl: + movl 4(%esp),%edx + movl 8(%esp),%eax + outl %eax,%dx + ret diff --git a/newlib/libc/sys/go32/outportw.s b/newlib/libc/sys/go32/outportw.s new file mode 100644 index 000000000..cde464843 --- /dev/null +++ b/newlib/libc/sys/go32/outportw.s @@ -0,0 +1,22 @@ +#/* This is file OUTPORTW.S */ +#/* +#** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +#** +#** This file is distributed under the terms listed in the document +#** "copying.dj", available from DJ Delorie at the address above. +#** A copy of "copying.dj" should accompany this file; if not, a copy +#** should be available from where this file was obtained. This file +#** may not be distributed without a verbatim copy of "copying.dj". +#** +#** This file is distributed WITHOUT ANY WARRANTY; without even the implied +#** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#*/ + + .globl _outportw +_outportw: + movl 4(%esp),%edx + movl 8(%esp),%eax +# outw %ax,%dx + .byte 0x66, 0xef + ret + diff --git a/newlib/libc/sys/go32/outprtsb.s b/newlib/libc/sys/go32/outprtsb.s new file mode 100644 index 000000000..f9ed4a1d5 --- /dev/null +++ b/newlib/libc/sys/go32/outprtsb.s @@ -0,0 +1,25 @@ + +#/* This is file OUTPRTSB.S */ +#/* +#** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +#** +#** This file is distributed under the terms listed in the document +#** "copying.dj", available from DJ Delorie at the address above. +#** A copy of "copying.dj" should accompany this file; if not, a copy +#** should be available from where this file was obtained. This file +#** may not be distributed without a verbatim copy of "copying.dj". +#** +#** This file is distributed WITHOUT ANY WARRANTY; without even the implied +#** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#*/ + + .globl _outportsb +_outportsb: + pushl %esi + movl 8(%esp),%edx + movl 12(%esp),%esi + movl 16(%esp),%ecx + rep + outsb + popl %esi + ret diff --git a/newlib/libc/sys/go32/outprtsl.s b/newlib/libc/sys/go32/outprtsl.s new file mode 100644 index 000000000..2f3e1c7cc --- /dev/null +++ b/newlib/libc/sys/go32/outprtsl.s @@ -0,0 +1,25 @@ +#/* This is file OUTPRTSL.S */ +#/* +#** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +#** +#** This file is distributed under the terms listed in the document +#** "copying.dj", available from DJ Delorie at the address above. +#** A copy of "copying.dj" should accompany this file; if not, a copy +#** should be available from where this file was obtained. This file +#** may not be distributed without a verbatim copy of "copying.dj". +#** +#** This file is distributed WITHOUT ANY WARRANTY; without even the implied +#** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#*/ + + .globl _outportsl +_outportsl: + pushl %esi + movl 8(%esp),%edx + movl 12(%esp),%esi + movl 16(%esp),%ecx + rep + outsl + popl %esi + ret + diff --git a/newlib/libc/sys/go32/outprtsw.s b/newlib/libc/sys/go32/outprtsw.s new file mode 100644 index 000000000..6045f196f --- /dev/null +++ b/newlib/libc/sys/go32/outprtsw.s @@ -0,0 +1,25 @@ +#/* This is file OUTPRTSW.S */ +#/* +#** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +#** +#** This file is distributed under the terms listed in the document +#** "copying.dj", available from DJ Delorie at the address above. +#** A copy of "copying.dj" should accompany this file; if not, a copy +#** should be available from where this file was obtained. This file +#** may not be distributed without a verbatim copy of "copying.dj". +#** +#** This file is distributed WITHOUT ANY WARRANTY; without even the implied +#** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#*/ +# + .globl _outportsw +_outportsw: + pushl %esi + movl 8(%esp),%edx + movl 12(%esp),%esi + movl 16(%esp),%ecx + rep + outsw + popl %esi + ret + diff --git a/newlib/libc/sys/go32/pc.h b/newlib/libc/sys/go32/pc.h new file mode 100644 index 000000000..8851d749e --- /dev/null +++ b/newlib/libc/sys/go32/pc.h @@ -0,0 +1,71 @@ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +** +** Modified by J. Alan Eldridge, Liberty Brokerage, 77 Water St, NYC 10005 +** +** added getxkey(), which can read extended keystrokes that start with +** 0xE0, as well as those which start with 0x00 +** +** added global char ScreenAttrib, the attribute used by ScreenClear(): +** it defaults to 0x07 so as not to break existing code. +** +** added ScreenMode(), to return the current video mode +*/ + +#ifndef _PC_H_ +#define _PC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +unsigned char inportb(unsigned short port); +unsigned short inportw(unsigned short port); +unsigned long inportl(unsigned short port); +unsigned char inportsb(unsigned short port, unsigned char *buf, unsigned len); +unsigned short inportsw(unsigned short port, unsigned short *buf, unsigned len); +unsigned long inportsl(unsigned short port, unsigned long *buf, unsigned len); +void outportb(unsigned short port, unsigned char data); +void outportw(unsigned short port, unsigned short data); +void outportl(unsigned short port, unsigned long data); +void outportsb(unsigned short port, unsigned char *buf, unsigned len); +void outportsw(unsigned short port, unsigned short *buf, unsigned len); +void outportsl(unsigned short port, unsigned long *buf, unsigned len); + +int kbhit(void); +int getkey(void); /* ALT's have 0x100 set */ +int getxkey(void); /* ALT's have 0x100 set, 0xe0 sets 0x200 */ + +void sound(int frequency); +#define nosound() sound(0) + +extern unsigned char ScreenAttrib; +extern short *ScreenPrimary; +extern short *ScreenSecondary; + +/* For the primary screen: */ +int ScreenMode(void); +int ScreenRows(void); +int ScreenCols(void); +void ScreenPutChar(int ch, int attr, int x, int y); +void ScreenSetCursor(int row, int col); +void ScreenGetCursor(int *row, int *col); +void ScreenClear(void); +void ScreenUpdate(void *virtual_screen); +void ScreenUpdateLine(void *virtual_screen_line, int row); +void ScreenRetrieve(void *virtual_screen); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/newlib/libc/sys/go32/read.s b/newlib/libc/sys/go32/read.s new file mode 100644 index 000000000..c989241ee --- /dev/null +++ b/newlib/libc/sys/go32/read.s @@ -0,0 +1,30 @@ +# /* This is file READ.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _read +_read: + pushl %ebx + pushl %esi + pushl %edi + movl 16(%esp),%ebx + movl 20(%esp),%edx + movl 24(%esp),%ecx + movb $0x3f,%ah + int $0x21 + popl %edi + popl %esi + popl %ebx + jb syscall_error + ret diff --git a/newlib/libc/sys/go32/readv.c b/newlib/libc/sys/go32/readv.c new file mode 100644 index 000000000..c50ef32fc --- /dev/null +++ b/newlib/libc/sys/go32/readv.c @@ -0,0 +1,31 @@ +/* This is file READV.C */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#include +#include + +readv(int handle, struct iovec *iov, int count) +{ + unsigned long r, t=0; + while (count) + { + r = read(handle, iov->iov_base, iov->iov_len); + if (r < 0) + return r; + t += r; + iov++; + count--; + } + return t; +} diff --git a/newlib/libc/sys/go32/rename.s b/newlib/libc/sys/go32/rename.s new file mode 100644 index 000000000..549dcb82d --- /dev/null +++ b/newlib/libc/sys/go32/rename.s @@ -0,0 +1,31 @@ +# /* This is file RENAME.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _rename +_rename: + pushl %ebx + pushl %esi + pushl %edi + movl 20(%esp),%edx + movb $0x41,%ah + int $0x21 # remove "to" + movl 16(%esp),%edx + movl 20(%esp),%edi + movb $0x56,%ah + int $0x21 # move "from" to "to" + popl %edi + popl %esi + popl %ebx + jmp syscall_check diff --git a/newlib/libc/sys/go32/rmdir.s b/newlib/libc/sys/go32/rmdir.s new file mode 100644 index 000000000..b4668797f --- /dev/null +++ b/newlib/libc/sys/go32/rmdir.s @@ -0,0 +1,27 @@ +# /* This is file RMDIR.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _rmdir +_rmdir: + pushl %ebx + pushl %esi + pushl %edi + movl 16(%esp),%edx + movb $0x3a,%ah + int $0x21 + popl %edi + popl %esi + popl %ebx + jmp syscall_check diff --git a/newlib/libc/sys/go32/sbrk.s b/newlib/libc/sys/go32/sbrk.s new file mode 100644 index 000000000..190396c8c --- /dev/null +++ b/newlib/libc/sys/go32/sbrk.s @@ -0,0 +1,27 @@ +# /* This is file SBRK.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _sbrk +_sbrk: + pushl %ebx + pushl %esi + pushl %edi + movl 16(%esp),%ebx + movw $0x4a01,%ax + int $0x21 + popl %edi + popl %esi + popl %ebx + ret diff --git a/newlib/libc/sys/go32/screen.S b/newlib/libc/sys/go32/screen.S new file mode 100644 index 000000000..4786f7ffe --- /dev/null +++ b/newlib/libc/sys/go32/screen.S @@ -0,0 +1,256 @@ +/* This is file SCREEN.S */ +/* +** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +** +** Modified by J. Alan Eldridge, Liberty Brokerage, 77 Water St, NYC 10005 +** +** added global char ScreenAttrib -- this is the attribute +** used by ScreenClear(): it defaults to 0x07 so as not to +** break existing code. +** +** Modified by C. Sandmann (sandmann@clio.rice.edu) for DPMI support +** Combined SCREEN2.S and SCREEN.C into SCREEN.S +*/ + + .data + + .globl _ScreenAttrib +_ScreenAttrib: + .byte 0x07 + + .text + + .align 2 + .globl _ScreenSetCursor + /* row, col */ +_ScreenSetCursor: + pushl %ebp + movl %esp,%ebp + pushl %ebx + pushl %esi + pushl %edi + movb $0x02,%ah + movb $0,%bh + movb 8(%ebp),%dh + movb 12(%ebp),%dl + int $0x10 + popl %edi + popl %esi + popl %ebx + popl %ebp + ret + + .align 2 + .globl _ScreenGetCursor + /* &row, &col */ +_ScreenGetCursor: + pushl %ebp + movl %esp,%ebp + pushl %ebx + pushl %esi + pushl %edi + movb $0x03,%ah + movb $0,%bh + pushl %ebp + int $0x10 + popl %ebp + movl 8(%ebp),%esi + movzbl %dh,%eax + movl %eax,(%esi) + movl 12(%ebp),%esi + movzbl %dl,%eax + movl %eax,(%esi) + popl %edi + popl %esi + popl %ebx + popl %ebp + ret + + .align 2 + .globl _ScreenClear +_ScreenClear: + pushl %edi + call _ScreenCols + movl %eax,%ecx + call _ScreenRows + /* ECX is total words to store */ + imull %eax,%ecx + movl _ScreenPrimary,%eax + call dosmemsetup + movl %eax,%edi + push %es + push %gs + pop %es + movb $0x20,%al + movb _ScreenAttrib,%ah + rep + stosw + pop %es + popl %edi + ret + + .align 2 + .globl _ScreenRows +_ScreenRows: + movl $0x484,%eax + call dosmemsetup + movzbl %gs:(%eax),%eax + incl %eax + ret + + .align 2 + .globl _ScreenCols +_ScreenCols: + movl $0x44a,%eax + call dosmemsetup + movzwl %gs:(%eax),%eax + ret + + .align 2 + .globl _ScreenMode +_ScreenMode: + movl $0x449,%eax + call dosmemsetup + movzbl %gs:(%eax),%eax + ret + + .align 2 + .globl _ScreenPutChar +_ScreenPutChar: + /* int ch, int attr, unsigned x, unsigned y */ +/* + if ( (x >= ScreenCols()) || (y >= ScreenRows())) return; + ch &= 0xff; + attr = (attr & 0xff) << 8; + *(unsigned short *)(ScreenPrimary+x+y*ScreenCols()) = ch | attr; +*/ + call _ScreenRows + cmpl %eax,16(%esp) + jae L1 + call _ScreenCols + cmpl %eax,12(%esp) + jae L1 + /* Out of range */ + movl %eax,%edx + imull 16(%esp),%edx + addl 12(%esp),%edx + /* EDX = x + y*ScreenCols */ + + movb 4(%esp),%cl + movb 8(%esp),%ch + + movl _ScreenPrimary,%eax + call dosmemsetup + movw %cx,%gs:(%eax,%edx,2) +L1: + ret + +/* A quick way to update the screen from a logical video buffer, used + primarily for DPMI full screen management */ + .align 2 + .globl _ScreenUpdate + /* (void *)screenbuf */ +_ScreenUpdate: + call _ScreenRows + movl %eax,%ecx + call _ScreenCols + imull %eax,%ecx + sarl $1,%ecx + /* Number of long words in screen */ + + movl _ScreenPrimary,%eax + call dosmemsetup + movl 4(%esp),%edx + /* screenbuf */ + + pushl %esi + pushl %edi + movl %eax,%edi + movl %edx,%esi + push %es + push %gs + pop %es + rep + movsl + /* move ECX bytes to Real area */ + pop %es + popl %edi + popl %esi + ret + +/* A quick way to update a screen line from a logical video buffer, used + primarily for DPMI full screen management */ + .align 2 + .globl _ScreenUpdateLine + /* (void *)screenline, int row */ +_ScreenUpdateLine: + call _ScreenCols + movl %eax,%ecx + sarl $1,%ecx + /* Number of long words in screen line */ + shll $1,%eax + imull 8(%esp),%eax + addl _ScreenPrimary,%eax + call dosmemsetup + movl 4(%esp),%edx + /* screenbuf */ + + pushl %esi + pushl %edi + movl %eax,%edi + movl %edx,%esi + push %es + push %gs + pop %es + rep + movsl + /* move ECX bytes to Real area */ + pop %es + popl %edi + popl %esi + ret + + +/* A quick way to update the screen from a logical video buffer, used + primarily for DPMI full screen management */ + .align 2 + .globl _ScreenRetrieve + /* (void *)screenbuf */ +_ScreenRetrieve: + call _ScreenRows + movl %eax,%ecx + call _ScreenCols + imull %eax,%ecx + sarl $1,%ecx + /* Number of long words in screen */ + + movl _ScreenPrimary,%eax + call dosmemsetup + movl 4(%esp),%edx + /* screenbuf */ + + pushl %esi + pushl %edi + movl %eax,%esi + movl %edx,%edi + push %ds + push %gs + pop %ds + rep + movsl + /* move ECX bytes to Real area */ + pop %ds + popl %edi + popl %esi + ret + + diff --git a/newlib/libc/sys/go32/setjmp.S b/newlib/libc/sys/go32/setjmp.S new file mode 100644 index 000000000..ef9a258e1 --- /dev/null +++ b/newlib/libc/sys/go32/setjmp.S @@ -0,0 +1,61 @@ +/* This is file SETJMP.S */ +/* +** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/* +** jmp_buf: +** eax ebx ecx edx esi edi ebp esp eip es fs gs ss +** 0 4 8 12 16 20 24 28 32 36 38 40 42 +*/ + + .globl _setjmp /* jmp_buf */ +_setjmp: + pushl %ebp + movl %esp,%ebp + + pushl %edi + movl 8(%ebp),%edi + + movl %eax,0(%edi) + movl %ebx,4(%edi) + movl %ecx,8(%edi) + movl %edx,12(%edi) + movl %esi,16(%edi) + + movl -4(%ebp),%eax + movl %eax,20(%edi) + + movl 0(%ebp),%eax + movl %eax,24(%edi) + + movl %esp,%eax + addl $12,%eax + movl %eax,28(%edi) + + movl 4(%ebp),%eax + movl %eax,32(%edi) + + movw %es, %ax + movw %ax, 36(%edi) + movw %fs, %ax + movw %ax, 38(%edi) + movw %gs, %ax + movw %ax, 40(%edi) + movw %ss, %ax + movw %ax, 42(%edi) + + popl %edi + movl $0,%eax + leave + ret + diff --git a/newlib/libc/sys/go32/setmode.s b/newlib/libc/sys/go32/setmode.s new file mode 100644 index 000000000..071e31636 --- /dev/null +++ b/newlib/libc/sys/go32/setmode.s @@ -0,0 +1,19 @@ +# /* This is file SETMODE.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _setmode +_setmode: + movb $8,%al + jmp turbo_assist diff --git a/newlib/libc/sys/go32/setstack.S b/newlib/libc/sys/go32/setstack.S new file mode 100644 index 000000000..dcd3ac0b2 --- /dev/null +++ b/newlib/libc/sys/go32/setstack.S @@ -0,0 +1,70 @@ +/* This routine potentially increases the stack size at runtime based on + the _stklen variable. Only used by DPMI code. + Copyright (c) 1993 C. Sandmann + Environment: called by crt0.s (and gcrt0.s) + EAX, EBX, EBP, EDI, ESI disposable (cleared on return) */ + + .text + .globl __setstack +__setstack: + movl %esp,%eax + andl $0xc0000000,%eax /* clear all except upper bits */ + jne ok_stack /* obviously not DPMI! */ + movw %ss,%ax + lsll %eax,%ebx /* stack segment limit */ + movl %esp,%eax /* current location */ + subl %ebx,%eax /* Free stack */ + cmpl %eax,__stklen + jb ok_stack + +/* Not enough stack. Call sbrk() to get a new area. Copy current ESP + 20 + to end of new area (3 args + our stack). Change ESP to new area. Set new + limit to start of new area using DPMI services. */ + + pushl __stklen + call _sbrk /* eax = got memory base */ + popl %ebx /* remove _stklen */ + cmpl $0xffffffff,%eax /* if eax = -1 failure */ + je badstack + addl %eax,%ebx /* ebx now is end of new stack area */ + andl $0xfffffff0,%ebx /* 16 byte alignment */ + addl $0xfff,%eax /* make stack base page aligned */ + andl $0xfffff000,%eax /* 4096 byte alignment */ + +/* Now copy old stack to new stack. We only need our part + 4 words, 3 for + the parameters to pass to main, one for our return EIP (4 extra safety) */ + movl %esp, %esi /* Source is current stack */ + subl $0x20, %ebx /* 8 longwords */ + movl %ebx, %edi /* Destination is new stack */ + movl $8,%ecx + rep + movsl + +/* New stack in place. Change ESP to point to it. Assumes new stack is + higher in memory so we don't get caught by limit. Change limit using + DPMI services. */ + + movl %ebx,%esp /* Switch to new stack */ + subl $1,%eax /* Low 12 bits all 1s */ + pushl %eax /* Easiest way to move long to words */ + popw %dx + popw %cx + movl $8,%eax /* DPMI function Set Segment Limit */ + movw %ss,%bx /* Selector */ + int $0x31 /* Do service */ + + xor %ecx,%ecx /* Clean up */ + xor %edx,%edx /* Clean up */ + +ok_stack: + ret /* What we have is already bigger */ + +badstack: + movl $0x4c01,%eax + int $0x21 + jmp badstack + + .data + .globl __stklen + .comm __stklen,4 + diff --git a/newlib/libc/sys/go32/settimeo.s b/newlib/libc/sys/go32/settimeo.s new file mode 100644 index 000000000..f9325cc9e --- /dev/null +++ b/newlib/libc/sys/go32/settimeo.s @@ -0,0 +1,19 @@ +# /* This is file SETTIMEO.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _settimeofday +_settimeofday: + movb $5,%al + jmp turbo_assist diff --git a/newlib/libc/sys/go32/sleep.c b/newlib/libc/sys/go32/sleep.c new file mode 100644 index 000000000..96e547ddc --- /dev/null +++ b/newlib/libc/sys/go32/sleep.c @@ -0,0 +1,27 @@ +/* This is file sleep.c */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + + +sleep(unsigned int seconds) +{ + long tnow, tthen; + time(&tnow); + tthen = tnow + seconds; + while (1) + { + time(&tnow); + if (tnow >= tthen) + return; + } +} diff --git a/newlib/libc/sys/go32/stat.c b/newlib/libc/sys/go32/stat.c new file mode 100644 index 000000000..e64e5b80c --- /dev/null +++ b/newlib/libc/sys/go32/stat.c @@ -0,0 +1,151 @@ +/* + (c) Copyright 1992 Eric Backus + + This software may be used freely so long as this copyright notice is + left intact. There is no warrantee on this software. +*/ + +#include +#include +#include + +#include "dos.h" +#include +#include + +extern int _stat_assist(const char *, struct stat *); +extern void _fixpath(const char *, char *); + +struct path_list +{ + struct path_list *next; + char *path; + int inode; +}; + +static int +fixinode(const char *path, struct stat *buf) +{ + static struct path_list *path_list[1256]; + /* Start the inode count at three, since root path should be two */ + static int inode_count = 3; + + struct path_list *path_ptr, *prev_ptr; + const char *p; + int hash; + + /* Skip over device and leading '/' */ + if (path[1] == ':' && path[2] == '/') path += 3; + + /* We could probably use a better hash than this */ + p = path; + hash = 0; + while (*p != '\0') hash += *p++; + hash = hash & 0xff; + + /* Have we seen this string? */ + path_ptr = path_list[hash]; + prev_ptr = path_ptr; + while (path_ptr) + { + if (strcmp(path, path_ptr->path) == 0) break; + prev_ptr = path_ptr; + path_ptr = path_ptr->next; + } + + if (path_ptr) + /* Same string, so same inode */ + buf->st_ino = path_ptr->inode; + else + { + /* New string with same hash code */ + path_ptr = malloc(sizeof *path_ptr); + if (path_ptr == NULL) + { + errno = ENOMEM; + return -1; + } + path_ptr->next = NULL; + path_ptr->path = strdup(path); + if (path_ptr->path == NULL) + { + errno = ENOMEM; + return -1; + } + path_ptr->inode = inode_count; + if (prev_ptr) + prev_ptr->next = path_ptr; + else + path_list[hash] = path_ptr; + buf->st_ino = inode_count; + inode_count++; + } + return 0; +} + +int +stat(const char *path, struct stat *buf) +{ + static int stat_called_before = 0; + char p[1090]; /* Should be p[PATH_MAX+1] */ + int status; + + /* Normalize the path */ + _fixpath(path, p); + + /* Work around strange bug with stat and time */ + if (!stat_called_before) + { + stat_called_before = 1; + (void) time((time_t *) 0); + } + + /* Check for root path */ + if (strcmp(p, "/") == 0 || strcmp(p + 1, ":/") == 0) + { + /* Handle root path as special case, stat_assist doesn't like + the root directory. */ + if (p[1] == ':') + { + if (p[0] >= 'a' && p[0] <= 'z') + buf->st_dev = p[0] - 'a'; + else + buf->st_dev = p[0] - 'A'; + } + else + buf->st_dev = -1; /* No device? */ + buf->st_ino = 2; /* Root path always inode 2 */ + buf->st_mode = S_IFDIR | S_IREAD | S_IWRITE | S_IEXEC; + buf->st_nlink = 1; + buf->st_uid = getuid(); + buf->st_gid = getgid(); + buf->st_rdev = buf->st_dev; + buf->st_size = 0; + buf->st_atime = 0; + buf->st_mtime = 0; + buf->st_ctime = 0; + buf->st_blksize = 512; /* Not always correct? */ + status = 0; + } + else + { + status = _stat_assist(p, buf); + + /* Make inode numbers unique */ + if (status == 0) status = fixinode(p, buf); + + /* The stat_assist does something weird with st_dev, but sets + st_rdev to the drive number. Fix st_dev. */ + buf->st_dev = buf->st_rdev; + + /* Make all files owned by ourself. */ + buf->st_uid = getuid(); + buf->st_gid = getgid(); + + /* Make all directories writable. They always are in DOS, but + stat_assist doesn't think so. */ + if (S_ISDIR(buf->st_mode)) buf->st_mode |= S_IWRITE; + } + + return status; +} diff --git a/newlib/libc/sys/go32/stat.s b/newlib/libc/sys/go32/stat.s new file mode 100644 index 000000000..045725f32 --- /dev/null +++ b/newlib/libc/sys/go32/stat.s @@ -0,0 +1,19 @@ +# /* This is file STAT.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _stat +_stat: + movb $6,%al + jmp turbo_assist diff --git a/newlib/libc/sys/go32/stat_ast.s b/newlib/libc/sys/go32/stat_ast.s new file mode 100644 index 000000000..3574f8279 --- /dev/null +++ b/newlib/libc/sys/go32/stat_ast.s @@ -0,0 +1,21 @@ +/* This is file STAT_AST.S */ +/* +** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +** +** Modified very slightly by Eric Backus. +*/ + + .text + .globl __stat_assist +__stat_assist: + movb $6,%al + jmp turbo_assist diff --git a/newlib/libc/sys/go32/sys/dir.h b/newlib/libc/sys/go32/sys/dir.h new file mode 100644 index 000000000..6ac830f27 --- /dev/null +++ b/newlib/libc/sys/go32/sys/dir.h @@ -0,0 +1,33 @@ +#ifndef _DIR_H_ +#define _DIR_H_ + +struct ffblk { + char ff_reserved[21]; + char ff_attrib; + short ff_ftime; + short ff_fdate; + short ff_filler; + long ff_fsize; + char ff_name[16]; +}; + +#define FA_RDONLY 1 +#define FA_HIDDEN 2 +#define FA_SYSTEM 4 +#define FA_LABEL 8 +#define FA_DIREC 16 +#define FA_ARCH 32 + +#ifdef __cplusplus +extern "C" { +#endif + +int findfirst(const char *pathname, struct ffblk *ffblk, int attrib); +int findnext(struct ffblk *ffblk); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/newlib/libc/sys/go32/sys/dirent.h b/newlib/libc/sys/go32/sys/dirent.h new file mode 100644 index 000000000..50ae799d8 --- /dev/null +++ b/newlib/libc/sys/go32/sys/dirent.h @@ -0,0 +1,39 @@ +/* This is file DIRENT.H */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#ifndef _dirent_h_ +#define _dirent_h_ + +#include + +struct dirent { + unsigned short d_namlen; + char d_name[14]; +}; + +typedef struct { + int num_read; + char *name; + struct ffblk ff; + struct dirent de; +} DIR; + +DIR *opendir(char *name); +struct dirent *readdir(DIR *dir); +long telldir(DIR *dir); +void seekdir(DIR *dir, long loc); +void rewinddir(DIR *dir); +int closedir(DIR *dir); + +#endif diff --git a/newlib/libc/sys/go32/sys/dos.h b/newlib/libc/sys/go32/sys/dos.h new file mode 100644 index 000000000..ff3103f93 --- /dev/null +++ b/newlib/libc/sys/go32/sys/dos.h @@ -0,0 +1,57 @@ +#ifndef _DOS_H_ +#define _DOS_H_ + +union REGS { + struct { + unsigned long ax; + unsigned long bx; + unsigned long cx; + unsigned long dx; + unsigned long si; + unsigned long di; + unsigned long cflag; + unsigned long flags; + } x; + struct { + unsigned char al; + unsigned char ah; + unsigned short upper_ax; + unsigned char bl; + unsigned char bh; + unsigned short upper_bx; + unsigned char cl; + unsigned char ch; + unsigned short upper_cx; + unsigned char dl; + unsigned char dh; + unsigned short upper_dx; + } h; +}; + +struct SREGS { + unsigned short cs; + unsigned short ds; + unsigned short es; + unsigned short fs; + unsigned short gs; + unsigned short ss; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +int bdos(int func, unsigned dx, unsigned al); +int bdosptr(int func, void *dx, unsigned al); +int int86(int ivec, union REGS *in, union REGS *out); +int int86x(int ivec, union REGS *in, union REGS *out, struct SREGS *seg); +int intdos(union REGS *in, union REGS *out); +int intdosx(union REGS *in, union REGS *out, struct SREGS *seg); + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/newlib/libc/sys/go32/sys/dpmi.h b/newlib/libc/sys/go32/sys/dpmi.h new file mode 100644 index 000000000..7a2cb13af --- /dev/null +++ b/newlib/libc/sys/go32/sys/dpmi.h @@ -0,0 +1,151 @@ +/* This is file dpmi.h */ +/* +** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#ifndef _DPMI_H_ +#define _DPMI_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef union { + struct { + u_long edi; + u_long esi; + u_long ebp; + u_long res; + u_long ebx; + u_long edx; + u_long ecx; + u_long eax; + } d; + struct { + u_short di, di_hi; + u_short si, si_hi; + u_short bp, bp_hi; + u_short res, res_hi; + u_short bx, bx_hi; + u_short dx, dx_hi; + u_short cx, cx_hi; + u_short ax, ax_hi; + u_short flags; + u_short es; + u_short ds; + u_short fs; + u_short gs; + u_short ip; + u_short cs; + u_short sp; + u_short ss; + } x; + struct { + u_char edi[4]; + u_char esi[4]; + u_char ebp[4]; + u_char res[4]; + u_char bl, bh, ebx_b2, ebx_b3; + u_char dl, dh, edx_b2, edx_b3; + u_char cl, ch, ecx_b2, ecx_b3; + u_char al, ah, eax_b2, eax_b3; + } h; +} _go32_dpmi_registers; + +typedef struct { + u_long size; + u_long pm_offset; + u_short pm_selector; + u_short rm_offset; + u_short rm_segment; +} _go32_dpmi_seginfo; + +typedef struct { + u_long available_memory; + u_long available_pages; + u_long available_lockable_pages; + u_long linear_space; + u_long unlocked_pages; + u_long available_physical_pages; + u_long total_physical_pages; + u_long free_linear_space; + u_long max_pages_in_paging_file; + u_long reserved[3]; +} _go32_dpmi_meminfo; + +/* returns zero if success, else dpmi error and info->size is max size */ +int _go32_dpmi_allocate_dos_memory(_go32_dpmi_seginfo *info); + /* set size to bytes/16, call, use rm_segment. Do not + change anthing but size until the memory is freed. + If error, max size is returned in size as bytes/16. */ +int _go32_dpmi_free_dos_memory(_go32_dpmi_seginfo *info); + /* set new size to bytes/16, call. If error, max size + is returned in size as bytes/16 */ +int _go32_dpmi_resize_dos_memory(_go32_dpmi_seginfo *info); + /* uses pm_selector to free memory */ + +/* These both use the rm_segment:rm_offset fields only */ +int _go32_dpmi_get_real_mode_interrupt_vector(int vector, _go32_dpmi_seginfo *info); +int _go32_dpmi_set_real_mode_interrupt_vector(int vector, _go32_dpmi_seginfo *info); + +/* These do NOT wrap the function in pm_offset in an iret handler. + You must provide an assembler interface yourself, or alloc one below. + You may NOT longjmp out of an interrupt handler. */ +int _go32_dpmi_get_protected_mode_interrupt_vector(int vector, _go32_dpmi_seginfo *info); + /* puts vector in pm_selector:pm_offset. */ +int _go32_dpmi_set_protected_mode_interrupt_vector(int vector, _go32_dpmi_seginfo *info); + /* sets vector from pm_offset and pm_selector */ +int _go32_dpmi_chain_protected_mode_interrupt_vector(int vector, _go32_dpmi_seginfo *info); + /* sets up wrapper that calls function in pm_offset, chaining to old + handler when it returns */ + +/* These can be used to generate assember IRET-style wrappers for functions */ +int _go32_dpmi_allocate_iret_wrapper(_go32_dpmi_seginfo *info); + /* Put function ptr in pm_offset, call, returns wrapper entry in pm_offset. */ +int _go32_dpmi_free_iret_wrapper(_go32_dpmi_seginfo *info); + /* assumes pm_offset points to wrapper, frees it */ + +/* simulate real mode calls. CS:IP from regs for non-interrupt */ +int _go32_dpmi_simulate_int(int vector, _go32_dpmi_registers *regs); +int _go32_dpmi_simulate_fcall(_go32_dpmi_registers *regs); +int _go32_dpmi_simulate_fcall_iret(_go32_dpmi_registers *regs); + +/* These automatically handle the tasks of restructuring the + real-mode stack for the proper return type. The callback + (info->pm_offset) is called as (*pmcb)(_go32_dpmi_registers *regs); */ +int _go32_dpmi_allocate_real_mode_callback_retf(_go32_dpmi_seginfo *info, _go32_dpmi_registers *regs); + /* points callback at pm_offset, returns seg:ofs of callback addr + in rm_segment:rm_offset. Do not change any fields until freed. + Interface is added to simulate far return */ +int _go32_dpmi_allocate_real_mode_callback_iret(_go32_dpmi_seginfo *info, _go32_dpmi_registers *regs); + /* same, but simulates iret */ +int _go32_dpmi_free_real_mode_callback(_go32_dpmi_seginfo *info); + /* frees callback */ + +/* Only available_memory is guaranteed to be valid. Try + available_physical_pages for phys mem left */ +int _go32_dpmi_get_free_memory_information(_go32_dpmi_meminfo *info); + +/* Convenience functions. These use the above memory info call. + The return value is *bytes* */ +u_long _go32_dpmi_remaining_physical_memory(void); +u_long _go32_dpmi_remaining_virtual_memory(void); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/newlib/libc/sys/go32/sys/errno.h b/newlib/libc/sys/go32/sys/errno.h new file mode 100644 index 000000000..44852aee3 --- /dev/null +++ b/newlib/libc/sys/go32/sys/errno.h @@ -0,0 +1,73 @@ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/* ??? This file has been modified to work with newlib's way of storing + `errno'. Arguably there's no need and arguably we shouldn't diverge + from go32 sources. If you feel strongly about it, please change it. + The interface between newlib and system's version of errno is via + __errno, so there's no problem in storing errno in a different place + (any changes can be dealt with inside __errno). */ + +#ifndef _SYS_ERRNO_H_ +#define _SYS_ERRNO_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#ifndef _REENT_ONLY +#define errno (*__errno()) +extern int *__errno _PARAMS ((void)); +#endif + +#define __errno_r(ptr) ((ptr)->_errno) + +#define ENOENT 2 /* No such file or directory */ +#define ENOTDIR 3 /* No path */ +#define EMFILE 4 /* Too many open files */ +#define EACCES 5 /* Permission denied */ +#define EBADF 6 /* Bad file number */ +#define EARENA 7 /* Arena trashed */ +#define ENOMEM 8 /* Not enough core */ +#define ESEGV 9 /* invalid memory address */ +#define EBADENV 10 /* invalid environment */ +#define ENODEV 15 /* No such device */ +#define ENMFILE 18 /* No more files */ +#define EINVAL 19 /* Invalid argument */ +#define E2BIG EBADENV /* Arg list too long */ +#define ENOEXEC 21 /* Exec format error */ +#define EXDEV 17 /* Cross-device link */ +#define EPIPE 32 /* POHC */ +#define EDOM 33 /* Math argument */ +#define ERANGE 34 /* Result too large */ +#if 0 /* readline.c assumes that if this is defined, so is O_NDELAY. + Newlib doesn't use it, so comment it out. */ +#define EWOULDBLOCK 35 /* POHC */ +#endif +#define EEXIST 36 /* File already exists */ +#define EINTR 100 /* Interrupted system call */ +#define EIO 101 /* I/O or bounds error */ +#define ENOSPC 102 /* No space left on drive */ +#define EAGAIN 103 /* No more processes */ +#define ECHILD 200 /* child exited (porting only) */ +#define EFAULT 201 /* bad address */ +#define ENXIO ENODEV +#define EPERM EACCES + +/* New values required by newlib and the Cygnus toolchain. */ +#define ENOSYS 230 /* Function not implemented */ +#define ESPIPE 231 /* Illegal seek */ + +#endif diff --git a/newlib/libc/sys/go32/sys/fcntl.h b/newlib/libc/sys/go32/sys/fcntl.h new file mode 100644 index 000000000..792c0673d --- /dev/null +++ b/newlib/libc/sys/go32/sys/fcntl.h @@ -0,0 +1,12 @@ +#define O_RDONLY 0x0001 +#define O_WRONLY 0x0002 +#define O_RDWR 0x0004 +#define O_CREAT 0x0100 +#define O_TRUNC 0x0200 +#define O_EXCL 0x0400 +#define O_APPEND 0x0800 +#define O_TEXT 0x4000 +#define O_BINARY 0x8000 + + + diff --git a/newlib/libc/sys/go32/sys/file.h b/newlib/libc/sys/go32/sys/file.h new file mode 100644 index 000000000..79f5f65f5 --- /dev/null +++ b/newlib/libc/sys/go32/sys/file.h @@ -0,0 +1,31 @@ +/* This is file FILE.H */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#ifndef _FILE_H_ +#define _FILE_H_ + +#include + +#define L_SET 0 +#define L_CURR 1 +#define L_INCR 1 +#define L_XTND 2 + + +#define F_OK 0 /* does file exist */ +#define X_OK 1 /* is it executable by caller */ +#define W_OK 2 /* is it writable by caller */ +#define R_OK 4 /* is it readable by caller */ + +#endif diff --git a/newlib/libc/sys/go32/sys/go32.h b/newlib/libc/sys/go32/sys/go32.h new file mode 100644 index 000000000..4b6adefe1 --- /dev/null +++ b/newlib/libc/sys/go32/sys/go32.h @@ -0,0 +1,69 @@ +/* This is file go32.h */ +/* +** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#ifndef _GO32_H_ +#define _GO32_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* This must match go32/proginfo.h */ + +typedef struct { + u_long size_of_this_structure_in_bytes; + u_long linear_address_of_primary_screen; + u_long linear_address_of_secondary_screen; + u_long linear_address_of_transfer_buffer; + u_long size_of_transfer_buffer; /* >= 4k */ + u_long pid; + u_char master_interrupt_controller_base; + u_char slave_interrupt_controller_base; + u_short selector_for_linear_memory; + u_long linear_address_of_stub_info_structure; + u_long linear_address_of_original_psp; + u_short run_mode; + u_short run_mode_info; +} Go32_Info_Block; + +extern Go32_Info_Block _go32_info_block; + +#define _GO32_RUN_MODE_UNDEF 0 +#define _GO32_RUN_MODE_RAW 1 +#define _GO32_RUN_MODE_XMS 2 +#define _GO32_RUN_MODE_VCPI 3 +#define _GO32_RUN_MODE_DPMI 4 + +void dosmemget(int offset, int length, void *buffer); +void dosmemput(const void *buffer, int length, int offset); +void movedata(unsigned source_selector, unsigned source_offset, + unsigned dest_selector, unsigned dest_offset, + size_t length); + +/* returns number of times hit since last call. (zero first time) */ +u_long _go32_was_ctrl_break_hit(void); +void _go32_want_ctrl_break(int yes); /* auto-yes if call above function */ + +u_short _go32_my_cs(void); +u_short _go32_my_ds(void); +u_short _go32_my_ss(void); +u_short _go32_conventional_mem_selector(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/newlib/libc/sys/go32/sys/param.h b/newlib/libc/sys/go32/sys/param.h new file mode 100644 index 000000000..c912b4082 --- /dev/null +++ b/newlib/libc/sys/go32/sys/param.h @@ -0,0 +1,22 @@ +/* This is file PARAM.H */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#ifndef _PARAM_H_ +#define _PARAM_H_ + +#define MAXPATHLEN 80 +/* 100, according to the real go32 sys/times.h */ +#define HZ (100) + +#endif diff --git a/newlib/libc/sys/go32/sys/pc.h b/newlib/libc/sys/go32/sys/pc.h new file mode 100644 index 000000000..4bce557d1 --- /dev/null +++ b/newlib/libc/sys/go32/sys/pc.h @@ -0,0 +1,56 @@ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#ifndef _PC_H_ +#define _PC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +unsigned char inportb(unsigned short port); +unsigned short inportw(unsigned short port); +unsigned long inportl(unsigned short port); +unsigned char inportsb(unsigned short port, unsigned char *buf, unsigned len); +unsigned short inportsw(unsigned short port, unsigned short *buf, unsigned len); +unsigned long inportsl(unsigned short port, unsigned long *buf, unsigned len); +void outportb(unsigned short port, unsigned char data); +void outportw(unsigned short port, unsigned short data); +void outportl(unsigned short port, unsigned long data); +void outportsb(unsigned short port, unsigned char *buf, unsigned len); +void outportsw(unsigned short port, unsigned short *buf, unsigned len); +void outportsl(unsigned short port, unsigned long *buf, unsigned len); + +int kbhit(void); +int getkey(void); + +void sound(int frequency); + +extern short ScreenPrimary[]; +extern short ScreenSecondary[]; + +/* For the primary screen: */ +int ScreenRows(); +int ScreenCols(); +void ScreenPutChar(int ch, int attr, int x, int y); +void ScreenSetCursor(int row, int col); +void ScreenGetCursor(int *row, int *col); +void ScreenClear(); + + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/newlib/libc/sys/go32/sys/register.h b/newlib/libc/sys/go32/sys/register.h new file mode 100644 index 000000000..56fb737dd --- /dev/null +++ b/newlib/libc/sys/go32/sys/register.h @@ -0,0 +1,28 @@ +/* This is file REGISTER.H */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + unsigned ax, bx, cx, dx, si, di, bp, f; + } REGISTERS; + +#define FLAGS_C 1 + +#ifdef __cplusplus +} +#endif + diff --git a/newlib/libc/sys/go32/sys/resource.h b/newlib/libc/sys/go32/sys/resource.h new file mode 100644 index 000000000..afdf39217 --- /dev/null +++ b/newlib/libc/sys/go32/sys/resource.h @@ -0,0 +1,50 @@ +/* This is file RESOURCE.H */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#ifndef _SYS_RESOURCE_H_ +#define _SYS_RESOURCE_H_ + +#include + +#define RUSAGE_SELF 0 /* calling process */ +#define RUSAGE_CHILDREN -1 /* terminated child processes */ + +struct rusage { + struct timeval ru_utime; /* user time used */ + struct timeval ru_stime; /* system time used */ + long ru_maxrss; /* integral max resident set size */ + long ru_ixrss; /* integral shared text memory size */ + long ru_idrss; /* integral unshared data size */ + long ru_isrss; /* integral unshared stack size */ + long ru_minflt; /* page reclaims */ + long ru_majflt; /* page faults */ + long ru_nswap; /* swaps */ + long ru_inblock; /* block input operations */ + long ru_oublock; /* block output operations */ + long ru_msgsnd; /* messages sent */ + long ru_msgrcv; /* messages received */ + long ru_nsignals; /* signals received */ + long ru_nvcsw; /* voluntary context switches */ + long ru_nivcsw; /* involuntary context switches */ +}; + + +#ifdef __cplusplus +extern "C" int getrusage(int who, struct rusage *rusage); +#else +extern int getrusage(int who, struct rusage *rusage); +#endif + +#endif + diff --git a/newlib/libc/sys/go32/sys/setjmp.h b/newlib/libc/sys/go32/sys/setjmp.h new file mode 100644 index 000000000..59e30c43e --- /dev/null +++ b/newlib/libc/sys/go32/sys/setjmp.h @@ -0,0 +1,44 @@ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#ifndef _SETJMP_H_ +#define _SETJMP_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + unsigned long eax; + unsigned long ebx; + unsigned long ecx; + unsigned long edx; + unsigned long esi; + unsigned long edi; + unsigned long ebp; + unsigned long esp; + unsigned long eip; + unsigned short es; + unsigned short fs; + unsigned short gs; + unsigned short ss; +} jmp_buf[1]; + +extern int setjmp(jmp_buf); +extern void longjmp(jmp_buf, int); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/newlib/libc/sys/go32/sys/stdc.h b/newlib/libc/sys/go32/sys/stdc.h new file mode 100644 index 000000000..b2e5bc19b --- /dev/null +++ b/newlib/libc/sys/go32/sys/stdc.h @@ -0,0 +1,15 @@ +/* This is file STDC.H */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#include diff --git a/newlib/libc/sys/go32/sys/uio.h b/newlib/libc/sys/go32/sys/uio.h new file mode 100644 index 000000000..d09fa5061 --- /dev/null +++ b/newlib/libc/sys/go32/sys/uio.h @@ -0,0 +1,23 @@ +/* This is file UIO.H */ +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +#ifndef _SYS_UIO_H_ +#define _SYS_UIO_H_ + +struct iovec { + void *iov_base; + unsigned long iov_len; +}; + +#endif diff --git a/newlib/libc/sys/go32/syserr.c b/newlib/libc/sys/go32/syserr.c new file mode 100644 index 000000000..1fe4ca4cf --- /dev/null +++ b/newlib/libc/sys/go32/syserr.c @@ -0,0 +1,38 @@ + +/* +** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +** +** This file is distributed under the terms listed in the document +** "copying.dj", available from DJ Delorie at the address above. +** A copy of "copying.dj" should accompany this file; if not, a copy +** should be available from where this file was obtained. This file +** may not be distributed without a verbatim copy of "copying.dj". +** +** This file is distributed WITHOUT ANY WARRANTY; without even the implied +** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +char *sys_errlist[] = { + "no error", + "invalid function", + "file not found", + "path not found", + "too many open files", + "access denied", + "invalid file handle", + "arena trashed", + "not enough memory", + "invalid block", + "no environment", + "no format", + "invalid access code", + "invalid data", + "undefined", + "invalid drive", + "attempt to remove current directory", + "not same device", + "no more files" +}; + +int sys_nerr= sizeof(sys_errlist) / sizeof(char *); + diff --git a/newlib/libc/sys/go32/system.s b/newlib/libc/sys/go32/system.s new file mode 100644 index 000000000..9b12bbee8 --- /dev/null +++ b/newlib/libc/sys/go32/system.s @@ -0,0 +1,19 @@ +# /* This is file SYSTEM.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _system +_system: + movb $7,%al + jmp turbo_assist diff --git a/newlib/libc/sys/go32/tell.s b/newlib/libc/sys/go32/tell.s new file mode 100644 index 000000000..5427cbe3f --- /dev/null +++ b/newlib/libc/sys/go32/tell.s @@ -0,0 +1,33 @@ +# /* This is file TELL.S */ +# /* +# ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954 +# ** +# ** This file is distributed under the terms listed in the document +# ** "copying.dj", available from DJ Delorie at the address above. +# ** A copy of "copying.dj" should accompany this file; if not, a copy +# ** should be available from where this file was obtained. This file +# ** may not be distributed without a verbatim copy of "copying.dj". +# ** +# ** This file is distributed WITHOUT ANY WARRANTY; without even the implied +# ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# */ + + .text + .globl _tell +_tell: + pushl %ebx + pushl %esi + pushl %edi + movl 16(%esp),%ebx + movl $0,%ecx + movl $0,%edx + movw $0x4201,%ax + int $0x21 + popl %edi + popl %esi + popl %ebx + jb syscall_error + shll $16,%edx + andl $0xffff,%eax + orl %edx,%eax + ret diff --git a/newlib/libc/sys/go32/time.c b/newlib/libc/sys/go32/time.c new file mode 100644 index 000000000..f8ab6f47e --- /dev/null +++ b/newlib/libc/sys/go32/time.c @@ -0,0 +1,53 @@ +/* +FUNCTION +<