What is a relocatable install? Are GNU Smalltalk installations relocatable?

Tagged:

A relocatable program can be moved or copied to a different location on the filesystem. A program supports a relocatable install if a user can copy a program, installed by another user on the same machine, to his home directory, and have it work correctly.

Versions of GNU Smalltalk up to 3.0a are never relocatable. Newer versions are relocatable under special conditions only. These are:

  1. the exec-prefix and prefix should be identical;
  2. the installation should reside entirely within the prefix;
  3. on systems other than Windows or Linux, shared libraries should be disabled.
  4. under Windows, if shared libraries are enabled, the bindir and libdir should be the same.

Item 2 usually means that packages offered by Linux distributions are not relocatable, because they install the image in /var (outside the prefix). However, user installations created with a standard ./configure will be relocatable. GNU Smalltalk's configure script prints whether the installation will be relocatable.

If you want a relocatable install, it is suggested that you configure with a non-existent prefix such as "--prefix=/nonexistent". Otherwise, on some OSes the executable will remember the location of shared libraries and will look for its shared libraries first in the original installation directory and only then in the relocated directory. To move the installation, you can install into a staging area with make DESTDIR and finish the installation from there.

For example, this will create a binary .tar.gz file that can be unpacked in multiple places (e.g. in /usr/local or $HOME).

 ./configure --prefix=/nonexistent
 make
 make install DESTDIR=`pwd`
 (cd nonexistent && tar cvf - .) > ../gnu-smalltalk-binary.tar.gz

Under Windows, you should pass special directories to configure, so that item 4 is satisfied:

 ./configure --prefix=/nonexistent \
        --bindir=/nonexistent --libdir=/nonexistent \
        --with-moduledir=/nonexistent/lib/smalltalk
 make
 make install DESTDIR=`pwd`
 (cd nonexistent && tar cvf - .) > ../gnu-smalltalk-binary.tar.gz

The resulting install will have the virtual machine installed as a shared library and the executable in the toplevel directory, which is customary under Windows. (Note: relocatability is still an experimental feature under Windows).

User login