jasonmc / forked-daapd

A re-write of the firefly media server (mt-daapd). It's released under GPLv2+. Please note that this git repository is a mirror of the official one at git://git.debian.org/~jblache/forked-daapd.git
http://blog.technologeek.org/2009/06/12/217
GNU General Public License v2.0
326 stars 45 forks source link

ftbfs on macosx #7

Closed holleB closed 6 years ago

holleB commented 14 years ago

After installing all the dependencies on MacOSX, forked-daapd fails to build from source. The make output is: make make all-recursive Making all in src java org.antlr.Tool -depend DAAP2SQL.g > DAAP2SQL.u java org.antlr.Tool -depend DAAP.g > DAAP.u java org.antlr.Tool -depend RSP2SQL.g > RSP2SQL.u java org.antlr.Tool -depend RSP.g > RSP.u RSP.u:7: * missing separator. Stop. make[1]: * [all-recursive] Error 1 make: *\ [all] Error 2

Any hints how to debug this problem would be greatly appreciated.

treydempsey commented 12 years ago

This is caused by the builtin echo inserting a literal "-n" into the output file instead of echoing without a new line. By using /bin/echo it correctly handles -n. A more portable solution would probably look for the location of echo and figure out how to echo out a string without a trailing newline (this has been done before). But for simplicity here is my patch for OS X:

diff --git a/src/Makefile.am b/src/Makefile.am
index 504c8f8..4431da3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -133,8 +133,8 @@ SUFFIXES = .g .u

 %.u: %.g
        $(ANTLR) -depend $< > $@
-       @echo -n "ANTLR_PRODUCTS += " > $@.tmp
-       @grep : $@ | cut -d : -f 1 | tr -d ' ' | { while read f; do test "$$f" != "$<" && echo -n "$$f "; done } >> $@.tmp
+       @/bin/echo -n "ANTLR_PRODUCTS += " > $@.tmp
+       @grep : $@ | cut -d : -f 1 | tr -d ' ' | { while read f; do test "$$f" != "$<" && /bin/echo -n "$$f "; done } >> $@.tmp
        @cat $@.tmp >> $@
        @rm $@.tmp