[PATCH xserver] configure: use backticks rather than $() for commands
memsize at videotron.ca
Thu Jan 7 17:34:51 PST 2010
On Thu, 2010-01-07 at 16:24 -0800, Alan Coopersmith wrote:
> Dan Nicholson wrote:
> > On Thu, Jan 7, 2010 at 4:16 PM, Matt Turner <mattst88 at gmail.com> wrote:
> >> On Thu, Jan 7, 2010 at 3:06 PM, Gaetan Nadon <memsize at videotron.ca> wrote:
> >>> This patch to xserver configure.ac is to increase code portability to
> >>> non POSIX system by using backticks rather than $() for command
> >>> substitution for BUILD_DATE and BUILD_TIME.
> >> What kind of systems would these be?
> > Older Solaris was definitely the common case where it would come up.
> Yes, /bin/sh on Solaris releases up to and including Solaris 10 and
> Solaris Express is a pre-POSIX bourne shell that only supports `` not $().
> There are POSIX shells available, but then builders always have to remember
> to run /bin/bash ./configure or /bin/ksh ./configure instead of just ./configure.
> OpenSolaris and future Solaris releases make /bin/sh be ksh93 instead, so
> won't have this limitation, but it will be a long time before Solaris 10
> and older variants die out in the wild.
For my part, not having extensive platform knowledge, I noticed that all
autoconf/automake scripts use backticks. I searched all configure.ac
files and there were only 2 cases, one with pkg-config (which I was
unknowingly spreading) and the date/time. That reassured me it was the
right thing to do.
Finally I found this in Autoconf manual:
Most notably, even recent releases of Solaris don't support it:
$ showrev -c /bin/sh | grep version
Command version: SunOS 5.10 Generic 121005-03 Oct 2006
$ echo $(echo blah)
syntax error: `(' unexpected
nor does irix 6.5's Bourne shell:
$ uname -a
IRIX firebird-image 6.5 07151432 IP22
$ echo $(echo blah)
I am glad Matt asked the question, this type of detailed information is
hard to find.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the xorg-devel