Sunday, February 24, 2008

SVN r35: The Runtime Directory

I've created a "runtime directory." What is a "runtime directory," you might ask? Good question. A runtime directory is a directory containing a relative directory structure which supplements a program. In our case, we need, at a minimum, the media/ folder to be present in our runtime directory.

Up until now, I've not worried about this concept; I've just let the scripts handle it automagically. However, when Derrick tried to run the Kdevelop project, it silently died, leaving cryptic comments in the logs. We eventually figured out that the problem was that media/ wasn't being found correctly due to a missing symlink. Well, symlinks are an ugly hack for getting a relative path right, so I decided to make a compile-time runtime directory.

This is harder than it sounds. I've altered the autoconf to guess `pwd` for the runtime dir, or to take it on the command line with "--with-runtime-dir":
./configure --with-runtime-dir=/home/simpson/os
Works excellently.

Now, of course, the story doesn't end there. Autoconf turns this setting into a command-line define (-DRUNTIME_DIR=\"/home/simpson/os\"), and then we have, in opensmash.cpp, a few lines that set up the working directory and path. Cool, right? Right?

Right?

TODO: Dunno, good question. Sleep?
~ C.

No comments: