bug-ncurses
[Top][All Lists]
Advanced

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

Re: Compiler flags in CC test broken


From: Stian Skjelstad
Subject: Re: Compiler flags in CC test broken
Date: Wed, 22 Feb 2017 08:12:25 +0100


> The logic in aclocal (CF_CC_ENV_FLAGS) to detect compiler flags in CC and
> move them to CFLAGS is broken: the sed uses a greedy .* so will only move
> the last option, and any other options are deleted.
>
> My workaround here is this:
>
> - cf_flags=`echo "$CC" | sed -e 's/^.*[ ]\(-[^ ]\)/\1/'`
> + cf_flags=`echo "$CC" | cut -f2- -d' '`

hmm - thanks - I'll have to rethink this (and use a better test-case :-)


Is grep -o standard across unixes? If so

cf_flags=`echo "$CC" |grep -o ' -.*'`

seems to do the trick, allowing $CC to include multiple start arguments before the - options appears


--
Stian Skjelstad

reply via email to

[Prev in Thread] Current Thread [Next in Thread]