This is a couple of utilities to help port RISC OS C programs to Unix. The only ones that port easily are those written with Unixlib in the first place, of course.
unacorn_files changes the RISC OS directory
o.hello and so
on to the Unix convention of files called
unacorn_mf attempts to do the same to a RISC OS
Makefile, as well as fixing some case-sensitivity problems.
There is one other program you will probably need, whitespace, which changes eight spaces to the tab character required by Unix make.
To port a Unixlib/RISC OS program to Unix, you'll typically do this from the source directory:
% unacorn_files % whitespace -c Makefile % unacorn_mf <Makefile >Makefile.new % mv Makefile.new Makefile
Then edit the Makefile to fix anything that's obviously wrong
(arguments to the C compiler, and
link on RISC OS
can probably be changed to
cc on Unix), and try
running make. If you're lucky then it might just work, if not
then at least some of the tedious work is done.
I wrote this for one program,
tr2latex (which was a
RISC OS port of a Unix program to start with) and haven't tested
any others, so I'd be interested to know how well it works.
I tried to think of a less pejorative name than 'Unacorn' but none of the alternatives were as snappy.
./install --prefix=/usr/local, or whatever.
All the files are in the public domain. This means there are no copyright restrictions, you may do what you wish with them. Of course, giving credit would be appreciated (but not required).
They are offered as-is with no warranty whatsoever.
Please contact me, Ed Avis <firstname.lastname@example.org> with any suggestions or bug reports.
These programs have a web page at http://membled.com/work/apps/unacorn/.