2005-12-05 14:11:09 +00:00
|
|
|
source $stdenv/setup
|
2004-03-31 22:47:06 +00:00
|
|
|
|
2011-07-07 15:10:40 +00:00
|
|
|
# Wrap the given `aclocal' program, appending extra `-I' flags
|
|
|
|
# corresponding to the directories listed in $ACLOCAL_PATH. (Note
|
|
|
|
# that `wrapProgram' can't be used for that purpose since it can only
|
|
|
|
# prepend flags, not append them.)
|
|
|
|
wrapAclocal() {
|
|
|
|
local program="$1"
|
|
|
|
local wrapped="$(dirname $program)/.$(basename $program)-wrapped"
|
|
|
|
|
|
|
|
mv "$program" "$wrapped"
|
|
|
|
cat > "$program"<<EOF
|
|
|
|
#! $SHELL -e
|
|
|
|
|
|
|
|
unset extraFlagsArray
|
|
|
|
declare -a extraFlagsArray
|
|
|
|
|
|
|
|
oldIFS=\$IFS
|
|
|
|
IFS=:
|
|
|
|
for dir in \$ACLOCAL_PATH; do
|
|
|
|
if test -n "\$dir" -a -d "\$dir"; then
|
|
|
|
extraFlagsArray=("\${extraFlagsArray[@]}" "-I" "\$dir")
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
IFS=\$oldIFS
|
|
|
|
|
|
|
|
exec "$wrapped" "\$@" "\${extraFlagsArray[@]}"
|
|
|
|
EOF
|
|
|
|
chmod +x "$program"
|
|
|
|
}
|
2004-03-31 22:47:06 +00:00
|
|
|
|
|
|
|
postInstall() {
|
|
|
|
# Create a wrapper around `aclocal' that converts every element in
|
|
|
|
# `ACLOCAL_PATH' into a `-I dir' option. This way `aclocal'
|
|
|
|
# becomes modular; M4 macros do not need to be stored in a single
|
|
|
|
# global directory, while callers of `aclocal' do not need to pass
|
|
|
|
# `-I' options explicitly.
|
|
|
|
|
2012-07-10 20:25:44 +00:00
|
|
|
for prog in $out/bin/aclocal*; do
|
2011-07-07 15:10:40 +00:00
|
|
|
wrapAclocal "$prog"
|
2009-04-05 18:13:59 +00:00
|
|
|
done
|
2004-03-31 22:47:06 +00:00
|
|
|
|
2012-07-10 20:25:44 +00:00
|
|
|
ln -s aclocal-1.11 $out/share/aclocal
|
|
|
|
ln -s automake-1.11 $out/share/automake
|
|
|
|
}
|
2004-03-31 22:47:06 +00:00
|
|
|
|
|
|
|
genericBuild
|