2003-11-02 18:42:19 +01:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
IFS=
|
|
|
|
|
|
|
|
justcompile=0
|
|
|
|
for i in $@; do
|
|
|
|
if test "$i" == "-c"; then
|
|
|
|
justcompile=1
|
|
|
|
elif test "$i" == "-S"; then
|
|
|
|
justcompile=1
|
|
|
|
elif test "$i" == "-E"; then
|
|
|
|
justcompile=1
|
|
|
|
elif test "$i" == "-E"; then
|
|
|
|
justcompile=1
|
|
|
|
elif test "$i" == "-M"; then
|
|
|
|
justcompile=1
|
|
|
|
elif test "$i" == "-MM"; then
|
|
|
|
justcompile=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
IFS=" "
|
|
|
|
extra=($NIX_CFLAGS_COMPILE)
|
|
|
|
if test "$justcompile" != "1"; then
|
|
|
|
extra=(${extra[@]} $NIX_CFLAGS_LINK)
|
|
|
|
for i in $NIX_LDFLAGS; do
|
2003-11-02 23:25:26 +01:00
|
|
|
extra=(${extra[@]} "-Wl,$i")
|
2003-11-02 18:42:19 +01:00
|
|
|
done
|
|
|
|
if test "$NIX_STRIP_DEBUG" == "1"; then
|
2003-11-02 23:25:26 +01:00
|
|
|
extra=(${extra[@]} -g0 -Wl,-s)
|
2003-11-02 18:42:19 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$NIX_DEBUG" == "1"; then
|
|
|
|
echo "extra flags to @GCC@:" >&2
|
|
|
|
for i in ${extra[@]}; do
|
|
|
|
echo " $i" >&2
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
IFS=
|
|
|
|
exec @GCC@ $@ ${extra[@]}
|