ok, I'm willing to try this. Just to make sure I don't mess up my NAND, I'm going to ask a few stupid questions (just checking if I understood everything correctly).
(
Yes: I'm basically doing this for the first time ever and
no: I'm not sure what I'm doing yet
)
1) if the procedure would be
$ ./configure
$ make
$ make install
it would (by default) compile things and write the binaries to /usr/local/<subdir>, so I have to use
$ ./configure --prefix=/media/mycard/there-you-go
and that's where everything will end up, is that correct?
This is correct. Writing to NAND will always required the use of 'sudo', so if you just type 'make install' and it works without errors, then you know its only installed to your SD card, as intended.
If you intending to ultimately make a PND, it's perhaps better to do this:
./configure --prefix=/
make
make DESTDIR=/media/mycard/there-you-go install
This is supported by the majority of build setups. The advantage of this method is that it avoids the possibility of "/media/sdcard/there-you-go" getting hard-coded into your application. This would result in a PND that works for you, but fails for everybody else.
2) I could also fool any compiler with a symlink
sudo ln -s /media/mycard/there-you-go /usr/local
with a similar result? Is this link permanent or just for this session?
This would be a permanent change. It fools the whole OS, not just the compiler. It's mostly useful for when you just want an application for yourself, not for something you're planning to make a PND out of. The advantage of this method is that the /usr/local file hierarchy is already established in Linux (e.g. /usr/local/bin in already in the PATH, /usr/local/share is already in XDG_DATA_DIRS etc), so it's less effort to get it running after the 'make install' stage. One thing you will need to do though, is create a file in /etc called 'ld.so.conf', containing the line '/usr/local/lib', and reboot.
Personally, when trying new apps, I first compile it so it installs into /usr/local/, to confirm that it will run on the Pandora without issues, then I delete it, and compile it again to install into "/media/mycard/there-you-go", and try to get it working in a portable way.
3) Is that really it? Am I (reasonably) save with one of these two options?
(sure, if the software I compile does weird things that's another problem ...)
Yeah. If you never type 'sudo', then you can be reassured that you're not writing to NAND.
4) So in an ideal case I just have to wrap what I find in /media/mycard/there-you-go into a .PND and it should run (or I will come back here and ask more questions because some dependencies are missing)?
Thanks!
Ideally, yes. Well-written applications will look in the PATH for binaries, and in XDG_DATA_DIRS for their data, so if you set these up in a start-up script, it should run okay. However, some applications find their data by setting the path at compile-time, based on the prefix. So if you did "./configure --prefix=/media/mycard/there-you-go", you might notice a line when compiling stating something like "-DAPPS_DATA_DIR=/media/mycard/there-you-go/share". These programs will need their source code changing before you can put them in a PND.
==================
In response to mcobit (who responded whilst I was typing this): I don't really agree with doing it like that, but I accept that the majority of existing PNDs have been set up like that. Also, if you have the problem mentioned above (of applications defining their data directories at compile-time), it will solve it without changing the source code.