I've been working on the beginnings of a miniparrot (something that can be
built anywhere without the Configure step). The first step was to get
configure to generate appropriate configuration files for an ANSI-only
environment.
To do this, I've added a --miniparrot option to Configure.pl. When used,
this option causes Configure to disable to use of any gcc features, and to
only make available those header files which are guaranteed by ANSI C89.
The resulting binary showed most of the non-ansi functionality was coming
from io_unix.c, which was still being used.
To address that, I have written a new io_stdio.c that uses STDIO functions
only, and have reworked the way an appropriate IO layer is chosen, so that
the STDIO-only version is used for this miniparrot environment.
Finally, I've changed embed.c to use the PIO layer to load in bytecode
files, rather than calling open/read/close directly. The result is that I
can now build a miniparrot binary that only has the following dependencies:
josh@galactic:~/devel/parrot-rw% make lib_deps_object
perl tools/dev/lib_deps.pl object exceptions.o global_setup.o interpreter.o parrot.o
register.o core_ops.o core_ops_prederef.o memory.o packfile.o stacks.o string.o sub.o
encoding.o chartype.o runops_cores.o trace.o pmc.o key.o hash.o platform.o
resources.o rx.o rxstacks.o embed.o warnings.o misc.o packout.o byteorder.o debug.o
io/io.o io/io_buf.o io/io_unix.o io/io_win32.o io/io_stdio.o classes/default.o
classes/array.o classes/perlint.o classes/perlstring.o classes/perlnum.o
classes/perlarray.o classes/perlundef.o classes/perlhash.o classes/parrotpointer.o
classes/parrotsub.o classes/parrotcoroutine.o classes/intqueue.o
encodings/singlebyte.o encodings/utf8.o encodings/utf16.o encodings/utf32.o
chartypes/unicode.o chartypes/usascii.o
Found 1922 symbols defined within the 52 supplied object files.
Found 56 external symbols
Of these, 2 are not defined by ANSI C89:
read (in core_ops.o,core_ops_prederef.o)
write (in core_ops.o,core_ops_prederef.o)
Pretty good!
--Josh
--
Josh Wilmes ([EMAIL PROTECTED]) | http://www.hitchhiker.org