[Rpcemu] Patch to 'make install' - configurable file paths

Theo Markettos rpcemu at markettos.org.uk
Sat Aug 16 22:33:18 BST 2008


As part of a push towards making RPCEmu packageable, I've spent today
tidying up its use of paths.  The patch below still has a few rough edges,
but it makes RPCEmu much more compliant with things like the Debian
Filesystem Hierarchy Guidelines.

I've added some preprocessor definitions to the build process:

CONFIG_DIR: The directory in which the rpc.cfg and any other configuration
file lives
CMOS_DIR: The directory in which CMOS RAM dumps are read from and saved
(currently only file is cmos.ram)
ARMCODE_DIR: The directory to executable ARM code - subdirectories are
'roms' and 'poduleroms'
DRIVES_DIR: Hard disc and CD images, and HostFS mounts.  Contents might be
'hd4.hdf', 'boot.adf'[1], 'notboot.adf', 'hostfs', 'cdimage.iso'.  On Unix
I'd envisage that this might contain symbolic links to wherever these
different bits might be (hostfs could be a USB stick, for example)
LOG_DIR: Where logfiles are emitted

[1] I fixed a discrepancy where there's a table at the top of a file to set
the floppy file names, but then they're hardcoded elsewhere.

CONFIG_DIR and LOG_DIR are fixed at build time - the latter only because
there are lots of places in the code that emit logfiles and I was too lazy
to change them all.  The configuration file can now override the pathnames
of the others:

armcode_dir = /home/fred/riscos
drives_dir = /mnt/rpc
cmos_dir = /tmp

Then I've added some autoconf stuff to define these based on the usual
installation directory settings to ./configure (see Makefile.am)

So to install rpcemu system-wide it should be a case of:
aclocal;automake;autoconf
./configure
(use --prefix=/somewhere if you don't want it to go in /usr/local)
make
sudo make install

By default configure will put things in:
CONFIG_DIR=/usr/local/etc/rpcemu/
CMOS_DIR=/usr/local/var/lib/rpcemu/
ARMCODE_DIR=/usr/local/share/rpcemu/
DRIVES_DIR=/usr/local/var/lib/rpcemu/
LOG_DIR=/usr/local/var/log/rpcemu/
and install the binary as /usr/local/bin/rpcemu

Any potential packager can just shuffle these around for wherever the files
should go, most simply by changing the options to ./configure (things like
--localstatedir)

I've barely touched the Windows version, but it should fallback gracefully
if none of these paths are defined, or the lines are missing in the config
file.  The Windows Makefile can just define these macros to move things
around as it likes.

To build it the old way under Unix (ie all files in the one directory), do:
./configure --enable-portableinstall
That fails to define any of the settings so it should fallback to the old
behaviour (but the configuration file settings will still work if present).

I won't have any more time to work on this for some weeks, so thought I'd
post it and see what people think...

Theo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rpcemu-system-paths.p
Type: text/x-pascal
Size: 21114 bytes
Desc: not available
URL: <http://www.riscos.info/pipermail/rpcemu/attachments/20080816/10ebdbf3/attachment.p>


More information about the Rpcemu mailing list