Search
lxdream.org :: lxdream :: r831:677a887f3e06
lxdream 0.9.1
released Jun 29
Download Now
changeset831:677a887f3e06
parent830:73637b9624e4
child832:40e5bb525c4e
authornkeynes
dateMon Aug 25 11:31:52 2008 +0000 (15 years ago)
Commit current version of the newlib AICA patch (assumes the -dc patch is
already applied)
test/lib-arm/newlib-1.8.2-aica.patch
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/lib-arm/newlib-1.8.2-aica.patch Mon Aug 25 11:31:52 2008 +0000
1.3 @@ -0,0 +1,3786 @@
1.4 +diff -urN newlib-1.8.2/config.sub newlib-1.8.2-aica/config.sub
1.5 +--- newlib-1.8.2/config.sub 2008-08-15 12:02:09.000000000 +1000
1.6 ++++ newlib-1.8.2-aica/config.sub 2008-08-13 11:59:17.000000000 +1000
1.7 +@@ -956,7 +956,7 @@
1.8 + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1.9 + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
1.10 + | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit* \
1.11 +- | -dreamcast* )
1.12 ++ | -dreamcast* | -aica* )
1.13 + # Remember, each alternative MUST END IN *, to match a version number.
1.14 + ;;
1.15 + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1.16 +diff -urN newlib-1.8.2/configure.in newlib-1.8.2-aica/configure.in
1.17 +--- newlib-1.8.2/configure.in 2008-08-15 12:02:09.000000000 +1000
1.18 ++++ newlib-1.8.2-aica/configure.in 2008-08-13 11:58:57.000000000 +1000
1.19 +@@ -606,6 +606,9 @@
1.20 + target_configdirs="${target_configdirs} target-bsp target-cygmon"
1.21 + fi
1.22 + ;;
1.23 ++ arm-*-aica*)
1.24 ++ noconfigdirs="$noconfigdirs target-libgloss"
1.25 ++ ;;
1.26 + arm-*-oabi*)
1.27 + noconfigdirs="$noconfigdirs target-libgloss"
1.28 + ;;
1.29 +diff -urN newlib-1.8.2/newlib/configure.host newlib-1.8.2-aica/newlib/configure.host
1.30 +--- newlib-1.8.2/newlib/configure.host 2008-08-15 12:02:09.000000000 +1000
1.31 ++++ newlib-1.8.2-aica/newlib/configure.host 2008-08-13 20:01:25.000000000 +1000
1.32 +@@ -194,6 +194,10 @@
1.33 + *-*-dc* | *-*-dreamcast*)
1.34 + sys_dir=dreamcast
1.35 + ;;
1.36 ++ *-*-aica*)
1.37 ++ sys_dir=aica
1.38 ++ newlib_cflags="${newlib_cflags} -mcpu=arm7tdmi"
1.39 ++ ;;
1.40 + *-*-netware*)
1.41 + signal_dir=
1.42 + sys_dir=netware
1.43 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/Makefile.am newlib-1.8.2-aica/newlib/libc/sys/aica/Makefile.am
1.44 +--- newlib-1.8.2/newlib/libc/sys/aica/Makefile.am 1970-01-01 10:00:00.000000000 +1000
1.45 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/Makefile.am 2008-08-13 11:54:44.000000000 +1000
1.46 +@@ -0,0 +1,17 @@
1.47 ++## Process this file with automake to generate Makefile.in
1.48 ++
1.49 ++AUTOMAKE_OPTIONS = cygnus
1.50 ++
1.51 ++INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
1.52 ++
1.53 ++noinst_LIBRARIES = lib.a
1.54 ++
1.55 ++lib_a_SOURCES = absolute_vfs.c chdir.c chmod.c close.c creat.c dcload_vfs.c dcload.S \
1.56 ++ exit.c fcntl.c fstat.c getpid.c gettimeofday.c ioctl.c isatty.c kill.c \
1.57 ++ link.c lseek.c mkdir.c open.c read.c rmdir.c sbrk.c scif.c stat.c \
1.58 ++ stdio_vfs.c times.c unlink.c vfs.c write.c dup.c
1.59 ++
1.60 ++all: crt0.o
1.61 ++
1.62 ++ACLOCAL_AMFLAGS = -I ../../..
1.63 ++CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
1.64 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/Makefile.in newlib-1.8.2-aica/newlib/libc/sys/aica/Makefile.in
1.65 +--- newlib-1.8.2/newlib/libc/sys/aica/Makefile.in 1970-01-01 10:00:00.000000000 +1000
1.66 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/Makefile.in 2008-08-13 11:54:44.000000000 +1000
1.67 +@@ -0,0 +1,322 @@
1.68 ++# Makefile.in generated automatically by automake 1.4 from Makefile.am
1.69 ++
1.70 ++# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
1.71 ++# This Makefile.in is free software; the Free Software Foundation
1.72 ++# gives unlimited permission to copy and/or distribute it,
1.73 ++# with or without modifications, as long as this notice is preserved.
1.74 ++
1.75 ++# This program is distributed in the hope that it will be useful,
1.76 ++# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1.77 ++# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1.78 ++# PARTICULAR PURPOSE.
1.79 ++
1.80 ++
1.81 ++SHELL = @SHELL@
1.82 ++
1.83 ++srcdir = @srcdir@
1.84 ++top_srcdir = @top_srcdir@
1.85 ++VPATH = @srcdir@
1.86 ++prefix = @prefix@
1.87 ++exec_prefix = @exec_prefix@
1.88 ++
1.89 ++bindir = @bindir@
1.90 ++sbindir = @sbindir@
1.91 ++libexecdir = @libexecdir@
1.92 ++datadir = @datadir@
1.93 ++sysconfdir = @sysconfdir@
1.94 ++sharedstatedir = @sharedstatedir@
1.95 ++localstatedir = @localstatedir@
1.96 ++libdir = @libdir@
1.97 ++infodir = @infodir@
1.98 ++mandir = @mandir@
1.99 ++includedir = @includedir@
1.100 ++oldincludedir = /usr/include
1.101 ++
1.102 ++DESTDIR =
1.103 ++
1.104 ++pkgdatadir = $(datadir)/@PACKAGE@
1.105 ++pkglibdir = $(libdir)/@PACKAGE@
1.106 ++pkgincludedir = $(includedir)/@PACKAGE@
1.107 ++
1.108 ++top_builddir = .
1.109 ++
1.110 ++ACLOCAL = @ACLOCAL@
1.111 ++AUTOCONF = @AUTOCONF@
1.112 ++AUTOMAKE = @AUTOMAKE@
1.113 ++AUTOHEADER = @AUTOHEADER@
1.114 ++
1.115 ++INSTALL = @INSTALL@
1.116 ++INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
1.117 ++INSTALL_DATA = @INSTALL_DATA@
1.118 ++INSTALL_SCRIPT = @INSTALL_SCRIPT@
1.119 ++transform = @program_transform_name@
1.120 ++
1.121 ++NORMAL_INSTALL = :
1.122 ++PRE_INSTALL = :
1.123 ++POST_INSTALL = :
1.124 ++NORMAL_UNINSTALL = :
1.125 ++PRE_UNINSTALL = :
1.126 ++POST_UNINSTALL = :
1.127 ++host_alias = @host_alias@
1.128 ++host_triplet = @host@
1.129 ++AR = @AR@
1.130 ++AS = @AS@
1.131 ++CC = @CC@
1.132 ++CPP = @CPP@
1.133 ++EXEEXT = @EXEEXT@
1.134 ++MAKEINFO = @MAKEINFO@
1.135 ++NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
1.136 ++PACKAGE = @PACKAGE@
1.137 ++RANLIB = @RANLIB@
1.138 ++VERSION = @VERSION@
1.139 ++machine_dir = @machine_dir@
1.140 ++newlib_basedir = @newlib_basedir@
1.141 ++sys_dir = @sys_dir@
1.142 ++
1.143 ++AUTOMAKE_OPTIONS = cygnus
1.144 ++
1.145 ++INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
1.146 ++
1.147 ++noinst_LIBRARIES = lib.a
1.148 ++
1.149 ++lib_a_SOURCES = absolute_vfs.c chdir.c chmod.c close.c creat.c dcload_vfs.c dcload.S exit.c fcntl.c fstat.c getpid.c gettimeofday.c ioctl.c isatty.c kill.c link.c lseek.c mkdir.c open.c read.c rmdir.c sbrk.c scif.c stat.c stdio_vfs.c times.c unlink.c vfs.c write.c dup.c
1.150 ++
1.151 ++
1.152 ++ACLOCAL_AMFLAGS = -I ../../..
1.153 ++CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
1.154 ++ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
1.155 ++mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs
1.156 ++CONFIG_CLEAN_FILES =
1.157 ++LIBRARIES = $(noinst_LIBRARIES)
1.158 ++
1.159 ++
1.160 ++DEFS = @DEFS@ -I. -I$(srcdir)
1.161 ++CPPFLAGS = @CPPFLAGS@
1.162 ++LDFLAGS = @LDFLAGS@
1.163 ++LIBS = @LIBS@
1.164 ++lib_a_LIBADD =
1.165 ++lib_a_OBJECTS = absolute_vfs.o chdir.o chmod.o close.o creat.o \
1.166 ++dcload_vfs.o dcload.o exit.o fcntl.o fstat.o getpid.o gettimeofday.o ioctl.o \
1.167 ++isatty.o kill.o link.o lseek.o mkdir.o open.o read.o rmdir.o sbrk.o \
1.168 ++scif.o stat.o stdio_vfs.o times.o unlink.o vfs.o write.o dup.o
1.169 ++CFLAGS = @CFLAGS@
1.170 ++COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
1.171 ++CCLD = $(CC)
1.172 ++LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
1.173 ++DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in
1.174 ++
1.175 ++
1.176 ++DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
1.177 ++
1.178 ++TAR = tar
1.179 ++GZIP_ENV = --best
1.180 ++SOURCES = $(lib_a_SOURCES)
1.181 ++OBJECTS = $(lib_a_OBJECTS)
1.182 ++
1.183 ++all: all-redirect
1.184 ++.SUFFIXES:
1.185 ++.SUFFIXES: .S .c .o .s
1.186 ++$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
1.187 ++ cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
1.188 ++
1.189 ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
1.190 ++ cd $(top_builddir) \
1.191 ++ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
1.192 ++
1.193 ++$(ACLOCAL_M4): configure.in ../../../acinclude.m4 ../../../aclocal.m4
1.194 ++ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
1.195 ++
1.196 ++config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
1.197 ++ $(SHELL) ./config.status --recheck
1.198 ++$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
1.199 ++ cd $(srcdir) && $(AUTOCONF)
1.200 ++
1.201 ++mostlyclean-noinstLIBRARIES:
1.202 ++
1.203 ++clean-noinstLIBRARIES:
1.204 ++ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
1.205 ++
1.206 ++distclean-noinstLIBRARIES:
1.207 ++
1.208 ++maintainer-clean-noinstLIBRARIES:
1.209 ++
1.210 ++.c.o:
1.211 ++ $(COMPILE) -c $<
1.212 ++
1.213 ++.s.o:
1.214 ++ $(COMPILE) -c $<
1.215 ++
1.216 ++.S.o:
1.217 ++ $(COMPILE) -c $<
1.218 ++
1.219 ++mostlyclean-compile:
1.220 ++ -rm -f *.o core *.core
1.221 ++
1.222 ++clean-compile:
1.223 ++
1.224 ++distclean-compile:
1.225 ++ -rm -f *.tab.c
1.226 ++
1.227 ++maintainer-clean-compile:
1.228 ++
1.229 ++lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES)
1.230 ++ -rm -f lib.a
1.231 ++ $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
1.232 ++ $(RANLIB) lib.a
1.233 ++
1.234 ++tags: TAGS
1.235 ++
1.236 ++ID: $(HEADERS) $(SOURCES) $(LISP)
1.237 ++ list='$(SOURCES) $(HEADERS)'; \
1.238 ++ unique=`for i in $$list; do echo $$i; done | \
1.239 ++ awk ' { files[$$0] = 1; } \
1.240 ++ END { for (i in files) print i; }'`; \
1.241 ++ here=`pwd` && cd $(srcdir) \
1.242 ++ && mkid -f$$here/ID $$unique $(LISP)
1.243 ++
1.244 ++TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
1.245 ++ tags=; \
1.246 ++ here=`pwd`; \
1.247 ++ list='$(SOURCES) $(HEADERS)'; \
1.248 ++ unique=`for i in $$list; do echo $$i; done | \
1.249 ++ awk ' { files[$$0] = 1; } \
1.250 ++ END { for (i in files) print i; }'`; \
1.251 ++ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
1.252 ++ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
1.253 ++
1.254 ++mostlyclean-tags:
1.255 ++
1.256 ++clean-tags:
1.257 ++
1.258 ++distclean-tags:
1.259 ++ -rm -f TAGS ID
1.260 ++
1.261 ++maintainer-clean-tags:
1.262 ++
1.263 ++distdir = $(PACKAGE)-$(VERSION)
1.264 ++top_distdir = $(distdir)
1.265 ++
1.266 ++# This target untars the dist file and tries a VPATH configuration. Then
1.267 ++# it guarantees that the distribution is self-contained by making another
1.268 ++# tarfile.
1.269 ++distcheck: dist
1.270 ++ -rm -rf $(distdir)
1.271 ++ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
1.272 ++ mkdir $(distdir)/=build
1.273 ++ mkdir $(distdir)/=inst
1.274 ++ dc_install_base=`cd $(distdir)/=inst && pwd`; \
1.275 ++ cd $(distdir)/=build \
1.276 ++ && ../configure --srcdir=.. --prefix=$$dc_install_base \
1.277 ++ && $(MAKE) $(AM_MAKEFLAGS) \
1.278 ++ && $(MAKE) $(AM_MAKEFLAGS) dvi \
1.279 ++ && $(MAKE) $(AM_MAKEFLAGS) check \
1.280 ++ && $(MAKE) $(AM_MAKEFLAGS) install \
1.281 ++ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
1.282 ++ && $(MAKE) $(AM_MAKEFLAGS) dist
1.283 ++ -rm -rf $(distdir)
1.284 ++ @banner="$(distdir).tar.gz is ready for distribution"; \
1.285 ++ dashes=`echo "$$banner" | sed s/./=/g`; \
1.286 ++ echo "$$dashes"; \
1.287 ++ echo "$$banner"; \
1.288 ++ echo "$$dashes"
1.289 ++dist: distdir
1.290 ++ -chmod -R a+r $(distdir)
1.291 ++ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
1.292 ++ -rm -rf $(distdir)
1.293 ++dist-all: distdir
1.294 ++ -chmod -R a+r $(distdir)
1.295 ++ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
1.296 ++ -rm -rf $(distdir)
1.297 ++distdir: $(DISTFILES)
1.298 ++ -rm -rf $(distdir)
1.299 ++ mkdir $(distdir)
1.300 ++ -chmod 777 $(distdir)
1.301 ++ @for file in $(DISTFILES); do \
1.302 ++ if test -f $$file; then d=.; else d=$(srcdir); fi; \
1.303 ++ if test -d $$d/$$file; then \
1.304 ++ cp -pr $$d/$$file $(distdir)/$$file; \
1.305 ++ else \
1.306 ++ test -f $(distdir)/$$file \
1.307 ++ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
1.308 ++ || cp -p $$d/$$file $(distdir)/$$file || :; \
1.309 ++ fi; \
1.310 ++ done
1.311 ++info-am:
1.312 ++info: info-am
1.313 ++dvi-am:
1.314 ++dvi: dvi-am
1.315 ++check-am:
1.316 ++check: check-am
1.317 ++installcheck-am:
1.318 ++installcheck: installcheck-am
1.319 ++install-info-am:
1.320 ++install-info: install-info-am
1.321 ++install-exec-am:
1.322 ++install-exec: install-exec-am
1.323 ++
1.324 ++install-data-am:
1.325 ++install-data: install-data-am
1.326 ++
1.327 ++install-am: all-am
1.328 ++ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
1.329 ++install: install-am
1.330 ++uninstall-am:
1.331 ++uninstall: uninstall-am
1.332 ++all-am: Makefile $(LIBRARIES)
1.333 ++all-redirect: all-am
1.334 ++install-strip:
1.335 ++ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
1.336 ++installdirs:
1.337 ++
1.338 ++
1.339 ++mostlyclean-generic:
1.340 ++
1.341 ++clean-generic:
1.342 ++
1.343 ++distclean-generic:
1.344 ++ -rm -f Makefile $(CONFIG_CLEAN_FILES)
1.345 ++ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
1.346 ++
1.347 ++maintainer-clean-generic:
1.348 ++mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
1.349 ++ mostlyclean-tags mostlyclean-generic
1.350 ++
1.351 ++mostlyclean: mostlyclean-am
1.352 ++
1.353 ++clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \
1.354 ++ mostlyclean-am
1.355 ++
1.356 ++clean: clean-am
1.357 ++
1.358 ++distclean-am: distclean-noinstLIBRARIES distclean-compile \
1.359 ++ distclean-tags distclean-generic clean-am
1.360 ++
1.361 ++distclean: distclean-am
1.362 ++ -rm -f config.status
1.363 ++
1.364 ++maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
1.365 ++ maintainer-clean-compile maintainer-clean-tags \
1.366 ++ maintainer-clean-generic distclean-am
1.367 ++ @echo "This command is intended for maintainers to use;"
1.368 ++ @echo "it deletes files that may require special tools to rebuild."
1.369 ++
1.370 ++maintainer-clean: maintainer-clean-am
1.371 ++ -rm -f config.status
1.372 ++
1.373 ++.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
1.374 ++clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
1.375 ++mostlyclean-compile distclean-compile clean-compile \
1.376 ++maintainer-clean-compile tags mostlyclean-tags distclean-tags \
1.377 ++clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
1.378 ++check-am installcheck-am installcheck install-info-am install-info \
1.379 ++install-exec-am install-exec install-data-am install-data install-am \
1.380 ++install uninstall-am uninstall all-redirect all-am all installdirs \
1.381 ++mostlyclean-generic distclean-generic clean-generic \
1.382 ++maintainer-clean-generic clean mostlyclean distclean maintainer-clean
1.383 ++
1.384 ++
1.385 ++all: crt0.o
1.386 ++
1.387 ++# Tell versions [3.59,3.63) of GNU make to not export all variables.
1.388 ++# Otherwise a system limit (for SysV at least) may be exceeded.
1.389 ++.NOEXPORT:
1.390 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/absolute_vfs.c newlib-1.8.2-aica/newlib/libc/sys/aica/absolute_vfs.c
1.391 +--- newlib-1.8.2/newlib/libc/sys/aica/absolute_vfs.c 1970-01-01 10:00:00.000000000 +1000
1.392 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/absolute_vfs.c 2008-08-13 11:54:44.000000000 +1000
1.393 +@@ -0,0 +1,11 @@
1.394 ++#include "vfs.h"
1.395 ++
1.396 ++int _newlib_vfs_is_absolute (void)
1.397 ++{
1.398 ++ return 0;
1.399 ++}
1.400 ++
1.401 ++void _newlib_vfs_absolute_load (void)
1.402 ++{
1.403 ++ _newlib_vfs_initialized = VFS_LOADER_ABSOLUTE;
1.404 ++}
1.405 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/aclocal.m4 newlib-1.8.2-aica/newlib/libc/sys/aica/aclocal.m4
1.406 +--- newlib-1.8.2/newlib/libc/sys/aica/aclocal.m4 1970-01-01 10:00:00.000000000 +1000
1.407 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/aclocal.m4 2008-08-13 11:54:44.000000000 +1000
1.408 +@@ -0,0 +1,345 @@
1.409 ++dnl aclocal.m4 generated automatically by aclocal 1.3b
1.410 ++
1.411 ++dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
1.412 ++dnl This file is free software; the Free Software Foundation
1.413 ++dnl gives unlimited permission to copy and/or distribute it,
1.414 ++dnl with or without modifications, as long as this notice is preserved.
1.415 ++
1.416 ++dnl This program is distributed in the hope that it will be useful,
1.417 ++dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1.418 ++dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1.419 ++dnl PARTICULAR PURPOSE.
1.420 ++
1.421 ++dnl This provides configure definitions used by all the newlib
1.422 ++dnl configure.in files.
1.423 ++
1.424 ++dnl Basic newlib configury. This calls basic introductory stuff,
1.425 ++dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs
1.426 ++dnl configure.host. The only argument is the relative path to the top
1.427 ++dnl newlib directory.
1.428 ++
1.429 ++AC_DEFUN(NEWLIB_CONFIGURE,
1.430 ++[
1.431 ++dnl Default to --enable-multilib
1.432 ++AC_ARG_ENABLE(multilib,
1.433 ++[ --enable-multilib build many library versions (default)],
1.434 ++[case "${enableval}" in
1.435 ++ yes) multilib=yes ;;
1.436 ++ no) multilib=no ;;
1.437 ++ *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
1.438 ++ esac], [multilib=yes])dnl
1.439 ++
1.440 ++dnl Support --enable-target-optspace
1.441 ++AC_ARG_ENABLE(target-optspace,
1.442 ++[ --enable-target-optspace optimize for space],
1.443 ++[case "${enableval}" in
1.444 ++ yes) target_optspace=yes ;;
1.445 ++ no) target_optspace=no ;;
1.446 ++ *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;;
1.447 ++ esac], [target_optspace=])dnl
1.448 ++
1.449 ++dnl Support --enable-newlib-mb
1.450 ++AC_ARG_ENABLE(newlib-mb,
1.451 ++[ --enable-newlib-mb enable multibyte support],
1.452 ++[case "${enableval}" in
1.453 ++ yes) newlib_mb=yes ;;
1.454 ++ no) newlib_mb=no ;;
1.455 ++ *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;;
1.456 ++ esac], [newlib_mb=no])dnl
1.457 ++
1.458 ++dnl We may get other options which we don't document:
1.459 ++dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
1.460 ++
1.461 ++test -z "[$]{with_target_subdir}" && with_target_subdir=.
1.462 ++
1.463 ++if test "[$]{srcdir}" = "."; then
1.464 ++ if test "[$]{with_target_subdir}" != "."; then
1.465 ++ newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
1.466 ++ else
1.467 ++ newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
1.468 ++ fi
1.469 ++else
1.470 ++ newlib_basedir="[$]{srcdir}/$1"
1.471 ++fi
1.472 ++AC_SUBST(newlib_basedir)
1.473 ++
1.474 ++AC_CANONICAL_HOST
1.475 ++
1.476 ++AM_INIT_AUTOMAKE(newlib, 1.8.1)
1.477 ++
1.478 ++# FIXME: We temporarily define our own version of AC_PROG_CC. This is
1.479 ++# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
1.480 ++# are probably using a cross compiler, which will not be able to fully
1.481 ++# link an executable. This should really be fixed in autoconf
1.482 ++# itself.
1.483 ++
1.484 ++AC_DEFUN(LIB_AC_PROG_CC,
1.485 ++[AC_BEFORE([$0], [AC_PROG_CPP])dnl
1.486 ++AC_CHECK_PROG(CC, gcc, gcc)
1.487 ++if test -z "$CC"; then
1.488 ++ AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
1.489 ++ test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
1.490 ++fi
1.491 ++
1.492 ++AC_PROG_CC_GNU
1.493 ++
1.494 ++if test $ac_cv_prog_gcc = yes; then
1.495 ++ GCC=yes
1.496 ++dnl Check whether -g works, even if CFLAGS is set, in case the package
1.497 ++dnl plays around with CFLAGS (such as to build both debugging and
1.498 ++dnl normal versions of a library), tasteless as that idea is.
1.499 ++ ac_test_CFLAGS="${CFLAGS+set}"
1.500 ++ ac_save_CFLAGS="$CFLAGS"
1.501 ++ CFLAGS=
1.502 ++ AC_PROG_CC_G
1.503 ++ if test "$ac_test_CFLAGS" = set; then
1.504 ++ CFLAGS="$ac_save_CFLAGS"
1.505 ++ elif test $ac_cv_prog_cc_g = yes; then
1.506 ++ CFLAGS="-g -O2"
1.507 ++ else
1.508 ++ CFLAGS="-O2"
1.509 ++ fi
1.510 ++else
1.511 ++ GCC=
1.512 ++ test "${CFLAGS+set}" = set || CFLAGS="-g"
1.513 ++fi
1.514 ++])
1.515 ++
1.516 ++LIB_AC_PROG_CC
1.517 ++
1.518 ++# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
1.519 ++# run it explicitly here, it will be run implicitly before
1.520 ++# NEWLIB_CONFIGURE, which doesn't work because that means that it will
1.521 ++# be run before AC_CANONICAL_HOST.
1.522 ++AC_CANONICAL_BUILD
1.523 ++
1.524 ++AC_CHECK_TOOL(AS, as)
1.525 ++AC_CHECK_TOOL(AR, ar)
1.526 ++AC_CHECK_TOOL(RANLIB, ranlib, :)
1.527 ++
1.528 ++AM_PROG_INSTALL
1.529 ++
1.530 ++#AM_MAINTAINER_MODE
1.531 ++
1.532 ++# We need AM_EXEEXT to keep automake happy in cygnus mode. However,
1.533 ++# at least currently, we never actually build a program, so we never
1.534 ++# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
1.535 ++# fails, because we are probably configuring with a cross compiler
1.536 ++# which can't create executables. So we include AM_EXEEXT to keep
1.537 ++# automake happy, but we don't execute it, since we don't care about
1.538 ++# the result.
1.539 ++if false; then
1.540 ++ AM_EXEEXT
1.541 ++fi
1.542 ++
1.543 ++. [$]{newlib_basedir}/configure.host
1.544 ++
1.545 ++case [$]{newlib_basedir} in
1.546 ++/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;;
1.547 ++*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;;
1.548 ++esac
1.549 ++
1.550 ++newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include"
1.551 ++case "${host}" in
1.552 ++ *-*-cygwin32*)
1.553 ++ newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/include"
1.554 ++ ;;
1.555 ++esac
1.556 ++
1.557 ++newlib_cflags="[$]{newlib_cflags} -fno-builtin"
1.558 ++
1.559 ++NEWLIB_CFLAGS=${newlib_cflags}
1.560 ++AC_SUBST(NEWLIB_CFLAGS)
1.561 ++
1.562 ++AC_SUBST(machine_dir)
1.563 ++AC_SUBST(sys_dir)
1.564 ++])
1.565 ++
1.566 ++# Do all the work for Automake. This macro actually does too much --
1.567 ++# some checks are only needed if your package does certain things.
1.568 ++# But this isn't really a big deal.
1.569 ++
1.570 ++# serial 1
1.571 ++
1.572 ++dnl Usage:
1.573 ++dnl AM_INIT_AUTOMAKE(package,version, [no-define])
1.574 ++
1.575 ++AC_DEFUN(AM_INIT_AUTOMAKE,
1.576 ++[AC_REQUIRE([AM_PROG_INSTALL])
1.577 ++PACKAGE=[$1]
1.578 ++AC_SUBST(PACKAGE)
1.579 ++VERSION=[$2]
1.580 ++AC_SUBST(VERSION)
1.581 ++dnl test to see if srcdir already configured
1.582 ++if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1.583 ++ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1.584 ++fi
1.585 ++ifelse([$3],,
1.586 ++AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
1.587 ++AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
1.588 ++AC_REQUIRE([AM_SANITY_CHECK])
1.589 ++AC_REQUIRE([AC_ARG_PROGRAM])
1.590 ++dnl FIXME This is truly gross.
1.591 ++missing_dir=`cd $ac_aux_dir && pwd`
1.592 ++AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
1.593 ++AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
1.594 ++AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
1.595 ++AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
1.596 ++AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
1.597 ++AC_REQUIRE([AC_PROG_MAKE_SET])])
1.598 ++
1.599 ++
1.600 ++# serial 1
1.601 ++
1.602 ++AC_DEFUN(AM_PROG_INSTALL,
1.603 ++[AC_REQUIRE([AC_PROG_INSTALL])
1.604 ++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1.605 ++AC_SUBST(INSTALL_SCRIPT)dnl
1.606 ++])
1.607 ++
1.608 ++#
1.609 ++# Check to make sure that the build environment is sane.
1.610 ++#
1.611 ++
1.612 ++AC_DEFUN(AM_SANITY_CHECK,
1.613 ++[AC_MSG_CHECKING([whether build environment is sane])
1.614 ++# Just in case
1.615 ++sleep 1
1.616 ++echo timestamp > conftestfile
1.617 ++# Do `set' in a subshell so we don't clobber the current shell's
1.618 ++# arguments. Must try -L first in case configure is actually a
1.619 ++# symlink; some systems play weird games with the mod time of symlinks
1.620 ++# (eg FreeBSD returns the mod time of the symlink's containing
1.621 ++# directory).
1.622 ++if (
1.623 ++ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1.624 ++ if test "[$]*" = "X"; then
1.625 ++ # -L didn't work.
1.626 ++ set X `ls -t $srcdir/configure conftestfile`
1.627 ++ fi
1.628 ++ if test "[$]*" != "X $srcdir/configure conftestfile" \
1.629 ++ && test "[$]*" != "X conftestfile $srcdir/configure"; then
1.630 ++
1.631 ++ # If neither matched, then we have a broken ls. This can happen
1.632 ++ # if, for instance, CONFIG_SHELL is bash and it inherits a
1.633 ++ # broken ls alias from the environment. This has actually
1.634 ++ # happened. Such a system could not be considered "sane".
1.635 ++ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1.636 ++alias in your environment])
1.637 ++ fi
1.638 ++
1.639 ++ test "[$]2" = conftestfile
1.640 ++ )
1.641 ++then
1.642 ++ # Ok.
1.643 ++ :
1.644 ++else
1.645 ++ AC_MSG_ERROR([newly created file is older than distributed files!
1.646 ++Check your system clock])
1.647 ++fi
1.648 ++rm -f conftest*
1.649 ++AC_MSG_RESULT(yes)])
1.650 ++
1.651 ++dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
1.652 ++dnl The program must properly implement --version.
1.653 ++AC_DEFUN(AM_MISSING_PROG,
1.654 ++[AC_MSG_CHECKING(for working $2)
1.655 ++# Run test in a subshell; some versions of sh will print an error if
1.656 ++# an executable is not found, even if stderr is redirected.
1.657 ++# Redirect stdin to placate older versions of autoconf. Sigh.
1.658 ++if ($2 --version) < /dev/null > /dev/null 2>&1; then
1.659 ++ $1=$2
1.660 ++ AC_MSG_RESULT(found)
1.661 ++else
1.662 ++ $1="$3/missing $2"
1.663 ++ AC_MSG_RESULT(missing)
1.664 ++fi
1.665 ++AC_SUBST($1)])
1.666 ++
1.667 ++# Add --enable-maintainer-mode option to configure.
1.668 ++# From Jim Meyering
1.669 ++
1.670 ++# serial 1
1.671 ++
1.672 ++AC_DEFUN(AM_MAINTAINER_MODE,
1.673 ++[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1.674 ++ dnl maintainer-mode is disabled by default
1.675 ++ AC_ARG_ENABLE(maintainer-mode,
1.676 ++[ --enable-maintainer-mode enable make rules and dependencies not useful
1.677 ++ (and sometimes confusing) to the casual installer],
1.678 ++ USE_MAINTAINER_MODE=$enableval,
1.679 ++ USE_MAINTAINER_MODE=no)
1.680 ++ AC_MSG_RESULT($USE_MAINTAINER_MODE)
1.681 ++ if test $USE_MAINTAINER_MODE = yes; then
1.682 ++ MAINT=
1.683 ++ else
1.684 ++ MAINT='#M#'
1.685 ++ fi
1.686 ++# AC_SUBST(MAINT)dnl
1.687 ++]
1.688 ++)
1.689 ++
1.690 ++# Check to see if we're running under Win32, without using
1.691 ++# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
1.692 ++# Otherwise set it to "".
1.693 ++
1.694 ++dnl AM_EXEEXT()
1.695 ++dnl This knows we add .exe if we're building in the Cygwin32
1.696 ++dnl environment. But if we're not, then it compiles a test program
1.697 ++dnl to see if there is a suffix for executables.
1.698 ++AC_DEFUN(AM_EXEEXT,
1.699 ++[AC_REQUIRE([AM_CYGWIN32])
1.700 ++AC_REQUIRE([AM_MINGW32])
1.701 ++AC_MSG_CHECKING([for executable suffix])
1.702 ++AC_CACHE_VAL(am_cv_exeext,
1.703 ++[if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
1.704 ++am_cv_exeext=.exe
1.705 ++else
1.706 ++cat > am_c_test.c << 'EOF'
1.707 ++int main() {
1.708 ++/* Nothing needed here */
1.709 ++}
1.710 ++EOF
1.711 ++${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
1.712 ++am_cv_exeext=
1.713 ++for file in am_c_test.*; do
1.714 ++ case $file in
1.715 ++ *.c) ;;
1.716 ++ *.o) ;;
1.717 ++ *) am_cv_exeext=`echo $file | sed -e s/am_c_test//` ;;
1.718 ++ esac
1.719 ++done
1.720 ++rm -f am_c_test*])
1.721 ++test x"${am_cv_exeext}" = x && am_cv_exeext=no
1.722 ++fi
1.723 ++EXEEXT=""
1.724 ++test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
1.725 ++AC_MSG_RESULT(${am_cv_exeext})
1.726 ++AC_SUBST(EXEEXT)])
1.727 ++
1.728 ++# Check to see if we're running under Cygwin32, without using
1.729 ++# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
1.730 ++# Otherwise set it to "no".
1.731 ++
1.732 ++dnl AM_CYGWIN32()
1.733 ++AC_DEFUN(AM_CYGWIN32,
1.734 ++[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
1.735 ++[AC_TRY_COMPILE(,[return __CYGWIN32__;],
1.736 ++am_cv_cygwin32=yes, am_cv_cygwin32=no)
1.737 ++rm -f conftest*])
1.738 ++CYGWIN32=
1.739 ++test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
1.740 ++
1.741 ++# Check to see if we're running under Mingw, without using
1.742 ++# AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
1.743 ++# Otherwise set it to "no".
1.744 ++
1.745 ++dnl AM_MINGW32()
1.746 ++AC_DEFUN(AM_MINGW32,
1.747 ++[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
1.748 ++[AC_TRY_COMPILE(,[return __MINGW32__;],
1.749 ++am_cv_mingw32=yes, am_cv_mingw32=no)
1.750 ++rm -f conftest*])
1.751 ++MINGW32=
1.752 ++test "$am_cv_mingw32" = yes && MINGW32=yes])
1.753 ++
1.754 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/chdir.c newlib-1.8.2-aica/newlib/libc/sys/aica/chdir.c
1.755 +--- newlib-1.8.2/newlib/libc/sys/aica/chdir.c 1970-01-01 10:00:00.000000000 +1000
1.756 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/chdir.c 2008-08-13 11:54:44.000000000 +1000
1.757 +@@ -0,0 +1,14 @@
1.758 ++#include "vfs.h"
1.759 ++
1.760 ++int
1.761 ++chdir (const char *path)
1.762 ++{
1.763 ++ char *obj = _newlib_vfs_new_string (path);
1.764 ++
1.765 ++ struct media_ops *mops = _newlib_vfs_get_media_ops (path);
1.766 ++ int res = mops->chdir (obj);
1.767 ++
1.768 ++ _newlib_vfs_delete_string (obj);
1.769 ++
1.770 ++ return res;
1.771 ++}
1.772 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/chmod.c newlib-1.8.2-aica/newlib/libc/sys/aica/chmod.c
1.773 +--- newlib-1.8.2/newlib/libc/sys/aica/chmod.c 1970-01-01 10:00:00.000000000 +1000
1.774 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/chmod.c 2008-08-13 11:54:44.000000000 +1000
1.775 +@@ -0,0 +1,16 @@
1.776 ++#include <sys/types.h>
1.777 ++
1.778 ++#include "vfs.h"
1.779 ++
1.780 ++int
1.781 ++chmod (const char *path, mode_t mode)
1.782 ++{
1.783 ++ char *obj = _newlib_vfs_new_string (path);
1.784 ++
1.785 ++ struct media_ops *mops = _newlib_vfs_get_media_ops (path);
1.786 ++ int res = mops->chmod (obj, mode);
1.787 ++
1.788 ++ _newlib_vfs_delete_string (obj);
1.789 ++
1.790 ++ return res;
1.791 ++}
1.792 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/close.c newlib-1.8.2-aica/newlib/libc/sys/aica/close.c
1.793 +--- newlib-1.8.2/newlib/libc/sys/aica/close.c 1970-01-01 10:00:00.000000000 +1000
1.794 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/close.c 2008-08-13 11:54:44.000000000 +1000
1.795 +@@ -0,0 +1,15 @@
1.796 ++#include "vfs.h"
1.797 ++
1.798 ++int
1.799 ++_close (int fd)
1.800 ++{
1.801 ++ struct file *pf = _newlib_vfs_get_file (fd);
1.802 ++ int res = pf->fops->close (pf);
1.803 ++
1.804 ++ if (res >= 0)
1.805 ++ {
1.806 ++ return _newlib_vfs_remove_file (pf);
1.807 ++ }
1.808 ++
1.809 ++ return res;
1.810 ++}
1.811 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/configure newlib-1.8.2-aica/newlib/libc/sys/aica/configure
1.812 +--- newlib-1.8.2/newlib/libc/sys/aica/configure 1970-01-01 10:00:00.000000000 +1000
1.813 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/configure 2008-08-13 11:54:44.000000000 +1000
1.814 +@@ -0,0 +1,1586 @@
1.815 ++#! /bin/sh
1.816 ++
1.817 ++# Guess values for system-dependent variables and create Makefiles.
1.818 ++# Generated automatically using autoconf version 2.13
1.819 ++# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
1.820 ++#
1.821 ++# This configure script is free software; the Free Software Foundation
1.822 ++# gives unlimited permission to copy, distribute and modify it.
1.823 ++
1.824 ++# Defaults:
1.825 ++ac_help=
1.826 ++ac_default_prefix=/usr/local
1.827 ++# Any additions from configure.in:
1.828 ++ac_help="$ac_help
1.829 ++ --enable-multilib build many library versions (default)"
1.830 ++ac_help="$ac_help
1.831 ++ --enable-target-optspace optimize for space"
1.832 ++ac_help="$ac_help
1.833 ++ --enable-newlib-mb enable multibyte support"
1.834 ++
1.835 ++# Initialize some variables set by options.
1.836 ++# The variables have the same names as the options, with
1.837 ++# dashes changed to underlines.
1.838 ++build=NONE
1.839 ++cache_file=./config.cache
1.840 ++exec_prefix=NONE
1.841 ++host=NONE
1.842 ++no_create=
1.843 ++nonopt=NONE
1.844 ++no_recursion=
1.845 ++prefix=NONE
1.846 ++program_prefix=NONE
1.847 ++program_suffix=NONE
1.848 ++program_transform_name=s,x,x,
1.849 ++silent=
1.850 ++site=
1.851 ++srcdir=
1.852 ++target=NONE
1.853 ++verbose=
1.854 ++x_includes=NONE
1.855 ++x_libraries=NONE
1.856 ++bindir='${exec_prefix}/bin'
1.857 ++sbindir='${exec_prefix}/sbin'
1.858 ++libexecdir='${exec_prefix}/libexec'
1.859 ++datadir='${prefix}/share'
1.860 ++sysconfdir='${prefix}/etc'
1.861 ++sharedstatedir='${prefix}/com'
1.862 ++localstatedir='${prefix}/var'
1.863 ++libdir='${exec_prefix}/lib'
1.864 ++includedir='${prefix}/include'
1.865 ++oldincludedir='/usr/include'
1.866 ++infodir='${prefix}/info'
1.867 ++mandir='${prefix}/man'
1.868 ++
1.869 ++# Initialize some other variables.
1.870 ++subdirs=
1.871 ++MFLAGS= MAKEFLAGS=
1.872 ++SHELL=${CONFIG_SHELL-/bin/sh}
1.873 ++# Maximum number of lines to put in a shell here document.
1.874 ++ac_max_here_lines=12
1.875 ++
1.876 ++ac_prev=
1.877 ++for ac_option
1.878 ++do
1.879 ++
1.880 ++ # If the previous option needs an argument, assign it.
1.881 ++ if test -n "$ac_prev"; then
1.882 ++ eval "$ac_prev=\$ac_option"
1.883 ++ ac_prev=
1.884 ++ continue
1.885 ++ fi
1.886 ++
1.887 ++ case "$ac_option" in
1.888 ++ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
1.889 ++ *) ac_optarg= ;;
1.890 ++ esac
1.891 ++
1.892 ++ # Accept the important Cygnus configure options, so we can diagnose typos.
1.893 ++
1.894 ++ case "$ac_option" in
1.895 ++
1.896 ++ -bindir | --bindir | --bindi | --bind | --bin | --bi)
1.897 ++ ac_prev=bindir ;;
1.898 ++ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
1.899 ++ bindir="$ac_optarg" ;;
1.900 ++
1.901 ++ -build | --build | --buil | --bui | --bu)
1.902 ++ ac_prev=build ;;
1.903 ++ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
1.904 ++ build="$ac_optarg" ;;
1.905 ++
1.906 ++ -cache-file | --cache-file | --cache-fil | --cache-fi \
1.907 ++ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
1.908 ++ ac_prev=cache_file ;;
1.909 ++ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
1.910 ++ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
1.911 ++ cache_file="$ac_optarg" ;;
1.912 ++
1.913 ++ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
1.914 ++ ac_prev=datadir ;;
1.915 ++ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
1.916 ++ | --da=*)
1.917 ++ datadir="$ac_optarg" ;;
1.918 ++
1.919 ++ -disable-* | --disable-*)
1.920 ++ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
1.921 ++ # Reject names that are not valid shell variable names.
1.922 ++ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
1.923 ++ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
1.924 ++ fi
1.925 ++ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
1.926 ++ eval "enable_${ac_feature}=no" ;;
1.927 ++
1.928 ++ -enable-* | --enable-*)
1.929 ++ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
1.930 ++ # Reject names that are not valid shell variable names.
1.931 ++ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
1.932 ++ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
1.933 ++ fi
1.934 ++ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
1.935 ++ case "$ac_option" in
1.936 ++ *=*) ;;
1.937 ++ *) ac_optarg=yes ;;
1.938 ++ esac
1.939 ++ eval "enable_${ac_feature}='$ac_optarg'" ;;
1.940 ++
1.941 ++ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
1.942 ++ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
1.943 ++ | --exec | --exe | --ex)
1.944 ++ ac_prev=exec_prefix ;;
1.945 ++ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
1.946 ++ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
1.947 ++ | --exec=* | --exe=* | --ex=*)
1.948 ++ exec_prefix="$ac_optarg" ;;
1.949 ++
1.950 ++ -gas | --gas | --ga | --g)
1.951 ++ # Obsolete; use --with-gas.
1.952 ++ with_gas=yes ;;
1.953 ++
1.954 ++ -help | --help | --hel | --he)
1.955 ++ # Omit some internal or obsolete options to make the list less imposing.
1.956 ++ # This message is too long to be a string in the A/UX 3.1 sh.
1.957 ++ cat << EOF
1.958 ++Usage: configure [options] [host]
1.959 ++Options: [defaults in brackets after descriptions]
1.960 ++Configuration:
1.961 ++ --cache-file=FILE cache test results in FILE
1.962 ++ --help print this message
1.963 ++ --no-create do not create output files
1.964 ++ --quiet, --silent do not print \`checking...' messages
1.965 ++ --version print the version of autoconf that created configure
1.966 ++Directory and file names:
1.967 ++ --prefix=PREFIX install architecture-independent files in PREFIX
1.968 ++ [$ac_default_prefix]
1.969 ++ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
1.970 ++ [same as prefix]
1.971 ++ --bindir=DIR user executables in DIR [EPREFIX/bin]
1.972 ++ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
1.973 ++ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
1.974 ++ --datadir=DIR read-only architecture-independent data in DIR
1.975 ++ [PREFIX/share]
1.976 ++ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
1.977 ++ --sharedstatedir=DIR modifiable architecture-independent data in DIR
1.978 ++ [PREFIX/com]
1.979 ++ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
1.980 ++ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
1.981 ++ --includedir=DIR C header files in DIR [PREFIX/include]
1.982 ++ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
1.983 ++ --infodir=DIR info documentation in DIR [PREFIX/info]
1.984 ++ --mandir=DIR man documentation in DIR [PREFIX/man]
1.985 ++ --srcdir=DIR find the sources in DIR [configure dir or ..]
1.986 ++ --program-prefix=PREFIX prepend PREFIX to installed program names
1.987 ++ --program-suffix=SUFFIX append SUFFIX to installed program names
1.988 ++ --program-transform-name=PROGRAM
1.989 ++ run sed PROGRAM on installed program names
1.990 ++EOF
1.991 ++ cat << EOF
1.992 ++Host type:
1.993 ++ --build=BUILD configure for building on BUILD [BUILD=HOST]
1.994 ++ --host=HOST configure for HOST [guessed]
1.995 ++ --target=TARGET configure for TARGET [TARGET=HOST]
1.996 ++Features and packages:
1.997 ++ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
1.998 ++ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1.999 ++ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
1.1000 ++ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
1.1001 ++ --x-includes=DIR X include files are in DIR
1.1002 ++ --x-libraries=DIR X library files are in DIR
1.1003 ++EOF
1.1004 ++ if test -n "$ac_help"; then
1.1005 ++ echo "--enable and --with options recognized:$ac_help"
1.1006 ++ fi
1.1007 ++ exit 0 ;;
1.1008 ++
1.1009 ++ -host | --host | --hos | --ho)
1.1010 ++ ac_prev=host ;;
1.1011 ++ -host=* | --host=* | --hos=* | --ho=*)
1.1012 ++ host="$ac_optarg" ;;
1.1013 ++
1.1014 ++ -includedir | --includedir | --includedi | --included | --include \
1.1015 ++ | --includ | --inclu | --incl | --inc)
1.1016 ++ ac_prev=includedir ;;
1.1017 ++ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
1.1018 ++ | --includ=* | --inclu=* | --incl=* | --inc=*)
1.1019 ++ includedir="$ac_optarg" ;;
1.1020 ++
1.1021 ++ -infodir | --infodir | --infodi | --infod | --info | --inf)
1.1022 ++ ac_prev=infodir ;;
1.1023 ++ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
1.1024 ++ infodir="$ac_optarg" ;;
1.1025 ++
1.1026 ++ -libdir | --libdir | --libdi | --libd)
1.1027 ++ ac_prev=libdir ;;
1.1028 ++ -libdir=* | --libdir=* | --libdi=* | --libd=*)
1.1029 ++ libdir="$ac_optarg" ;;
1.1030 ++
1.1031 ++ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
1.1032 ++ | --libexe | --libex | --libe)
1.1033 ++ ac_prev=libexecdir ;;
1.1034 ++ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
1.1035 ++ | --libexe=* | --libex=* | --libe=*)
1.1036 ++ libexecdir="$ac_optarg" ;;
1.1037 ++
1.1038 ++ -localstatedir | --localstatedir | --localstatedi | --localstated \
1.1039 ++ | --localstate | --localstat | --localsta | --localst \
1.1040 ++ | --locals | --local | --loca | --loc | --lo)
1.1041 ++ ac_prev=localstatedir ;;
1.1042 ++ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
1.1043 ++ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
1.1044 ++ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
1.1045 ++ localstatedir="$ac_optarg" ;;
1.1046 ++
1.1047 ++ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
1.1048 ++ ac_prev=mandir ;;
1.1049 ++ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
1.1050 ++ mandir="$ac_optarg" ;;
1.1051 ++
1.1052 ++ -nfp | --nfp | --nf)
1.1053 ++ # Obsolete; use --without-fp.
1.1054 ++ with_fp=no ;;
1.1055 ++
1.1056 ++ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1.1057 ++ | --no-cr | --no-c)
1.1058 ++ no_create=yes ;;
1.1059 ++
1.1060 ++ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1.1061 ++ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1.1062 ++ no_recursion=yes ;;
1.1063 ++
1.1064 ++ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
1.1065 ++ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
1.1066 ++ | --oldin | --oldi | --old | --ol | --o)
1.1067 ++ ac_prev=oldincludedir ;;
1.1068 ++ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1.1069 ++ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1.1070 ++ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1.1071 ++ oldincludedir="$ac_optarg" ;;
1.1072 ++
1.1073 ++ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1.1074 ++ ac_prev=prefix ;;
1.1075 ++ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1.1076 ++ prefix="$ac_optarg" ;;
1.1077 ++
1.1078 ++ -program-prefix | --program-prefix | --program-prefi | --program-pref \
1.1079 ++ | --program-pre | --program-pr | --program-p)
1.1080 ++ ac_prev=program_prefix ;;
1.1081 ++ -program-prefix=* | --program-prefix=* | --program-prefi=* \
1.1082 ++ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1.1083 ++ program_prefix="$ac_optarg" ;;
1.1084 ++
1.1085 ++ -program-suffix | --program-suffix | --program-suffi | --program-suff \
1.1086 ++ | --program-suf | --program-su | --program-s)
1.1087 ++ ac_prev=program_suffix ;;
1.1088 ++ -program-suffix=* | --program-suffix=* | --program-suffi=* \
1.1089 ++ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1.1090 ++ program_suffix="$ac_optarg" ;;
1.1091 ++
1.1092 ++ -program-transform-name | --program-transform-name \
1.1093 ++ | --program-transform-nam | --program-transform-na \
1.1094 ++ | --program-transform-n | --program-transform- \
1.1095 ++ | --program-transform | --program-transfor \
1.1096 ++ | --program-transfo | --program-transf \
1.1097 ++ | --program-trans | --program-tran \
1.1098 ++ | --progr-tra | --program-tr | --program-t)
1.1099 ++ ac_prev=program_transform_name ;;
1.1100 ++ -program-transform-name=* | --program-transform-name=* \
1.1101 ++ | --program-transform-nam=* | --program-transform-na=* \
1.1102 ++ | --program-transform-n=* | --program-transform-=* \
1.1103 ++ | --program-transform=* | --program-transfor=* \
1.1104 ++ | --program-transfo=* | --program-transf=* \
1.1105 ++ | --program-trans=* | --program-tran=* \
1.1106 ++ | --progr-tra=* | --program-tr=* | --program-t=*)
1.1107 ++ program_transform_name="$ac_optarg" ;;
1.1108 ++
1.1109 ++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1.1110 ++ | -silent | --silent | --silen | --sile | --sil)
1.1111 ++ silent=yes ;;
1.1112 ++
1.1113 ++ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1.1114 ++ ac_prev=sbindir ;;
1.1115 ++ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1.1116 ++ | --sbi=* | --sb=*)
1.1117 ++ sbindir="$ac_optarg" ;;
1.1118 ++
1.1119 ++ -sharedstatedir | --sharedstatedir | --sharedstatedi \
1.1120 ++ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1.1121 ++ | --sharedst | --shareds | --shared | --share | --shar \
1.1122 ++ | --sha | --sh)
1.1123 ++ ac_prev=sharedstatedir ;;
1.1124 ++ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1.1125 ++ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1.1126 ++ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1.1127 ++ | --sha=* | --sh=*)
1.1128 ++ sharedstatedir="$ac_optarg" ;;
1.1129 ++
1.1130 ++ -site | --site | --sit)
1.1131 ++ ac_prev=site ;;
1.1132 ++ -site=* | --site=* | --sit=*)
1.1133 ++ site="$ac_optarg" ;;
1.1134 ++
1.1135 ++ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1.1136 ++ ac_prev=srcdir ;;
1.1137 ++ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1.1138 ++ srcdir="$ac_optarg" ;;
1.1139 ++
1.1140 ++ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1.1141 ++ | --syscon | --sysco | --sysc | --sys | --sy)
1.1142 ++ ac_prev=sysconfdir ;;
1.1143 ++ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1.1144 ++ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1.1145 ++ sysconfdir="$ac_optarg" ;;
1.1146 ++
1.1147 ++ -target | --target | --targe | --targ | --tar | --ta | --t)
1.1148 ++ ac_prev=target ;;
1.1149 ++ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1.1150 ++ target="$ac_optarg" ;;
1.1151 ++
1.1152 ++ -v | -verbose | --verbose | --verbos | --verbo | --verb)
1.1153 ++ verbose=yes ;;
1.1154 ++
1.1155 ++ -version | --version | --versio | --versi | --vers)
1.1156 ++ echo "configure generated by autoconf version 2.13"
1.1157 ++ exit 0 ;;
1.1158 ++
1.1159 ++ -with-* | --with-*)
1.1160 ++ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
1.1161 ++ # Reject names that are not valid shell variable names.
1.1162 ++ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
1.1163 ++ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
1.1164 ++ fi
1.1165 ++ ac_package=`echo $ac_package| sed 's/-/_/g'`
1.1166 ++ case "$ac_option" in
1.1167 ++ *=*) ;;
1.1168 ++ *) ac_optarg=yes ;;
1.1169 ++ esac
1.1170 ++ eval "with_${ac_package}='$ac_optarg'" ;;
1.1171 ++
1.1172 ++ -without-* | --without-*)
1.1173 ++ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
1.1174 ++ # Reject names that are not valid shell variable names.
1.1175 ++ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
1.1176 ++ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
1.1177 ++ fi
1.1178 ++ ac_package=`echo $ac_package| sed 's/-/_/g'`
1.1179 ++ eval "with_${ac_package}=no" ;;
1.1180 ++
1.1181 ++ --x)
1.1182 ++ # Obsolete; use --with-x.
1.1183 ++ with_x=yes ;;
1.1184 ++
1.1185 ++ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1.1186 ++ | --x-incl | --x-inc | --x-in | --x-i)
1.1187 ++ ac_prev=x_includes ;;
1.1188 ++ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1.1189 ++ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1.1190 ++ x_includes="$ac_optarg" ;;
1.1191 ++
1.1192 ++ -x-libraries | --x-libraries | --x-librarie | --x-librari \
1.1193 ++ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1.1194 ++ ac_prev=x_libraries ;;
1.1195 ++ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1.1196 ++ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1.1197 ++ x_libraries="$ac_optarg" ;;
1.1198 ++
1.1199 ++ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
1.1200 ++ ;;
1.1201 ++
1.1202 ++ *)
1.1203 ++ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
1.1204 ++ echo "configure: warning: $ac_option: invalid host type" 1>&2
1.1205 ++ fi
1.1206 ++ if test "x$nonopt" != xNONE; then
1.1207 ++ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
1.1208 ++ fi
1.1209 ++ nonopt="$ac_option"
1.1210 ++ ;;
1.1211 ++
1.1212 ++ esac
1.1213 ++done
1.1214 ++
1.1215 ++if test -n "$ac_prev"; then
1.1216 ++ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
1.1217 ++fi
1.1218 ++
1.1219 ++trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
1.1220 ++
1.1221 ++# File descriptor usage:
1.1222 ++# 0 standard input
1.1223 ++# 1 file creation
1.1224 ++# 2 errors and warnings
1.1225 ++# 3 some systems may open it to /dev/tty
1.1226 ++# 4 used on the Kubota Titan
1.1227 ++# 6 checking for... messages and results
1.1228 ++# 5 compiler messages saved in config.log
1.1229 ++if test "$silent" = yes; then
1.1230 ++ exec 6>/dev/null
1.1231 ++else
1.1232 ++ exec 6>&1
1.1233 ++fi
1.1234 ++exec 5>./config.log
1.1235 ++
1.1236 ++echo "\
1.1237 ++This file contains any messages produced by compilers while
1.1238 ++running configure, to aid debugging if configure makes a mistake.
1.1239 ++" 1>&5
1.1240 ++
1.1241 ++# Strip out --no-create and --no-recursion so they do not pile up.
1.1242 ++# Also quote any args containing shell metacharacters.
1.1243 ++ac_configure_args=
1.1244 ++for ac_arg
1.1245 ++do
1.1246 ++ case "$ac_arg" in
1.1247 ++ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1.1248 ++ | --no-cr | --no-c) ;;
1.1249 ++ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1.1250 ++ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
1.1251 ++ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
1.1252 ++ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
1.1253 ++ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
1.1254 ++ esac
1.1255 ++done
1.1256 ++
1.1257 ++# NLS nuisances.
1.1258 ++# Only set these to C if already set. These must not be set unconditionally
1.1259 ++# because not all systems understand e.g. LANG=C (notably SCO).
1.1260 ++# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
1.1261 ++# Non-C LC_CTYPE values break the ctype check.
1.1262 ++if test "${LANG+set}" = set; then LANG=C; export LANG; fi
1.1263 ++if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
1.1264 ++if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
1.1265 ++if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
1.1266 ++
1.1267 ++# confdefs.h avoids OS command line length limits that DEFS can exceed.
1.1268 ++rm -rf conftest* confdefs.h
1.1269 ++# AIX cpp loses on an empty file, so make sure it contains at least a newline.
1.1270 ++echo > confdefs.h
1.1271 ++
1.1272 ++# A filename unique to this package, relative to the directory that
1.1273 ++# configure is in, which we can look for to find out if srcdir is correct.
1.1274 ++ac_unique_file=sbrk.c
1.1275 ++
1.1276 ++# Find the source files, if location was not specified.
1.1277 ++if test -z "$srcdir"; then
1.1278 ++ ac_srcdir_defaulted=yes
1.1279 ++ # Try the directory containing this script, then its parent.
1.1280 ++ ac_prog=$0
1.1281 ++ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
1.1282 ++ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
1.1283 ++ srcdir=$ac_confdir
1.1284 ++ if test ! -r $srcdir/$ac_unique_file; then
1.1285 ++ srcdir=..
1.1286 ++ fi
1.1287 ++else
1.1288 ++ ac_srcdir_defaulted=no
1.1289 ++fi
1.1290 ++if test ! -r $srcdir/$ac_unique_file; then
1.1291 ++ if test "$ac_srcdir_defaulted" = yes; then
1.1292 ++ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
1.1293 ++ else
1.1294 ++ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
1.1295 ++ fi
1.1296 ++fi
1.1297 ++srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
1.1298 ++
1.1299 ++# Prefer explicitly selected file to automatically selected ones.
1.1300 ++if test -z "$CONFIG_SITE"; then
1.1301 ++ if test "x$prefix" != xNONE; then
1.1302 ++ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
1.1303 ++ else
1.1304 ++ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
1.1305 ++ fi
1.1306 ++fi
1.1307 ++for ac_site_file in $CONFIG_SITE; do
1.1308 ++ if test -r "$ac_site_file"; then
1.1309 ++ echo "loading site script $ac_site_file"
1.1310 ++ . "$ac_site_file"
1.1311 ++ fi
1.1312 ++done
1.1313 ++
1.1314 ++if test -r "$cache_file"; then
1.1315 ++ echo "loading cache $cache_file"
1.1316 ++ . $cache_file
1.1317 ++else
1.1318 ++ echo "creating cache $cache_file"
1.1319 ++ > $cache_file
1.1320 ++fi
1.1321 ++
1.1322 ++ac_ext=c
1.1323 ++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1.1324 ++ac_cpp='$CPP $CPPFLAGS'
1.1325 ++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1.1326 ++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1.1327 ++cross_compiling=$ac_cv_prog_cc_cross
1.1328 ++
1.1329 ++ac_exeext=
1.1330 ++ac_objext=o
1.1331 ++if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
1.1332 ++ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
1.1333 ++ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
1.1334 ++ ac_n= ac_c='
1.1335 ++' ac_t=' '
1.1336 ++ else
1.1337 ++ ac_n=-n ac_c= ac_t=
1.1338 ++ fi
1.1339 ++else
1.1340 ++ ac_n= ac_c='\c' ac_t=
1.1341 ++fi
1.1342 ++
1.1343 ++
1.1344 ++
1.1345 ++ac_aux_dir=
1.1346 ++for ac_dir in ../../../.. $srcdir/../../../..; do
1.1347 ++ if test -f $ac_dir/install-sh; then
1.1348 ++ ac_aux_dir=$ac_dir
1.1349 ++ ac_install_sh="$ac_aux_dir/install-sh -c"
1.1350 ++ break
1.1351 ++ elif test -f $ac_dir/install.sh; then
1.1352 ++ ac_aux_dir=$ac_dir
1.1353 ++ ac_install_sh="$ac_aux_dir/install.sh -c"
1.1354 ++ break
1.1355 ++ fi
1.1356 ++done
1.1357 ++if test -z "$ac_aux_dir"; then
1.1358 ++ { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; }
1.1359 ++fi
1.1360 ++ac_config_guess=$ac_aux_dir/config.guess
1.1361 ++ac_config_sub=$ac_aux_dir/config.sub
1.1362 ++ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
1.1363 ++
1.1364 ++
1.1365 ++# Find a good install program. We prefer a C program (faster),
1.1366 ++# so one script is as good as another. But avoid the broken or
1.1367 ++# incompatible versions:
1.1368 ++# SysV /etc/install, /usr/sbin/install
1.1369 ++# SunOS /usr/etc/install
1.1370 ++# IRIX /sbin/install
1.1371 ++# AIX /bin/install
1.1372 ++# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1.1373 ++# AFS /usr/afsws/bin/install, which mishandles nonexistent args
1.1374 ++# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1.1375 ++# ./install, which can be erroneously created by make from ./install.sh.
1.1376 ++echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1.1377 ++echo "configure:564: checking for a BSD compatible install" >&5
1.1378 ++if test -z "$INSTALL"; then
1.1379 ++if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1.1380 ++ echo $ac_n "(cached) $ac_c" 1>&6
1.1381 ++else
1.1382 ++ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
1.1383 ++ for ac_dir in $PATH; do
1.1384 ++ # Account for people who put trailing slashes in PATH elements.
1.1385 ++ case "$ac_dir/" in
1.1386 ++ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1.1387 ++ *)
1.1388 ++ # OSF1 and SCO ODT 3.0 have their own names for install.
1.1389 ++ # Don't use installbsd from OSF since it installs stuff as root
1.1390 ++ # by default.
1.1391 ++ for ac_prog in ginstall scoinst install; do
1.1392 ++ if test -f $ac_dir/$ac_prog; then
1.1393 ++ if test $ac_prog = install &&
1.1394 ++ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1.1395 ++ # AIX install. It has an incompatible calling convention.
1.1396 ++ :
1.1397 ++ else
1.1398 ++ ac_cv_path_install="$ac_dir/$ac_prog -c"
1.1399 ++ break 2
1.1400 ++ fi
1.1401 ++ fi
1.1402 ++ done
1.1403 ++ ;;
1.1404 ++ esac
1.1405 ++ done
1.1406 ++ IFS="$ac_save_IFS"
1.1407 ++
1.1408 ++fi
1.1409 ++ if test "${ac_cv_path_install+set}" = set; then
1.1410 ++ INSTALL="$ac_cv_path_install"
1.1411 ++ else
1.1412 ++ # As a last resort, use the slow shell script. We don't cache a
1.1413 ++ # path for INSTALL within a source directory, because that will
1.1414 ++ # break other packages using the cache if that directory is
1.1415 ++ # removed, or if the path is relative.
1.1416 ++ INSTALL="$ac_install_sh"
1.1417 ++ fi
1.1418 ++fi
1.1419 ++echo "$ac_t""$INSTALL" 1>&6
1.1420 ++
1.1421 ++# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1.1422 ++# It thinks the first close brace ends the variable substitution.
1.1423 ++test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1.1424 ++
1.1425 ++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1.1426 ++
1.1427 ++test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1.1428 ++
1.1429 ++
1.1430 ++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1.1431 ++
1.1432 ++echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
1.1433 ++echo "configure:620: checking whether build environment is sane" >&5
1.1434 ++# Just in case
1.1435 ++sleep 1
1.1436 ++echo timestamp > conftestfile
1.1437 ++# Do `set' in a subshell so we don't clobber the current shell's
1.1438 ++# arguments. Must try -L first in case configure is actually a
1.1439 ++# symlink; some systems play weird games with the mod time of symlinks
1.1440 ++# (eg FreeBSD returns the mod time of the symlink's containing
1.1441 ++# directory).
1.1442 ++if (
1.1443 ++ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1.1444 ++ if test "$*" = "X"; then
1.1445 ++ # -L didn't work.
1.1446 ++ set X `ls -t $srcdir/configure conftestfile`
1.1447 ++ fi
1.1448 ++ if test "$*" != "X $srcdir/configure conftestfile" \
1.1449 ++ && test "$*" != "X conftestfile $srcdir/configure"; then
1.1450 ++
1.1451 ++ # If neither matched, then we have a broken ls. This can happen
1.1452 ++ # if, for instance, CONFIG_SHELL is bash and it inherits a
1.1453 ++ # broken ls alias from the environment. This has actually
1.1454 ++ # happened. Such a system could not be considered "sane".
1.1455 ++ { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
1.1456 ++alias in your environment" 1>&2; exit 1; }
1.1457 ++ fi
1.1458 ++
1.1459 ++ test "$2" = conftestfile
1.1460 ++ )
1.1461 ++then
1.1462 ++ # Ok.
1.1463 ++ :
1.1464 ++else
1.1465 ++ { echo "configure: error: newly created file is older than distributed files!
1.1466 ++Check your system clock" 1>&2; exit 1; }
1.1467 ++fi
1.1468 ++rm -f conftest*
1.1469 ++echo "$ac_t""yes" 1>&6
1.1470 ++if test "$program_transform_name" = s,x,x,; then
1.1471 ++ program_transform_name=
1.1472 ++else
1.1473 ++ # Double any \ or $. echo might interpret backslashes.
1.1474 ++ cat <<\EOF_SED > conftestsed
1.1475 ++s,\\,\\\\,g; s,\$,$$,g
1.1476 ++EOF_SED
1.1477 ++ program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
1.1478 ++ rm -f conftestsed
1.1479 ++fi
1.1480 ++test "$program_prefix" != NONE &&
1.1481 ++ program_transform_name="s,^,${program_prefix},; $program_transform_name"
1.1482 ++# Use a double $ so make ignores it.
1.1483 ++test "$program_suffix" != NONE &&
1.1484 ++ program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
1.1485 ++
1.1486 ++# sed with no file args requires a program.
1.1487 ++test "$program_transform_name" = "" && program_transform_name="s,x,x,"
1.1488 ++
1.1489 ++echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1.1490 ++echo "configure:677: checking whether ${MAKE-make} sets \${MAKE}" >&5
1.1491 ++set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1.1492 ++if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1.1493 ++ echo $ac_n "(cached) $ac_c" 1>&6
1.1494 ++else
1.1495 ++ cat > conftestmake <<\EOF
1.1496 ++all:
1.1497 ++ @echo 'ac_maketemp="${MAKE}"'
1.1498 ++EOF
1.1499 ++# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1.1500 ++eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1.1501 ++if test -n "$ac_maketemp"; then
1.1502 ++ eval ac_cv_prog_make_${ac_make}_set=yes
1.1503 ++else
1.1504 ++ eval ac_cv_prog_make_${ac_make}_set=no
1.1505 ++fi
1.1506 ++rm -f conftestmake
1.1507 ++fi
1.1508 ++if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1.1509 ++ echo "$ac_t""yes" 1>&6
1.1510 ++ SET_MAKE=
1.1511 ++else
1.1512 ++ echo "$ac_t""no" 1>&6
1.1513 ++ SET_MAKE="MAKE=${MAKE-make}"
1.1514 ++fi
1.1515 ++
1.1516 ++if test $host != $build; then
1.1517 ++ ac_tool_prefix=${host_alias}-
1.1518 ++else
1.1519 ++ ac_tool_prefix=
1.1520 ++fi
1.1521 ++
1.1522 ++echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
1.1523 ++echo "configure:710: checking for Cygwin32 environment" >&5
1.1524 ++if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
1.1525 ++ echo $ac_n "(cached) $ac_c" 1>&6
1.1526 ++else
1.1527 ++ cat > conftest.$ac_ext <<EOF
1.1528 ++#line 715 "configure"
1.1529 ++#include "confdefs.h"
1.1530 ++
1.1531 ++int main() {
1.1532 ++return __CYGWIN32__;
1.1533 ++; return 0; }
1.1534 ++EOF
1.1535 ++if { (eval echo configure:722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1.1536 ++ rm -rf conftest*
1.1537 ++ am_cv_cygwin32=yes
1.1538 ++else
1.1539 ++ echo "configure: failed program was:" >&5
1.1540 ++ cat conftest.$ac_ext >&5
1.1541 ++ rm -rf conftest*
1.1542 ++ am_cv_cygwin32=no
1.1543 ++fi
1.1544 ++rm -f conftest*
1.1545 ++rm -f conftest*
1.1546 ++fi
1.1547 ++
1.1548 ++echo "$ac_t""$am_cv_cygwin32" 1>&6
1.1549 ++CYGWIN32=
1.1550 ++test "$am_cv_cygwin32" = yes && CYGWIN32=yes
1.1551 ++echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
1.1552 ++echo "configure:739: checking for Mingw32 environment" >&5
1.1553 ++if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
1.1554 ++ echo $ac_n "(cached) $ac_c" 1>&6
1.1555 ++else
1.1556 ++ cat > conftest.$ac_ext <<EOF
1.1557 ++#line 744 "configure"
1.1558 ++#include "confdefs.h"
1.1559 ++
1.1560 ++int main() {
1.1561 ++return __MINGW32__;
1.1562 ++; return 0; }
1.1563 ++EOF
1.1564 ++if { (eval echo configure:751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1.1565 ++ rm -rf conftest*
1.1566 ++ am_cv_mingw32=yes
1.1567 ++else
1.1568 ++ echo "configure: failed program was:" >&5
1.1569 ++ cat conftest.$ac_ext >&5
1.1570 ++ rm -rf conftest*
1.1571 ++ am_cv_mingw32=no
1.1572 ++fi
1.1573 ++rm -f conftest*
1.1574 ++rm -f conftest*
1.1575 ++fi
1.1576 ++
1.1577 ++echo "$ac_t""$am_cv_mingw32" 1>&6
1.1578 ++MINGW32=
1.1579 ++test "$am_cv_mingw32" = yes && MINGW32=yes
1.1580 ++
1.1581 ++# Check whether --enable-multilib or --disable-multilib was given.
1.1582 ++if test "${enable_multilib+set}" = set; then
1.1583 ++ enableval="$enable_multilib"
1.1584 ++ case "${enableval}" in
1.1585 ++ yes) multilib=yes ;;
1.1586 ++ no) multilib=no ;;
1.1587 ++ *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;;
1.1588 ++ esac
1.1589 ++else
1.1590 ++ multilib=yes
1.1591 ++fi
1.1592 ++
1.1593 ++# Check whether --enable-target-optspace or --disable-target-optspace was given.
1.1594 ++if test "${enable_target_optspace+set}" = set; then
1.1595 ++ enableval="$enable_target_optspace"
1.1596 ++ case "${enableval}" in
1.1597 ++ yes) target_optspace=yes ;;
1.1598 ++ no) target_optspace=no ;;
1.1599 ++ *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;;
1.1600 ++ esac
1.1601 ++else
1.1602 ++ target_optspace=
1.1603 ++fi
1.1604 ++
1.1605 ++# Check whether --enable-newlib-mb or --disable-newlib-mb was given.
1.1606 ++if test "${enable_newlib_mb+set}" = set; then
1.1607 ++ enableval="$enable_newlib_mb"
1.1608 ++ case "${enableval}" in
1.1609 ++ yes) newlib_mb=yes ;;
1.1610 ++ no) newlib_mb=no ;;
1.1611 ++ *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;;
1.1612 ++ esac
1.1613 ++else
1.1614 ++ newlib_mb=no
1.1615 ++fi
1.1616 ++
1.1617 ++
1.1618 ++test -z "${with_target_subdir}" && with_target_subdir=.
1.1619 ++
1.1620 ++if test "${srcdir}" = "."; then
1.1621 ++ if test "${with_target_subdir}" != "."; then
1.1622 ++ newlib_basedir="${srcdir}/${with_multisrctop}../../../.."
1.1623 ++ else
1.1624 ++ newlib_basedir="${srcdir}/${with_multisrctop}../../.."
1.1625 ++ fi
1.1626 ++else
1.1627 ++ newlib_basedir="${srcdir}/../../.."
1.1628 ++fi
1.1629 ++
1.1630 ++
1.1631 ++
1.1632 ++# Make sure we can run config.sub.
1.1633 ++if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
1.1634 ++else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1.1635 ++fi
1.1636 ++
1.1637 ++echo $ac_n "checking host system type""... $ac_c" 1>&6
1.1638 ++echo "configure:825: checking host system type" >&5
1.1639 ++
1.1640 ++host_alias=$host
1.1641 ++case "$host_alias" in
1.1642 ++NONE)
1.1643 ++ case $nonopt in
1.1644 ++ NONE)
1.1645 ++ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
1.1646 ++ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1.1647 ++ fi ;;
1.1648 ++ *) host_alias=$nonopt ;;
1.1649 ++ esac ;;
1.1650 ++esac
1.1651 ++
1.1652 ++host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
1.1653 ++host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1.1654 ++host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1.1655 ++host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1.1656 ++echo "$ac_t""$host" 1>&6
1.1657 ++
1.1658 ++
1.1659 ++
1.1660 ++PACKAGE=newlib
1.1661 ++
1.1662 ++VERSION=1.8.1
1.1663 ++
1.1664 ++if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1.1665 ++ { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1.1666 ++fi
1.1667 ++cat >> confdefs.h <<EOF
1.1668 ++#define PACKAGE "$PACKAGE"
1.1669 ++EOF
1.1670 ++
1.1671 ++cat >> confdefs.h <<EOF
1.1672 ++#define VERSION "$VERSION"
1.1673 ++EOF
1.1674 ++
1.1675 ++
1.1676 ++
1.1677 ++missing_dir=`cd $ac_aux_dir && pwd`
1.1678 ++echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1.1679 ++echo "configure:866: checking for working aclocal" >&5
1.1680 ++# Run test in a subshell; some versions of sh will print an error if
1.1681 ++# an executable is not found, even if stderr is redirected.
1.1682 ++# Redirect stdin to placate older versions of autoconf. Sigh.
1.1683 ++if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1.1684 ++ ACLOCAL=aclocal
1.1685 ++ echo "$ac_t""found" 1>&6
1.1686 ++else
1.1687 ++ ACLOCAL="$missing_dir/missing aclocal"
1.1688 ++ echo "$ac_t""missing" 1>&6
1.1689 ++fi
1.1690 ++
1.1691 ++echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1.1692 ++echo "configure:879: checking for working autoconf" >&5
1.1693 ++# Run test in a subshell; some versions of sh will print an error if
1.1694 ++# an executable is not found, even if stderr is redirected.
1.1695 ++# Redirect stdin to placate older versions of autoconf. Sigh.
1.1696 ++if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1.1697 ++ AUTOCONF=autoconf
1.1698 ++ echo "$ac_t""found" 1>&6
1.1699 ++else
1.1700 ++ AUTOCONF="$missing_dir/missing autoconf"
1.1701 ++ echo "$ac_t""missing" 1>&6
1.1702 ++fi
1.1703 ++
1.1704 ++echo $ac_n "checking for working automake""... $ac_c" 1>&6
1.1705 ++echo "configure:892: checking for working automake" >&5
1.1706 ++# Run test in a subshell; some versions of sh will print an error if
1.1707 ++# an executable is not found, even if stderr is redirected.
1.1708 ++# Redirect stdin to placate older versions of autoconf. Sigh.
1.1709 ++if (automake --version) < /dev/null > /dev/null 2>&1; then
1.1710 ++ AUTOMAKE=automake
1.1711 ++ echo "$ac_t""found" 1>&6
1.1712 ++else
1.1713 ++ AUTOMAKE="$missing_dir/missing automake"
1.1714 ++ echo "$ac_t""missing" 1>&6
1.1715 ++fi
1.1716 ++
1.1717 ++echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1.1718 ++echo "configure:905: checking for working autoheader" >&5
1.1719 ++# Run test in a subshell; some versions of sh will print an error if
1.1720 ++# an executable is not found, even if stderr is redirected.
1.1721 ++# Redirect stdin to placate older versions of autoconf. Sigh.
1.1722 ++if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1.1723 ++ AUTOHEADER=autoheader
1.1724 ++ echo "$ac_t""found" 1>&6
1.1725 ++else
1.1726 ++ AUTOHEADER="$missing_dir/missing autoheader"
1.1727 ++ echo "$ac_t""missing" 1>&6
1.1728 ++fi
1.1729 ++
1.1730 ++echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1.1731 ++echo "configure:918: checking for working makeinfo" >&5
1.1732 ++# Run test in a subshell; some versions of sh will print an error if
1.1733 ++# an executable is not found, even if stderr is redirected.
1.1734 ++# Redirect stdin to placate older versions of autoconf. Sigh.
1.1735 ++if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1.1736 ++ MAKEINFO=makeinfo
1.1737 ++ echo "$ac_t""found" 1>&6
1.1738 ++else
1.1739 ++ MAKEINFO="$missing_dir/missing makeinfo"
1.1740 ++ echo "$ac_t""missing" 1>&6
1.1741 ++fi
1.1742 ++
1.1743 ++
1.1744 ++
1.1745 ++# FIXME: We temporarily define our own version of AC_PROG_CC. This is
1.1746 ++# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
1.1747 ++# are probably using a cross compiler, which will not be able to fully
1.1748 ++# link an executable. This should really be fixed in autoconf
1.1749 ++# itself.
1.1750 ++
1.1751 ++
1.1752 ++
1.1753 ++# Extract the first word of "gcc", so it can be a program name with args.
1.1754 ++set dummy gcc; ac_word=$2
1.1755 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1.1756 ++echo "configure:943: checking for $ac_word" >&5
1.1757 ++if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1.1758 ++ echo $ac_n "(cached) $ac_c" 1>&6
1.1759 ++else
1.1760 ++ if test -n "$CC"; then
1.1761 ++ ac_cv_prog_CC="$CC" # Let the user override the test.
1.1762 ++else
1.1763 ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1.1764 ++ ac_dummy="$PATH"
1.1765 ++ for ac_dir in $ac_dummy; do
1.1766 ++ test -z "$ac_dir" && ac_dir=.
1.1767 ++ if test -f $ac_dir/$ac_word; then
1.1768 ++ ac_cv_prog_CC="gcc"
1.1769 ++ break
1.1770 ++ fi
1.1771 ++ done
1.1772 ++ IFS="$ac_save_ifs"
1.1773 ++fi
1.1774 ++fi
1.1775 ++CC="$ac_cv_prog_CC"
1.1776 ++if test -n "$CC"; then
1.1777 ++ echo "$ac_t""$CC" 1>&6
1.1778 ++else
1.1779 ++ echo "$ac_t""no" 1>&6
1.1780 ++fi
1.1781 ++
1.1782 ++if test -z "$CC"; then
1.1783 ++ # Extract the first word of "cc", so it can be a program name with args.
1.1784 ++set dummy cc; ac_word=$2
1.1785 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1.1786 ++echo "configure:973: checking for $ac_word" >&5
1.1787 ++if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1.1788 ++ echo $ac_n "(cached) $ac_c" 1>&6
1.1789 ++else
1.1790 ++ if test -n "$CC"; then
1.1791 ++ ac_cv_prog_CC="$CC" # Let the user override the test.
1.1792 ++else
1.1793 ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1.1794 ++ ac_prog_rejected=no
1.1795 ++ ac_dummy="$PATH"
1.1796 ++ for ac_dir in $ac_dummy; do
1.1797 ++ test -z "$ac_dir" && ac_dir=.
1.1798 ++ if test -f $ac_dir/$ac_word; then
1.1799 ++ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1.1800 ++ ac_prog_rejected=yes
1.1801 ++ continue
1.1802 ++ fi
1.1803 ++ ac_cv_prog_CC="cc"
1.1804 ++ break
1.1805 ++ fi
1.1806 ++ done
1.1807 ++ IFS="$ac_save_ifs"
1.1808 ++if test $ac_prog_rejected = yes; then
1.1809 ++ # We found a bogon in the path, so make sure we never use it.
1.1810 ++ set dummy $ac_cv_prog_CC
1.1811 ++ shift
1.1812 ++ if test $# -gt 0; then
1.1813 ++ # We chose a different compiler from the bogus one.
1.1814 ++ # However, it has the same basename, so the bogon will be chosen
1.1815 ++ # first if we set CC to just the basename; use the full file name.
1.1816 ++ shift
1.1817 ++ set dummy "$ac_dir/$ac_word" "$@"
1.1818 ++ shift
1.1819 ++ ac_cv_prog_CC="$@"
1.1820 ++ fi
1.1821 ++fi
1.1822 ++fi
1.1823 ++fi
1.1824 ++CC="$ac_cv_prog_CC"
1.1825 ++if test -n "$CC"; then
1.1826 ++ echo "$ac_t""$CC" 1>&6
1.1827 ++else
1.1828 ++ echo "$ac_t""no" 1>&6
1.1829 ++fi
1.1830 ++
1.1831 ++ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1.1832 ++fi
1.1833 ++
1.1834 ++echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1.1835 ++echo "configure:1022: checking whether we are using GNU C" >&5
1.1836 ++if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1.1837 ++ echo $ac_n "(cached) $ac_c" 1>&6
1.1838 ++else
1.1839 ++ cat > conftest.c <<EOF
1.1840 ++#ifdef __GNUC__
1.1841 ++ yes;
1.1842 ++#endif
1.1843 ++EOF
1.1844 ++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1.1845 ++ ac_cv_prog_gcc=yes
1.1846 ++else
1.1847 ++ ac_cv_prog_gcc=no
1.1848 ++fi
1.1849 ++fi
1.1850 ++
1.1851 ++echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1.1852 ++
1.1853 ++if test $ac_cv_prog_gcc = yes; then
1.1854 ++ GCC=yes
1.1855 ++ ac_test_CFLAGS="${CFLAGS+set}"
1.1856 ++ ac_save_CFLAGS="$CFLAGS"
1.1857 ++ CFLAGS=
1.1858 ++ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1.1859 ++echo "configure:1046: checking whether ${CC-cc} accepts -g" >&5
1.1860 ++if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1.1861 ++ echo $ac_n "(cached) $ac_c" 1>&6
1.1862 ++else
1.1863 ++ echo 'void f(){}' > conftest.c
1.1864 ++if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1.1865 ++ ac_cv_prog_cc_g=yes
1.1866 ++else
1.1867 ++ ac_cv_prog_cc_g=no
1.1868 ++fi
1.1869 ++rm -f conftest*
1.1870 ++
1.1871 ++fi
1.1872 ++
1.1873 ++echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1.1874 ++ if test "$ac_test_CFLAGS" = set; then
1.1875 ++ CFLAGS="$ac_save_CFLAGS"
1.1876 ++ elif test $ac_cv_prog_cc_g = yes; then
1.1877 ++ CFLAGS="-g -O2"
1.1878 ++ else
1.1879 ++ CFLAGS="-O2"
1.1880 ++ fi
1.1881 ++else
1.1882 ++ GCC=
1.1883 ++ test "${CFLAGS+set}" = set || CFLAGS="-g"
1.1884 ++fi
1.1885 ++
1.1886 ++
1.1887 ++# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
1.1888 ++# run it explicitly here, it will be run implicitly before
1.1889 ++# NEWLIB_CONFIGURE, which doesn't work because that means that it will
1.1890 ++# be run before AC_CANONICAL_HOST.
1.1891 ++echo $ac_n "checking build system type""... $ac_c" 1>&6
1.1892 ++echo "configure:1079: checking build system type" >&5
1.1893 ++
1.1894 ++build_alias=$build
1.1895 ++case "$build_alias" in
1.1896 ++NONE)
1.1897 ++ case $nonopt in
1.1898 ++ NONE) build_alias=$host_alias ;;
1.1899 ++ *) build_alias=$nonopt ;;
1.1900 ++ esac ;;
1.1901 ++esac
1.1902 ++
1.1903 ++build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
1.1904 ++build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1.1905 ++build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1.1906 ++build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1.1907 ++echo "$ac_t""$build" 1>&6
1.1908 ++
1.1909 ++
1.1910 ++# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
1.1911 ++set dummy ${ac_tool_prefix}as; ac_word=$2
1.1912 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1.1913 ++echo "configure:1100: checking for $ac_word" >&5
1.1914 ++if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
1.1915 ++ echo $ac_n "(cached) $ac_c" 1>&6
1.1916 ++else
1.1917 ++ if test -n "$AS"; then
1.1918 ++ ac_cv_prog_AS="$AS" # Let the user override the test.
1.1919 ++else
1.1920 ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1.1921 ++ ac_dummy="$PATH"
1.1922 ++ for ac_dir in $ac_dummy; do
1.1923 ++ test -z "$ac_dir" && ac_dir=.
1.1924 ++ if test -f $ac_dir/$ac_word; then
1.1925 ++ ac_cv_prog_AS="${ac_tool_prefix}as"
1.1926 ++ break
1.1927 ++ fi
1.1928 ++ done
1.1929 ++ IFS="$ac_save_ifs"
1.1930 ++ test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as"
1.1931 ++fi
1.1932 ++fi
1.1933 ++AS="$ac_cv_prog_AS"
1.1934 ++if test -n "$AS"; then
1.1935 ++ echo "$ac_t""$AS" 1>&6
1.1936 ++else
1.1937 ++ echo "$ac_t""no" 1>&6
1.1938 ++fi
1.1939 ++
1.1940 ++
1.1941 ++
1.1942 ++# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
1.1943 ++set dummy ${ac_tool_prefix}ar; ac_word=$2
1.1944 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1.1945 ++echo "configure:1132: checking for $ac_word" >&5
1.1946 ++if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
1.1947 ++ echo $ac_n "(cached) $ac_c" 1>&6
1.1948 ++else
1.1949 ++ if test -n "$AR"; then
1.1950 ++ ac_cv_prog_AR="$AR" # Let the user override the test.
1.1951 ++else
1.1952 ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1.1953 ++ ac_dummy="$PATH"
1.1954 ++ for ac_dir in $ac_dummy; do
1.1955 ++ test -z "$ac_dir" && ac_dir=.
1.1956 ++ if test -f $ac_dir/$ac_word; then
1.1957 ++ ac_cv_prog_AR="${ac_tool_prefix}ar"
1.1958 ++ break
1.1959 ++ fi
1.1960 ++ done
1.1961 ++ IFS="$ac_save_ifs"
1.1962 ++ test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
1.1963 ++fi
1.1964 ++fi
1.1965 ++AR="$ac_cv_prog_AR"
1.1966 ++if test -n "$AR"; then
1.1967 ++ echo "$ac_t""$AR" 1>&6
1.1968 ++else
1.1969 ++ echo "$ac_t""no" 1>&6
1.1970 ++fi
1.1971 ++
1.1972 ++
1.1973 ++
1.1974 ++# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
1.1975 ++set dummy ${ac_tool_prefix}ranlib; ac_word=$2
1.1976 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1.1977 ++echo "configure:1164: checking for $ac_word" >&5
1.1978 ++if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1.1979 ++ echo $ac_n "(cached) $ac_c" 1>&6
1.1980 ++else
1.1981 ++ if test -n "$RANLIB"; then
1.1982 ++ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1.1983 ++else
1.1984 ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1.1985 ++ ac_dummy="$PATH"
1.1986 ++ for ac_dir in $ac_dummy; do
1.1987 ++ test -z "$ac_dir" && ac_dir=.
1.1988 ++ if test -f $ac_dir/$ac_word; then
1.1989 ++ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
1.1990 ++ break
1.1991 ++ fi
1.1992 ++ done
1.1993 ++ IFS="$ac_save_ifs"
1.1994 ++fi
1.1995 ++fi
1.1996 ++RANLIB="$ac_cv_prog_RANLIB"
1.1997 ++if test -n "$RANLIB"; then
1.1998 ++ echo "$ac_t""$RANLIB" 1>&6
1.1999 ++else
1.2000 ++ echo "$ac_t""no" 1>&6
1.2001 ++fi
1.2002 ++
1.2003 ++
1.2004 ++if test -z "$ac_cv_prog_RANLIB"; then
1.2005 ++if test -n "$ac_tool_prefix"; then
1.2006 ++ # Extract the first word of "ranlib", so it can be a program name with args.
1.2007 ++set dummy ranlib; ac_word=$2
1.2008 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1.2009 ++echo "configure:1196: checking for $ac_word" >&5
1.2010 ++if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1.2011 ++ echo $ac_n "(cached) $ac_c" 1>&6
1.2012 ++else
1.2013 ++ if test -n "$RANLIB"; then
1.2014 ++ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1.2015 ++else
1.2016 ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1.2017 ++ ac_dummy="$PATH"
1.2018 ++ for ac_dir in $ac_dummy; do
1.2019 ++ test -z "$ac_dir" && ac_dir=.
1.2020 ++ if test -f $ac_dir/$ac_word; then
1.2021 ++ ac_cv_prog_RANLIB="ranlib"
1.2022 ++ break
1.2023 ++ fi
1.2024 ++ done
1.2025 ++ IFS="$ac_save_ifs"
1.2026 ++ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1.2027 ++fi
1.2028 ++fi
1.2029 ++RANLIB="$ac_cv_prog_RANLIB"
1.2030 ++if test -n "$RANLIB"; then
1.2031 ++ echo "$ac_t""$RANLIB" 1>&6
1.2032 ++else
1.2033 ++ echo "$ac_t""no" 1>&6
1.2034 ++fi
1.2035 ++
1.2036 ++else
1.2037 ++ RANLIB=":"
1.2038 ++fi
1.2039 ++fi
1.2040 ++
1.2041 ++
1.2042 ++
1.2043 ++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1.2044 ++
1.2045 ++
1.2046 ++#AM_MAINTAINER_MODE
1.2047 ++
1.2048 ++# We need AM_EXEEXT to keep automake happy in cygnus mode. However,
1.2049 ++# at least currently, we never actually build a program, so we never
1.2050 ++# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
1.2051 ++# fails, because we are probably configuring with a cross compiler
1.2052 ++# which can't create executables. So we include AM_EXEEXT to keep
1.2053 ++# automake happy, but we don't execute it, since we don't care about
1.2054 ++# the result.
1.2055 ++if false; then
1.2056 ++
1.2057 ++
1.2058 ++echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
1.2059 ++echo "configure:1246: checking for executable suffix" >&5
1.2060 ++if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
1.2061 ++ echo $ac_n "(cached) $ac_c" 1>&6
1.2062 ++else
1.2063 ++ if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
1.2064 ++am_cv_exeext=.exe
1.2065 ++else
1.2066 ++cat > am_c_test.c << 'EOF'
1.2067 ++int main() {
1.2068 ++/* Nothing needed here */
1.2069 ++}
1.2070 ++EOF
1.2071 ++${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
1.2072 ++am_cv_exeext=
1.2073 ++for file in am_c_test.*; do
1.2074 ++ case $file in
1.2075 ++ *.c) ;;
1.2076 ++ *.o) ;;
1.2077 ++ *) am_cv_exeext=`echo $file | sed -e s/am_c_test//` ;;
1.2078 ++ esac
1.2079 ++done
1.2080 ++rm -f am_c_test*
1.2081 ++fi
1.2082 ++
1.2083 ++test x"${am_cv_exeext}" = x && am_cv_exeext=no
1.2084 ++fi
1.2085 ++EXEEXT=""
1.2086 ++test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
1.2087 ++echo "$ac_t""${am_cv_exeext}" 1>&6
1.2088 ++
1.2089 ++fi
1.2090 ++
1.2091 ++. ${newlib_basedir}/configure.host
1.2092 ++
1.2093 ++case ${newlib_basedir} in
1.2094 ++/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;;
1.2095 ++*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;;
1.2096 ++esac
1.2097 ++
1.2098 ++newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include"
1.2099 ++case "${host}" in
1.2100 ++ *-*-cygwin32*)
1.2101 ++ newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/include"
1.2102 ++ ;;
1.2103 ++esac
1.2104 ++
1.2105 ++newlib_cflags="${newlib_cflags} -fno-builtin"
1.2106 ++
1.2107 ++NEWLIB_CFLAGS=${newlib_cflags}
1.2108 ++
1.2109 ++
1.2110 ++
1.2111 ++
1.2112 ++
1.2113 ++
1.2114 ++trap '' 1 2 15
1.2115 ++cat > confcache <<\EOF
1.2116 ++# This file is a shell script that caches the results of configure
1.2117 ++# tests run on this system so they can be shared between configure
1.2118 ++# scripts and configure runs. It is not useful on other systems.
1.2119 ++# If it contains results you don't want to keep, you may remove or edit it.
1.2120 ++#
1.2121 ++# By default, configure uses ./config.cache as the cache file,
1.2122 ++# creating it if it does not exist already. You can give configure
1.2123 ++# the --cache-file=FILE option to use a different cache file; that is
1.2124 ++# what configure does when it calls configure scripts in
1.2125 ++# subdirectories, so they share the cache.
1.2126 ++# Giving --cache-file=/dev/null disables caching, for debugging configure.
1.2127 ++# config.status only pays attention to the cache file if you give it the
1.2128 ++# --recheck option to rerun configure.
1.2129 ++#
1.2130 ++EOF
1.2131 ++# The following way of writing the cache mishandles newlines in values,
1.2132 ++# but we know of no workaround that is simple, portable, and efficient.
1.2133 ++# So, don't put newlines in cache variables' values.
1.2134 ++# Ultrix sh set writes to stderr and can't be redirected directly,
1.2135 ++# and sets the high bit in the cache file unless we assign to the vars.
1.2136 ++(set) 2>&1 |
1.2137 ++ case `(ac_space=' '; set | grep ac_space) 2>&1` in
1.2138 ++ *ac_space=\ *)
1.2139 ++ # `set' does not quote correctly, so add quotes (double-quote substitution
1.2140 ++ # turns \\\\ into \\, and sed turns \\ into \).
1.2141 ++ sed -n \
1.2142 ++ -e "s/'/'\\\\''/g" \
1.2143 ++ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
1.2144 ++ ;;
1.2145 ++ *)
1.2146 ++ # `set' quotes correctly as required by POSIX, so do not add quotes.
1.2147 ++ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
1.2148 ++ ;;
1.2149 ++ esac >> confcache
1.2150 ++if cmp -s $cache_file confcache; then
1.2151 ++ :
1.2152 ++else
1.2153 ++ if test -w $cache_file; then
1.2154 ++ echo "updating cache $cache_file"
1.2155 ++ cat confcache > $cache_file
1.2156 ++ else
1.2157 ++ echo "not updating unwritable cache $cache_file"
1.2158 ++ fi
1.2159 ++fi
1.2160 ++rm -f confcache
1.2161 ++
1.2162 ++trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
1.2163 ++
1.2164 ++test "x$prefix" = xNONE && prefix=$ac_default_prefix
1.2165 ++# Let make expand exec_prefix.
1.2166 ++test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1.2167 ++
1.2168 ++# Any assignment to VPATH causes Sun make to only execute
1.2169 ++# the first set of double-colon rules, so remove it if not needed.
1.2170 ++# If there is a colon in the path, we need to keep it.
1.2171 ++if test "x$srcdir" = x.; then
1.2172 ++ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
1.2173 ++fi
1.2174 ++
1.2175 ++trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
1.2176 ++
1.2177 ++# Transform confdefs.h into DEFS.
1.2178 ++# Protect against shell expansion while executing Makefile rules.
1.2179 ++# Protect against Makefile macro expansion.
1.2180 ++cat > conftest.defs <<\EOF
1.2181 ++s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
1.2182 ++s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
1.2183 ++s%\[%\\&%g
1.2184 ++s%\]%\\&%g
1.2185 ++s%\$%$$%g
1.2186 ++EOF
1.2187 ++DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
1.2188 ++rm -f conftest.defs
1.2189 ++
1.2190 ++
1.2191 ++# Without the "./", some shells look in PATH for config.status.
1.2192 ++: ${CONFIG_STATUS=./config.status}
1.2193 ++
1.2194 ++echo creating $CONFIG_STATUS
1.2195 ++rm -f $CONFIG_STATUS
1.2196 ++cat > $CONFIG_STATUS <<EOF
1.2197 ++#! /bin/sh
1.2198 ++# Generated automatically by configure.
1.2199 ++# Run this file to recreate the current configuration.
1.2200 ++# This directory was configured as follows,
1.2201 ++# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1.2202 ++#
1.2203 ++# $0 $ac_configure_args
1.2204 ++#
1.2205 ++# Compiler output produced by configure, useful for debugging
1.2206 ++# configure, is in ./config.log if it exists.
1.2207 ++
1.2208 ++ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
1.2209 ++for ac_option
1.2210 ++do
1.2211 ++ case "\$ac_option" in
1.2212 ++ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
1.2213 ++ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
1.2214 ++ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
1.2215 ++ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
1.2216 ++ echo "$CONFIG_STATUS generated by autoconf version 2.13"
1.2217 ++ exit 0 ;;
1.2218 ++ -help | --help | --hel | --he | --h)
1.2219 ++ echo "\$ac_cs_usage"; exit 0 ;;
1.2220 ++ *) echo "\$ac_cs_usage"; exit 1 ;;
1.2221 ++ esac
1.2222 ++done
1.2223 ++
1.2224 ++ac_given_srcdir=$srcdir
1.2225 ++ac_given_INSTALL="$INSTALL"
1.2226 ++
1.2227 ++trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
1.2228 ++EOF
1.2229 ++cat >> $CONFIG_STATUS <<EOF
1.2230 ++
1.2231 ++# Protect against being on the right side of a sed subst in config.status.
1.2232 ++sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
1.2233 ++ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
1.2234 ++$ac_vpsub
1.2235 ++$extrasub
1.2236 ++s%@SHELL@%$SHELL%g
1.2237 ++s%@CFLAGS@%$CFLAGS%g
1.2238 ++s%@CPPFLAGS@%$CPPFLAGS%g
1.2239 ++s%@CXXFLAGS@%$CXXFLAGS%g
1.2240 ++s%@FFLAGS@%$FFLAGS%g
1.2241 ++s%@DEFS@%$DEFS%g
1.2242 ++s%@LDFLAGS@%$LDFLAGS%g
1.2243 ++s%@LIBS@%$LIBS%g
1.2244 ++s%@exec_prefix@%$exec_prefix%g
1.2245 ++s%@prefix@%$prefix%g
1.2246 ++s%@program_transform_name@%$program_transform_name%g
1.2247 ++s%@bindir@%$bindir%g
1.2248 ++s%@sbindir@%$sbindir%g
1.2249 ++s%@libexecdir@%$libexecdir%g
1.2250 ++s%@datadir@%$datadir%g
1.2251 ++s%@sysconfdir@%$sysconfdir%g
1.2252 ++s%@sharedstatedir@%$sharedstatedir%g
1.2253 ++s%@localstatedir@%$localstatedir%g
1.2254 ++s%@libdir@%$libdir%g
1.2255 ++s%@includedir@%$includedir%g
1.2256 ++s%@oldincludedir@%$oldincludedir%g
1.2257 ++s%@infodir@%$infodir%g
1.2258 ++s%@mandir@%$mandir%g
1.2259 ++s%@newlib_basedir@%$newlib_basedir%g
1.2260 ++s%@host@%$host%g
1.2261 ++s%@host_alias@%$host_alias%g
1.2262 ++s%@host_cpu@%$host_cpu%g
1.2263 ++s%@host_vendor@%$host_vendor%g
1.2264 ++s%@host_os@%$host_os%g
1.2265 ++s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
1.2266 ++s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
1.2267 ++s%@INSTALL_DATA@%$INSTALL_DATA%g
1.2268 ++s%@PACKAGE@%$PACKAGE%g
1.2269 ++s%@VERSION@%$VERSION%g
1.2270 ++s%@ACLOCAL@%$ACLOCAL%g
1.2271 ++s%@AUTOCONF@%$AUTOCONF%g
1.2272 ++s%@AUTOMAKE@%$AUTOMAKE%g
1.2273 ++s%@AUTOHEADER@%$AUTOHEADER%g
1.2274 ++s%@MAKEINFO@%$MAKEINFO%g
1.2275 ++s%@SET_MAKE@%$SET_MAKE%g
1.2276 ++s%@CC@%$CC%g
1.2277 ++s%@build@%$build%g
1.2278 ++s%@build_alias@%$build_alias%g
1.2279 ++s%@build_cpu@%$build_cpu%g
1.2280 ++s%@build_vendor@%$build_vendor%g
1.2281 ++s%@build_os@%$build_os%g
1.2282 ++s%@AS@%$AS%g
1.2283 ++s%@AR@%$AR%g
1.2284 ++s%@RANLIB@%$RANLIB%g
1.2285 ++s%@EXEEXT@%$EXEEXT%g
1.2286 ++s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g
1.2287 ++s%@machine_dir@%$machine_dir%g
1.2288 ++s%@sys_dir@%$sys_dir%g
1.2289 ++
1.2290 ++CEOF
1.2291 ++EOF
1.2292 ++
1.2293 ++cat >> $CONFIG_STATUS <<\EOF
1.2294 ++
1.2295 ++# Split the substitutions into bite-sized pieces for seds with
1.2296 ++# small command number limits, like on Digital OSF/1 and HP-UX.
1.2297 ++ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
1.2298 ++ac_file=1 # Number of current file.
1.2299 ++ac_beg=1 # First line for current file.
1.2300 ++ac_end=$ac_max_sed_cmds # Line after last line for current file.
1.2301 ++ac_more_lines=:
1.2302 ++ac_sed_cmds=""
1.2303 ++while $ac_more_lines; do
1.2304 ++ if test $ac_beg -gt 1; then
1.2305 ++ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
1.2306 ++ else
1.2307 ++ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
1.2308 ++ fi
1.2309 ++ if test ! -s conftest.s$ac_file; then
1.2310 ++ ac_more_lines=false
1.2311 ++ rm -f conftest.s$ac_file
1.2312 ++ else
1.2313 ++ if test -z "$ac_sed_cmds"; then
1.2314 ++ ac_sed_cmds="sed -f conftest.s$ac_file"
1.2315 ++ else
1.2316 ++ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
1.2317 ++ fi
1.2318 ++ ac_file=`expr $ac_file + 1`
1.2319 ++ ac_beg=$ac_end
1.2320 ++ ac_end=`expr $ac_end + $ac_max_sed_cmds`
1.2321 ++ fi
1.2322 ++done
1.2323 ++if test -z "$ac_sed_cmds"; then
1.2324 ++ ac_sed_cmds=cat
1.2325 ++fi
1.2326 ++EOF
1.2327 ++
1.2328 ++cat >> $CONFIG_STATUS <<EOF
1.2329 ++
1.2330 ++CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
1.2331 ++EOF
1.2332 ++cat >> $CONFIG_STATUS <<\EOF
1.2333 ++for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
1.2334 ++ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
1.2335 ++ case "$ac_file" in
1.2336 ++ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
1.2337 ++ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1.2338 ++ *) ac_file_in="${ac_file}.in" ;;
1.2339 ++ esac
1.2340 ++
1.2341 ++ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
1.2342 ++
1.2343 ++ # Remove last slash and all that follows it. Not all systems have dirname.
1.2344 ++ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
1.2345 ++ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
1.2346 ++ # The file is in a subdirectory.
1.2347 ++ test ! -d "$ac_dir" && mkdir "$ac_dir"
1.2348 ++ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
1.2349 ++ # A "../" for each directory in $ac_dir_suffix.
1.2350 ++ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
1.2351 ++ else
1.2352 ++ ac_dir_suffix= ac_dots=
1.2353 ++ fi
1.2354 ++
1.2355 ++ case "$ac_given_srcdir" in
1.2356 ++ .) srcdir=.
1.2357 ++ if test -z "$ac_dots"; then top_srcdir=.
1.2358 ++ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
1.2359 ++ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
1.2360 ++ *) # Relative path.
1.2361 ++ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
1.2362 ++ top_srcdir="$ac_dots$ac_given_srcdir" ;;
1.2363 ++ esac
1.2364 ++
1.2365 ++ case "$ac_given_INSTALL" in
1.2366 ++ [/$]*) INSTALL="$ac_given_INSTALL" ;;
1.2367 ++ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
1.2368 ++ esac
1.2369 ++
1.2370 ++ echo creating "$ac_file"
1.2371 ++ rm -f "$ac_file"
1.2372 ++ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
1.2373 ++ case "$ac_file" in
1.2374 ++ *Makefile*) ac_comsub="1i\\
1.2375 ++# $configure_input" ;;
1.2376 ++ *) ac_comsub= ;;
1.2377 ++ esac
1.2378 ++
1.2379 ++ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
1.2380 ++ sed -e "$ac_comsub
1.2381 ++s%@configure_input@%$configure_input%g
1.2382 ++s%@srcdir@%$srcdir%g
1.2383 ++s%@top_srcdir@%$top_srcdir%g
1.2384 ++s%@INSTALL@%$INSTALL%g
1.2385 ++" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
1.2386 ++fi; done
1.2387 ++rm -f conftest.s*
1.2388 ++
1.2389 ++EOF
1.2390 ++cat >> $CONFIG_STATUS <<EOF
1.2391 ++
1.2392 ++EOF
1.2393 ++cat >> $CONFIG_STATUS <<\EOF
1.2394 ++
1.2395 ++exit 0
1.2396 ++EOF
1.2397 ++chmod +x $CONFIG_STATUS
1.2398 ++rm -fr confdefs* $ac_clean_files
1.2399 ++test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
1.2400 ++
1.2401 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/configure.in newlib-1.8.2-aica/newlib/libc/sys/aica/configure.in
1.2402 +--- newlib-1.8.2/newlib/libc/sys/aica/configure.in 1970-01-01 10:00:00.000000000 +1000
1.2403 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/configure.in 2008-08-13 11:54:44.000000000 +1000
1.2404 +@@ -0,0 +1,12 @@
1.2405 ++dnl This is the newlib/libc/sys/sh configure.in file.
1.2406 ++dnl Process this file with autoconf to produce a configure script.
1.2407 ++
1.2408 ++AC_PREREQ(2.5)
1.2409 ++AC_INIT(sbrk.c)
1.2410 ++
1.2411 ++dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
1.2412 ++AC_CONFIG_AUX_DIR(../../../..)
1.2413 ++
1.2414 ++NEWLIB_CONFIGURE(../../..)
1.2415 ++
1.2416 ++AC_OUTPUT(Makefile)
1.2417 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/creat.c newlib-1.8.2-aica/newlib/libc/sys/aica/creat.c
1.2418 +--- newlib-1.8.2/newlib/libc/sys/aica/creat.c 1970-01-01 10:00:00.000000000 +1000
1.2419 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/creat.c 2008-08-13 11:54:44.000000000 +1000
1.2420 +@@ -0,0 +1,22 @@
1.2421 ++#include <sys/types.h>
1.2422 ++#include <sys/fcntl.h>
1.2423 ++
1.2424 ++#include "vfs.h"
1.2425 ++
1.2426 ++int
1.2427 ++creat (const char *path, mode_t mode)
1.2428 ++{
1.2429 ++ char *obj = _newlib_vfs_new_string (path);
1.2430 ++
1.2431 ++ struct media_ops *mops = _newlib_vfs_get_media_ops (path);
1.2432 ++ struct file *pf = mops->creat (obj, mode);
1.2433 ++
1.2434 ++ _newlib_vfs_delete_string (obj);
1.2435 ++
1.2436 ++ if (pf != NULL)
1.2437 ++ {
1.2438 ++ return _newlib_vfs_insert_file (pf);
1.2439 ++ }
1.2440 ++
1.2441 ++ return -1;
1.2442 ++}
1.2443 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/crt0.S newlib-1.8.2-aica/newlib/libc/sys/aica/crt0.S
1.2444 +--- newlib-1.8.2/newlib/libc/sys/aica/crt0.S 1970-01-01 10:00:00.000000000 +1000
1.2445 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/crt0.S 2008-08-13 13:08:13.000000000 +1000
1.2446 +@@ -0,0 +1,165 @@
1.2447 ++.section .text
1.2448 ++.code 32
1.2449 ++.align 0
1.2450 ++.global start
1.2451 ++.global ___exit
1.2452 ++.global _atexit
1.2453 ++start:
1.2454 ++
1.2455 ++/* Start by setting up a stack */
1.2456 ++ /* Set up the stack pointer to a fixed value */
1.2457 ++ ldr r3, .LC0
1.2458 ++ mov sp, r3
1.2459 ++ /* Setup a default stack-limit in-case the code has been
1.2460 ++ compiled with "-mapcs-stack-check". Hard-wiring this value
1.2461 ++ is not ideal, since there is currently no support for
1.2462 ++ checking that the heap and stack have not collided, or that
1.2463 ++ this default 64k is enough for the program being executed.
1.2464 ++ However, it ensures that this simple crt0 world will not
1.2465 ++ immediately cause an overflow event: */
1.2466 ++ sub sl, sp, #64 << 10 /* Still assumes 256bytes below sl */
1.2467 ++
1.2468 ++ mov a2, #0 /* Second arg: fill value */
1.2469 ++ mov fp, a2 /* Null frame pointer */
1.2470 ++ mov r7, a2 /* Null frame pointer for Thumb */
1.2471 ++
1.2472 ++ ldr a1, .LC1 /* First arg: start of memory block */
1.2473 ++ ldr a3, .LC2
1.2474 ++ sub a3, a3, a1 /* Third arg: length of block */
1.2475 ++
1.2476 ++
1.2477 ++#ifdef __thumb__ /* Enter Thumb mode.... */
1.2478 ++
1.2479 ++ add a4, pc, #1 /* Get the address of the Thumb block */
1.2480 ++ bx a4 /* Go there and start Thumb decoding */
1.2481 ++
1.2482 ++ .code 16
1.2483 ++ .global __change_mode
1.2484 ++ .thumb_func
1.2485 ++__change_mode:
1.2486 ++#endif
1.2487 ++
1.2488 ++ bl memset
1.2489 ++ mov r0, #0 /* no arguments */
1.2490 ++ mov r1, #0 /* no argv either */
1.2491 ++
1.2492 ++ /* Parse string at r1 */
1.2493 ++ mov r0, #0 /* count of arguments so far */
1.2494 ++.LC10:
1.2495 ++/* Skip leading blanks */
1.2496 ++#ifdef __thumb__
1.2497 ++ ldrb r3, [r1]
1.2498 ++ add r1, #1
1.2499 ++#else
1.2500 ++ ldrb r3, [r1], #1
1.2501 ++#endif
1.2502 ++ cmp r3, #0
1.2503 ++ beq .LC12
1.2504 ++ cmp r3, #' '
1.2505 ++ beq .LC10
1.2506 ++
1.2507 ++/* See whether we are scanning a string */
1.2508 ++ cmp r3, #'"'
1.2509 ++#ifdef __thumb__
1.2510 ++ beq .LC20
1.2511 ++ cmp r3, #'\''
1.2512 ++ bne .LC21
1.2513 ++.LC20:
1.2514 ++ mov r2, r3
1.2515 ++ b .LC22
1.2516 ++
1.2517 ++.LC21:
1.2518 ++ mov r2, #' ' /* terminator type */
1.2519 ++ sub r1, r1, #1 /* adjust back to point at start char */
1.2520 ++.LC22:
1.2521 ++#else
1.2522 ++ cmpne r3, #'\''
1.2523 ++ moveq r2, r3
1.2524 ++ movne r2, #' ' /* terminator type */
1.2525 ++ subne r1, r1, #1 /* adjust back to point at start char */
1.2526 ++#endif
1.2527 ++
1.2528 ++/* Stack a pointer to the current argument */
1.2529 ++#ifdef __thumb__
1.2530 ++ push {r1}
1.2531 ++#else
1.2532 ++ stmfd sp!, {r1}
1.2533 ++#endif
1.2534 ++ add r0, r0, #1
1.2535 ++.LC11:
1.2536 ++#ifdef __thumb__
1.2537 ++ ldrb r3, [r1]
1.2538 ++ add r1, #1
1.2539 ++#else
1.2540 ++ ldrb r3, [r1], #1
1.2541 ++#endif
1.2542 ++ cmp r3, #0
1.2543 ++ beq .LC12
1.2544 ++ cmp r2, r3 /* reached terminator? */
1.2545 ++ bne .LC11
1.2546 ++ mov r2, #0
1.2547 ++ sub r3, r1, #1
1.2548 ++ strb r2, [r3] /* terminate the arg string */
1.2549 ++ b .LC10
1.2550 ++
1.2551 ++.LC12:
1.2552 ++ mov r1, sp /* point at stacked arg pointers */
1.2553 ++ /* We've now got the stacked args in order reverse the */
1.2554 ++#ifdef __thumb__
1.2555 ++ mov r2, r0
1.2556 ++ lsl r2, #2
1.2557 ++ add r2, sp
1.2558 ++ mov r3, sp
1.2559 ++.LC15: cmp r2, r3
1.2560 ++ bls .LC14
1.2561 ++ sub r2, #4
1.2562 ++ ldr r4, [r2]
1.2563 ++ ldr r5, [r3]
1.2564 ++ str r5, [r2]
1.2565 ++ str r4, [r3]
1.2566 ++ add r3, #4
1.2567 ++ b .LC15
1.2568 ++.LC14:
1.2569 ++#else
1.2570 ++ add r2, sp, r0, LSL #2 /* End of args */
1.2571 ++ mov r3, sp /* Start of args */
1.2572 ++.LC13: cmp r2, r3
1.2573 ++ ldrhi r4,[r2, #-4] /* Reverse ends of list */
1.2574 ++ ldrhi r5, [r3]
1.2575 ++ strhi r5, [r2, #-4]!
1.2576 ++ strhi r4, [r3], #4
1.2577 ++ bhi .LC13
1.2578 ++#endif
1.2579 ++
1.2580 ++ bl main
1.2581 ++
1.2582 ++ bl exit /* Should not return */
1.2583 ++
1.2584 ++#ifdef __thumb__
1.2585 ++ /* Come out of Thumb mode... This code should be redundant... */
1.2586 ++
1.2587 ++ mov a4, pc
1.2588 ++ bx a4
1.2589 ++
1.2590 ++ .code 32
1.2591 ++ .global change_back
1.2592 ++change_back:
1.2593 ++ /* Halt the execution. This code should never be executed. */
1.2594 ++ /*
1.2595 ++ ** With no debug monitor, this probably aborts (eventually).
1.2596 ++ ** With a Demon debug monitor, this halts cleanly.
1.2597 ++ ** With an Angel debug monitor, this will report 'Unknown SWI'.
1.2598 ++ */
1.2599 ++ swi 0
1.2600 ++#endif
1.2601 ++
1.2602 ++ /* For Thumb, constants must be after the code since only
1.2603 ++ positive offsets are supported for PC relative addresses. */
1.2604 ++
1.2605 ++ .align 0
1.2606 ++.LC0:
1.2607 ++.LC1:
1.2608 ++ .word __bss_start__
1.2609 ++.LC2:
1.2610 ++ .word __bss_end__
1.2611 ++
1.2612 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/dcload.S newlib-1.8.2-aica/newlib/libc/sys/aica/dcload.S
1.2613 +--- newlib-1.8.2/newlib/libc/sys/aica/dcload.S 1970-01-01 10:00:00.000000000 +1000
1.2614 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/dcload.S 2008-08-13 13:57:28.000000000 +1000
1.2615 +@@ -0,0 +1,21 @@
1.2616 ++.text
1.2617 ++.align 2
1.2618 ++.global dcloadsyscall
1.2619 ++.type dcloadsyscall, %function
1.2620 ++dcloadsyscall:
1.2621 ++ @ args = 0, pretend = 0, frame = 0
1.2622 ++ @ frame_needed = 0, uses_anonymous_args = 0
1.2623 ++ @ link register save eliminated.
1.2624 ++ mov ip, #48
1.2625 ++ str r1, [ip, #4]
1.2626 ++ str r2, [ip, #8]
1.2627 ++ str r3, [ip, #12]
1.2628 ++ str r0, [ip, #0]
1.2629 ++ @ lr needed for prologue
1.2630 ++.L2:
1.2631 ++ ldr r3, [ip, #0]
1.2632 ++ cmn r3, #1
1.2633 ++ bne .L2
1.2634 ++ ldr r0, [ip, #4]
1.2635 ++ mov pc, lr
1.2636 ++ .size dcloadsyscall, .-dcloadsyscall
1.2637 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/dcload.c newlib-1.8.2-aica/newlib/libc/sys/aica/dcload.c
1.2638 +--- newlib-1.8.2/newlib/libc/sys/aica/dcload.c 1970-01-01 10:00:00.000000000 +1000
1.2639 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/dcload.c 2008-08-13 12:10:51.000000000 +1000
1.2640 +@@ -0,0 +1,17 @@
1.2641 ++#define SYSCALL_BASE 0x00000030
1.2642 ++
1.2643 ++struct syscall_struct {
1.2644 ++ unsigned int syscall;
1.2645 ++ unsigned int arg1, arg2, arg3;
1.2646 ++};
1.2647 ++
1.2648 ++unsigned int dcloadsyscall(unsigned int syscall, unsigned int arg1, unsigned int arg2, unsigned int arg3)
1.2649 ++{
1.2650 ++ volatile struct syscall_struct *p = (struct syscall_struct *)(SYSCALL_BASE);
1.2651 ++ p->arg1 = arg1;
1.2652 ++ p->arg2 = arg2;
1.2653 ++ p->arg3 = arg3;
1.2654 ++ p->syscall = syscall;
1.2655 ++ while( p->syscall != 0xFFFFFFFF );
1.2656 ++ return p->arg1;
1.2657 ++}
1.2658 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/dcload_vfs.c newlib-1.8.2-aica/newlib/libc/sys/aica/dcload_vfs.c
1.2659 +--- newlib-1.8.2/newlib/libc/sys/aica/dcload_vfs.c 1970-01-01 10:00:00.000000000 +1000
1.2660 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/dcload_vfs.c 2008-08-13 18:19:05.000000000 +1000
1.2661 +@@ -0,0 +1,225 @@
1.2662 ++/* Support routines for host access via Andrew K's dcload. dcload offers
1.2663 ++ full host file-system access along with a few POSIX-like functions. */
1.2664 ++
1.2665 ++/* FIXME: If the host is returning negative values (error codes), then
1.2666 ++ we need to assign the proper value to errno and return -1 as per newlib's
1.2667 ++ conventions. */
1.2668 ++
1.2669 ++/* FIXME: Split some of this off into a separate file, dcload.c. This will
1.2670 ++ contain public functions that coincide with the prototypes in
1.2671 ++ include/dcload.h */
1.2672 ++
1.2673 ++#include <sys/types.h>
1.2674 ++#include <sys/stat.h>
1.2675 ++#include <errno.h>
1.2676 ++#include <stdlib.h>
1.2677 ++
1.2678 ++#include "vfs.h"
1.2679 ++
1.2680 ++static struct media_ops dcload_host_media_ops;
1.2681 ++static struct file_ops dcload_host_file_ops;
1.2682 ++
1.2683 ++/* True if we have console/file-system access on the host */
1.2684 ++static int host_enabled = 1;
1.2685 ++
1.2686 ++/* Determine whether we're loaded under dcload and if so, whether or not
1.2687 ++ the console/file-server is enabled. If the console/file-server isn't
1.2688 ++ enabled, then we won't have anything meaningful to do in the host access
1.2689 ++ routines, so they'll be replaced with invalid media/file ops in our init
1.2690 ++ routine. */
1.2691 ++
1.2692 ++int _newlib_vfs_is_dcload (void)
1.2693 ++{
1.2694 ++ return 1;
1.2695 ++}
1.2696 ++
1.2697 ++void _newlib_vfs_dcload_init (void)
1.2698 ++{
1.2699 ++ _newlib_vfs_initialized = VFS_LOADER_DCLOAD_NOHOST;
1.2700 ++
1.2701 ++ if (host_enabled)
1.2702 ++ {
1.2703 ++ /* FIXME: Rework this... */
1.2704 ++ struct file * stdin_file = _newlib_vfs_first_file;
1.2705 ++ struct file * stdout_file = stdin_file->next;
1.2706 ++ struct file * stderr_file = stdout_file->next;
1.2707 ++
1.2708 ++ _newlib_vfs_initialized = VFS_LOADER_DCLOAD_HOST;
1.2709 ++ _newlib_vfs_host_media_ops = &dcload_host_media_ops;
1.2710 ++
1.2711 ++ /* Reroute stdin, stdout, and stderr through dcload's host console. */
1.2712 ++ stdin_file->fops = &dcload_host_file_ops;
1.2713 ++ stdout_file->fops = &dcload_host_file_ops;
1.2714 ++ stderr_file->fops = &dcload_host_file_ops;
1.2715 ++ }
1.2716 ++
1.2717 ++ /* All media ops are initially set to invalid so our work is done. */
1.2718 ++}
1.2719 ++
1.2720 ++extern int dcloadsyscall (int func, ...);
1.2721 ++
1.2722 ++/* dcload host media operations */
1.2723 ++
1.2724 ++/* Perform the open/creat syscall and allocate space for a new file if
1.2725 ++ we get a valid fd. Otherwise return the errno and NULL on errror. */
1.2726 ++static struct file *do_open_media_op (int func, const char *obj, int arg, ...)
1.2727 ++{
1.2728 ++ struct file *pf;
1.2729 ++ int res = dcloadsyscall (func, obj, arg);
1.2730 ++ if (res >= 0)
1.2731 ++ {
1.2732 ++ pf = (struct file *) malloc (sizeof (struct file));
1.2733 ++
1.2734 ++ if (pf)
1.2735 ++ {
1.2736 ++ /* The library fd is set in _newlib_vfs_insert_file */
1.2737 ++ pf->next = NULL;
1.2738 ++ pf->fd = 0;
1.2739 ++ pf->media_fd = res;
1.2740 ++ pf->fops = &dcload_host_file_ops;
1.2741 ++ pf->specifics = NULL;
1.2742 ++ return pf;
1.2743 ++ }
1.2744 ++ }
1.2745 ++
1.2746 ++ return NULL;
1.2747 ++}
1.2748 ++
1.2749 ++#define OPEN_NR 2
1.2750 ++static struct file *dcload_open_media_op (const char *obj, int flags,
1.2751 ++ mode_t mode)
1.2752 ++{
1.2753 ++ return do_open_media_op (OPEN_NR, obj, flags, mode);
1.2754 ++}
1.2755 ++
1.2756 ++#define CREAT_NR 4
1.2757 ++static struct file *dcload_creat_media_op (const char *obj, mode_t mode)
1.2758 ++{
1.2759 ++ return do_open_media_op (CREAT_NR, obj, mode);
1.2760 ++}
1.2761 ++
1.2762 ++#define LINK_NR 5
1.2763 ++static int dcload_link_media_op (const char *old_obj, const char *new_obj)
1.2764 ++{
1.2765 ++ return dcloadsyscall (LINK_NR, old_obj, new_obj);
1.2766 ++}
1.2767 ++
1.2768 ++#define UNLINK_NR 6
1.2769 ++static int dcload_unlink_media_op (const char *obj)
1.2770 ++{
1.2771 ++ return dcloadsyscall (UNLINK_NR, obj);
1.2772 ++}
1.2773 ++
1.2774 ++#define STAT_NR 12
1.2775 ++static int dcload_stat_media_op (const char *obj, struct stat *pstat)
1.2776 ++{
1.2777 ++ return dcloadsyscall (STAT_NR, obj, pstat);
1.2778 ++}
1.2779 ++
1.2780 ++#define CHMOD_NR 8
1.2781 ++static int dcload_chmod_media_op (const char *obj, mode_t mode)
1.2782 ++{
1.2783 ++ return dcloadsyscall (CHMOD_NR, obj, mode);
1.2784 ++}
1.2785 ++
1.2786 ++#define CHDIR_NR 7
1.2787 ++static int dcload_chdir_media_op (const char *obj)
1.2788 ++{
1.2789 ++ return dcloadsyscall (CHDIR_NR, obj);
1.2790 ++}
1.2791 ++
1.2792 ++/* dcload host file operations */
1.2793 ++
1.2794 ++static size_t do_rw_file_op (int func, struct file *pf, void *buf, size_t cnt)
1.2795 ++{
1.2796 ++ return dcloadsyscall (func, pf->media_fd, buf, cnt);
1.2797 ++}
1.2798 ++
1.2799 ++#define READ_NR 0
1.2800 ++static size_t dcload_read_file_op (struct file *pf, void *buf, size_t cnt)
1.2801 ++{
1.2802 ++ return do_rw_file_op (READ_NR, pf, buf, cnt);
1.2803 ++}
1.2804 ++
1.2805 ++#define WRITE_NR 1
1.2806 ++static size_t dcload_write_file_op (struct file *pf, void *buf, size_t cnt)
1.2807 ++{
1.2808 ++ return do_rw_file_op (WRITE_NR, pf, buf, cnt);
1.2809 ++}
1.2810 ++
1.2811 ++#define LSEEK_NR 9
1.2812 ++static off_t dcload_lseek_file_op (struct file *pf, off_t pos, int whence)
1.2813 ++{
1.2814 ++ return dcloadsyscall (LSEEK_NR, pf->media_fd, pos, whence);
1.2815 ++}
1.2816 ++
1.2817 ++#define CLOSE_NR 3
1.2818 ++static int dcload_close_file_op (struct file *pf)
1.2819 ++{
1.2820 ++ return dcloadsyscall (CLOSE_NR, pf->media_fd);
1.2821 ++}
1.2822 ++
1.2823 ++#define FSTAT_NR 10
1.2824 ++static int dcload_fstat_file_op (struct file *pf, struct stat *pstat)
1.2825 ++{
1.2826 ++ return dcloadsyscall (FSTAT_NR, pf->media_fd, pstat);
1.2827 ++}
1.2828 ++
1.2829 ++#define EXIT_NR 15
1.2830 ++void _newlib_vfs_dcload_exit (int n)
1.2831 ++{
1.2832 ++ dcloadsyscall (EXIT_NR, n);
1.2833 ++}
1.2834 ++
1.2835 ++#define ASSIGN_WRKMEM_NR 14
1.2836 ++void dcload_assign_wrkmem (void *buf)
1.2837 ++{
1.2838 ++ dcloadsyscall (ASSIGN_WRKMEM_NR, buf);
1.2839 ++}
1.2840 ++
1.2841 ++/* media_ops for host file-system access */
1.2842 ++
1.2843 ++int dcload_mkdir_media_op( const char *c, mode_t mode )
1.2844 ++{
1.2845 ++ errno = ENOSYS;
1.2846 ++ return -1;
1.2847 ++}
1.2848 ++
1.2849 ++int dcload_rmdir_media_op( const char *c )
1.2850 ++{
1.2851 ++ errno = ENOSYS;
1.2852 ++ return -1;
1.2853 ++}
1.2854 ++
1.2855 ++int dcload_ioctl_file_op( )
1.2856 ++{
1.2857 ++ errno = ENOSYS;
1.2858 ++ return -1;
1.2859 ++}
1.2860 ++
1.2861 ++static struct media_ops dcload_host_media_ops =
1.2862 ++{
1.2863 ++ open: dcload_open_media_op,
1.2864 ++ creat: dcload_creat_media_op,
1.2865 ++ link: dcload_link_media_op,
1.2866 ++ unlink: dcload_unlink_media_op,
1.2867 ++ stat: dcload_stat_media_op,
1.2868 ++ chmod: dcload_chmod_media_op,
1.2869 ++ mkdir: dcload_mkdir_media_op,
1.2870 ++ rmdir: dcload_rmdir_media_op,
1.2871 ++ chdir: dcload_chdir_media_op
1.2872 ++};
1.2873 ++
1.2874 ++/* file_ops for a host file */
1.2875 ++
1.2876 ++static struct file_ops dcload_host_file_ops =
1.2877 ++{
1.2878 ++ lseek: dcload_lseek_file_op,
1.2879 ++ close: dcload_close_file_op,
1.2880 ++ read: dcload_read_file_op,
1.2881 ++ write: dcload_write_file_op,
1.2882 ++ ioctl: dcload_ioctl_file_op,
1.2883 ++ fstat: dcload_fstat_file_op
1.2884 ++};
1.2885 ++
1.2886 ++
1.2887 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/dup.c newlib-1.8.2-aica/newlib/libc/sys/aica/dup.c
1.2888 +--- newlib-1.8.2/newlib/libc/sys/aica/dup.c 1970-01-01 10:00:00.000000000 +1000
1.2889 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/dup.c 2008-08-13 11:54:44.000000000 +1000
1.2890 +@@ -0,0 +1,2 @@
1.2891 ++/* This hack is required for libstdc++ to work properly */
1.2892 ++int dup(int fd) { return fd; }
1.2893 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/exit.c newlib-1.8.2-aica/newlib/libc/sys/aica/exit.c
1.2894 +--- newlib-1.8.2/newlib/libc/sys/aica/exit.c 1970-01-01 10:00:00.000000000 +1000
1.2895 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/exit.c 2008-08-13 11:54:44.000000000 +1000
1.2896 +@@ -0,0 +1,18 @@
1.2897 ++/* TODO: Do different things depending on the loader present, e.g. dcload
1.2898 ++ has an exit() call, gdbstubs can tell gdb "W00", etc. */
1.2899 ++
1.2900 ++#include "vfs.h"
1.2901 ++
1.2902 ++void _exit(int n);
1.2903 ++
1.2904 ++void exit (int n) { _exit (n); }
1.2905 ++
1.2906 ++extern void _newlib_vfs_dcload_exit (int);
1.2907 ++
1.2908 ++void
1.2909 ++_exit (int n)
1.2910 ++{
1.2911 ++ if( _newlib_vfs_is_dcload() ) {
1.2912 ++ _newlib_vfs_dcload_exit (n);
1.2913 ++ }
1.2914 ++}
1.2915 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/fcntl.c newlib-1.8.2-aica/newlib/libc/sys/aica/fcntl.c
1.2916 +--- newlib-1.8.2/newlib/libc/sys/aica/fcntl.c 1970-01-01 10:00:00.000000000 +1000
1.2917 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/fcntl.c 2008-08-13 11:54:44.000000000 +1000
1.2918 +@@ -0,0 +1,21 @@
1.2919 ++#include <sys/fcntl.h>
1.2920 ++
1.2921 ++/* Minimal fcntl support is necessary for C++ console streams cin, cout, and
1.2922 ++ cerr. */
1.2923 ++int
1.2924 ++_fcntl (int fd, int flag, ...)
1.2925 ++{
1.2926 ++ switch (flag) {
1.2927 ++ case F_GETFL:
1.2928 ++ switch (fd) {
1.2929 ++ case 0: return O_RDONLY;
1.2930 ++ case 1: return O_WRONLY;
1.2931 ++ case 2: return O_WRONLY;
1.2932 ++ default: return -1;
1.2933 ++ }
1.2934 ++ default:
1.2935 ++ return -1;
1.2936 ++ }
1.2937 ++
1.2938 ++ return -1;
1.2939 ++}
1.2940 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/fstat.c newlib-1.8.2-aica/newlib/libc/sys/aica/fstat.c
1.2941 +--- newlib-1.8.2/newlib/libc/sys/aica/fstat.c 1970-01-01 10:00:00.000000000 +1000
1.2942 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/fstat.c 2008-08-13 11:54:44.000000000 +1000
1.2943 +@@ -0,0 +1,12 @@
1.2944 ++#include <sys/types.h>
1.2945 ++#include <sys/stat.h>
1.2946 ++
1.2947 ++#include "vfs.h"
1.2948 ++
1.2949 ++int
1.2950 ++_fstat (int fd, struct stat *pstat)
1.2951 ++{
1.2952 ++ struct file *pf = _newlib_vfs_get_file (fd);
1.2953 ++
1.2954 ++ return pf->fops->fstat (pf, pstat);
1.2955 ++}
1.2956 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/getpid.c newlib-1.8.2-aica/newlib/libc/sys/aica/getpid.c
1.2957 +--- newlib-1.8.2/newlib/libc/sys/aica/getpid.c 1970-01-01 10:00:00.000000000 +1000
1.2958 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/getpid.c 2008-08-13 11:54:44.000000000 +1000
1.2959 +@@ -0,0 +1,5 @@
1.2960 ++int
1.2961 ++_getpid ()
1.2962 ++{
1.2963 ++ return 1;
1.2964 ++}
1.2965 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/gettimeofday.c newlib-1.8.2-aica/newlib/libc/sys/aica/gettimeofday.c
1.2966 +--- newlib-1.8.2/newlib/libc/sys/aica/gettimeofday.c 1970-01-01 10:00:00.000000000 +1000
1.2967 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/gettimeofday.c 2008-08-13 11:54:44.000000000 +1000
1.2968 +@@ -0,0 +1,30 @@
1.2969 ++#include <time.h>
1.2970 ++#include <sys/time.h>
1.2971 ++
1.2972 ++/* Returns the number of seconds elapsed from the Unix epoch, January 1st,
1.2973 ++ 1970. Note that the Dreamcast counts time from January 1st, 1950, so we
1.2974 ++ need to subtract 20 years (and 5 leap days) from the Dreamcast RTC to
1.2975 ++ get valid values for libc's time functions. */
1.2976 ++
1.2977 ++#define TWENTY_YEARS ((20 * 365LU + 5) * 86400)
1.2978 ++
1.2979 ++int
1.2980 ++_gettimeofday (struct timeval *tp, struct timezone *tzp)
1.2981 ++{
1.2982 ++ if (tp)
1.2983 ++ {
1.2984 ++ unsigned long rtc_h = *(volatile unsigned long*)0x00810000;
1.2985 ++ unsigned long rtc_l = *(volatile unsigned long*)0x00810004;
1.2986 ++ unsigned long secs = ((rtc_h & 0xffff) << 16) | (rtc_l & 0xffff);
1.2987 ++
1.2988 ++ tp->tv_sec = secs - TWENTY_YEARS;
1.2989 ++ tp->tv_usec = 0;
1.2990 ++ }
1.2991 ++ if (tzp)
1.2992 ++ {
1.2993 ++ tzp->tz_minuteswest = 0;
1.2994 ++ tzp->tz_dsttime = 0;
1.2995 ++ }
1.2996 ++
1.2997 ++ return 0;
1.2998 ++}
1.2999 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/ioctl.c newlib-1.8.2-aica/newlib/libc/sys/aica/ioctl.c
1.3000 +--- newlib-1.8.2/newlib/libc/sys/aica/ioctl.c 1970-01-01 10:00:00.000000000 +1000
1.3001 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/ioctl.c 2008-08-13 11:54:44.000000000 +1000
1.3002 +@@ -0,0 +1,9 @@
1.3003 ++#include "vfs.h"
1.3004 ++
1.3005 ++int
1.3006 ++ioctl (int fd, int func, long arg)
1.3007 ++{
1.3008 ++ struct file *pf = _newlib_vfs_get_file (fd);
1.3009 ++
1.3010 ++ return pf->fops->ioctl (pf, func, arg);
1.3011 ++}
1.3012 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/isatty.c newlib-1.8.2-aica/newlib/libc/sys/aica/isatty.c
1.3013 +--- newlib-1.8.2/newlib/libc/sys/aica/isatty.c 1970-01-01 10:00:00.000000000 +1000
1.3014 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/isatty.c 2008-08-13 11:54:44.000000000 +1000
1.3015 +@@ -0,0 +1,10 @@
1.3016 ++/* Since file descriptors 0, 1, and 2 are always mapped to stdin, stdout,
1.3017 ++ and stderr, we assume these are the only fds that permit interactive I/O. */
1.3018 ++
1.3019 ++int
1.3020 ++isatty (int fd)
1.3021 ++{
1.3022 ++ if (fd >= 0 && fd < 3)
1.3023 ++ return 1;
1.3024 ++ return 0;
1.3025 ++}
1.3026 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/kill.c newlib-1.8.2-aica/newlib/libc/sys/aica/kill.c
1.3027 +--- newlib-1.8.2/newlib/libc/sys/aica/kill.c 1970-01-01 10:00:00.000000000 +1000
1.3028 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/kill.c 2008-08-13 11:54:44.000000000 +1000
1.3029 +@@ -0,0 +1,8 @@
1.3030 ++#include <stdlib.h>
1.3031 ++
1.3032 ++int
1.3033 ++_kill ()
1.3034 ++{
1.3035 ++ abort ();
1.3036 ++ return 0;
1.3037 ++}
1.3038 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/link.c newlib-1.8.2-aica/newlib/libc/sys/aica/link.c
1.3039 +--- newlib-1.8.2/newlib/libc/sys/aica/link.c 1970-01-01 10:00:00.000000000 +1000
1.3040 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/link.c 2008-08-13 11:54:44.000000000 +1000
1.3041 +@@ -0,0 +1,16 @@
1.3042 ++#include "vfs.h"
1.3043 ++
1.3044 ++int
1.3045 ++_link (const char *old_path, const char *new_path)
1.3046 ++{
1.3047 ++ char *old_obj = _newlib_vfs_new_string (old_path);
1.3048 ++ char *new_obj = _newlib_vfs_new_string (new_path);
1.3049 ++
1.3050 ++ struct media_ops *mops = _newlib_vfs_get_media_ops (old_path);
1.3051 ++ int res = mops->link (old_obj, new_obj);
1.3052 ++
1.3053 ++ _newlib_vfs_delete_string (old_obj);
1.3054 ++ _newlib_vfs_delete_string (new_obj);
1.3055 ++
1.3056 ++ return res;
1.3057 ++}
1.3058 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/lseek.c newlib-1.8.2-aica/newlib/libc/sys/aica/lseek.c
1.3059 +--- newlib-1.8.2/newlib/libc/sys/aica/lseek.c 1970-01-01 10:00:00.000000000 +1000
1.3060 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/lseek.c 2008-08-13 11:54:44.000000000 +1000
1.3061 +@@ -0,0 +1,11 @@
1.3062 ++#include <sys/types.h>
1.3063 ++
1.3064 ++#include "vfs.h"
1.3065 ++
1.3066 ++off_t
1.3067 ++_lseek (int fd, off_t pos, int whence)
1.3068 ++{
1.3069 ++ struct file *pf = _newlib_vfs_get_file (fd);
1.3070 ++
1.3071 ++ return pf->fops->lseek (pf, pos, whence);
1.3072 ++}
1.3073 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/mkdir.c newlib-1.8.2-aica/newlib/libc/sys/aica/mkdir.c
1.3074 +--- newlib-1.8.2/newlib/libc/sys/aica/mkdir.c 1970-01-01 10:00:00.000000000 +1000
1.3075 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/mkdir.c 2008-08-13 11:54:44.000000000 +1000
1.3076 +@@ -0,0 +1,16 @@
1.3077 ++#include <sys/types.h>
1.3078 ++
1.3079 ++#include "vfs.h"
1.3080 ++
1.3081 ++int
1.3082 ++mkdir (const char *path, mode_t mode)
1.3083 ++{
1.3084 ++ char *obj = _newlib_vfs_new_string (path);
1.3085 ++
1.3086 ++ struct media_ops *mops = _newlib_vfs_get_media_ops (path);
1.3087 ++ int res = mops->mkdir (obj, mode);
1.3088 ++
1.3089 ++ _newlib_vfs_delete_string (obj);
1.3090 ++
1.3091 ++ return res;
1.3092 ++}
1.3093 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/open.c newlib-1.8.2-aica/newlib/libc/sys/aica/open.c
1.3094 +--- newlib-1.8.2/newlib/libc/sys/aica/open.c 1970-01-01 10:00:00.000000000 +1000
1.3095 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/open.c 2008-08-13 11:54:44.000000000 +1000
1.3096 +@@ -0,0 +1,23 @@
1.3097 ++#include <sys/types.h>
1.3098 ++
1.3099 ++#include <stdio.h>
1.3100 ++
1.3101 ++#include "vfs.h"
1.3102 ++
1.3103 ++int
1.3104 ++_open (const char *path, int flags, mode_t mode)
1.3105 ++{
1.3106 ++ char *obj = _newlib_vfs_new_string (path);
1.3107 ++
1.3108 ++ struct media_ops *mops = _newlib_vfs_get_media_ops (path);
1.3109 ++ struct file *pf = mops->open (obj, flags, mode);
1.3110 ++
1.3111 ++ _newlib_vfs_delete_string (obj);
1.3112 ++
1.3113 ++ if (pf != NULL)
1.3114 ++ {
1.3115 ++ return _newlib_vfs_insert_file (pf);
1.3116 ++ }
1.3117 ++
1.3118 ++ return -1;
1.3119 ++}
1.3120 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/read.c newlib-1.8.2-aica/newlib/libc/sys/aica/read.c
1.3121 +--- newlib-1.8.2/newlib/libc/sys/aica/read.c 1970-01-01 10:00:00.000000000 +1000
1.3122 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/read.c 2008-08-13 11:54:44.000000000 +1000
1.3123 +@@ -0,0 +1,11 @@
1.3124 ++#include <sys/types.h>
1.3125 ++
1.3126 ++#include "vfs.h"
1.3127 ++
1.3128 ++size_t
1.3129 ++_read (int fd, void *buf, size_t cnt)
1.3130 ++{
1.3131 ++ struct file *pf = _newlib_vfs_get_file (fd);
1.3132 ++
1.3133 ++ return pf->fops->read (pf, buf, cnt);
1.3134 ++}
1.3135 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/rmdir.c newlib-1.8.2-aica/newlib/libc/sys/aica/rmdir.c
1.3136 +--- newlib-1.8.2/newlib/libc/sys/aica/rmdir.c 1970-01-01 10:00:00.000000000 +1000
1.3137 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/rmdir.c 2008-08-13 11:54:44.000000000 +1000
1.3138 +@@ -0,0 +1,14 @@
1.3139 ++#include "vfs.h"
1.3140 ++
1.3141 ++int
1.3142 ++rmdir (const char *path)
1.3143 ++{
1.3144 ++ char *obj = _newlib_vfs_new_string (path);
1.3145 ++
1.3146 ++ struct media_ops *mops = _newlib_vfs_get_media_ops (path);
1.3147 ++ int res = mops->rmdir (obj);
1.3148 ++
1.3149 ++ _newlib_vfs_delete_string (obj);
1.3150 ++
1.3151 ++ return res;
1.3152 ++}
1.3153 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/sbrk.c newlib-1.8.2-aica/newlib/libc/sys/aica/sbrk.c
1.3154 +--- newlib-1.8.2/newlib/libc/sys/aica/sbrk.c 1970-01-01 10:00:00.000000000 +1000
1.3155 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/sbrk.c 2008-08-13 11:54:44.000000000 +1000
1.3156 +@@ -0,0 +1,27 @@
1.3157 ++#include <_ansi.h>
1.3158 ++#include <errno.h>
1.3159 ++#include <sys/types.h>
1.3160 ++
1.3161 ++extern char end; /* The end of the program (BSS section). */
1.3162 ++
1.3163 ++register char *stack_ptr asm ("r15");
1.3164 ++
1.3165 ++caddr_t
1.3166 ++_sbrk (int incr)
1.3167 ++{
1.3168 ++ static char *heap_end;
1.3169 ++ char *prev_heap_end;
1.3170 ++
1.3171 ++ if (!heap_end)
1.3172 ++ heap_end = &end;
1.3173 ++
1.3174 ++ prev_heap_end = heap_end;
1.3175 ++ if (heap_end + incr > stack_ptr)
1.3176 ++ {
1.3177 ++ errno = ENOMEM;
1.3178 ++ return (caddr_t)-1;
1.3179 ++ }
1.3180 ++
1.3181 ++ heap_end += incr;
1.3182 ++ return (caddr_t) prev_heap_end;
1.3183 ++}
1.3184 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/scif.c newlib-1.8.2-aica/newlib/libc/sys/aica/scif.c
1.3185 +--- newlib-1.8.2/newlib/libc/sys/aica/scif.c 1970-01-01 10:00:00.000000000 +1000
1.3186 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/scif.c 2008-08-13 11:54:44.000000000 +1000
1.3187 +@@ -0,0 +1,46 @@
1.3188 ++/* Blatantly stolen from libdream, others...
1.3189 ++ * Please fix this :) */
1.3190 ++#include <sys/types.h>
1.3191 ++
1.3192 ++/*#include "scif.h"*/
1.3193 ++
1.3194 ++#define ACK (volatile unsigned short *)0xffe80010
1.3195 ++#define WR_FIFO (volatile unsigned char *)0xffe8000c
1.3196 ++#define RD_FIFO (volatile unsigned char *)0xffe80014
1.3197 ++#define STATUS (volatile unsigned short *)0xffe8001c
1.3198 ++
1.3199 ++static void scif_flush ()
1.3200 ++{
1.3201 ++ *ACK &= 0xbf;
1.3202 ++
1.3203 ++ while (!(*ACK & 0x40)) ;
1.3204 ++
1.3205 ++ *ACK &= 0xbf;
1.3206 ++}
1.3207 ++
1.3208 ++size_t _newlib_vfs_scif_write (void *buf, size_t cnt)
1.3209 ++{
1.3210 ++ while (cnt-- > 0)
1.3211 ++ {
1.3212 ++ while (!(*ACK & 0x20)) ;
1.3213 ++
1.3214 ++ *WR_FIFO = *(unsigned char *)buf++;
1.3215 ++
1.3216 ++ *ACK &= 0x9f;
1.3217 ++ }
1.3218 ++ scif_flush ();
1.3219 ++ return cnt;
1.3220 ++}
1.3221 ++
1.3222 ++size_t _newlib_vfs_scif_read (void *buf, size_t cnt)
1.3223 ++{
1.3224 ++ while (cnt -- > 0)
1.3225 ++ {
1.3226 ++ while (*STATUS & 0x1f) ;
1.3227 ++
1.3228 ++ *(unsigned char *)buf++ = *RD_FIFO;
1.3229 ++
1.3230 ++ *ACK &= 0x6d;
1.3231 ++ }
1.3232 ++ return cnt;
1.3233 ++}
1.3234 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/stat.c newlib-1.8.2-aica/newlib/libc/sys/aica/stat.c
1.3235 +--- newlib-1.8.2/newlib/libc/sys/aica/stat.c 1970-01-01 10:00:00.000000000 +1000
1.3236 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/stat.c 2008-08-13 11:54:44.000000000 +1000
1.3237 +@@ -0,0 +1,26 @@
1.3238 ++#include <sys/types.h>
1.3239 ++#include <sys/stat.h>
1.3240 ++
1.3241 ++#include "vfs.h"
1.3242 ++
1.3243 ++/* Clunky, but remember we're "namespace clean" and library routines also
1.3244 ++ use _stat as a syscall... */
1.3245 ++
1.3246 ++int
1.3247 ++stat (const char *path, struct stat *pstat)
1.3248 ++{
1.3249 ++ return _stat (path, pstat);
1.3250 ++}
1.3251 ++
1.3252 ++int
1.3253 ++_stat (const char *path, struct stat *pstat)
1.3254 ++{
1.3255 ++ char *obj = _newlib_vfs_new_string (path);
1.3256 ++
1.3257 ++ struct media_ops *mops = _newlib_vfs_get_media_ops (path);
1.3258 ++ int res = mops->stat (obj, pstat);
1.3259 ++
1.3260 ++ _newlib_vfs_delete_string (obj);
1.3261 ++
1.3262 ++ return res;
1.3263 ++}
1.3264 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/stdio_vfs.c newlib-1.8.2-aica/newlib/libc/sys/aica/stdio_vfs.c
1.3265 +--- newlib-1.8.2/newlib/libc/sys/aica/stdio_vfs.c 1970-01-01 10:00:00.000000000 +1000
1.3266 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/stdio_vfs.c 2008-08-13 18:19:58.000000000 +1000
1.3267 +@@ -0,0 +1,96 @@
1.3268 ++/* Support for Marcus Comstedt's serial slave and gdbstubs, e.g. generic
1.3269 ++ serial console I/O. */
1.3270 ++
1.3271 ++#include "vfs.h"
1.3272 ++
1.3273 ++/* Only read and write are supported for stdio_file_ops, so these are
1.3274 ++ used for stdin, stdout, and stderr which are already "open" when the
1.3275 ++ program is started. */
1.3276 ++
1.3277 ++static size_t stdio_read_file_op (struct file *, void *, size_t);
1.3278 ++static size_t stdio_write_file_op (struct file *, void *, size_t);
1.3279 ++
1.3280 ++static struct file_ops stdio_file_ops =
1.3281 ++{
1.3282 ++ lseek: _newlib_vfs_invalid_file_op,
1.3283 ++ close: _newlib_vfs_invalid_file_op,
1.3284 ++ read: stdio_read_file_op,
1.3285 ++ write: stdio_write_file_op,
1.3286 ++ ioctl: _newlib_vfs_invalid_file_op,
1.3287 ++ fstat: _newlib_vfs_invalid_file_op
1.3288 ++};
1.3289 ++
1.3290 ++/* dcload or absolute may override these to go through their own console
1.3291 ++ output routines. */
1.3292 ++
1.3293 ++static struct file stdout_file;
1.3294 ++static struct file stderr_file;
1.3295 ++
1.3296 ++static struct file stdin_file =
1.3297 ++{
1.3298 ++ &stdout_file,
1.3299 ++ 0, 0,
1.3300 ++ &stdio_file_ops,
1.3301 ++ NULL,
1.3302 ++};
1.3303 ++
1.3304 ++static struct file stdout_file =
1.3305 ++{
1.3306 ++ &stderr_file,
1.3307 ++ 1, 1,
1.3308 ++ &stdio_file_ops,
1.3309 ++ NULL,
1.3310 ++};
1.3311 ++
1.3312 ++static struct file stderr_file =
1.3313 ++{
1.3314 ++ NULL,
1.3315 ++ 2, 2,
1.3316 ++ &stdio_file_ops,
1.3317 ++ NULL,
1.3318 ++};
1.3319 ++
1.3320 ++struct file * _newlib_vfs_first_file = &stdin_file;
1.3321 ++struct file * _newlib_vfs_last_file = &stderr_file;
1.3322 ++
1.3323 ++int _newlib_vfs_is_sslave (void)
1.3324 ++{
1.3325 ++ return 0;
1.3326 ++}
1.3327 ++
1.3328 ++void _newlib_vfs_sslave_init (void)
1.3329 ++{
1.3330 ++ /* Initialize serial console to a known state. We already assume that
1.3331 ++ we connected to the host, we just make sure the SCIF is setup the way
1.3332 ++ we need it. */
1.3333 ++ _newlib_vfs_initialized = VFS_LOADER_SERIAL_SLAVE;
1.3334 ++}
1.3335 ++
1.3336 ++
1.3337 ++/* Detect gdbstubs. gdbstubs sets the border color to green to indicate that
1.3338 ++ it's active. While this can't reliably be used to detect it, we also look
1.3339 ++ for gdbstubs start code at two separate addresses (gdbstub can load itself
1.3340 ++ at either address). */
1.3341 ++
1.3342 ++int _newlib_vfs_is_gdbstubs (void)
1.3343 ++{
1.3344 ++ return 0;
1.3345 ++}
1.3346 ++
1.3347 ++void _newlib_vfs_gdbstubs_init (void)
1.3348 ++{
1.3349 ++ _newlib_vfs_initialized = VFS_LOADER_GDBSTUBS;
1.3350 ++}
1.3351 ++
1.3352 ++extern size_t _newlib_vfs_scif_write (void *, size_t);
1.3353 ++extern size_t _newlib_vfs_scif_read (void *, size_t);
1.3354 ++
1.3355 ++static size_t stdio_read_file_op (struct file *pf, void *buf, size_t cnt)
1.3356 ++{
1.3357 ++ return _newlib_vfs_scif_read (buf, cnt);
1.3358 ++}
1.3359 ++
1.3360 ++static size_t stdio_write_file_op (struct file *pf, void *buf, size_t cnt)
1.3361 ++{
1.3362 ++ return _newlib_vfs_scif_write (buf, cnt);
1.3363 ++}
1.3364 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/times.c newlib-1.8.2-aica/newlib/libc/sys/aica/times.c
1.3365 +--- newlib-1.8.2/newlib/libc/sys/aica/times.c 1970-01-01 10:00:00.000000000 +1000
1.3366 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/times.c 2008-08-13 11:54:44.000000000 +1000
1.3367 +@@ -0,0 +1,35 @@
1.3368 ++#include <time.h>
1.3369 ++#include <sys/times.h>
1.3370 ++
1.3371 ++/* crt.S stores program startup time (Dreamcast-relative, epoch at 1/1/1950)
1.3372 ++ in the global variable _newlib_dreamcast_utime. We can use this variable to
1.3373 ++ determine the total amount of time that the program has been running. */
1.3374 ++
1.3375 ++/* This is raw seconds of program usage, we don't need to worry about
1.3376 ++ converting epochs or anything like that... */
1.3377 ++
1.3378 ++extern unsigned long _newlib_dreamcast_utime;
1.3379 ++
1.3380 ++clock_t
1.3381 ++_times (struct tms *buf)
1.3382 ++{
1.3383 ++ if (_newlib_dreamcast_utime)
1.3384 ++ {
1.3385 ++ unsigned long rtc_h = *(volatile unsigned long*)0x00810000;
1.3386 ++ unsigned long rtc_l = *(volatile unsigned long*)0x00810004;
1.3387 ++ unsigned long secs = ((rtc_h & 0xffff) << 16) | (rtc_l & 0xffff);
1.3388 ++
1.3389 ++ clock_t utime = secs - _newlib_dreamcast_utime;
1.3390 ++
1.3391 ++ if (buf) {
1.3392 ++ buf->tms_utime = utime;
1.3393 ++ buf->tms_stime = 0;
1.3394 ++ buf->tms_cutime = 0;
1.3395 ++ buf->tms_cstime = 0;
1.3396 ++ }
1.3397 ++
1.3398 ++ return utime;
1.3399 ++ }
1.3400 ++
1.3401 ++ return (clock_t)-1;
1.3402 ++}
1.3403 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/unlink.c newlib-1.8.2-aica/newlib/libc/sys/aica/unlink.c
1.3404 +--- newlib-1.8.2/newlib/libc/sys/aica/unlink.c 1970-01-01 10:00:00.000000000 +1000
1.3405 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/unlink.c 2008-08-13 11:54:44.000000000 +1000
1.3406 +@@ -0,0 +1,14 @@
1.3407 ++#include "vfs.h"
1.3408 ++
1.3409 ++int
1.3410 ++_unlink (const char *path)
1.3411 ++{
1.3412 ++ char *obj = _newlib_vfs_new_string (path);
1.3413 ++
1.3414 ++ struct media_ops *mops = _newlib_vfs_get_media_ops (path);
1.3415 ++ int res = mops->unlink (obj);
1.3416 ++
1.3417 ++ _newlib_vfs_delete_string (obj);
1.3418 ++
1.3419 ++ return res;
1.3420 ++}
1.3421 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/vfs.c newlib-1.8.2-aica/newlib/libc/sys/aica/vfs.c
1.3422 +--- newlib-1.8.2/newlib/libc/sys/aica/vfs.c 1970-01-01 10:00:00.000000000 +1000
1.3423 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/vfs.c 2008-08-13 11:54:44.000000000 +1000
1.3424 +@@ -0,0 +1,246 @@
1.3425 ++#include <sys/types.h>
1.3426 ++#include <errno.h>
1.3427 ++#include <stdlib.h>
1.3428 ++#include <string.h>
1.3429 ++
1.3430 ++#include "vfs.h"
1.3431 ++
1.3432 ++static struct file * invalid_open_media_op (void);
1.3433 ++
1.3434 ++static struct media_ops invalid_media_ops =
1.3435 ++{
1.3436 ++ open: invalid_open_media_op,
1.3437 ++ creat: invalid_open_media_op,
1.3438 ++ link: _newlib_vfs_invalid_media_op,
1.3439 ++ unlink: _newlib_vfs_invalid_media_op,
1.3440 ++ stat: _newlib_vfs_invalid_media_op,
1.3441 ++ chmod: _newlib_vfs_invalid_media_op,
1.3442 ++ mkdir: _newlib_vfs_invalid_media_op,
1.3443 ++ rmdir: _newlib_vfs_invalid_media_op,
1.3444 ++ chdir: _newlib_vfs_invalid_media_op
1.3445 ++};
1.3446 ++
1.3447 ++struct media_ops * _newlib_vfs_host_media_ops = &invalid_media_ops;
1.3448 ++struct media_ops * _newlib_vfs_cd_media_ops = &invalid_media_ops;
1.3449 ++struct media_ops * _newlib_vfs_vmu_media_ops = &invalid_media_ops;
1.3450 ++
1.3451 ++/* This is where we detect the loader and initialize the relevant *_ops
1.3452 ++ variables. */
1.3453 ++
1.3454 ++enum _newlib_vfs_loader _newlib_vfs_initialized = VFS_LOADER_NONE;
1.3455 ++
1.3456 ++extern int _newlib_vfs_is_sslave (void);
1.3457 ++extern void _newlib_vfs_sslave_init (void);
1.3458 ++
1.3459 ++extern int _newlib_vfs_is_gdbstubs (void);
1.3460 ++extern void _newlib_vfs_gdbstubs_init (void);
1.3461 ++
1.3462 ++extern int _newlib_vfs_is_dcload (void);
1.3463 ++extern void _newlib_vfs_dcload_init (void);
1.3464 ++
1.3465 ++extern int _newlib_vfs_is_absolute (void);
1.3466 ++extern void _newlib_vfs_absolute_load (void);
1.3467 ++
1.3468 ++static void vfs_init (void)
1.3469 ++{
1.3470 ++ _newlib_vfs_initialized = VFS_LOADER_UNKNOWN;
1.3471 ++
1.3472 ++ if (_newlib_vfs_is_sslave ()) /* Marcus Comstedt's serial slave */
1.3473 ++ {
1.3474 ++ _newlib_vfs_sslave_init ();
1.3475 ++ }
1.3476 ++ else if (_newlib_vfs_is_gdbstubs ()) /* Benoit Miller's port of gdbstubs */
1.3477 ++ {
1.3478 ++ _newlib_vfs_gdbstubs_init ();
1.3479 ++ }
1.3480 ++ else if (_newlib_vfs_is_dcload ()) /* Andrew K's dcload */
1.3481 ++ {
1.3482 ++ _newlib_vfs_dcload_init ();
1.3483 ++ }
1.3484 ++ else if (_newlib_vfs_is_absolute ()) /* my own absolute */
1.3485 ++ {
1.3486 ++ _newlib_vfs_absolute_load ();
1.3487 ++ }
1.3488 ++}
1.3489 ++
1.3490 ++#define VFS_INIT { if (!_newlib_vfs_initialized) vfs_init (); }
1.3491 ++
1.3492 ++/* Each prefix, "/pc/", "/cd", and "/vmu" in little-endian. */
1.3493 ++#define PREFIX_HOST 0x2f63702f
1.3494 ++#define PREFIX_CD 0x2f64632f
1.3495 ++#define PREFIX_VMU 0x756d762f
1.3496 ++
1.3497 ++char *_newlib_vfs_new_string (const char *s)
1.3498 ++{
1.3499 ++ VFS_INIT;
1.3500 ++
1.3501 ++ {
1.3502 ++ char *obj = NULL;
1.3503 ++ unsigned long prefix = *(unsigned long *)s;
1.3504 ++ int len;
1.3505 ++
1.3506 ++ if (prefix == PREFIX_HOST || prefix == PREFIX_CD ||
1.3507 ++ prefix == PREFIX_VMU)
1.3508 ++ {
1.3509 ++ /* We snatch the prefix, accounting for the null byte (since we're
1.3510 ++ using memcpy; this could be changed to a simple copy loop... */
1.3511 ++ len = strlen (s) - 3;
1.3512 ++ obj = malloc (len);
1.3513 ++ if (!obj) return obj;
1.3514 ++
1.3515 ++ memcpy (obj, s + 4, len);
1.3516 ++ }
1.3517 ++ else /* Just return a copy of the string if no path given */
1.3518 ++ {
1.3519 ++ len = strlen (s) + 1;
1.3520 ++ obj = malloc (len);
1.3521 ++ if (!obj) return obj;
1.3522 ++
1.3523 ++ memcpy (obj, s, len);
1.3524 ++ }
1.3525 ++ return obj;
1.3526 ++ }
1.3527 ++}
1.3528 ++
1.3529 ++void _newlib_vfs_delete_string (char *s)
1.3530 ++{
1.3531 ++ if (s) free (s);
1.3532 ++}
1.3533 ++
1.3534 ++/* When each media op calls this, it's already got a copy of the stripped
1.3535 ++ path so we just do simple comparisons on the path prefix here. */
1.3536 ++struct media_ops *_newlib_vfs_get_media_ops (const char *path)
1.3537 ++{
1.3538 ++ unsigned long prefix = *(unsigned long *)path;
1.3539 ++
1.3540 ++ if (prefix == PREFIX_HOST)
1.3541 ++ {
1.3542 ++ return _newlib_vfs_host_media_ops;
1.3543 ++ }
1.3544 ++ else if (prefix == PREFIX_CD)
1.3545 ++ {
1.3546 ++ return _newlib_vfs_cd_media_ops;
1.3547 ++ }
1.3548 ++ else if (prefix == PREFIX_VMU)
1.3549 ++ {
1.3550 ++ return _newlib_vfs_vmu_media_ops;
1.3551 ++ }
1.3552 ++
1.3553 ++ return _newlib_vfs_host_media_ops;
1.3554 ++}
1.3555 ++
1.3556 ++static struct file_ops invalid_file_ops =
1.3557 ++{
1.3558 ++ lseek: _newlib_vfs_invalid_file_op,
1.3559 ++ close: _newlib_vfs_invalid_file_op,
1.3560 ++ read: _newlib_vfs_invalid_file_op,
1.3561 ++ write: _newlib_vfs_invalid_file_op,
1.3562 ++ ioctl: _newlib_vfs_invalid_file_op,
1.3563 ++ fstat: _newlib_vfs_invalid_file_op
1.3564 ++};
1.3565 ++
1.3566 ++static struct file invalid_file =
1.3567 ++{
1.3568 ++ NULL,
1.3569 ++ -1, -1,
1.3570 ++ &invalid_file_ops,
1.3571 ++ NULL
1.3572 ++};
1.3573 ++
1.3574 ++/* FIXME: A lookup for each fd could get expensive...find a better way to
1.3575 ++ "cache" frequently used fds */
1.3576 ++
1.3577 ++static struct file *cached_file = NULL;
1.3578 ++
1.3579 ++/* Find the file matching fd and return a pointer to its contents. If the
1.3580 ++ file isn't found, return a pointer to invalid_file, which represents a
1.3581 ++ non-existent file (all operations on it will fail). */
1.3582 ++struct file *_newlib_vfs_get_file (int fd)
1.3583 ++{
1.3584 ++ VFS_INIT;
1.3585 ++
1.3586 ++ {
1.3587 ++ struct file *next_file = _newlib_vfs_first_file;
1.3588 ++
1.3589 ++ if ((cached_file != NULL) && (cached_file->fd == fd))
1.3590 ++ {
1.3591 ++ return cached_file;
1.3592 ++ }
1.3593 ++
1.3594 ++ while (next_file)
1.3595 ++ {
1.3596 ++ if (next_file->fd == fd)
1.3597 ++ {
1.3598 ++ cached_file = next_file;
1.3599 ++ return next_file;
1.3600 ++ }
1.3601 ++ next_file = next_file->next;
1.3602 ++ }
1.3603 ++ return &invalid_file;
1.3604 ++ }
1.3605 ++}
1.3606 ++
1.3607 ++static int last_fd = -1;
1.3608 ++
1.3609 ++/* Just insert the file at the end of the list, as it's already been
1.3610 ++ allocated by open/creat. Increase the library's fd by using the last
1.3611 ++ file's fd. */
1.3612 ++int _newlib_vfs_insert_file (struct file *pf)
1.3613 ++{
1.3614 ++ if (last_fd < 0)
1.3615 ++ {
1.3616 ++ last_fd = _newlib_vfs_last_file->fd;
1.3617 ++ }
1.3618 ++/* ++last_fd; */
1.3619 ++ pf->fd = ++last_fd;
1.3620 ++ _newlib_vfs_last_file->next = pf;
1.3621 ++ _newlib_vfs_last_file = pf;
1.3622 ++ return last_fd;
1.3623 ++}
1.3624 ++
1.3625 ++int _newlib_vfs_remove_file (struct file *pf)
1.3626 ++{
1.3627 ++ if (pf)
1.3628 ++ {
1.3629 ++ struct file *prev_file = _newlib_vfs_first_file;
1.3630 ++ struct file *next_file = NULL;
1.3631 ++
1.3632 ++ while (prev_file)
1.3633 ++ {
1.3634 ++ if (prev_file->next == pf)
1.3635 ++ {
1.3636 ++ prev_file->next = pf->next;
1.3637 ++ next_file = prev_file->next;
1.3638 ++ while (next_file)
1.3639 ++ {
1.3640 ++ prev_file = next_file;
1.3641 ++ next_file = next_file->next;
1.3642 ++ }
1.3643 ++ _newlib_vfs_last_file = prev_file;
1.3644 ++ free (pf);
1.3645 ++ return 0;
1.3646 ++ }
1.3647 ++ prev_file = prev_file->next;
1.3648 ++ }
1.3649 ++ }
1.3650 ++ errno = ENOSYS;
1.3651 ++ return -1;
1.3652 ++}
1.3653 ++
1.3654 ++int _newlib_vfs_invalid_file_op (void)
1.3655 ++{
1.3656 ++ errno = ENOSYS;
1.3657 ++ return -1;
1.3658 ++}
1.3659 ++
1.3660 ++static struct file *invalid_open_media_op (void)
1.3661 ++{
1.3662 ++ errno = ENOSYS;
1.3663 ++ return NULL;
1.3664 ++}
1.3665 ++
1.3666 ++int _newlib_vfs_invalid_media_op (void)
1.3667 ++{
1.3668 ++ errno = ENOSYS;
1.3669 ++ return -1;
1.3670 ++}
1.3671 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/vfs.h newlib-1.8.2-aica/newlib/libc/sys/aica/vfs.h
1.3672 +--- newlib-1.8.2/newlib/libc/sys/aica/vfs.h 1970-01-01 10:00:00.000000000 +1000
1.3673 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/vfs.h 2008-08-13 11:54:44.000000000 +1000
1.3674 +@@ -0,0 +1,100 @@
1.3675 ++#ifndef __VFS_H__
1.3676 ++#define __VFS_H__
1.3677 ++
1.3678 ++#include <sys/types.h>
1.3679 ++#include <sys/stat.h>
1.3680 ++
1.3681 ++/* Defines all of the operations that can be performed on a particular media
1.3682 ++ type. These are independent of file access routines. */
1.3683 ++
1.3684 ++struct media_ops {
1.3685 ++ struct file * (*open) (const char *, int, mode_t);
1.3686 ++ struct file * (*creat) (const char *, mode_t);
1.3687 ++ int (*link) (const char *, const char *);
1.3688 ++ int (*unlink) (const char *);
1.3689 ++ int (*stat) (const char *, struct stat *);
1.3690 ++ int (*chmod) (const char *, mode_t);
1.3691 ++ int (*mkdir) (const char*, mode_t);
1.3692 ++ int (*rmdir) (const char *);
1.3693 ++ int (*chdir) (const char *);
1.3694 ++};
1.3695 ++
1.3696 ++/* These are the operations that can be done to a file. Each media and stub
1.3697 ++ has it's own combination of routines (e.g. Absolute + VMU, dcload + host). */
1.3698 ++
1.3699 ++struct file_ops {
1.3700 ++ off_t (*lseek) (struct file *, off_t, int);
1.3701 ++ int (*close) (struct file *);
1.3702 ++ size_t (*read) (struct file *, void *, size_t);
1.3703 ++ size_t (*write) (struct file *, void *, size_t);
1.3704 ++ /* Hmm, what to do with this one? */
1.3705 ++ int (*ioctl) (struct file *, int, long);
1.3706 ++ int (*fstat) (struct file *, struct stat *);
1.3707 ++};
1.3708 ++
1.3709 ++/* We maintain a linked list of files so that we can remove and add files
1.3710 ++ to/from the list easier. Each file contains an fd, the "real" fd of whatever
1.3711 ++ media it resides upon, a pointer to the file_ops for the file, and a pointer
1.3712 ++ to media/stub specific data. */
1.3713 ++
1.3714 ++struct file {
1.3715 ++ struct file *next;
1.3716 ++ int fd;
1.3717 ++ int media_fd;
1.3718 ++ struct file_ops *fops;
1.3719 ++ void *specifics;
1.3720 ++};
1.3721 ++
1.3722 ++
1.3723 ++/* Each load initializes the media_ops for each type based on the media it
1.3724 ++ supports. If a media type isn't supported, then it's ops points to
1.3725 ++ _newlib_vfs_invalid_media_ops. */
1.3726 ++extern struct media_ops * _newlib_vfs_host_media_ops;
1.3727 ++extern struct media_ops * _newlib_vfs_cd_media_ops;
1.3728 ++extern struct media_ops * _newlib_vfs_vmu_media_ops;
1.3729 ++
1.3730 ++/* Pointers to the first and last file in the list */
1.3731 ++extern struct file * _newlib_vfs_first_file;
1.3732 ++extern struct file * _newlib_vfs_last_file;
1.3733 ++
1.3734 ++/* Each loader initializer gives this a distinct value so that programs
1.3735 ++ can determine which loader they're being loaded under. */
1.3736 ++enum _newlib_vfs_loader
1.3737 ++{
1.3738 ++ VFS_LOADER_NONE,
1.3739 ++ VFS_LOADER_UNKNOWN,
1.3740 ++ VFS_LOADER_SERIAL_SLAVE,
1.3741 ++ VFS_LOADER_GDBSTUBS,
1.3742 ++ VFS_LOADER_DCLOAD_HOST,
1.3743 ++ VFS_LOADER_DCLOAD_NOHOST,
1.3744 ++ VFS_LOADER_ABSOLUTE
1.3745 ++};
1.3746 ++
1.3747 ++extern enum _newlib_vfs_loader _newlib_vfs_initialized;
1.3748 ++
1.3749 ++/* Generic media/file_ops that return ENOSYS */
1.3750 ++int _newlib_vfs_invalid_media_op (void);
1.3751 ++int _newlib_vfs_invalid_file_op (void);
1.3752 ++
1.3753 ++/* Using the path prefix, return the media_ops that handles it */
1.3754 ++struct media_ops *_newlib_vfs_get_media_ops (const char *path);
1.3755 ++
1.3756 ++/* Returns the file that matches the given fd */
1.3757 ++struct file *_newlib_vfs_get_file (int fd);
1.3758 ++
1.3759 ++/* Insert a new file into the list. Returns -1 and sets errno if the file
1.3760 ++ can't be inserted, otherewise returns 0 */
1.3761 ++int _newlib_vfs_insert_file (struct file *);
1.3762 ++
1.3763 ++/* Removes a file from the list. Returns -1 and sets errno if there was
1.3764 ++ a problem (e.g. invalid fd passed to close, etc.) */
1.3765 ++int _newlib_vfs_remove_file (struct file *);
1.3766 ++
1.3767 ++/* Copy the given string into a new buffer, while stripping the vfs prefix
1.3768 ++ at the same time. */
1.3769 ++char *_newlib_vfs_new_string (const char *s);
1.3770 ++
1.3771 ++/* Free the buffer previously allocated with *_new_string */
1.3772 ++void _newlib_vfs_delete_string (char *s);
1.3773 ++
1.3774 ++#endif /* __VFS_H__ */
1.3775 +diff -urN newlib-1.8.2/newlib/libc/sys/aica/write.c newlib-1.8.2-aica/newlib/libc/sys/aica/write.c
1.3776 +--- newlib-1.8.2/newlib/libc/sys/aica/write.c 1970-01-01 10:00:00.000000000 +1000
1.3777 ++++ newlib-1.8.2-aica/newlib/libc/sys/aica/write.c 2008-08-13 11:54:44.000000000 +1000
1.3778 +@@ -0,0 +1,11 @@
1.3779 ++#include <sys/types.h>
1.3780 ++
1.3781 ++#include "vfs.h"
1.3782 ++
1.3783 ++int
1.3784 ++_write (int fd, const void *buf, size_t cnt)
1.3785 ++{
1.3786 ++ struct file *pf = _newlib_vfs_get_file (fd);
1.3787 ++
1.3788 ++ return pf->fops->write (pf, buf, cnt);
1.3789 ++}
.