1 diff -urN newlib-1.8.2/config.sub newlib-1.8.2-aica/config.sub
2 --- newlib-1.8.2/config.sub 2008-08-15 12:02:09.000000000 +1000
3 +++ newlib-1.8.2-aica/config.sub 2008-08-13 11:59:17.000000000 +1000
5 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
6 | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
7 | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit* \
9 + | -dreamcast* | -aica* )
10 # Remember, each alternative MUST END IN *, to match a version number.
12 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
13 diff -urN newlib-1.8.2/configure.in newlib-1.8.2-aica/configure.in
14 --- newlib-1.8.2/configure.in 2008-08-15 12:02:09.000000000 +1000
15 +++ newlib-1.8.2-aica/configure.in 2008-08-13 11:58:57.000000000 +1000
17 target_configdirs="${target_configdirs} target-bsp target-cygmon"
21 + noconfigdirs="$noconfigdirs target-libgloss"
24 noconfigdirs="$noconfigdirs target-libgloss"
26 diff -urN newlib-1.8.2/newlib/configure.host newlib-1.8.2-aica/newlib/configure.host
27 --- newlib-1.8.2/newlib/configure.host 2008-08-15 12:02:09.000000000 +1000
28 +++ newlib-1.8.2-aica/newlib/configure.host 2008-08-13 20:01:25.000000000 +1000
30 *-*-dc* | *-*-dreamcast*)
35 + newlib_cflags="${newlib_cflags} -mcpu=arm7tdmi"
40 diff -urN newlib-1.8.2/newlib/libc/sys/aica/Makefile.am newlib-1.8.2-aica/newlib/libc/sys/aica/Makefile.am
41 --- newlib-1.8.2/newlib/libc/sys/aica/Makefile.am 1970-01-01 10:00:00.000000000 +1000
42 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/Makefile.am 2008-08-13 11:54:44.000000000 +1000
44 +## Process this file with automake to generate Makefile.in
46 +AUTOMAKE_OPTIONS = cygnus
48 +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
50 +noinst_LIBRARIES = lib.a
52 +lib_a_SOURCES = absolute_vfs.c chdir.c chmod.c close.c creat.c dcload_vfs.c dcload.S \
53 + exit.c fcntl.c fstat.c getpid.c gettimeofday.c ioctl.c isatty.c kill.c \
54 + link.c lseek.c mkdir.c open.c read.c rmdir.c sbrk.c scif.c stat.c \
55 + stdio_vfs.c times.c unlink.c vfs.c write.c dup.c
59 +ACLOCAL_AMFLAGS = -I ../../..
60 +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
61 diff -urN newlib-1.8.2/newlib/libc/sys/aica/Makefile.in newlib-1.8.2-aica/newlib/libc/sys/aica/Makefile.in
62 --- newlib-1.8.2/newlib/libc/sys/aica/Makefile.in 1970-01-01 10:00:00.000000000 +1000
63 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/Makefile.in 2008-08-13 11:54:44.000000000 +1000
65 +# Makefile.in generated automatically by automake 1.4 from Makefile.am
67 +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
68 +# This Makefile.in is free software; the Free Software Foundation
69 +# gives unlimited permission to copy and/or distribute it,
70 +# with or without modifications, as long as this notice is preserved.
72 +# This program is distributed in the hope that it will be useful,
73 +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
74 +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
75 +# PARTICULAR PURPOSE.
81 +top_srcdir = @top_srcdir@
84 +exec_prefix = @exec_prefix@
88 +libexecdir = @libexecdir@
90 +sysconfdir = @sysconfdir@
91 +sharedstatedir = @sharedstatedir@
92 +localstatedir = @localstatedir@
96 +includedir = @includedir@
97 +oldincludedir = /usr/include
101 +pkgdatadir = $(datadir)/@PACKAGE@
102 +pkglibdir = $(libdir)/@PACKAGE@
103 +pkgincludedir = $(includedir)/@PACKAGE@
108 +AUTOCONF = @AUTOCONF@
109 +AUTOMAKE = @AUTOMAKE@
110 +AUTOHEADER = @AUTOHEADER@
113 +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
114 +INSTALL_DATA = @INSTALL_DATA@
115 +INSTALL_SCRIPT = @INSTALL_SCRIPT@
116 +transform = @program_transform_name@
121 +NORMAL_UNINSTALL = :
124 +host_alias = @host_alias@
125 +host_triplet = @host@
131 +MAKEINFO = @MAKEINFO@
132 +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
136 +machine_dir = @machine_dir@
137 +newlib_basedir = @newlib_basedir@
140 +AUTOMAKE_OPTIONS = cygnus
142 +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
144 +noinst_LIBRARIES = lib.a
146 +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
149 +ACLOCAL_AMFLAGS = -I ../../..
150 +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
151 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
152 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs
153 +CONFIG_CLEAN_FILES =
154 +LIBRARIES = $(noinst_LIBRARIES)
157 +DEFS = @DEFS@ -I. -I$(srcdir)
158 +CPPFLAGS = @CPPFLAGS@
162 +lib_a_OBJECTS = absolute_vfs.o chdir.o chmod.o close.o creat.o \
163 +dcload_vfs.o dcload.o exit.o fcntl.o fstat.o getpid.o gettimeofday.o ioctl.o \
164 +isatty.o kill.o link.o lseek.o mkdir.o open.o read.o rmdir.o sbrk.o \
165 +scif.o stat.o stdio_vfs.o times.o unlink.o vfs.o write.o dup.o
167 +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
169 +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
170 +DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in
173 +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
177 +SOURCES = $(lib_a_SOURCES)
178 +OBJECTS = $(lib_a_OBJECTS)
182 +.SUFFIXES: .S .c .o .s
183 +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
184 + cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
186 +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
187 + cd $(top_builddir) \
188 + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
190 +$(ACLOCAL_M4): configure.in ../../../acinclude.m4 ../../../aclocal.m4
191 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
193 +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
194 + $(SHELL) ./config.status --recheck
195 +$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
196 + cd $(srcdir) && $(AUTOCONF)
198 +mostlyclean-noinstLIBRARIES:
200 +clean-noinstLIBRARIES:
201 + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
203 +distclean-noinstLIBRARIES:
205 +maintainer-clean-noinstLIBRARIES:
216 +mostlyclean-compile:
217 + -rm -f *.o core *.core
224 +maintainer-clean-compile:
226 +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES)
228 + $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
233 +ID: $(HEADERS) $(SOURCES) $(LISP)
234 + list='$(SOURCES) $(HEADERS)'; \
235 + unique=`for i in $$list; do echo $$i; done | \
236 + awk ' { files[$$0] = 1; } \
237 + END { for (i in files) print i; }'`; \
238 + here=`pwd` && cd $(srcdir) \
239 + && mkid -f$$here/ID $$unique $(LISP)
241 +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
244 + list='$(SOURCES) $(HEADERS)'; \
245 + unique=`for i in $$list; do echo $$i; done | \
246 + awk ' { files[$$0] = 1; } \
247 + END { for (i in files) print i; }'`; \
248 + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
249 + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
258 +maintainer-clean-tags:
260 +distdir = $(PACKAGE)-$(VERSION)
261 +top_distdir = $(distdir)
263 +# This target untars the dist file and tries a VPATH configuration. Then
264 +# it guarantees that the distribution is self-contained by making another
268 + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
269 + mkdir $(distdir)/=build
270 + mkdir $(distdir)/=inst
271 + dc_install_base=`cd $(distdir)/=inst && pwd`; \
272 + cd $(distdir)/=build \
273 + && ../configure --srcdir=.. --prefix=$$dc_install_base \
274 + && $(MAKE) $(AM_MAKEFLAGS) \
275 + && $(MAKE) $(AM_MAKEFLAGS) dvi \
276 + && $(MAKE) $(AM_MAKEFLAGS) check \
277 + && $(MAKE) $(AM_MAKEFLAGS) install \
278 + && $(MAKE) $(AM_MAKEFLAGS) installcheck \
279 + && $(MAKE) $(AM_MAKEFLAGS) dist
281 + @banner="$(distdir).tar.gz is ready for distribution"; \
282 + dashes=`echo "$$banner" | sed s/./=/g`; \
287 + -chmod -R a+r $(distdir)
288 + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
291 + -chmod -R a+r $(distdir)
292 + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
294 +distdir: $(DISTFILES)
297 + -chmod 777 $(distdir)
298 + @for file in $(DISTFILES); do \
299 + if test -f $$file; then d=.; else d=$(srcdir); fi; \
300 + if test -d $$d/$$file; then \
301 + cp -pr $$d/$$file $(distdir)/$$file; \
303 + test -f $(distdir)/$$file \
304 + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
305 + || cp -p $$d/$$file $(distdir)/$$file || :; \
315 +installcheck: installcheck-am
317 +install-info: install-info-am
319 +install-exec: install-exec-am
322 +install-data: install-data-am
325 + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
328 +uninstall: uninstall-am
329 +all-am: Makefile $(LIBRARIES)
330 +all-redirect: all-am
332 + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
336 +mostlyclean-generic:
341 + -rm -f Makefile $(CONFIG_CLEAN_FILES)
342 + -rm -f config.cache config.log stamp-h stamp-h[0-9]*
344 +maintainer-clean-generic:
345 +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
346 + mostlyclean-tags mostlyclean-generic
348 +mostlyclean: mostlyclean-am
350 +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \
355 +distclean-am: distclean-noinstLIBRARIES distclean-compile \
356 + distclean-tags distclean-generic clean-am
358 +distclean: distclean-am
359 + -rm -f config.status
361 +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
362 + maintainer-clean-compile maintainer-clean-tags \
363 + maintainer-clean-generic distclean-am
364 + @echo "This command is intended for maintainers to use;"
365 + @echo "it deletes files that may require special tools to rebuild."
367 +maintainer-clean: maintainer-clean-am
368 + -rm -f config.status
370 +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
371 +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
372 +mostlyclean-compile distclean-compile clean-compile \
373 +maintainer-clean-compile tags mostlyclean-tags distclean-tags \
374 +clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
375 +check-am installcheck-am installcheck install-info-am install-info \
376 +install-exec-am install-exec install-data-am install-data install-am \
377 +install uninstall-am uninstall all-redirect all-am all installdirs \
378 +mostlyclean-generic distclean-generic clean-generic \
379 +maintainer-clean-generic clean mostlyclean distclean maintainer-clean
384 +# Tell versions [3.59,3.63) of GNU make to not export all variables.
385 +# Otherwise a system limit (for SysV at least) may be exceeded.
387 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
388 --- newlib-1.8.2/newlib/libc/sys/aica/absolute_vfs.c 1970-01-01 10:00:00.000000000 +1000
389 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/absolute_vfs.c 2008-08-13 11:54:44.000000000 +1000
393 +int _newlib_vfs_is_absolute (void)
398 +void _newlib_vfs_absolute_load (void)
400 + _newlib_vfs_initialized = VFS_LOADER_ABSOLUTE;
402 diff -urN newlib-1.8.2/newlib/libc/sys/aica/aclocal.m4 newlib-1.8.2-aica/newlib/libc/sys/aica/aclocal.m4
403 --- newlib-1.8.2/newlib/libc/sys/aica/aclocal.m4 1970-01-01 10:00:00.000000000 +1000
404 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/aclocal.m4 2008-08-13 11:54:44.000000000 +1000
406 +dnl aclocal.m4 generated automatically by aclocal 1.3b
408 +dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
409 +dnl This file is free software; the Free Software Foundation
410 +dnl gives unlimited permission to copy and/or distribute it,
411 +dnl with or without modifications, as long as this notice is preserved.
413 +dnl This program is distributed in the hope that it will be useful,
414 +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
415 +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
416 +dnl PARTICULAR PURPOSE.
418 +dnl This provides configure definitions used by all the newlib
419 +dnl configure.in files.
421 +dnl Basic newlib configury. This calls basic introductory stuff,
422 +dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs
423 +dnl configure.host. The only argument is the relative path to the top
424 +dnl newlib directory.
426 +AC_DEFUN(NEWLIB_CONFIGURE,
428 +dnl Default to --enable-multilib
429 +AC_ARG_ENABLE(multilib,
430 +[ --enable-multilib build many library versions (default)],
431 +[case "${enableval}" in
432 + yes) multilib=yes ;;
434 + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
435 + esac], [multilib=yes])dnl
437 +dnl Support --enable-target-optspace
438 +AC_ARG_ENABLE(target-optspace,
439 +[ --enable-target-optspace optimize for space],
440 +[case "${enableval}" in
441 + yes) target_optspace=yes ;;
442 + no) target_optspace=no ;;
443 + *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;;
444 + esac], [target_optspace=])dnl
446 +dnl Support --enable-newlib-mb
447 +AC_ARG_ENABLE(newlib-mb,
448 +[ --enable-newlib-mb enable multibyte support],
449 +[case "${enableval}" in
450 + yes) newlib_mb=yes ;;
451 + no) newlib_mb=no ;;
452 + *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;;
453 + esac], [newlib_mb=no])dnl
455 +dnl We may get other options which we don't document:
456 +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
458 +test -z "[$]{with_target_subdir}" && with_target_subdir=.
460 +if test "[$]{srcdir}" = "."; then
461 + if test "[$]{with_target_subdir}" != "."; then
462 + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
464 + newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
467 + newlib_basedir="[$]{srcdir}/$1"
469 +AC_SUBST(newlib_basedir)
473 +AM_INIT_AUTOMAKE(newlib, 1.8.1)
475 +# FIXME: We temporarily define our own version of AC_PROG_CC. This is
476 +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
477 +# are probably using a cross compiler, which will not be able to fully
478 +# link an executable. This should really be fixed in autoconf
481 +AC_DEFUN(LIB_AC_PROG_CC,
482 +[AC_BEFORE([$0], [AC_PROG_CPP])dnl
483 +AC_CHECK_PROG(CC, gcc, gcc)
484 +if test -z "$CC"; then
485 + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
486 + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
491 +if test $ac_cv_prog_gcc = yes; then
493 +dnl Check whether -g works, even if CFLAGS is set, in case the package
494 +dnl plays around with CFLAGS (such as to build both debugging and
495 +dnl normal versions of a library), tasteless as that idea is.
496 + ac_test_CFLAGS="${CFLAGS+set}"
497 + ac_save_CFLAGS="$CFLAGS"
500 + if test "$ac_test_CFLAGS" = set; then
501 + CFLAGS="$ac_save_CFLAGS"
502 + elif test $ac_cv_prog_cc_g = yes; then
509 + test "${CFLAGS+set}" = set || CFLAGS="-g"
515 +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
516 +# run it explicitly here, it will be run implicitly before
517 +# NEWLIB_CONFIGURE, which doesn't work because that means that it will
518 +# be run before AC_CANONICAL_HOST.
521 +AC_CHECK_TOOL(AS, as)
522 +AC_CHECK_TOOL(AR, ar)
523 +AC_CHECK_TOOL(RANLIB, ranlib, :)
529 +# We need AM_EXEEXT to keep automake happy in cygnus mode. However,
530 +# at least currently, we never actually build a program, so we never
531 +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
532 +# fails, because we are probably configuring with a cross compiler
533 +# which can't create executables. So we include AM_EXEEXT to keep
534 +# automake happy, but we don't execute it, since we don't care about
540 +. [$]{newlib_basedir}/configure.host
542 +case [$]{newlib_basedir} in
543 +/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;;
544 +*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;;
547 +newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include"
550 + newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/include"
554 +newlib_cflags="[$]{newlib_cflags} -fno-builtin"
556 +NEWLIB_CFLAGS=${newlib_cflags}
557 +AC_SUBST(NEWLIB_CFLAGS)
559 +AC_SUBST(machine_dir)
563 +# Do all the work for Automake. This macro actually does too much --
564 +# some checks are only needed if your package does certain things.
565 +# But this isn't really a big deal.
570 +dnl AM_INIT_AUTOMAKE(package,version, [no-define])
572 +AC_DEFUN(AM_INIT_AUTOMAKE,
573 +[AC_REQUIRE([AM_PROG_INSTALL])
578 +dnl test to see if srcdir already configured
579 +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
580 + AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
583 +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
584 +AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
585 +AC_REQUIRE([AM_SANITY_CHECK])
586 +AC_REQUIRE([AC_ARG_PROGRAM])
587 +dnl FIXME This is truly gross.
588 +missing_dir=`cd $ac_aux_dir && pwd`
589 +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
590 +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
591 +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
592 +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
593 +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
594 +AC_REQUIRE([AC_PROG_MAKE_SET])])
599 +AC_DEFUN(AM_PROG_INSTALL,
600 +[AC_REQUIRE([AC_PROG_INSTALL])
601 +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
602 +AC_SUBST(INSTALL_SCRIPT)dnl
606 +# Check to make sure that the build environment is sane.
609 +AC_DEFUN(AM_SANITY_CHECK,
610 +[AC_MSG_CHECKING([whether build environment is sane])
613 +echo timestamp > conftestfile
614 +# Do `set' in a subshell so we don't clobber the current shell's
615 +# arguments. Must try -L first in case configure is actually a
616 +# symlink; some systems play weird games with the mod time of symlinks
617 +# (eg FreeBSD returns the mod time of the symlink's containing
620 + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
621 + if test "[$]*" = "X"; then
623 + set X `ls -t $srcdir/configure conftestfile`
625 + if test "[$]*" != "X $srcdir/configure conftestfile" \
626 + && test "[$]*" != "X conftestfile $srcdir/configure"; then
628 + # If neither matched, then we have a broken ls. This can happen
629 + # if, for instance, CONFIG_SHELL is bash and it inherits a
630 + # broken ls alias from the environment. This has actually
631 + # happened. Such a system could not be considered "sane".
632 + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
633 +alias in your environment])
636 + test "[$]2" = conftestfile
642 + AC_MSG_ERROR([newly created file is older than distributed files!
643 +Check your system clock])
646 +AC_MSG_RESULT(yes)])
648 +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
649 +dnl The program must properly implement --version.
650 +AC_DEFUN(AM_MISSING_PROG,
651 +[AC_MSG_CHECKING(for working $2)
652 +# Run test in a subshell; some versions of sh will print an error if
653 +# an executable is not found, even if stderr is redirected.
654 +# Redirect stdin to placate older versions of autoconf. Sigh.
655 +if ($2 --version) < /dev/null > /dev/null 2>&1; then
657 + AC_MSG_RESULT(found)
660 + AC_MSG_RESULT(missing)
664 +# Add --enable-maintainer-mode option to configure.
669 +AC_DEFUN(AM_MAINTAINER_MODE,
670 +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
671 + dnl maintainer-mode is disabled by default
672 + AC_ARG_ENABLE(maintainer-mode,
673 +[ --enable-maintainer-mode enable make rules and dependencies not useful
674 + (and sometimes confusing) to the casual installer],
675 + USE_MAINTAINER_MODE=$enableval,
676 + USE_MAINTAINER_MODE=no)
677 + AC_MSG_RESULT($USE_MAINTAINER_MODE)
678 + if test $USE_MAINTAINER_MODE = yes; then
683 +# AC_SUBST(MAINT)dnl
687 +# Check to see if we're running under Win32, without using
688 +# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
689 +# Otherwise set it to "".
692 +dnl This knows we add .exe if we're building in the Cygwin32
693 +dnl environment. But if we're not, then it compiles a test program
694 +dnl to see if there is a suffix for executables.
696 +[AC_REQUIRE([AM_CYGWIN32])
697 +AC_REQUIRE([AM_MINGW32])
698 +AC_MSG_CHECKING([for executable suffix])
699 +AC_CACHE_VAL(am_cv_exeext,
700 +[if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
703 +cat > am_c_test.c << 'EOF'
705 +/* Nothing needed here */
708 +${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
710 +for file in am_c_test.*; do
714 + *) am_cv_exeext=`echo $file | sed -e s/am_c_test//` ;;
718 +test x"${am_cv_exeext}" = x && am_cv_exeext=no
721 +test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
722 +AC_MSG_RESULT(${am_cv_exeext})
725 +# Check to see if we're running under Cygwin32, without using
726 +# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
727 +# Otherwise set it to "no".
730 +AC_DEFUN(AM_CYGWIN32,
731 +[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
732 +[AC_TRY_COMPILE(,[return __CYGWIN32__;],
733 +am_cv_cygwin32=yes, am_cv_cygwin32=no)
736 +test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
738 +# Check to see if we're running under Mingw, without using
739 +# AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
740 +# Otherwise set it to "no".
743 +AC_DEFUN(AM_MINGW32,
744 +[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
745 +[AC_TRY_COMPILE(,[return __MINGW32__;],
746 +am_cv_mingw32=yes, am_cv_mingw32=no)
749 +test "$am_cv_mingw32" = yes && MINGW32=yes])
751 diff -urN newlib-1.8.2/newlib/libc/sys/aica/chdir.c newlib-1.8.2-aica/newlib/libc/sys/aica/chdir.c
752 --- newlib-1.8.2/newlib/libc/sys/aica/chdir.c 1970-01-01 10:00:00.000000000 +1000
753 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/chdir.c 2008-08-13 11:54:44.000000000 +1000
758 +chdir (const char *path)
760 + char *obj = _newlib_vfs_new_string (path);
762 + struct media_ops *mops = _newlib_vfs_get_media_ops (path);
763 + int res = mops->chdir (obj);
765 + _newlib_vfs_delete_string (obj);
769 diff -urN newlib-1.8.2/newlib/libc/sys/aica/chmod.c newlib-1.8.2-aica/newlib/libc/sys/aica/chmod.c
770 --- newlib-1.8.2/newlib/libc/sys/aica/chmod.c 1970-01-01 10:00:00.000000000 +1000
771 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/chmod.c 2008-08-13 11:54:44.000000000 +1000
773 +#include <sys/types.h>
778 +chmod (const char *path, mode_t mode)
780 + char *obj = _newlib_vfs_new_string (path);
782 + struct media_ops *mops = _newlib_vfs_get_media_ops (path);
783 + int res = mops->chmod (obj, mode);
785 + _newlib_vfs_delete_string (obj);
789 diff -urN newlib-1.8.2/newlib/libc/sys/aica/close.c newlib-1.8.2-aica/newlib/libc/sys/aica/close.c
790 --- newlib-1.8.2/newlib/libc/sys/aica/close.c 1970-01-01 10:00:00.000000000 +1000
791 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/close.c 2008-08-13 11:54:44.000000000 +1000
798 + struct file *pf = _newlib_vfs_get_file (fd);
799 + int res = pf->fops->close (pf);
803 + return _newlib_vfs_remove_file (pf);
808 diff -urN newlib-1.8.2/newlib/libc/sys/aica/configure newlib-1.8.2-aica/newlib/libc/sys/aica/configure
809 --- newlib-1.8.2/newlib/libc/sys/aica/configure 1970-01-01 10:00:00.000000000 +1000
810 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/configure 2008-08-13 11:54:44.000000000 +1000
814 +# Guess values for system-dependent variables and create Makefiles.
815 +# Generated automatically using autoconf version 2.13
816 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
818 +# This configure script is free software; the Free Software Foundation
819 +# gives unlimited permission to copy, distribute and modify it.
823 +ac_default_prefix=/usr/local
824 +# Any additions from configure.in:
826 + --enable-multilib build many library versions (default)"
828 + --enable-target-optspace optimize for space"
830 + --enable-newlib-mb enable multibyte support"
832 +# Initialize some variables set by options.
833 +# The variables have the same names as the options, with
834 +# dashes changed to underlines.
836 +cache_file=./config.cache
845 +program_transform_name=s,x,x,
853 +bindir='${exec_prefix}/bin'
854 +sbindir='${exec_prefix}/sbin'
855 +libexecdir='${exec_prefix}/libexec'
856 +datadir='${prefix}/share'
857 +sysconfdir='${prefix}/etc'
858 +sharedstatedir='${prefix}/com'
859 +localstatedir='${prefix}/var'
860 +libdir='${exec_prefix}/lib'
861 +includedir='${prefix}/include'
862 +oldincludedir='/usr/include'
863 +infodir='${prefix}/info'
864 +mandir='${prefix}/man'
866 +# Initialize some other variables.
869 +SHELL=${CONFIG_SHELL-/bin/sh}
870 +# Maximum number of lines to put in a shell here document.
871 +ac_max_here_lines=12
877 + # If the previous option needs an argument, assign it.
878 + if test -n "$ac_prev"; then
879 + eval "$ac_prev=\$ac_option"
884 + case "$ac_option" in
885 + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
889 + # Accept the important Cygnus configure options, so we can diagnose typos.
891 + case "$ac_option" in
893 + -bindir | --bindir | --bindi | --bind | --bin | --bi)
895 + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
896 + bindir="$ac_optarg" ;;
898 + -build | --build | --buil | --bui | --bu)
900 + -build=* | --build=* | --buil=* | --bui=* | --bu=*)
901 + build="$ac_optarg" ;;
903 + -cache-file | --cache-file | --cache-fil | --cache-fi \
904 + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
905 + ac_prev=cache_file ;;
906 + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
907 + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
908 + cache_file="$ac_optarg" ;;
910 + -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
912 + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
914 + datadir="$ac_optarg" ;;
916 + -disable-* | --disable-*)
917 + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
918 + # Reject names that are not valid shell variable names.
919 + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
920 + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
922 + ac_feature=`echo $ac_feature| sed 's/-/_/g'`
923 + eval "enable_${ac_feature}=no" ;;
925 + -enable-* | --enable-*)
926 + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
927 + # Reject names that are not valid shell variable names.
928 + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
929 + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
931 + ac_feature=`echo $ac_feature| sed 's/-/_/g'`
932 + case "$ac_option" in
934 + *) ac_optarg=yes ;;
936 + eval "enable_${ac_feature}='$ac_optarg'" ;;
938 + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
939 + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
940 + | --exec | --exe | --ex)
941 + ac_prev=exec_prefix ;;
942 + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
943 + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
944 + | --exec=* | --exe=* | --ex=*)
945 + exec_prefix="$ac_optarg" ;;
947 + -gas | --gas | --ga | --g)
948 + # Obsolete; use --with-gas.
951 + -help | --help | --hel | --he)
952 + # Omit some internal or obsolete options to make the list less imposing.
953 + # This message is too long to be a string in the A/UX 3.1 sh.
955 +Usage: configure [options] [host]
956 +Options: [defaults in brackets after descriptions]
958 + --cache-file=FILE cache test results in FILE
959 + --help print this message
960 + --no-create do not create output files
961 + --quiet, --silent do not print \`checking...' messages
962 + --version print the version of autoconf that created configure
963 +Directory and file names:
964 + --prefix=PREFIX install architecture-independent files in PREFIX
965 + [$ac_default_prefix]
966 + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
968 + --bindir=DIR user executables in DIR [EPREFIX/bin]
969 + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
970 + --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
971 + --datadir=DIR read-only architecture-independent data in DIR
973 + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
974 + --sharedstatedir=DIR modifiable architecture-independent data in DIR
976 + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
977 + --libdir=DIR object code libraries in DIR [EPREFIX/lib]
978 + --includedir=DIR C header files in DIR [PREFIX/include]
979 + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
980 + --infodir=DIR info documentation in DIR [PREFIX/info]
981 + --mandir=DIR man documentation in DIR [PREFIX/man]
982 + --srcdir=DIR find the sources in DIR [configure dir or ..]
983 + --program-prefix=PREFIX prepend PREFIX to installed program names
984 + --program-suffix=SUFFIX append SUFFIX to installed program names
985 + --program-transform-name=PROGRAM
986 + run sed PROGRAM on installed program names
990 + --build=BUILD configure for building on BUILD [BUILD=HOST]
991 + --host=HOST configure for HOST [guessed]
992 + --target=TARGET configure for TARGET [TARGET=HOST]
993 +Features and packages:
994 + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
995 + --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
996 + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
997 + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
998 + --x-includes=DIR X include files are in DIR
999 + --x-libraries=DIR X library files are in DIR
1001 + if test -n "$ac_help"; then
1002 + echo "--enable and --with options recognized:$ac_help"
1006 + -host | --host | --hos | --ho)
1008 + -host=* | --host=* | --hos=* | --ho=*)
1009 + host="$ac_optarg" ;;
1011 + -includedir | --includedir | --includedi | --included | --include \
1012 + | --includ | --inclu | --incl | --inc)
1013 + ac_prev=includedir ;;
1014 + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
1015 + | --includ=* | --inclu=* | --incl=* | --inc=*)
1016 + includedir="$ac_optarg" ;;
1018 + -infodir | --infodir | --infodi | --infod | --info | --inf)
1019 + ac_prev=infodir ;;
1020 + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
1021 + infodir="$ac_optarg" ;;
1023 + -libdir | --libdir | --libdi | --libd)
1025 + -libdir=* | --libdir=* | --libdi=* | --libd=*)
1026 + libdir="$ac_optarg" ;;
1028 + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
1029 + | --libexe | --libex | --libe)
1030 + ac_prev=libexecdir ;;
1031 + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
1032 + | --libexe=* | --libex=* | --libe=*)
1033 + libexecdir="$ac_optarg" ;;
1035 + -localstatedir | --localstatedir | --localstatedi | --localstated \
1036 + | --localstate | --localstat | --localsta | --localst \
1037 + | --locals | --local | --loca | --loc | --lo)
1038 + ac_prev=localstatedir ;;
1039 + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
1040 + | --localstate=* | --localstat=* | --localsta=* | --localst=* \
1041 + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
1042 + localstatedir="$ac_optarg" ;;
1044 + -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
1046 + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
1047 + mandir="$ac_optarg" ;;
1049 + -nfp | --nfp | --nf)
1050 + # Obsolete; use --without-fp.
1053 + -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1054 + | --no-cr | --no-c)
1057 + -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1058 + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1059 + no_recursion=yes ;;
1061 + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
1062 + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
1063 + | --oldin | --oldi | --old | --ol | --o)
1064 + ac_prev=oldincludedir ;;
1065 + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1066 + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1067 + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1068 + oldincludedir="$ac_optarg" ;;
1070 + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1072 + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1073 + prefix="$ac_optarg" ;;
1075 + -program-prefix | --program-prefix | --program-prefi | --program-pref \
1076 + | --program-pre | --program-pr | --program-p)
1077 + ac_prev=program_prefix ;;
1078 + -program-prefix=* | --program-prefix=* | --program-prefi=* \
1079 + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1080 + program_prefix="$ac_optarg" ;;
1082 + -program-suffix | --program-suffix | --program-suffi | --program-suff \
1083 + | --program-suf | --program-su | --program-s)
1084 + ac_prev=program_suffix ;;
1085 + -program-suffix=* | --program-suffix=* | --program-suffi=* \
1086 + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1087 + program_suffix="$ac_optarg" ;;
1089 + -program-transform-name | --program-transform-name \
1090 + | --program-transform-nam | --program-transform-na \
1091 + | --program-transform-n | --program-transform- \
1092 + | --program-transform | --program-transfor \
1093 + | --program-transfo | --program-transf \
1094 + | --program-trans | --program-tran \
1095 + | --progr-tra | --program-tr | --program-t)
1096 + ac_prev=program_transform_name ;;
1097 + -program-transform-name=* | --program-transform-name=* \
1098 + | --program-transform-nam=* | --program-transform-na=* \
1099 + | --program-transform-n=* | --program-transform-=* \
1100 + | --program-transform=* | --program-transfor=* \
1101 + | --program-transfo=* | --program-transf=* \
1102 + | --program-trans=* | --program-tran=* \
1103 + | --progr-tra=* | --program-tr=* | --program-t=*)
1104 + program_transform_name="$ac_optarg" ;;
1106 + -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1107 + | -silent | --silent | --silen | --sile | --sil)
1110 + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1111 + ac_prev=sbindir ;;
1112 + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1113 + | --sbi=* | --sb=*)
1114 + sbindir="$ac_optarg" ;;
1116 + -sharedstatedir | --sharedstatedir | --sharedstatedi \
1117 + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1118 + | --sharedst | --shareds | --shared | --share | --shar \
1120 + ac_prev=sharedstatedir ;;
1121 + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1122 + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1123 + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1124 + | --sha=* | --sh=*)
1125 + sharedstatedir="$ac_optarg" ;;
1127 + -site | --site | --sit)
1129 + -site=* | --site=* | --sit=*)
1130 + site="$ac_optarg" ;;
1132 + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1134 + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1135 + srcdir="$ac_optarg" ;;
1137 + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1138 + | --syscon | --sysco | --sysc | --sys | --sy)
1139 + ac_prev=sysconfdir ;;
1140 + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1141 + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1142 + sysconfdir="$ac_optarg" ;;
1144 + -target | --target | --targe | --targ | --tar | --ta | --t)
1146 + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1147 + target="$ac_optarg" ;;
1149 + -v | -verbose | --verbose | --verbos | --verbo | --verb)
1152 + -version | --version | --versio | --versi | --vers)
1153 + echo "configure generated by autoconf version 2.13"
1156 + -with-* | --with-*)
1157 + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
1158 + # Reject names that are not valid shell variable names.
1159 + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
1160 + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
1162 + ac_package=`echo $ac_package| sed 's/-/_/g'`
1163 + case "$ac_option" in
1165 + *) ac_optarg=yes ;;
1167 + eval "with_${ac_package}='$ac_optarg'" ;;
1169 + -without-* | --without-*)
1170 + ac_package=`echo $ac_option|sed -e 's/-*without-//'`
1171 + # Reject names that are not valid shell variable names.
1172 + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
1173 + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
1175 + ac_package=`echo $ac_package| sed 's/-/_/g'`
1176 + eval "with_${ac_package}=no" ;;
1179 + # Obsolete; use --with-x.
1182 + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1183 + | --x-incl | --x-inc | --x-in | --x-i)
1184 + ac_prev=x_includes ;;
1185 + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1186 + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1187 + x_includes="$ac_optarg" ;;
1189 + -x-libraries | --x-libraries | --x-librarie | --x-librari \
1190 + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1191 + ac_prev=x_libraries ;;
1192 + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1193 + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1194 + x_libraries="$ac_optarg" ;;
1196 + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
1200 + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
1201 + echo "configure: warning: $ac_option: invalid host type" 1>&2
1203 + if test "x$nonopt" != xNONE; then
1204 + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
1206 + nonopt="$ac_option"
1212 +if test -n "$ac_prev"; then
1213 + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
1216 +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
1218 +# File descriptor usage:
1221 +# 2 errors and warnings
1222 +# 3 some systems may open it to /dev/tty
1223 +# 4 used on the Kubota Titan
1224 +# 6 checking for... messages and results
1225 +# 5 compiler messages saved in config.log
1226 +if test "$silent" = yes; then
1231 +exec 5>./config.log
1234 +This file contains any messages produced by compilers while
1235 +running configure, to aid debugging if configure makes a mistake.
1238 +# Strip out --no-create and --no-recursion so they do not pile up.
1239 +# Also quote any args containing shell metacharacters.
1244 + -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1245 + | --no-cr | --no-c) ;;
1246 + -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1247 + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
1248 + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
1249 + ac_configure_args="$ac_configure_args '$ac_arg'" ;;
1250 + *) ac_configure_args="$ac_configure_args $ac_arg" ;;
1255 +# Only set these to C if already set. These must not be set unconditionally
1256 +# because not all systems understand e.g. LANG=C (notably SCO).
1257 +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
1258 +# Non-C LC_CTYPE values break the ctype check.
1259 +if test "${LANG+set}" = set; then LANG=C; export LANG; fi
1260 +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
1261 +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
1262 +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
1264 +# confdefs.h avoids OS command line length limits that DEFS can exceed.
1265 +rm -rf conftest* confdefs.h
1266 +# AIX cpp loses on an empty file, so make sure it contains at least a newline.
1269 +# A filename unique to this package, relative to the directory that
1270 +# configure is in, which we can look for to find out if srcdir is correct.
1271 +ac_unique_file=sbrk.c
1273 +# Find the source files, if location was not specified.
1274 +if test -z "$srcdir"; then
1275 + ac_srcdir_defaulted=yes
1276 + # Try the directory containing this script, then its parent.
1278 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
1279 + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
1280 + srcdir=$ac_confdir
1281 + if test ! -r $srcdir/$ac_unique_file; then
1285 + ac_srcdir_defaulted=no
1287 +if test ! -r $srcdir/$ac_unique_file; then
1288 + if test "$ac_srcdir_defaulted" = yes; then
1289 + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
1291 + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
1294 +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
1296 +# Prefer explicitly selected file to automatically selected ones.
1297 +if test -z "$CONFIG_SITE"; then
1298 + if test "x$prefix" != xNONE; then
1299 + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
1301 + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
1304 +for ac_site_file in $CONFIG_SITE; do
1305 + if test -r "$ac_site_file"; then
1306 + echo "loading site script $ac_site_file"
1311 +if test -r "$cache_file"; then
1312 + echo "loading cache $cache_file"
1315 + echo "creating cache $cache_file"
1320 +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1321 +ac_cpp='$CPP $CPPFLAGS'
1322 +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1323 +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1324 +cross_compiling=$ac_cv_prog_cc_cross
1328 +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
1329 + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
1330 + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
1334 + ac_n=-n ac_c= ac_t=
1337 + ac_n= ac_c='\c' ac_t=
1343 +for ac_dir in ../../../.. $srcdir/../../../..; do
1344 + if test -f $ac_dir/install-sh; then
1345 + ac_aux_dir=$ac_dir
1346 + ac_install_sh="$ac_aux_dir/install-sh -c"
1348 + elif test -f $ac_dir/install.sh; then
1349 + ac_aux_dir=$ac_dir
1350 + ac_install_sh="$ac_aux_dir/install.sh -c"
1354 +if test -z "$ac_aux_dir"; then
1355 + { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; }
1357 +ac_config_guess=$ac_aux_dir/config.guess
1358 +ac_config_sub=$ac_aux_dir/config.sub
1359 +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
1362 +# Find a good install program. We prefer a C program (faster),
1363 +# so one script is as good as another. But avoid the broken or
1364 +# incompatible versions:
1365 +# SysV /etc/install, /usr/sbin/install
1366 +# SunOS /usr/etc/install
1367 +# IRIX /sbin/install
1369 +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1370 +# AFS /usr/afsws/bin/install, which mishandles nonexistent args
1371 +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1372 +# ./install, which can be erroneously created by make from ./install.sh.
1373 +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1374 +echo "configure:564: checking for a BSD compatible install" >&5
1375 +if test -z "$INSTALL"; then
1376 +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1377 + echo $ac_n "(cached) $ac_c" 1>&6
1379 + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
1380 + for ac_dir in $PATH; do
1381 + # Account for people who put trailing slashes in PATH elements.
1382 + case "$ac_dir/" in
1383 + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1385 + # OSF1 and SCO ODT 3.0 have their own names for install.
1386 + # Don't use installbsd from OSF since it installs stuff as root
1388 + for ac_prog in ginstall scoinst install; do
1389 + if test -f $ac_dir/$ac_prog; then
1390 + if test $ac_prog = install &&
1391 + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1392 + # AIX install. It has an incompatible calling convention.
1395 + ac_cv_path_install="$ac_dir/$ac_prog -c"
1403 + IFS="$ac_save_IFS"
1406 + if test "${ac_cv_path_install+set}" = set; then
1407 + INSTALL="$ac_cv_path_install"
1409 + # As a last resort, use the slow shell script. We don't cache a
1410 + # path for INSTALL within a source directory, because that will
1411 + # break other packages using the cache if that directory is
1412 + # removed, or if the path is relative.
1413 + INSTALL="$ac_install_sh"
1416 +echo "$ac_t""$INSTALL" 1>&6
1418 +# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1419 +# It thinks the first close brace ends the variable substitution.
1420 +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1422 +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1424 +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1427 +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1429 +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
1430 +echo "configure:620: checking whether build environment is sane" >&5
1433 +echo timestamp > conftestfile
1434 +# Do `set' in a subshell so we don't clobber the current shell's
1435 +# arguments. Must try -L first in case configure is actually a
1436 +# symlink; some systems play weird games with the mod time of symlinks
1437 +# (eg FreeBSD returns the mod time of the symlink's containing
1440 + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1441 + if test "$*" = "X"; then
1443 + set X `ls -t $srcdir/configure conftestfile`
1445 + if test "$*" != "X $srcdir/configure conftestfile" \
1446 + && test "$*" != "X conftestfile $srcdir/configure"; then
1448 + # If neither matched, then we have a broken ls. This can happen
1449 + # if, for instance, CONFIG_SHELL is bash and it inherits a
1450 + # broken ls alias from the environment. This has actually
1451 + # happened. Such a system could not be considered "sane".
1452 + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
1453 +alias in your environment" 1>&2; exit 1; }
1456 + test "$2" = conftestfile
1462 + { echo "configure: error: newly created file is older than distributed files!
1463 +Check your system clock" 1>&2; exit 1; }
1466 +echo "$ac_t""yes" 1>&6
1467 +if test "$program_transform_name" = s,x,x,; then
1468 + program_transform_name=
1470 + # Double any \ or $. echo might interpret backslashes.
1471 + cat <<\EOF_SED > conftestsed
1472 +s,\\,\\\\,g; s,\$,$$,g
1474 + program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
1477 +test "$program_prefix" != NONE &&
1478 + program_transform_name="s,^,${program_prefix},; $program_transform_name"
1479 +# Use a double $ so make ignores it.
1480 +test "$program_suffix" != NONE &&
1481 + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
1483 +# sed with no file args requires a program.
1484 +test "$program_transform_name" = "" && program_transform_name="s,x,x,"
1486 +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1487 +echo "configure:677: checking whether ${MAKE-make} sets \${MAKE}" >&5
1488 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1489 +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1490 + echo $ac_n "(cached) $ac_c" 1>&6
1492 + cat > conftestmake <<\EOF
1494 + @echo 'ac_maketemp="${MAKE}"'
1496 +# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1497 +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1498 +if test -n "$ac_maketemp"; then
1499 + eval ac_cv_prog_make_${ac_make}_set=yes
1501 + eval ac_cv_prog_make_${ac_make}_set=no
1505 +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1506 + echo "$ac_t""yes" 1>&6
1509 + echo "$ac_t""no" 1>&6
1510 + SET_MAKE="MAKE=${MAKE-make}"
1513 +if test $host != $build; then
1514 + ac_tool_prefix=${host_alias}-
1519 +echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
1520 +echo "configure:710: checking for Cygwin32 environment" >&5
1521 +if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
1522 + echo $ac_n "(cached) $ac_c" 1>&6
1524 + cat > conftest.$ac_ext <<EOF
1525 +#line 715 "configure"
1526 +#include "confdefs.h"
1529 +return __CYGWIN32__;
1532 +if { (eval echo configure:722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1534 + am_cv_cygwin32=yes
1536 + echo "configure: failed program was:" >&5
1537 + cat conftest.$ac_ext >&5
1545 +echo "$ac_t""$am_cv_cygwin32" 1>&6
1547 +test "$am_cv_cygwin32" = yes && CYGWIN32=yes
1548 +echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
1549 +echo "configure:739: checking for Mingw32 environment" >&5
1550 +if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
1551 + echo $ac_n "(cached) $ac_c" 1>&6
1553 + cat > conftest.$ac_ext <<EOF
1554 +#line 744 "configure"
1555 +#include "confdefs.h"
1558 +return __MINGW32__;
1561 +if { (eval echo configure:751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1565 + echo "configure: failed program was:" >&5
1566 + cat conftest.$ac_ext >&5
1574 +echo "$ac_t""$am_cv_mingw32" 1>&6
1576 +test "$am_cv_mingw32" = yes && MINGW32=yes
1578 +# Check whether --enable-multilib or --disable-multilib was given.
1579 +if test "${enable_multilib+set}" = set; then
1580 + enableval="$enable_multilib"
1581 + case "${enableval}" in
1582 + yes) multilib=yes ;;
1583 + no) multilib=no ;;
1584 + *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;;
1590 +# Check whether --enable-target-optspace or --disable-target-optspace was given.
1591 +if test "${enable_target_optspace+set}" = set; then
1592 + enableval="$enable_target_optspace"
1593 + case "${enableval}" in
1594 + yes) target_optspace=yes ;;
1595 + no) target_optspace=no ;;
1596 + *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;;
1602 +# Check whether --enable-newlib-mb or --disable-newlib-mb was given.
1603 +if test "${enable_newlib_mb+set}" = set; then
1604 + enableval="$enable_newlib_mb"
1605 + case "${enableval}" in
1606 + yes) newlib_mb=yes ;;
1607 + no) newlib_mb=no ;;
1608 + *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;;
1615 +test -z "${with_target_subdir}" && with_target_subdir=.
1617 +if test "${srcdir}" = "."; then
1618 + if test "${with_target_subdir}" != "."; then
1619 + newlib_basedir="${srcdir}/${with_multisrctop}../../../.."
1621 + newlib_basedir="${srcdir}/${with_multisrctop}../../.."
1624 + newlib_basedir="${srcdir}/../../.."
1629 +# Make sure we can run config.sub.
1630 +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
1631 +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1634 +echo $ac_n "checking host system type""... $ac_c" 1>&6
1635 +echo "configure:825: checking host system type" >&5
1638 +case "$host_alias" in
1642 + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
1643 + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1645 + *) host_alias=$nonopt ;;
1649 +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
1650 +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1651 +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1652 +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1653 +echo "$ac_t""$host" 1>&6
1661 +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1662 + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1664 +cat >> confdefs.h <<EOF
1665 +#define PACKAGE "$PACKAGE"
1668 +cat >> confdefs.h <<EOF
1669 +#define VERSION "$VERSION"
1674 +missing_dir=`cd $ac_aux_dir && pwd`
1675 +echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1676 +echo "configure:866: checking for working aclocal" >&5
1677 +# Run test in a subshell; some versions of sh will print an error if
1678 +# an executable is not found, even if stderr is redirected.
1679 +# Redirect stdin to placate older versions of autoconf. Sigh.
1680 +if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1682 + echo "$ac_t""found" 1>&6
1684 + ACLOCAL="$missing_dir/missing aclocal"
1685 + echo "$ac_t""missing" 1>&6
1688 +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1689 +echo "configure:879: checking for working autoconf" >&5
1690 +# Run test in a subshell; some versions of sh will print an error if
1691 +# an executable is not found, even if stderr is redirected.
1692 +# Redirect stdin to placate older versions of autoconf. Sigh.
1693 +if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1695 + echo "$ac_t""found" 1>&6
1697 + AUTOCONF="$missing_dir/missing autoconf"
1698 + echo "$ac_t""missing" 1>&6
1701 +echo $ac_n "checking for working automake""... $ac_c" 1>&6
1702 +echo "configure:892: checking for working automake" >&5
1703 +# Run test in a subshell; some versions of sh will print an error if
1704 +# an executable is not found, even if stderr is redirected.
1705 +# Redirect stdin to placate older versions of autoconf. Sigh.
1706 +if (automake --version) < /dev/null > /dev/null 2>&1; then
1708 + echo "$ac_t""found" 1>&6
1710 + AUTOMAKE="$missing_dir/missing automake"
1711 + echo "$ac_t""missing" 1>&6
1714 +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1715 +echo "configure:905: checking for working autoheader" >&5
1716 +# Run test in a subshell; some versions of sh will print an error if
1717 +# an executable is not found, even if stderr is redirected.
1718 +# Redirect stdin to placate older versions of autoconf. Sigh.
1719 +if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1720 + AUTOHEADER=autoheader
1721 + echo "$ac_t""found" 1>&6
1723 + AUTOHEADER="$missing_dir/missing autoheader"
1724 + echo "$ac_t""missing" 1>&6
1727 +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1728 +echo "configure:918: checking for working makeinfo" >&5
1729 +# Run test in a subshell; some versions of sh will print an error if
1730 +# an executable is not found, even if stderr is redirected.
1731 +# Redirect stdin to placate older versions of autoconf. Sigh.
1732 +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1734 + echo "$ac_t""found" 1>&6
1736 + MAKEINFO="$missing_dir/missing makeinfo"
1737 + echo "$ac_t""missing" 1>&6
1742 +# FIXME: We temporarily define our own version of AC_PROG_CC. This is
1743 +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
1744 +# are probably using a cross compiler, which will not be able to fully
1745 +# link an executable. This should really be fixed in autoconf
1750 +# Extract the first word of "gcc", so it can be a program name with args.
1751 +set dummy gcc; ac_word=$2
1752 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1753 +echo "configure:943: checking for $ac_word" >&5
1754 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1755 + echo $ac_n "(cached) $ac_c" 1>&6
1757 + if test -n "$CC"; then
1758 + ac_cv_prog_CC="$CC" # Let the user override the test.
1760 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1762 + for ac_dir in $ac_dummy; do
1763 + test -z "$ac_dir" && ac_dir=.
1764 + if test -f $ac_dir/$ac_word; then
1765 + ac_cv_prog_CC="gcc"
1769 + IFS="$ac_save_ifs"
1772 +CC="$ac_cv_prog_CC"
1773 +if test -n "$CC"; then
1774 + echo "$ac_t""$CC" 1>&6
1776 + echo "$ac_t""no" 1>&6
1779 +if test -z "$CC"; then
1780 + # Extract the first word of "cc", so it can be a program name with args.
1781 +set dummy cc; ac_word=$2
1782 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1783 +echo "configure:973: checking for $ac_word" >&5
1784 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1785 + echo $ac_n "(cached) $ac_c" 1>&6
1787 + if test -n "$CC"; then
1788 + ac_cv_prog_CC="$CC" # Let the user override the test.
1790 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1791 + ac_prog_rejected=no
1793 + for ac_dir in $ac_dummy; do
1794 + test -z "$ac_dir" && ac_dir=.
1795 + if test -f $ac_dir/$ac_word; then
1796 + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1797 + ac_prog_rejected=yes
1800 + ac_cv_prog_CC="cc"
1804 + IFS="$ac_save_ifs"
1805 +if test $ac_prog_rejected = yes; then
1806 + # We found a bogon in the path, so make sure we never use it.
1807 + set dummy $ac_cv_prog_CC
1809 + if test $# -gt 0; then
1810 + # We chose a different compiler from the bogus one.
1811 + # However, it has the same basename, so the bogon will be chosen
1812 + # first if we set CC to just the basename; use the full file name.
1814 + set dummy "$ac_dir/$ac_word" "$@"
1816 + ac_cv_prog_CC="$@"
1821 +CC="$ac_cv_prog_CC"
1822 +if test -n "$CC"; then
1823 + echo "$ac_t""$CC" 1>&6
1825 + echo "$ac_t""no" 1>&6
1828 + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1831 +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1832 +echo "configure:1022: checking whether we are using GNU C" >&5
1833 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1834 + echo $ac_n "(cached) $ac_c" 1>&6
1836 + cat > conftest.c <<EOF
1841 +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
1842 + ac_cv_prog_gcc=yes
1848 +echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1850 +if test $ac_cv_prog_gcc = yes; then
1852 + ac_test_CFLAGS="${CFLAGS+set}"
1853 + ac_save_CFLAGS="$CFLAGS"
1855 + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1856 +echo "configure:1046: checking whether ${CC-cc} accepts -g" >&5
1857 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1858 + echo $ac_n "(cached) $ac_c" 1>&6
1860 + echo 'void f(){}' > conftest.c
1861 +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1862 + ac_cv_prog_cc_g=yes
1864 + ac_cv_prog_cc_g=no
1870 +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1871 + if test "$ac_test_CFLAGS" = set; then
1872 + CFLAGS="$ac_save_CFLAGS"
1873 + elif test $ac_cv_prog_cc_g = yes; then
1880 + test "${CFLAGS+set}" = set || CFLAGS="-g"
1884 +# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
1885 +# run it explicitly here, it will be run implicitly before
1886 +# NEWLIB_CONFIGURE, which doesn't work because that means that it will
1887 +# be run before AC_CANONICAL_HOST.
1888 +echo $ac_n "checking build system type""... $ac_c" 1>&6
1889 +echo "configure:1079: checking build system type" >&5
1892 +case "$build_alias" in
1895 + NONE) build_alias=$host_alias ;;
1896 + *) build_alias=$nonopt ;;
1900 +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
1901 +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1902 +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1903 +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1904 +echo "$ac_t""$build" 1>&6
1907 +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
1908 +set dummy ${ac_tool_prefix}as; ac_word=$2
1909 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1910 +echo "configure:1100: checking for $ac_word" >&5
1911 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
1912 + echo $ac_n "(cached) $ac_c" 1>&6
1914 + if test -n "$AS"; then
1915 + ac_cv_prog_AS="$AS" # Let the user override the test.
1917 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1919 + for ac_dir in $ac_dummy; do
1920 + test -z "$ac_dir" && ac_dir=.
1921 + if test -f $ac_dir/$ac_word; then
1922 + ac_cv_prog_AS="${ac_tool_prefix}as"
1926 + IFS="$ac_save_ifs"
1927 + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as"
1930 +AS="$ac_cv_prog_AS"
1931 +if test -n "$AS"; then
1932 + echo "$ac_t""$AS" 1>&6
1934 + echo "$ac_t""no" 1>&6
1939 +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
1940 +set dummy ${ac_tool_prefix}ar; ac_word=$2
1941 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1942 +echo "configure:1132: checking for $ac_word" >&5
1943 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
1944 + echo $ac_n "(cached) $ac_c" 1>&6
1946 + if test -n "$AR"; then
1947 + ac_cv_prog_AR="$AR" # Let the user override the test.
1949 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1951 + for ac_dir in $ac_dummy; do
1952 + test -z "$ac_dir" && ac_dir=.
1953 + if test -f $ac_dir/$ac_word; then
1954 + ac_cv_prog_AR="${ac_tool_prefix}ar"
1958 + IFS="$ac_save_ifs"
1959 + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
1962 +AR="$ac_cv_prog_AR"
1963 +if test -n "$AR"; then
1964 + echo "$ac_t""$AR" 1>&6
1966 + echo "$ac_t""no" 1>&6
1971 +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
1972 +set dummy ${ac_tool_prefix}ranlib; ac_word=$2
1973 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1974 +echo "configure:1164: checking for $ac_word" >&5
1975 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1976 + echo $ac_n "(cached) $ac_c" 1>&6
1978 + if test -n "$RANLIB"; then
1979 + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1981 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1983 + for ac_dir in $ac_dummy; do
1984 + test -z "$ac_dir" && ac_dir=.
1985 + if test -f $ac_dir/$ac_word; then
1986 + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
1990 + IFS="$ac_save_ifs"
1993 +RANLIB="$ac_cv_prog_RANLIB"
1994 +if test -n "$RANLIB"; then
1995 + echo "$ac_t""$RANLIB" 1>&6
1997 + echo "$ac_t""no" 1>&6
2001 +if test -z "$ac_cv_prog_RANLIB"; then
2002 +if test -n "$ac_tool_prefix"; then
2003 + # Extract the first word of "ranlib", so it can be a program name with args.
2004 +set dummy ranlib; ac_word=$2
2005 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2006 +echo "configure:1196: checking for $ac_word" >&5
2007 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
2008 + echo $ac_n "(cached) $ac_c" 1>&6
2010 + if test -n "$RANLIB"; then
2011 + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2013 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2015 + for ac_dir in $ac_dummy; do
2016 + test -z "$ac_dir" && ac_dir=.
2017 + if test -f $ac_dir/$ac_word; then
2018 + ac_cv_prog_RANLIB="ranlib"
2022 + IFS="$ac_save_ifs"
2023 + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2026 +RANLIB="$ac_cv_prog_RANLIB"
2027 +if test -n "$RANLIB"; then
2028 + echo "$ac_t""$RANLIB" 1>&6
2030 + echo "$ac_t""no" 1>&6
2040 +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
2043 +#AM_MAINTAINER_MODE
2045 +# We need AM_EXEEXT to keep automake happy in cygnus mode. However,
2046 +# at least currently, we never actually build a program, so we never
2047 +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
2048 +# fails, because we are probably configuring with a cross compiler
2049 +# which can't create executables. So we include AM_EXEEXT to keep
2050 +# automake happy, but we don't execute it, since we don't care about
2055 +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
2056 +echo "configure:1246: checking for executable suffix" >&5
2057 +if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
2058 + echo $ac_n "(cached) $ac_c" 1>&6
2060 + if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
2063 +cat > am_c_test.c << 'EOF'
2065 +/* Nothing needed here */
2068 +${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
2070 +for file in am_c_test.*; do
2074 + *) am_cv_exeext=`echo $file | sed -e s/am_c_test//` ;;
2080 +test x"${am_cv_exeext}" = x && am_cv_exeext=no
2083 +test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
2084 +echo "$ac_t""${am_cv_exeext}" 1>&6
2088 +. ${newlib_basedir}/configure.host
2090 +case ${newlib_basedir} in
2091 +/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;;
2092 +*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;;
2095 +newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include"
2098 + newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/include"
2102 +newlib_cflags="${newlib_cflags} -fno-builtin"
2104 +NEWLIB_CFLAGS=${newlib_cflags}
2112 +cat > confcache <<\EOF
2113 +# This file is a shell script that caches the results of configure
2114 +# tests run on this system so they can be shared between configure
2115 +# scripts and configure runs. It is not useful on other systems.
2116 +# If it contains results you don't want to keep, you may remove or edit it.
2118 +# By default, configure uses ./config.cache as the cache file,
2119 +# creating it if it does not exist already. You can give configure
2120 +# the --cache-file=FILE option to use a different cache file; that is
2121 +# what configure does when it calls configure scripts in
2122 +# subdirectories, so they share the cache.
2123 +# Giving --cache-file=/dev/null disables caching, for debugging configure.
2124 +# config.status only pays attention to the cache file if you give it the
2125 +# --recheck option to rerun configure.
2128 +# The following way of writing the cache mishandles newlines in values,
2129 +# but we know of no workaround that is simple, portable, and efficient.
2130 +# So, don't put newlines in cache variables' values.
2131 +# Ultrix sh set writes to stderr and can't be redirected directly,
2132 +# and sets the high bit in the cache file unless we assign to the vars.
2134 + case `(ac_space=' '; set | grep ac_space) 2>&1` in
2136 + # `set' does not quote correctly, so add quotes (double-quote substitution
2137 + # turns \\\\ into \\, and sed turns \\ into \).
2139 + -e "s/'/'\\\\''/g" \
2140 + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
2143 + # `set' quotes correctly as required by POSIX, so do not add quotes.
2144 + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
2147 +if cmp -s $cache_file confcache; then
2150 + if test -w $cache_file; then
2151 + echo "updating cache $cache_file"
2152 + cat confcache > $cache_file
2154 + echo "not updating unwritable cache $cache_file"
2159 +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
2161 +test "x$prefix" = xNONE && prefix=$ac_default_prefix
2162 +# Let make expand exec_prefix.
2163 +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
2165 +# Any assignment to VPATH causes Sun make to only execute
2166 +# the first set of double-colon rules, so remove it if not needed.
2167 +# If there is a colon in the path, we need to keep it.
2168 +if test "x$srcdir" = x.; then
2169 + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
2172 +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
2174 +# Transform confdefs.h into DEFS.
2175 +# Protect against shell expansion while executing Makefile rules.
2176 +# Protect against Makefile macro expansion.
2177 +cat > conftest.defs <<\EOF
2178 +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
2179 +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
2184 +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
2185 +rm -f conftest.defs
2188 +# Without the "./", some shells look in PATH for config.status.
2189 +: ${CONFIG_STATUS=./config.status}
2191 +echo creating $CONFIG_STATUS
2192 +rm -f $CONFIG_STATUS
2193 +cat > $CONFIG_STATUS <<EOF
2195 +# Generated automatically by configure.
2196 +# Run this file to recreate the current configuration.
2197 +# This directory was configured as follows,
2198 +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2200 +# $0 $ac_configure_args
2202 +# Compiler output produced by configure, useful for debugging
2203 +# configure, is in ./config.log if it exists.
2205 +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
2208 + case "\$ac_option" in
2209 + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
2210 + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
2211 + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
2212 + -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
2213 + echo "$CONFIG_STATUS generated by autoconf version 2.13"
2215 + -help | --help | --hel | --he | --h)
2216 + echo "\$ac_cs_usage"; exit 0 ;;
2217 + *) echo "\$ac_cs_usage"; exit 1 ;;
2221 +ac_given_srcdir=$srcdir
2222 +ac_given_INSTALL="$INSTALL"
2224 +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
2226 +cat >> $CONFIG_STATUS <<EOF
2228 +# Protect against being on the right side of a sed subst in config.status.
2229 +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
2230 + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
2234 +s%@CFLAGS@%$CFLAGS%g
2235 +s%@CPPFLAGS@%$CPPFLAGS%g
2236 +s%@CXXFLAGS@%$CXXFLAGS%g
2237 +s%@FFLAGS@%$FFLAGS%g
2239 +s%@LDFLAGS@%$LDFLAGS%g
2241 +s%@exec_prefix@%$exec_prefix%g
2242 +s%@prefix@%$prefix%g
2243 +s%@program_transform_name@%$program_transform_name%g
2244 +s%@bindir@%$bindir%g
2245 +s%@sbindir@%$sbindir%g
2246 +s%@libexecdir@%$libexecdir%g
2247 +s%@datadir@%$datadir%g
2248 +s%@sysconfdir@%$sysconfdir%g
2249 +s%@sharedstatedir@%$sharedstatedir%g
2250 +s%@localstatedir@%$localstatedir%g
2251 +s%@libdir@%$libdir%g
2252 +s%@includedir@%$includedir%g
2253 +s%@oldincludedir@%$oldincludedir%g
2254 +s%@infodir@%$infodir%g
2255 +s%@mandir@%$mandir%g
2256 +s%@newlib_basedir@%$newlib_basedir%g
2258 +s%@host_alias@%$host_alias%g
2259 +s%@host_cpu@%$host_cpu%g
2260 +s%@host_vendor@%$host_vendor%g
2261 +s%@host_os@%$host_os%g
2262 +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
2263 +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
2264 +s%@INSTALL_DATA@%$INSTALL_DATA%g
2265 +s%@PACKAGE@%$PACKAGE%g
2266 +s%@VERSION@%$VERSION%g
2267 +s%@ACLOCAL@%$ACLOCAL%g
2268 +s%@AUTOCONF@%$AUTOCONF%g
2269 +s%@AUTOMAKE@%$AUTOMAKE%g
2270 +s%@AUTOHEADER@%$AUTOHEADER%g
2271 +s%@MAKEINFO@%$MAKEINFO%g
2272 +s%@SET_MAKE@%$SET_MAKE%g
2275 +s%@build_alias@%$build_alias%g
2276 +s%@build_cpu@%$build_cpu%g
2277 +s%@build_vendor@%$build_vendor%g
2278 +s%@build_os@%$build_os%g
2281 +s%@RANLIB@%$RANLIB%g
2282 +s%@EXEEXT@%$EXEEXT%g
2283 +s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g
2284 +s%@machine_dir@%$machine_dir%g
2285 +s%@sys_dir@%$sys_dir%g
2290 +cat >> $CONFIG_STATUS <<\EOF
2292 +# Split the substitutions into bite-sized pieces for seds with
2293 +# small command number limits, like on Digital OSF/1 and HP-UX.
2294 +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
2295 +ac_file=1 # Number of current file.
2296 +ac_beg=1 # First line for current file.
2297 +ac_end=$ac_max_sed_cmds # Line after last line for current file.
2300 +while $ac_more_lines; do
2301 + if test $ac_beg -gt 1; then
2302 + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
2304 + sed "${ac_end}q" conftest.subs > conftest.s$ac_file
2306 + if test ! -s conftest.s$ac_file; then
2307 + ac_more_lines=false
2308 + rm -f conftest.s$ac_file
2310 + if test -z "$ac_sed_cmds"; then
2311 + ac_sed_cmds="sed -f conftest.s$ac_file"
2313 + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
2315 + ac_file=`expr $ac_file + 1`
2317 + ac_end=`expr $ac_end + $ac_max_sed_cmds`
2320 +if test -z "$ac_sed_cmds"; then
2325 +cat >> $CONFIG_STATUS <<EOF
2327 +CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
2329 +cat >> $CONFIG_STATUS <<\EOF
2330 +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
2331 + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2332 + case "$ac_file" in
2333 + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2334 + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2335 + *) ac_file_in="${ac_file}.in" ;;
2338 + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
2340 + # Remove last slash and all that follows it. Not all systems have dirname.
2341 + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2342 + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2343 + # The file is in a subdirectory.
2344 + test ! -d "$ac_dir" && mkdir "$ac_dir"
2345 + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
2346 + # A "../" for each directory in $ac_dir_suffix.
2347 + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
2349 + ac_dir_suffix= ac_dots=
2352 + case "$ac_given_srcdir" in
2354 + if test -z "$ac_dots"; then top_srcdir=.
2355 + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
2356 + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
2357 + *) # Relative path.
2358 + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
2359 + top_srcdir="$ac_dots$ac_given_srcdir" ;;
2362 + case "$ac_given_INSTALL" in
2363 + [/$]*) INSTALL="$ac_given_INSTALL" ;;
2364 + *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
2367 + echo creating "$ac_file"
2369 + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
2370 + case "$ac_file" in
2371 + *Makefile*) ac_comsub="1i\\
2372 +# $configure_input" ;;
2376 + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2377 + sed -e "$ac_comsub
2378 +s%@configure_input@%$configure_input%g
2379 +s%@srcdir@%$srcdir%g
2380 +s%@top_srcdir@%$top_srcdir%g
2381 +s%@INSTALL@%$INSTALL%g
2382 +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
2387 +cat >> $CONFIG_STATUS <<EOF
2390 +cat >> $CONFIG_STATUS <<\EOF
2394 +chmod +x $CONFIG_STATUS
2395 +rm -fr confdefs* $ac_clean_files
2396 +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
2398 diff -urN newlib-1.8.2/newlib/libc/sys/aica/configure.in newlib-1.8.2-aica/newlib/libc/sys/aica/configure.in
2399 --- newlib-1.8.2/newlib/libc/sys/aica/configure.in 1970-01-01 10:00:00.000000000 +1000
2400 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/configure.in 2008-08-13 11:54:44.000000000 +1000
2402 +dnl This is the newlib/libc/sys/sh configure.in file.
2403 +dnl Process this file with autoconf to produce a configure script.
2408 +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
2409 +AC_CONFIG_AUX_DIR(../../../..)
2411 +NEWLIB_CONFIGURE(../../..)
2413 +AC_OUTPUT(Makefile)
2414 diff -urN newlib-1.8.2/newlib/libc/sys/aica/creat.c newlib-1.8.2-aica/newlib/libc/sys/aica/creat.c
2415 --- newlib-1.8.2/newlib/libc/sys/aica/creat.c 1970-01-01 10:00:00.000000000 +1000
2416 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/creat.c 2008-08-13 11:54:44.000000000 +1000
2418 +#include <sys/types.h>
2419 +#include <sys/fcntl.h>
2424 +creat (const char *path, mode_t mode)
2426 + char *obj = _newlib_vfs_new_string (path);
2428 + struct media_ops *mops = _newlib_vfs_get_media_ops (path);
2429 + struct file *pf = mops->creat (obj, mode);
2431 + _newlib_vfs_delete_string (obj);
2435 + return _newlib_vfs_insert_file (pf);
2440 diff -urN newlib-1.8.2/newlib/libc/sys/aica/crt0.S newlib-1.8.2-aica/newlib/libc/sys/aica/crt0.S
2441 --- newlib-1.8.2/newlib/libc/sys/aica/crt0.S 1970-01-01 10:00:00.000000000 +1000
2442 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/crt0.S 2008-08-13 13:08:13.000000000 +1000
2452 +/* Start by setting up a stack */
2453 + /* Set up the stack pointer to a fixed value */
2456 + /* Setup a default stack-limit in-case the code has been
2457 + compiled with "-mapcs-stack-check". Hard-wiring this value
2458 + is not ideal, since there is currently no support for
2459 + checking that the heap and stack have not collided, or that
2460 + this default 64k is enough for the program being executed.
2461 + However, it ensures that this simple crt0 world will not
2462 + immediately cause an overflow event: */
2463 + sub sl, sp, #64 << 10 /* Still assumes 256bytes below sl */
2465 + mov a2, #0 /* Second arg: fill value */
2466 + mov fp, a2 /* Null frame pointer */
2467 + mov r7, a2 /* Null frame pointer for Thumb */
2469 + ldr a1, .LC1 /* First arg: start of memory block */
2471 + sub a3, a3, a1 /* Third arg: length of block */
2474 +#ifdef __thumb__ /* Enter Thumb mode.... */
2476 + add a4, pc, #1 /* Get the address of the Thumb block */
2477 + bx a4 /* Go there and start Thumb decoding */
2480 + .global __change_mode
2486 + mov r0, #0 /* no arguments */
2487 + mov r1, #0 /* no argv either */
2489 + /* Parse string at r1 */
2490 + mov r0, #0 /* count of arguments so far */
2492 +/* Skip leading blanks */
2504 +/* See whether we are scanning a string */
2515 + mov r2, #' ' /* terminator type */
2516 + sub r1, r1, #1 /* adjust back to point at start char */
2521 + movne r2, #' ' /* terminator type */
2522 + subne r1, r1, #1 /* adjust back to point at start char */
2525 +/* Stack a pointer to the current argument */
2541 + cmp r2, r3 /* reached terminator? */
2545 + strb r2, [r3] /* terminate the arg string */
2549 + mov r1, sp /* point at stacked arg pointers */
2550 + /* We've now got the stacked args in order reverse the */
2567 + add r2, sp, r0, LSL #2 /* End of args */
2568 + mov r3, sp /* Start of args */
2570 + ldrhi r4,[r2, #-4] /* Reverse ends of list */
2572 + strhi r5, [r2, #-4]!
2573 + strhi r4, [r3], #4
2579 + bl exit /* Should not return */
2582 + /* Come out of Thumb mode... This code should be redundant... */
2588 + .global change_back
2590 + /* Halt the execution. This code should never be executed. */
2592 + ** With no debug monitor, this probably aborts (eventually).
2593 + ** With a Demon debug monitor, this halts cleanly.
2594 + ** With an Angel debug monitor, this will report 'Unknown SWI'.
2599 + /* For Thumb, constants must be after the code since only
2600 + positive offsets are supported for PC relative addresses. */
2605 + .word __bss_start__
2609 diff -urN newlib-1.8.2/newlib/libc/sys/aica/dcload.S newlib-1.8.2-aica/newlib/libc/sys/aica/dcload.S
2610 --- newlib-1.8.2/newlib/libc/sys/aica/dcload.S 1970-01-01 10:00:00.000000000 +1000
2611 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/dcload.S 2008-08-13 13:57:28.000000000 +1000
2615 +.global dcloadsyscall
2616 +.type dcloadsyscall, %function
2618 + @ args = 0, pretend = 0, frame = 0
2619 + @ frame_needed = 0, uses_anonymous_args = 0
2620 + @ link register save eliminated.
2626 + @ lr needed for prologue
2633 + .size dcloadsyscall, .-dcloadsyscall
2634 diff -urN newlib-1.8.2/newlib/libc/sys/aica/dcload.c newlib-1.8.2-aica/newlib/libc/sys/aica/dcload.c
2635 --- newlib-1.8.2/newlib/libc/sys/aica/dcload.c 1970-01-01 10:00:00.000000000 +1000
2636 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/dcload.c 2008-08-13 12:10:51.000000000 +1000
2638 +#define SYSCALL_BASE 0x00000030
2640 +struct syscall_struct {
2641 + unsigned int syscall;
2642 + unsigned int arg1, arg2, arg3;
2645 +unsigned int dcloadsyscall(unsigned int syscall, unsigned int arg1, unsigned int arg2, unsigned int arg3)
2647 + volatile struct syscall_struct *p = (struct syscall_struct *)(SYSCALL_BASE);
2651 + p->syscall = syscall;
2652 + while( p->syscall != 0xFFFFFFFF );
2655 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
2656 --- newlib-1.8.2/newlib/libc/sys/aica/dcload_vfs.c 1970-01-01 10:00:00.000000000 +1000
2657 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/dcload_vfs.c 2008-08-13 18:19:05.000000000 +1000
2659 +/* Support routines for host access via Andrew K's dcload. dcload offers
2660 + full host file-system access along with a few POSIX-like functions. */
2662 +/* FIXME: If the host is returning negative values (error codes), then
2663 + we need to assign the proper value to errno and return -1 as per newlib's
2666 +/* FIXME: Split some of this off into a separate file, dcload.c. This will
2667 + contain public functions that coincide with the prototypes in
2668 + include/dcload.h */
2670 +#include <sys/types.h>
2671 +#include <sys/stat.h>
2673 +#include <stdlib.h>
2677 +static struct media_ops dcload_host_media_ops;
2678 +static struct file_ops dcload_host_file_ops;
2680 +/* True if we have console/file-system access on the host */
2681 +static int host_enabled = 1;
2683 +/* Determine whether we're loaded under dcload and if so, whether or not
2684 + the console/file-server is enabled. If the console/file-server isn't
2685 + enabled, then we won't have anything meaningful to do in the host access
2686 + routines, so they'll be replaced with invalid media/file ops in our init
2689 +int _newlib_vfs_is_dcload (void)
2694 +void _newlib_vfs_dcload_init (void)
2696 + _newlib_vfs_initialized = VFS_LOADER_DCLOAD_NOHOST;
2700 + /* FIXME: Rework this... */
2701 + struct file * stdin_file = _newlib_vfs_first_file;
2702 + struct file * stdout_file = stdin_file->next;
2703 + struct file * stderr_file = stdout_file->next;
2705 + _newlib_vfs_initialized = VFS_LOADER_DCLOAD_HOST;
2706 + _newlib_vfs_host_media_ops = &dcload_host_media_ops;
2708 + /* Reroute stdin, stdout, and stderr through dcload's host console. */
2709 + stdin_file->fops = &dcload_host_file_ops;
2710 + stdout_file->fops = &dcload_host_file_ops;
2711 + stderr_file->fops = &dcload_host_file_ops;
2714 + /* All media ops are initially set to invalid so our work is done. */
2717 +extern int dcloadsyscall (int func, ...);
2719 +/* dcload host media operations */
2721 +/* Perform the open/creat syscall and allocate space for a new file if
2722 + we get a valid fd. Otherwise return the errno and NULL on errror. */
2723 +static struct file *do_open_media_op (int func, const char *obj, int arg, ...)
2726 + int res = dcloadsyscall (func, obj, arg);
2729 + pf = (struct file *) malloc (sizeof (struct file));
2733 + /* The library fd is set in _newlib_vfs_insert_file */
2736 + pf->media_fd = res;
2737 + pf->fops = &dcload_host_file_ops;
2738 + pf->specifics = NULL;
2747 +static struct file *dcload_open_media_op (const char *obj, int flags,
2750 + return do_open_media_op (OPEN_NR, obj, flags, mode);
2754 +static struct file *dcload_creat_media_op (const char *obj, mode_t mode)
2756 + return do_open_media_op (CREAT_NR, obj, mode);
2760 +static int dcload_link_media_op (const char *old_obj, const char *new_obj)
2762 + return dcloadsyscall (LINK_NR, old_obj, new_obj);
2765 +#define UNLINK_NR 6
2766 +static int dcload_unlink_media_op (const char *obj)
2768 + return dcloadsyscall (UNLINK_NR, obj);
2772 +static int dcload_stat_media_op (const char *obj, struct stat *pstat)
2774 + return dcloadsyscall (STAT_NR, obj, pstat);
2778 +static int dcload_chmod_media_op (const char *obj, mode_t mode)
2780 + return dcloadsyscall (CHMOD_NR, obj, mode);
2784 +static int dcload_chdir_media_op (const char *obj)
2786 + return dcloadsyscall (CHDIR_NR, obj);
2789 +/* dcload host file operations */
2791 +static size_t do_rw_file_op (int func, struct file *pf, void *buf, size_t cnt)
2793 + return dcloadsyscall (func, pf->media_fd, buf, cnt);
2797 +static size_t dcload_read_file_op (struct file *pf, void *buf, size_t cnt)
2799 + return do_rw_file_op (READ_NR, pf, buf, cnt);
2803 +static size_t dcload_write_file_op (struct file *pf, void *buf, size_t cnt)
2805 + return do_rw_file_op (WRITE_NR, pf, buf, cnt);
2809 +static off_t dcload_lseek_file_op (struct file *pf, off_t pos, int whence)
2811 + return dcloadsyscall (LSEEK_NR, pf->media_fd, pos, whence);
2815 +static int dcload_close_file_op (struct file *pf)
2817 + return dcloadsyscall (CLOSE_NR, pf->media_fd);
2820 +#define FSTAT_NR 10
2821 +static int dcload_fstat_file_op (struct file *pf, struct stat *pstat)
2823 + return dcloadsyscall (FSTAT_NR, pf->media_fd, pstat);
2827 +void _newlib_vfs_dcload_exit (int n)
2829 + dcloadsyscall (EXIT_NR, n);
2832 +#define ASSIGN_WRKMEM_NR 14
2833 +void dcload_assign_wrkmem (void *buf)
2835 + dcloadsyscall (ASSIGN_WRKMEM_NR, buf);
2838 +/* media_ops for host file-system access */
2840 +int dcload_mkdir_media_op( const char *c, mode_t mode )
2846 +int dcload_rmdir_media_op( const char *c )
2852 +int dcload_ioctl_file_op( )
2858 +static struct media_ops dcload_host_media_ops =
2860 + open: dcload_open_media_op,
2861 + creat: dcload_creat_media_op,
2862 + link: dcload_link_media_op,
2863 + unlink: dcload_unlink_media_op,
2864 + stat: dcload_stat_media_op,
2865 + chmod: dcload_chmod_media_op,
2866 + mkdir: dcload_mkdir_media_op,
2867 + rmdir: dcload_rmdir_media_op,
2868 + chdir: dcload_chdir_media_op
2871 +/* file_ops for a host file */
2873 +static struct file_ops dcload_host_file_ops =
2875 + lseek: dcload_lseek_file_op,
2876 + close: dcload_close_file_op,
2877 + read: dcload_read_file_op,
2878 + write: dcload_write_file_op,
2879 + ioctl: dcload_ioctl_file_op,
2880 + fstat: dcload_fstat_file_op
2884 diff -urN newlib-1.8.2/newlib/libc/sys/aica/dup.c newlib-1.8.2-aica/newlib/libc/sys/aica/dup.c
2885 --- newlib-1.8.2/newlib/libc/sys/aica/dup.c 1970-01-01 10:00:00.000000000 +1000
2886 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/dup.c 2008-08-13 11:54:44.000000000 +1000
2888 +/* This hack is required for libstdc++ to work properly */
2889 +int dup(int fd) { return fd; }
2890 diff -urN newlib-1.8.2/newlib/libc/sys/aica/exit.c newlib-1.8.2-aica/newlib/libc/sys/aica/exit.c
2891 --- newlib-1.8.2/newlib/libc/sys/aica/exit.c 1970-01-01 10:00:00.000000000 +1000
2892 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/exit.c 2008-08-13 11:54:44.000000000 +1000
2894 +/* TODO: Do different things depending on the loader present, e.g. dcload
2895 + has an exit() call, gdbstubs can tell gdb "W00", etc. */
2901 +void exit (int n) { _exit (n); }
2903 +extern void _newlib_vfs_dcload_exit (int);
2908 + if( _newlib_vfs_is_dcload() ) {
2909 + _newlib_vfs_dcload_exit (n);
2912 diff -urN newlib-1.8.2/newlib/libc/sys/aica/fcntl.c newlib-1.8.2-aica/newlib/libc/sys/aica/fcntl.c
2913 --- newlib-1.8.2/newlib/libc/sys/aica/fcntl.c 1970-01-01 10:00:00.000000000 +1000
2914 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/fcntl.c 2008-08-13 11:54:44.000000000 +1000
2916 +#include <sys/fcntl.h>
2918 +/* Minimal fcntl support is necessary for C++ console streams cin, cout, and
2921 +_fcntl (int fd, int flag, ...)
2926 + case 0: return O_RDONLY;
2927 + case 1: return O_WRONLY;
2928 + case 2: return O_WRONLY;
2929 + default: return -1;
2937 diff -urN newlib-1.8.2/newlib/libc/sys/aica/fstat.c newlib-1.8.2-aica/newlib/libc/sys/aica/fstat.c
2938 --- newlib-1.8.2/newlib/libc/sys/aica/fstat.c 1970-01-01 10:00:00.000000000 +1000
2939 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/fstat.c 2008-08-13 11:54:44.000000000 +1000
2941 +#include <sys/types.h>
2942 +#include <sys/stat.h>
2947 +_fstat (int fd, struct stat *pstat)
2949 + struct file *pf = _newlib_vfs_get_file (fd);
2951 + return pf->fops->fstat (pf, pstat);
2953 diff -urN newlib-1.8.2/newlib/libc/sys/aica/getpid.c newlib-1.8.2-aica/newlib/libc/sys/aica/getpid.c
2954 --- newlib-1.8.2/newlib/libc/sys/aica/getpid.c 1970-01-01 10:00:00.000000000 +1000
2955 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/getpid.c 2008-08-13 11:54:44.000000000 +1000
2962 diff -urN newlib-1.8.2/newlib/libc/sys/aica/gettimeofday.c newlib-1.8.2-aica/newlib/libc/sys/aica/gettimeofday.c
2963 --- newlib-1.8.2/newlib/libc/sys/aica/gettimeofday.c 1970-01-01 10:00:00.000000000 +1000
2964 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/gettimeofday.c 2008-08-13 11:54:44.000000000 +1000
2967 +#include <sys/time.h>
2969 +/* Returns the number of seconds elapsed from the Unix epoch, January 1st,
2970 + 1970. Note that the Dreamcast counts time from January 1st, 1950, so we
2971 + need to subtract 20 years (and 5 leap days) from the Dreamcast RTC to
2972 + get valid values for libc's time functions. */
2974 +#define TWENTY_YEARS ((20 * 365LU + 5) * 86400)
2977 +_gettimeofday (struct timeval *tp, struct timezone *tzp)
2981 + unsigned long rtc_h = *(volatile unsigned long*)0x00810000;
2982 + unsigned long rtc_l = *(volatile unsigned long*)0x00810004;
2983 + unsigned long secs = ((rtc_h & 0xffff) << 16) | (rtc_l & 0xffff);
2985 + tp->tv_sec = secs - TWENTY_YEARS;
2990 + tzp->tz_minuteswest = 0;
2991 + tzp->tz_dsttime = 0;
2996 diff -urN newlib-1.8.2/newlib/libc/sys/aica/ioctl.c newlib-1.8.2-aica/newlib/libc/sys/aica/ioctl.c
2997 --- newlib-1.8.2/newlib/libc/sys/aica/ioctl.c 1970-01-01 10:00:00.000000000 +1000
2998 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/ioctl.c 2008-08-13 11:54:44.000000000 +1000
3003 +ioctl (int fd, int func, long arg)
3005 + struct file *pf = _newlib_vfs_get_file (fd);
3007 + return pf->fops->ioctl (pf, func, arg);
3009 diff -urN newlib-1.8.2/newlib/libc/sys/aica/isatty.c newlib-1.8.2-aica/newlib/libc/sys/aica/isatty.c
3010 --- newlib-1.8.2/newlib/libc/sys/aica/isatty.c 1970-01-01 10:00:00.000000000 +1000
3011 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/isatty.c 2008-08-13 11:54:44.000000000 +1000
3013 +/* Since file descriptors 0, 1, and 2 are always mapped to stdin, stdout,
3014 + and stderr, we assume these are the only fds that permit interactive I/O. */
3019 + if (fd >= 0 && fd < 3)
3023 diff -urN newlib-1.8.2/newlib/libc/sys/aica/kill.c newlib-1.8.2-aica/newlib/libc/sys/aica/kill.c
3024 --- newlib-1.8.2/newlib/libc/sys/aica/kill.c 1970-01-01 10:00:00.000000000 +1000
3025 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/kill.c 2008-08-13 11:54:44.000000000 +1000
3027 +#include <stdlib.h>
3035 diff -urN newlib-1.8.2/newlib/libc/sys/aica/link.c newlib-1.8.2-aica/newlib/libc/sys/aica/link.c
3036 --- newlib-1.8.2/newlib/libc/sys/aica/link.c 1970-01-01 10:00:00.000000000 +1000
3037 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/link.c 2008-08-13 11:54:44.000000000 +1000
3042 +_link (const char *old_path, const char *new_path)
3044 + char *old_obj = _newlib_vfs_new_string (old_path);
3045 + char *new_obj = _newlib_vfs_new_string (new_path);
3047 + struct media_ops *mops = _newlib_vfs_get_media_ops (old_path);
3048 + int res = mops->link (old_obj, new_obj);
3050 + _newlib_vfs_delete_string (old_obj);
3051 + _newlib_vfs_delete_string (new_obj);
3055 diff -urN newlib-1.8.2/newlib/libc/sys/aica/lseek.c newlib-1.8.2-aica/newlib/libc/sys/aica/lseek.c
3056 --- newlib-1.8.2/newlib/libc/sys/aica/lseek.c 1970-01-01 10:00:00.000000000 +1000
3057 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/lseek.c 2008-08-13 11:54:44.000000000 +1000
3059 +#include <sys/types.h>
3064 +_lseek (int fd, off_t pos, int whence)
3066 + struct file *pf = _newlib_vfs_get_file (fd);
3068 + return pf->fops->lseek (pf, pos, whence);
3070 diff -urN newlib-1.8.2/newlib/libc/sys/aica/mkdir.c newlib-1.8.2-aica/newlib/libc/sys/aica/mkdir.c
3071 --- newlib-1.8.2/newlib/libc/sys/aica/mkdir.c 1970-01-01 10:00:00.000000000 +1000
3072 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/mkdir.c 2008-08-13 11:54:44.000000000 +1000
3074 +#include <sys/types.h>
3079 +mkdir (const char *path, mode_t mode)
3081 + char *obj = _newlib_vfs_new_string (path);
3083 + struct media_ops *mops = _newlib_vfs_get_media_ops (path);
3084 + int res = mops->mkdir (obj, mode);
3086 + _newlib_vfs_delete_string (obj);
3090 diff -urN newlib-1.8.2/newlib/libc/sys/aica/open.c newlib-1.8.2-aica/newlib/libc/sys/aica/open.c
3091 --- newlib-1.8.2/newlib/libc/sys/aica/open.c 1970-01-01 10:00:00.000000000 +1000
3092 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/open.c 2008-08-13 11:54:44.000000000 +1000
3094 +#include <sys/types.h>
3101 +_open (const char *path, int flags, mode_t mode)
3103 + char *obj = _newlib_vfs_new_string (path);
3105 + struct media_ops *mops = _newlib_vfs_get_media_ops (path);
3106 + struct file *pf = mops->open (obj, flags, mode);
3108 + _newlib_vfs_delete_string (obj);
3112 + return _newlib_vfs_insert_file (pf);
3117 diff -urN newlib-1.8.2/newlib/libc/sys/aica/read.c newlib-1.8.2-aica/newlib/libc/sys/aica/read.c
3118 --- newlib-1.8.2/newlib/libc/sys/aica/read.c 1970-01-01 10:00:00.000000000 +1000
3119 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/read.c 2008-08-13 11:54:44.000000000 +1000
3121 +#include <sys/types.h>
3126 +_read (int fd, void *buf, size_t cnt)
3128 + struct file *pf = _newlib_vfs_get_file (fd);
3130 + return pf->fops->read (pf, buf, cnt);
3132 diff -urN newlib-1.8.2/newlib/libc/sys/aica/rmdir.c newlib-1.8.2-aica/newlib/libc/sys/aica/rmdir.c
3133 --- newlib-1.8.2/newlib/libc/sys/aica/rmdir.c 1970-01-01 10:00:00.000000000 +1000
3134 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/rmdir.c 2008-08-13 11:54:44.000000000 +1000
3139 +rmdir (const char *path)
3141 + char *obj = _newlib_vfs_new_string (path);
3143 + struct media_ops *mops = _newlib_vfs_get_media_ops (path);
3144 + int res = mops->rmdir (obj);
3146 + _newlib_vfs_delete_string (obj);
3150 diff -urN newlib-1.8.2/newlib/libc/sys/aica/sbrk.c newlib-1.8.2-aica/newlib/libc/sys/aica/sbrk.c
3151 --- newlib-1.8.2/newlib/libc/sys/aica/sbrk.c 1970-01-01 10:00:00.000000000 +1000
3152 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/sbrk.c 2008-08-13 11:54:44.000000000 +1000
3156 +#include <sys/types.h>
3158 +extern char end; /* The end of the program (BSS section). */
3160 +register char *stack_ptr asm ("r15");
3165 + static char *heap_end;
3166 + char *prev_heap_end;
3171 + prev_heap_end = heap_end;
3172 + if (heap_end + incr > stack_ptr)
3175 + return (caddr_t)-1;
3179 + return (caddr_t) prev_heap_end;
3181 diff -urN newlib-1.8.2/newlib/libc/sys/aica/scif.c newlib-1.8.2-aica/newlib/libc/sys/aica/scif.c
3182 --- newlib-1.8.2/newlib/libc/sys/aica/scif.c 1970-01-01 10:00:00.000000000 +1000
3183 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/scif.c 2008-08-13 11:54:44.000000000 +1000
3185 +/* Blatantly stolen from libdream, others...
3186 + * Please fix this :) */
3187 +#include <sys/types.h>
3189 +/*#include "scif.h"*/
3191 +#define ACK (volatile unsigned short *)0xffe80010
3192 +#define WR_FIFO (volatile unsigned char *)0xffe8000c
3193 +#define RD_FIFO (volatile unsigned char *)0xffe80014
3194 +#define STATUS (volatile unsigned short *)0xffe8001c
3196 +static void scif_flush ()
3200 + while (!(*ACK & 0x40)) ;
3205 +size_t _newlib_vfs_scif_write (void *buf, size_t cnt)
3209 + while (!(*ACK & 0x20)) ;
3211 + *WR_FIFO = *(unsigned char *)buf++;
3219 +size_t _newlib_vfs_scif_read (void *buf, size_t cnt)
3221 + while (cnt -- > 0)
3223 + while (*STATUS & 0x1f) ;
3225 + *(unsigned char *)buf++ = *RD_FIFO;
3231 diff -urN newlib-1.8.2/newlib/libc/sys/aica/stat.c newlib-1.8.2-aica/newlib/libc/sys/aica/stat.c
3232 --- newlib-1.8.2/newlib/libc/sys/aica/stat.c 1970-01-01 10:00:00.000000000 +1000
3233 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/stat.c 2008-08-13 11:54:44.000000000 +1000
3235 +#include <sys/types.h>
3236 +#include <sys/stat.h>
3240 +/* Clunky, but remember we're "namespace clean" and library routines also
3241 + use _stat as a syscall... */
3244 +stat (const char *path, struct stat *pstat)
3246 + return _stat (path, pstat);
3250 +_stat (const char *path, struct stat *pstat)
3252 + char *obj = _newlib_vfs_new_string (path);
3254 + struct media_ops *mops = _newlib_vfs_get_media_ops (path);
3255 + int res = mops->stat (obj, pstat);
3257 + _newlib_vfs_delete_string (obj);
3261 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
3262 --- newlib-1.8.2/newlib/libc/sys/aica/stdio_vfs.c 1970-01-01 10:00:00.000000000 +1000
3263 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/stdio_vfs.c 2008-08-13 18:19:58.000000000 +1000
3265 +/* Support for Marcus Comstedt's serial slave and gdbstubs, e.g. generic
3266 + serial console I/O. */
3270 +/* Only read and write are supported for stdio_file_ops, so these are
3271 + used for stdin, stdout, and stderr which are already "open" when the
3272 + program is started. */
3274 +static size_t stdio_read_file_op (struct file *, void *, size_t);
3275 +static size_t stdio_write_file_op (struct file *, void *, size_t);
3277 +static struct file_ops stdio_file_ops =
3279 + lseek: _newlib_vfs_invalid_file_op,
3280 + close: _newlib_vfs_invalid_file_op,
3281 + read: stdio_read_file_op,
3282 + write: stdio_write_file_op,
3283 + ioctl: _newlib_vfs_invalid_file_op,
3284 + fstat: _newlib_vfs_invalid_file_op
3287 +/* dcload or absolute may override these to go through their own console
3288 + output routines. */
3290 +static struct file stdout_file;
3291 +static struct file stderr_file;
3293 +static struct file stdin_file =
3301 +static struct file stdout_file =
3309 +static struct file stderr_file =
3317 +struct file * _newlib_vfs_first_file = &stdin_file;
3318 +struct file * _newlib_vfs_last_file = &stderr_file;
3320 +int _newlib_vfs_is_sslave (void)
3325 +void _newlib_vfs_sslave_init (void)
3327 + /* Initialize serial console to a known state. We already assume that
3328 + we connected to the host, we just make sure the SCIF is setup the way
3330 + _newlib_vfs_initialized = VFS_LOADER_SERIAL_SLAVE;
3334 +/* Detect gdbstubs. gdbstubs sets the border color to green to indicate that
3335 + it's active. While this can't reliably be used to detect it, we also look
3336 + for gdbstubs start code at two separate addresses (gdbstub can load itself
3337 + at either address). */
3339 +int _newlib_vfs_is_gdbstubs (void)
3344 +void _newlib_vfs_gdbstubs_init (void)
3346 + _newlib_vfs_initialized = VFS_LOADER_GDBSTUBS;
3349 +extern size_t _newlib_vfs_scif_write (void *, size_t);
3350 +extern size_t _newlib_vfs_scif_read (void *, size_t);
3352 +static size_t stdio_read_file_op (struct file *pf, void *buf, size_t cnt)
3354 + return _newlib_vfs_scif_read (buf, cnt);
3357 +static size_t stdio_write_file_op (struct file *pf, void *buf, size_t cnt)
3359 + return _newlib_vfs_scif_write (buf, cnt);
3361 diff -urN newlib-1.8.2/newlib/libc/sys/aica/times.c newlib-1.8.2-aica/newlib/libc/sys/aica/times.c
3362 --- newlib-1.8.2/newlib/libc/sys/aica/times.c 1970-01-01 10:00:00.000000000 +1000
3363 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/times.c 2008-08-13 11:54:44.000000000 +1000
3366 +#include <sys/times.h>
3368 +/* crt.S stores program startup time (Dreamcast-relative, epoch at 1/1/1950)
3369 + in the global variable _newlib_dreamcast_utime. We can use this variable to
3370 + determine the total amount of time that the program has been running. */
3372 +/* This is raw seconds of program usage, we don't need to worry about
3373 + converting epochs or anything like that... */
3375 +extern unsigned long _newlib_dreamcast_utime;
3378 +_times (struct tms *buf)
3380 + if (_newlib_dreamcast_utime)
3382 + unsigned long rtc_h = *(volatile unsigned long*)0x00810000;
3383 + unsigned long rtc_l = *(volatile unsigned long*)0x00810004;
3384 + unsigned long secs = ((rtc_h & 0xffff) << 16) | (rtc_l & 0xffff);
3386 + clock_t utime = secs - _newlib_dreamcast_utime;
3389 + buf->tms_utime = utime;
3390 + buf->tms_stime = 0;
3391 + buf->tms_cutime = 0;
3392 + buf->tms_cstime = 0;
3398 + return (clock_t)-1;
3400 diff -urN newlib-1.8.2/newlib/libc/sys/aica/unlink.c newlib-1.8.2-aica/newlib/libc/sys/aica/unlink.c
3401 --- newlib-1.8.2/newlib/libc/sys/aica/unlink.c 1970-01-01 10:00:00.000000000 +1000
3402 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/unlink.c 2008-08-13 11:54:44.000000000 +1000
3407 +_unlink (const char *path)
3409 + char *obj = _newlib_vfs_new_string (path);
3411 + struct media_ops *mops = _newlib_vfs_get_media_ops (path);
3412 + int res = mops->unlink (obj);
3414 + _newlib_vfs_delete_string (obj);
3418 diff -urN newlib-1.8.2/newlib/libc/sys/aica/vfs.c newlib-1.8.2-aica/newlib/libc/sys/aica/vfs.c
3419 --- newlib-1.8.2/newlib/libc/sys/aica/vfs.c 1970-01-01 10:00:00.000000000 +1000
3420 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/vfs.c 2008-08-13 11:54:44.000000000 +1000
3422 +#include <sys/types.h>
3424 +#include <stdlib.h>
3425 +#include <string.h>
3429 +static struct file * invalid_open_media_op (void);
3431 +static struct media_ops invalid_media_ops =
3433 + open: invalid_open_media_op,
3434 + creat: invalid_open_media_op,
3435 + link: _newlib_vfs_invalid_media_op,
3436 + unlink: _newlib_vfs_invalid_media_op,
3437 + stat: _newlib_vfs_invalid_media_op,
3438 + chmod: _newlib_vfs_invalid_media_op,
3439 + mkdir: _newlib_vfs_invalid_media_op,
3440 + rmdir: _newlib_vfs_invalid_media_op,
3441 + chdir: _newlib_vfs_invalid_media_op
3444 +struct media_ops * _newlib_vfs_host_media_ops = &invalid_media_ops;
3445 +struct media_ops * _newlib_vfs_cd_media_ops = &invalid_media_ops;
3446 +struct media_ops * _newlib_vfs_vmu_media_ops = &invalid_media_ops;
3448 +/* This is where we detect the loader and initialize the relevant *_ops
3451 +enum _newlib_vfs_loader _newlib_vfs_initialized = VFS_LOADER_NONE;
3453 +extern int _newlib_vfs_is_sslave (void);
3454 +extern void _newlib_vfs_sslave_init (void);
3456 +extern int _newlib_vfs_is_gdbstubs (void);
3457 +extern void _newlib_vfs_gdbstubs_init (void);
3459 +extern int _newlib_vfs_is_dcload (void);
3460 +extern void _newlib_vfs_dcload_init (void);
3462 +extern int _newlib_vfs_is_absolute (void);
3463 +extern void _newlib_vfs_absolute_load (void);
3465 +static void vfs_init (void)
3467 + _newlib_vfs_initialized = VFS_LOADER_UNKNOWN;
3469 + if (_newlib_vfs_is_sslave ()) /* Marcus Comstedt's serial slave */
3471 + _newlib_vfs_sslave_init ();
3473 + else if (_newlib_vfs_is_gdbstubs ()) /* Benoit Miller's port of gdbstubs */
3475 + _newlib_vfs_gdbstubs_init ();
3477 + else if (_newlib_vfs_is_dcload ()) /* Andrew K's dcload */
3479 + _newlib_vfs_dcload_init ();
3481 + else if (_newlib_vfs_is_absolute ()) /* my own absolute */
3483 + _newlib_vfs_absolute_load ();
3487 +#define VFS_INIT { if (!_newlib_vfs_initialized) vfs_init (); }
3489 +/* Each prefix, "/pc/", "/cd", and "/vmu" in little-endian. */
3490 +#define PREFIX_HOST 0x2f63702f
3491 +#define PREFIX_CD 0x2f64632f
3492 +#define PREFIX_VMU 0x756d762f
3494 +char *_newlib_vfs_new_string (const char *s)
3500 + unsigned long prefix = *(unsigned long *)s;
3503 + if (prefix == PREFIX_HOST || prefix == PREFIX_CD ||
3504 + prefix == PREFIX_VMU)
3506 + /* We snatch the prefix, accounting for the null byte (since we're
3507 + using memcpy; this could be changed to a simple copy loop... */
3508 + len = strlen (s) - 3;
3509 + obj = malloc (len);
3510 + if (!obj) return obj;
3512 + memcpy (obj, s + 4, len);
3514 + else /* Just return a copy of the string if no path given */
3516 + len = strlen (s) + 1;
3517 + obj = malloc (len);
3518 + if (!obj) return obj;
3520 + memcpy (obj, s, len);
3526 +void _newlib_vfs_delete_string (char *s)
3531 +/* When each media op calls this, it's already got a copy of the stripped
3532 + path so we just do simple comparisons on the path prefix here. */
3533 +struct media_ops *_newlib_vfs_get_media_ops (const char *path)
3535 + unsigned long prefix = *(unsigned long *)path;
3537 + if (prefix == PREFIX_HOST)
3539 + return _newlib_vfs_host_media_ops;
3541 + else if (prefix == PREFIX_CD)
3543 + return _newlib_vfs_cd_media_ops;
3545 + else if (prefix == PREFIX_VMU)
3547 + return _newlib_vfs_vmu_media_ops;
3550 + return _newlib_vfs_host_media_ops;
3553 +static struct file_ops invalid_file_ops =
3555 + lseek: _newlib_vfs_invalid_file_op,
3556 + close: _newlib_vfs_invalid_file_op,
3557 + read: _newlib_vfs_invalid_file_op,
3558 + write: _newlib_vfs_invalid_file_op,
3559 + ioctl: _newlib_vfs_invalid_file_op,
3560 + fstat: _newlib_vfs_invalid_file_op
3563 +static struct file invalid_file =
3567 + &invalid_file_ops,
3571 +/* FIXME: A lookup for each fd could get expensive...find a better way to
3572 + "cache" frequently used fds */
3574 +static struct file *cached_file = NULL;
3576 +/* Find the file matching fd and return a pointer to its contents. If the
3577 + file isn't found, return a pointer to invalid_file, which represents a
3578 + non-existent file (all operations on it will fail). */
3579 +struct file *_newlib_vfs_get_file (int fd)
3584 + struct file *next_file = _newlib_vfs_first_file;
3586 + if ((cached_file != NULL) && (cached_file->fd == fd))
3588 + return cached_file;
3593 + if (next_file->fd == fd)
3595 + cached_file = next_file;
3598 + next_file = next_file->next;
3600 + return &invalid_file;
3604 +static int last_fd = -1;
3606 +/* Just insert the file at the end of the list, as it's already been
3607 + allocated by open/creat. Increase the library's fd by using the last
3609 +int _newlib_vfs_insert_file (struct file *pf)
3613 + last_fd = _newlib_vfs_last_file->fd;
3616 + pf->fd = ++last_fd;
3617 + _newlib_vfs_last_file->next = pf;
3618 + _newlib_vfs_last_file = pf;
3622 +int _newlib_vfs_remove_file (struct file *pf)
3626 + struct file *prev_file = _newlib_vfs_first_file;
3627 + struct file *next_file = NULL;
3631 + if (prev_file->next == pf)
3633 + prev_file->next = pf->next;
3634 + next_file = prev_file->next;
3637 + prev_file = next_file;
3638 + next_file = next_file->next;
3640 + _newlib_vfs_last_file = prev_file;
3644 + prev_file = prev_file->next;
3651 +int _newlib_vfs_invalid_file_op (void)
3657 +static struct file *invalid_open_media_op (void)
3663 +int _newlib_vfs_invalid_media_op (void)
3668 diff -urN newlib-1.8.2/newlib/libc/sys/aica/vfs.h newlib-1.8.2-aica/newlib/libc/sys/aica/vfs.h
3669 --- newlib-1.8.2/newlib/libc/sys/aica/vfs.h 1970-01-01 10:00:00.000000000 +1000
3670 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/vfs.h 2008-08-13 11:54:44.000000000 +1000
3675 +#include <sys/types.h>
3676 +#include <sys/stat.h>
3678 +/* Defines all of the operations that can be performed on a particular media
3679 + type. These are independent of file access routines. */
3682 + struct file * (*open) (const char *, int, mode_t);
3683 + struct file * (*creat) (const char *, mode_t);
3684 + int (*link) (const char *, const char *);
3685 + int (*unlink) (const char *);
3686 + int (*stat) (const char *, struct stat *);
3687 + int (*chmod) (const char *, mode_t);
3688 + int (*mkdir) (const char*, mode_t);
3689 + int (*rmdir) (const char *);
3690 + int (*chdir) (const char *);
3693 +/* These are the operations that can be done to a file. Each media and stub
3694 + has it's own combination of routines (e.g. Absolute + VMU, dcload + host). */
3697 + off_t (*lseek) (struct file *, off_t, int);
3698 + int (*close) (struct file *);
3699 + size_t (*read) (struct file *, void *, size_t);
3700 + size_t (*write) (struct file *, void *, size_t);
3701 + /* Hmm, what to do with this one? */
3702 + int (*ioctl) (struct file *, int, long);
3703 + int (*fstat) (struct file *, struct stat *);
3706 +/* We maintain a linked list of files so that we can remove and add files
3707 + to/from the list easier. Each file contains an fd, the "real" fd of whatever
3708 + media it resides upon, a pointer to the file_ops for the file, and a pointer
3709 + to media/stub specific data. */
3712 + struct file *next;
3715 + struct file_ops *fops;
3720 +/* Each load initializes the media_ops for each type based on the media it
3721 + supports. If a media type isn't supported, then it's ops points to
3722 + _newlib_vfs_invalid_media_ops. */
3723 +extern struct media_ops * _newlib_vfs_host_media_ops;
3724 +extern struct media_ops * _newlib_vfs_cd_media_ops;
3725 +extern struct media_ops * _newlib_vfs_vmu_media_ops;
3727 +/* Pointers to the first and last file in the list */
3728 +extern struct file * _newlib_vfs_first_file;
3729 +extern struct file * _newlib_vfs_last_file;
3731 +/* Each loader initializer gives this a distinct value so that programs
3732 + can determine which loader they're being loaded under. */
3733 +enum _newlib_vfs_loader
3736 + VFS_LOADER_UNKNOWN,
3737 + VFS_LOADER_SERIAL_SLAVE,
3738 + VFS_LOADER_GDBSTUBS,
3739 + VFS_LOADER_DCLOAD_HOST,
3740 + VFS_LOADER_DCLOAD_NOHOST,
3741 + VFS_LOADER_ABSOLUTE
3744 +extern enum _newlib_vfs_loader _newlib_vfs_initialized;
3746 +/* Generic media/file_ops that return ENOSYS */
3747 +int _newlib_vfs_invalid_media_op (void);
3748 +int _newlib_vfs_invalid_file_op (void);
3750 +/* Using the path prefix, return the media_ops that handles it */
3751 +struct media_ops *_newlib_vfs_get_media_ops (const char *path);
3753 +/* Returns the file that matches the given fd */
3754 +struct file *_newlib_vfs_get_file (int fd);
3756 +/* Insert a new file into the list. Returns -1 and sets errno if the file
3757 + can't be inserted, otherewise returns 0 */
3758 +int _newlib_vfs_insert_file (struct file *);
3760 +/* Removes a file from the list. Returns -1 and sets errno if there was
3761 + a problem (e.g. invalid fd passed to close, etc.) */
3762 +int _newlib_vfs_remove_file (struct file *);
3764 +/* Copy the given string into a new buffer, while stripping the vfs prefix
3765 + at the same time. */
3766 +char *_newlib_vfs_new_string (const char *s);
3768 +/* Free the buffer previously allocated with *_new_string */
3769 +void _newlib_vfs_delete_string (char *s);
3771 +#endif /* __VFS_H__ */
3772 diff -urN newlib-1.8.2/newlib/libc/sys/aica/write.c newlib-1.8.2-aica/newlib/libc/sys/aica/write.c
3773 --- newlib-1.8.2/newlib/libc/sys/aica/write.c 1970-01-01 10:00:00.000000000 +1000
3774 +++ newlib-1.8.2-aica/newlib/libc/sys/aica/write.c 2008-08-13 11:54:44.000000000 +1000
3776 +#include <sys/types.h>
3781 +_write (int fd, const void *buf, size_t cnt)
3783 + struct file *pf = _newlib_vfs_get_file (fd);
3785 + return pf->fops->write (pf, buf, cnt);
.