pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: libnbcompat fails to link, in bootstrap on Mac OS X 10.5.2 (x86)



On Tue, 15 Apr 2008, J. Alexander Jacocks wrote:
> +if [ "`echo "${CC}" | /usr/bin/wc -w`" -gt "1" ]; then
> +     ccprog=`echo "${CC}" | /usr/bin/awk '{ print $1 }'`
> +     ccargs=`echo "${CC}" | /usr/bin/sed "s/^${ccprog}//g"`
> +     CC=${ccprog}
> +fi

This can all be done using shell builtins, which will be much
more efficient than wc/awk/sed.

        # Convert CC="foo -bar" to ccprog="foo", ccargs="-bar", CC="foo"
        case "$CC" in
        *\ *)
                ccprog="${CC%% *}"
                ccargs="${CC#${ccprog} }"
                ;;
        *)
                ccprog="$CC"
                ccargs=""
                ;;
        esac
        CC="${ccprog}"

--apb (Alan Barrett)


Home | Main Index | Thread Index | Old Index