2010-01-16 23:09:27 +00:00
|
|
|
#! @shell@ -e
|
|
|
|
|
|
|
|
# Add the flags for the GNAT compiler proper.
|
|
|
|
extraAfter="--GCC=@out@/bin/gcc"
|
|
|
|
extraBefore=()
|
|
|
|
|
|
|
|
# Add the flags that should be passed to the linker (and prevent
|
|
|
|
# `ld-wrapper' from adding NIX_LDFLAGS again).
|
|
|
|
#for i in $NIX_LDFLAGS_BEFORE; do
|
|
|
|
# extraBefore=(${extraBefore[@]} "-largs $i")
|
|
|
|
#done
|
|
|
|
|
|
|
|
# Optionally print debug info.
|
2014-10-10 12:25:23 +00:00
|
|
|
if [ -n "$NIX_DEBUG" ]; then
|
2014-10-10 11:49:26 +00:00
|
|
|
echo "original flags to @prog@:" >&2
|
2010-01-16 23:09:27 +00:00
|
|
|
for i in "$@"; do
|
|
|
|
echo " $i" >&2
|
|
|
|
done
|
2014-10-10 11:49:26 +00:00
|
|
|
echo "extraBefore flags to @prog@:" >&2
|
2010-01-16 23:09:27 +00:00
|
|
|
for i in ${extraBefore[@]}; do
|
|
|
|
echo " $i" >&2
|
|
|
|
done
|
2014-10-10 11:49:26 +00:00
|
|
|
echo "extraAfter flags to @prog@:" >&2
|
2010-01-16 23:09:27 +00:00
|
|
|
for i in ${extraAfter[@]}; do
|
|
|
|
echo " $i" >&2
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2014-10-10 12:25:23 +00:00
|
|
|
if [ -n "$NIX_GNAT_WRAPPER_EXEC_HOOK" ]; then
|
2010-01-16 23:09:27 +00:00
|
|
|
source "$NIX_GNAT_WRAPPER_EXEC_HOOK"
|
|
|
|
fi
|
|
|
|
|
2014-10-10 11:49:26 +00:00
|
|
|
exec @prog@ ${extraBefore[@]} "$@" ${extraAfter[@]}
|