GNOME Bugzilla – Bug 613580
Build failure: LANGDIRS relies on non-portable behavior of 'echo -n'
Last modified: 2010-03-22 19:49:37 UTC
A tester of gok-2.28.1 on OS X 10.5/32bit reported to me: >make >Makefile:190: *** missing separator. Stop. > > The corresponding lines are : > >189 LANGDIRS = -n am/ >190 -n ang/ Apparently 'echo -n' isn't behaving the way you expect in configure.in: LANGDIRS="`$GREP -v "^\#" po/LINGUAS | while read line; do echo -n "$line/ "; done `" Autoconf has a whole series of tests to figure out if/how to get the desired behavior...sets $ECHO_N for you. But there may not be *any* determined value available. Can the intended effect be gotten with sed? That seems simpler than a while-read-do loop anyway. Or else, can you skip the LANGDIRS setting by a maintainer-mode or other autoconf flag? Or can it be done directly as part of the makefile recipes rather than passed from autoconf (still not portable, but only affects git developers not source-release builders).
Created attachment 156738 [details] [review] Avoid echo -n Hi Daniel, here's a patch that uses sed. Can you check if it works on OS X. Thanks.
To get result like previous, want slash after each? ':a;N;$!ba;s/\n/\/ /g' Not sure how to get one after the last (I don't know enough sed regex to match "\n or end-of-line").
A solution might be to just use awk as in LANGDIRS=`awk '/^[^#]/ {printf "%s/ ",$0}' po/LINGUAS`
Thanks Peter, your solution looks much cleaner. Committed to master. http://git.gnome.org/browse/gok/commit/?id=ed9481f3d52b099afe7dbb5b51d4ff9424bfb3ac