I may fall into a X-Y problem with this question and I encourage you guys to correct me if I am wrong.
I would like to configure a toolchain environment that can work on different platform and different compiler version. I initially wrote a long Perl script that generate configuration Makefile that contain only variables. I wanted to be KISS so I did not write any complexe things using automake or autoconf. Moreover I wanted the reconfiguration process to be very fast. In my case my home made
./configure does everything in less than 1 second. I am very happy with that.
However I fill I can use a better approach using environment variables. Instead to writing a Makefile with the specific variables I can set the current shell environment directly. For example:
Unfortunately some variables are already declared in the $PATH. The solution is to add the new $PATH in the front of the other:
export PATH=/new/toolchain/path:PATH echo $PATH /new/toolchain/path:/old/toolchain/path:/usr/bin:/bin...
I fill this is ugly I would like to remove the old path before adding the new one.
- Is it better to use the environment instead of custom makefiles to set a build configuration?
- How to properly adjust existing environment variables?