]> git.videolan.org Git - x264.git/commitdiff
Check whether 'echo -n' works, otherwise try printf (fixes build on current OS X...
authorEric Petit <titer@videolan.org>
Tue, 2 Jan 2007 14:51:10 +0000 (14:51 +0000)
committerEric Petit <titer@videolan.org>
Tue, 2 Jan 2007 14:51:10 +0000 (14:51 +0000)
git-svn-id: svn://svn.videolan.org/x264/trunk@616 df754926-b1dd-0310-bc7b-ec298dee348c

Makefile
configure

index f763c3b4cc67501eea691f8d55f854dc6cd88847..5c49c2f4075d44262ee66b6afada1e5914deb207 100644 (file)
--- 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)
index 3ae29fb59b5e36f145a7ab61bfb0e7940e64d4fb..3d00d1bda0a566ce40be0901c491fece60788db8 100755 (executable)
--- 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