GNOME Bugzilla – Bug 73381
intltool.m4 uses $() feature not found in /bin/sh on Solaris
Last modified: 2004-12-22 21:47:04 UTC
Someone is confusing Makefile syntax with shell syntax. There is no $(...) in the shell. Use backquotes. INTLTOOL_REQUIRED_VERSION_AS_INT=$(echo $1 | awk -F. '{ printf "%d", $[1] * 100 + $[2]; }')
Kenneth?
Ok, In the beginning I used back quotes, but I couldn't escape the awk code properly, so it didn't work. Cactus told me that this was the way to do it, so that is what I did. If you can tell me how to get it working with backquotes, I am happy to change it
If you read this: http://perso.club-internet.fr/thedech/unix/ksh/appa_02.htm especially this part: However, the Korn shell did contribute a few of its features to the POSIX standard, including: [...] * $(...) syntax for command substitution [...] it implies that $() is, in fact, a POSIX-standard way of doing this in a shell. I'm sure you can look up more formal definitions -- this is just the first page I found on Google.
I stand corrected as far as the standardness is concerned. However... It does not matter much if it's a standard if that standard is not yet widely enough deployed. /bin/sh on Solaris does not seem to support it and although Solaris undoubtedly has other shells that do, configure is a /bin/sh script. A version of Digital unix just tested does not support it either.
I'm fairly sure that $(...) isn't POSIX shell. Even if it is, it's -not- among the portable shell constructs. Check out the autobook, namely http://sources.redhat.com/autobook/autobook/autobook_217.html#SEC217 Ah, it seems that it IS POSIX, just "not remotely portable".
OK. Lets port this so it doesn't require this $() feature. Can someone tackle this?
The original problem wasn't with the line shown in the bugreport, so the $( ... ) can easily be removed from all but one line. The problem was that I didn't know how to escape the ['s in m4, because [ is used to escape strings like '$1' by doing '$[1]' Suggestions are more than welcome
In M4, use "[[" instead of "[".
I've sent Kenneth a patch that solves the real issue at hand (which is _NOT_ "use [[ instead of [" -- maybe next time you should consider looking at the code before suggesting bogus non-fixes)
You could also attach the patch here, rather than just sending it to Kenneth. I'd like to see it.
Created attachment 6992 [details] [review] Patch to use backticks instead of $()
here it is (it's NOT tested, that's why I've only sent it to Kenneth)
i ran into this problem too, and had already done the above patch. i've built up to gnome-vfs w/o problems.
Seems fixed.