From: Eric Petit Date: Tue, 2 Jan 2007 14:51:10 +0000 (+0000) Subject: Check whether 'echo -n' works, otherwise try printf (fixes build on current OS X... X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=0fe97f423591939454ac7d272fe5fb5dde837b3f;p=x264.git Check whether 'echo -n' works, otherwise try printf (fixes build on current OS X 10.5) git-svn-id: svn://svn.videolan.org/x264/trunk@616 df754926-b1dd-0310-bc7b-ec298dee348c --- diff --git a/Makefile b/Makefile index f763c3b4..5c49c2f4 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,7 @@ common/i386/*.o: common/i386/i386inc.asm .depend: config.mak rm -f .depend # Hacky - because gcc 2.9x doesn't have -MT - $(foreach SRC, $(SRCS) $(SRCCLI), ( echo -n "`dirname $(SRC)`/" && $(CC) $(CFLAGS) $(SRC) -MM -g0 ) 1>> .depend;) + $(foreach SRC, $(SRCS) $(SRCCLI), ( $(ECHON) "`dirname $(SRC)`/" && $(CC) $(CFLAGS) $(SRC) -MM -g0 ) 1>> .depend;) config.mak: $(wildcard .svn/entries */.svn/entries */*/.svn/entries) ./configure $(CONFIGURE_ARGS) diff --git a/configure b/configure index 3ae29fb5..3d00d1bd 100755 --- a/configure +++ b/configure @@ -64,6 +64,18 @@ ASFLAGS="" EXE="" +# check whether 'echo -n' works as expected, otherwise try printf +if [ "x`echo -n houba`" = xhouba ] +then + ECHON="echo -n" +elif [ "x`printf houba`" = xhouba ] +then + ECHON="printf" +else + echo "Neither 'echo -n' nor 'printf' are working with your shell!" + exit 1 +fi + MACHINE="$(./config.guess)" case "${MACHINE#*-*-}" in @@ -381,11 +393,12 @@ EXE=$EXE VIS=$vis HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG DEVNULL=$DEVNULL +ECHON=$ECHON EOF -echo -n 'CONFIGURE_ARGS=' >> config.mak +$ECHON 'CONFIGURE_ARGS=' >> config.mak for A in "$@" ; do - echo -n " '$A'" >> config.mak + $ECHON " '$A'" >> config.mak done echo '' >> config.mak