2003-07-24 15:15:48 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
2003-07-25 14:59:22 +00:00
|
|
|
IFS=
|
|
|
|
|
2003-07-24 15:15:48 +00:00
|
|
|
justcompile=0
|
2003-07-25 14:59:22 +00:00
|
|
|
for i in $@; do
|
2003-07-24 15:15:48 +00:00
|
|
|
if test "$i" == "-c"; then
|
|
|
|
justcompile=1
|
2003-08-27 12:37:38 +00:00
|
|
|
elif test "$i" == "-S"; then
|
2003-07-28 21:15:03 +00:00
|
|
|
justcompile=1
|
2003-08-27 12:37:38 +00:00
|
|
|
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
|
2003-07-28 21:15:03 +00:00
|
|
|
justcompile=1
|
|
|
|
fi
|
2003-07-24 15:15:48 +00:00
|
|
|
done
|
|
|
|
|
2003-07-28 21:15:03 +00:00
|
|
|
IFS=" "
|
2003-08-27 12:37:38 +00:00
|
|
|
extra=($NIX_CFLAGS_COMPILE)
|
2003-07-24 15:15:48 +00:00
|
|
|
if test "$justcompile" != "1"; then
|
2003-08-27 12:37:38 +00:00
|
|
|
extra=(${extra[@]} $NIX_CFLAGS_LINK)
|
|
|
|
for i in $NIX_LDFLAGS; do
|
|
|
|
extra=(${extra[@]} "-Wl,$i")
|
|
|
|
done
|
2003-08-18 15:32:13 +00:00
|
|
|
if test "$NIX_STRIP_DEBUG" == "1"; then
|
2003-08-27 12:37:38 +00:00
|
|
|
extra=(${extra[@]} -g0 -Wl,-s)
|
2003-08-18 15:32:13 +00:00
|
|
|
fi
|
2003-07-24 15:15:48 +00:00
|
|
|
fi
|
|
|
|
|
2003-07-28 21:15:03 +00:00
|
|
|
if test "$NIX_DEBUG" == "1"; then
|
2003-08-27 12:37:38 +00:00
|
|
|
echo "extra flags to @GCC@:" >&2
|
2003-07-28 21:15:03 +00:00
|
|
|
for i in ${extra[@]}; do
|
2003-08-18 15:32:13 +00:00
|
|
|
echo " $i" >&2
|
2003-07-28 21:15:03 +00:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
IFS=
|
2003-08-18 17:49:30 +00:00
|
|
|
exec @GCC@ $@ ${extra[@]}
|