mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-20 12:42:24 +00:00
5f248af2a0
* Fix a bug that occurs when NIX_CFLAGS is empty. svn path=/nixpkgs/trunk/; revision=241
35 lines
504 B
Bash
35 lines
504 B
Bash
#! /bin/sh
|
|
|
|
IFS=
|
|
|
|
realgcc=@GCC@
|
|
|
|
justcompile=0
|
|
for i in $@; do
|
|
if test "$i" == "-c"; then
|
|
justcompile=1
|
|
fi
|
|
if test "$i" == "-S"; then
|
|
justcompile=1
|
|
fi
|
|
if test "$i" == "-E"; then
|
|
justcompile=1
|
|
fi
|
|
done
|
|
|
|
IFS=" "
|
|
extra=($NIX_CFLAGS)
|
|
if test "$justcompile" != "1"; then
|
|
extra=(${extra[@]} $NIX_LDFLAGS)
|
|
fi
|
|
|
|
if test "$NIX_DEBUG" == "1"; then
|
|
echo "extra gcc flags:"
|
|
for i in ${extra[@]}; do
|
|
echo " $i"
|
|
done
|
|
fi
|
|
|
|
IFS=
|
|
exec $realgcc $@ ${extra[@]}
|