Solve the problem of variable expansion in general way
The ticket evolved into a request to solve the variable expansion in a generic way. The solution should work for:
- makefiles
- scripts (both internal and external)
- documentation (.rst and man pages)
- config file examples
The original description is as follows:
wipe_data.sh.in contains:
if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then
. @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh
else
. @abs_top_builddir@/src/bin/admin/admin-utils.sh
fi
and this is evaluated by ./configure to:
if [ -e ${prefix}/share/kea/scripts/admin-utils.sh ]; then
. ${prefix}/share/kea/scripts/admin-utils.sh
else
. /home/test/workspace/kea-master-system-tests-v6/src/bin/admin/admin-utils.sh
fi
but ${prefix} has to been substituted but should have been.
After ./configure it should be:
if [ -e /usr/local/share/kea/scripts/admin-utils.sh ]; then
. /usr/local/share/kea/scripts/admin-utils.sh
else
. /home/test/workspace/kea-master-system-tests-v6/src/bin/admin/admin-utils.sh
fi
Generally this problem is broader. It touches many generated files by autoconf using AC_CONFIG_FILES. One of the solution is using path_replacer.sh but it is inconvenient. Other approach is using sh script and makaefiles capabilities of resolving unresolved vars on its own. But it does not work in e.g. config files.
It would be good to have one solution for all.
Edited by Tomek Mrugalski