The GNU Modula-2 front end to GCC

Moving the installation of GNU Modula-2 to another directory

This section documents how you can configure GNU Modula-2 to install in one directory and at a later time move the installation to another completely different directory. The example assumes the user has a bourne shell.

Let us assume that the build was configured as such:

$ mkdir build
$ cd build
$ ../gcc-10.3.1+gm2-git-latest/configure \
   --prefix=$HOME/private \
   --enable-languages=c,c++,gm2  --enable-checking \
   --disable-multilib

in this example we see that the installation directory would normally be $HOME/private. This is accomplished by the following commands:

$ make
$ make install

Now, assuming we have correct privileges, we may move the entire contents of $HOME/private to /usr/local/public:

$ mv $HOME/private /usr/local/public

The new compiler and libraries can be referenced by modifying our PATH environment variable:

$ PATH=/usr/local/public/bin:$PATH
$ export PATH
$ GM2_ROOT=/usr/local/public
$ export GM2_ROOT

Finally we can rebuild the hello world example found in ../gcc-10.3.1/gcc/gm2/examples/hello by:

$ cd ../gcc-10.3.1/gcc/gm2/examples/hello
$ make
$ ./a.out