Am 20.07.2011 um 10:52 schrieb Enrico Forestieri: > On Wed, Jul 20, 2011 at 08:57:46AM +0200, Stephan Witt wrote: >> Am 20.07.2011 um 01:09 schrieb Pavel Sanda: >> >>> Stephan Witt wrote: >>>> In case of interest >>>> >>>> QT_VERSION="4.10.3" sh -c 'v="0x0"; for i in ${QT_VERSION//./ } ; do case >>>> $i in 10) v=$v"0a" ;; 11) v=$v"0b" ;; 12) v=$v"0c" ;; 13) v=$v"0d" ;; 14) >>>> v=$v"0e" ;; 15) v=$v"0f" ;; *) v=$v"0"$i ;; esac ; done; echo $v' >>>> >>>> prints 0x0040a03 > > This code uses bash specific features and fails with a posix shell (try it > with dash, for example). As a matter of fact, it fails on solaris.
Ok. I know the pattern matching substitution is not bourne shell. The bc replacement is the "case" part of the solution. > >>> how do cmake people solve this in windows? pavel >> >> This is not for cmake. It's a possible replacement for the construct with bc >> in >> src/frontends/qt4/Makefile.am >> >> I don't know if add bc as a build requirement is a solution too. > > The basic calculator (bc) is part of the Single UNIX specification, so it > is expected to be there, such as one expects that ls is there. So, I don't > know what it means "adding bc as a build requirement", as we don't add > tens of other commands as build requirement and simply expect that they > are there. Cor wrote it was needed to add on the build system. I have no problem with the bc based solution. Stephan