pkgsrc-Users archive

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

Re: gcc version selection



On Fri, Oct 03, 2014 at 01:29:55PM +0100, Jonathan Perkin wrote:
> #1 in a general case, i.e. if there is no exact match then use the
> next higher version that we offer rather than simply jumping straight
> to the highest.

Playing around with bmake:

# gcc -dumpversion
BUILTIN_GCC=4.1.3
_GCC_REQD=3.0
IN_PKGSRC="gcc gcc3 gcc34 gcc44 gcc45 gcc46 gcc47 gcc48 gcc49 gcc-aux"
SOME_GCC=4.3 2.0 3.1 2.0.3 3.1.9
ORDERED_GCC=${SOME_GCC:O}
HIGHEST_GCC=${SOME_GCC:O:[-1]}
.if ${BUILTIN_GCC:S/./ /g:[1]} >= ${HIGHEST_GCC:S/./ /g:[1]} \
 && ${BUILTIN_GCC:S/./ /g:[2]} >= ${HIGHEST_GCC:S/./ /g:[2]} \
 && ${BUILTIN_GCC:S/./ /g:[3]} >= ${HIGHEST_GCC:S/./ /g:[3]}        XXX
BUILTIN_OK=yes
.else
BUILTIN_OK=no
.endif

all:
        @echo various reqd: ${SOME_GCC}
        @echo ordered reqd: ${ORDERED_GCC}
        @echo wanted:       ${HIGHEST_GCC}
        @echo builtin:      ${BUILTIN_GCC}
        @echo use builtin:  ${BUILTIN_OK}


What happens in the line XXX if there is no index=3 in either or both
variable? (It seems to work, but what does [3] on a 2 item list return,
and what does an operator like >= do with it?)

BTW the PR Obata refers to seems much harder to deal with...

Cheers,

Patrick


Home | Main Index | Thread Index | Old Index