Karl,
It took me a while to remember what this issue was about... but I managed to get to my old reproducer.
Ok, let me do one step back. The root problem is how do I ensure that paths passed through ./configure command line are valid when building source code under 'src' (for example).
Look at the two attached .tar.gz. and un-tar the one called 'autotool-bug-rel.tar.gz'.
In this project I have:
/proj <- Here is where is the configure script
/proj/src <- Here is the source code
/lib <- This is another location of some lib I want to be able to define through ./configure
Enter the `proj/src` and generate the configure script (./bootstrap.sh or just use autoreconf).
The configure script accepts a parameter `--with-mylib=<dir>` where the library code is located.
Launch it with:
./configure --with-mylib=../lib
Note that now ../lib is a valid path only for the /proj directory, when building inside the '/proj/src' directory, that directory is no longer valid (that's why it needs to be converted somehow to something that makes sense for the `src` directory).
I have two options at this point:
1. Make this library path relative to the 'src' directory
2. Convert the provided path to absolute
These two approaches although very similar lead to an error when using absolute paths. Note the issue is not in the conversion between relative/absolute paths.
If I don't change the path provided through the --with-mylib parameter, and I enter an absolute path, I'm getting the same problem.
Let's go back to my test example, this version of the
configure.ac follows the first approach (converts all the values to paths relative to the src directory):
MYLIB_PATH=`realpath --relative-to src "${MYLIB_PATH}"`
Do a build. After the building completes, you end up with two .deps directories, one under 'test/proj/src' and one under the 'test/lib' directory:
test/proj/src/.deps <- .Po files for the files under 'src'
test/lib/.deps <- .Po files for the files under 'lib'
So far so good.
Cleanup everything (do an rm -Rf of the autotool-bug directory entirely) and un-tar the other file (autotool-bug-abs.tar.gz).
This example is exactly like the other one, but the
configure.ac converts the library path to absolute:
MYLIB_PATH=`readlink -f ${MYLIB_PATH}`
Again, generate the configure script and run: configure --with-mylib=../lib
Now when you build you are going to get an error because it is looking for the .Po file in the (right/wrong?) directory.
The .Po file is trying to locate (expected to be under `/lib/.deps`) is in a wrong directory: proj/src/home/fabrizio/test/lib/.deps
See the problem? It seems when using absolute paths, the .Po file is created in the wrong directory and the build fails.
Take a look at the content of the src/home/...../.deps. There is a .Po file containing only a "# dummy" line.
Tested with autoconf 2.69.
Regards,
Fabrizio