[x264-devel] Solaris 10 sparc patch to configure
Loren Merritt
lorenm at u.washington.edu
Tue Jan 27 07:52:58 CET 2009
does this patch work?
On Tue, 27 Jan 2009, Robinson, Greg wrote:
> 1. echo
> I think when the configure script is run, it uses the shells builtin
> echo command (which works), but when make is run, it uses /bin/echo,
> which is broken on solaris. Printf works, as well as echo \c.
You can test that theory by adding "SHELL=/bin/bash" to the Makefile
--Loren Merritt
-------------- next part --------------
remove $ECHON kludge, which broke on sparc. bring back `gcc -MT`.
remove auto-reconfigure on svn update, which has done nothing since we stopped using svn.
fix $AS on sparc (was disabled by mmx check).
fix --extra-asflags (was ignored).
mark bash scripts as bash, not sh
---
Makefile | 7 +++----
configure | 35 +++++++++--------------------------
version.sh | 2 +-
3 files changed, 13 insertions(+), 31 deletions(-)
diff --git a/Makefile b/Makefile
index fb97d25..57d6e9c 100644
--- a/Makefile
+++ b/Makefile
@@ -93,11 +93,10 @@ checkasm: tools/checkasm.o libx264.a
.depend: config.mak
rm -f .depend
-# Hacky - because gcc 2.9x doesn't have -MT
- $(foreach SRC, $(SRCS) $(SRCCLI), ( $(ECHON) "`dirname $(SRC)`/" && $(CC) $(CFLAGS) $(ALTIVECFLAGS) $(SRC) -MM -g0 ) 1>> .depend;)
+ $(foreach SRC, $(SRCS) $(SRCCLI), $(CC) $(CFLAGS) $(ALTIVECFLAGS) $(SRC) -MT $(SRC:%.c=%.o) -MM -g0 1>> .depend;)
-config.mak: $(wildcard .svn/entries */.svn/entries */*/.svn/entries)
- ./configure $(CONFIGURE_ARGS)
+config.mak:
+ ./configure
depend: .depend
ifneq ($(wildcard .depend),)
diff --git a/configure b/configure
index 599b105..83e9271 100755
--- a/configure
+++ b/configure
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/bin/bash
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
@@ -65,23 +65,11 @@ CFLAGS="$CFLAGS -Wall -I."
LDFLAGS="$LDFLAGS"
HAVE_GETOPT_LONG=1
-AS="yasm"
+AS=""
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
-
# parse options
for opt do
@@ -238,7 +226,8 @@ esac
case $host_cpu in
i*86)
ARCH="X86"
- ASFLAGS="-O2"
+ AS="yasm"
+ ASFLAGS="$ASFLAGS -O2"
if [ "$SYS" = MACOSX ]; then
ASFLAGS="$ASFLAGS -f macho -DPREFIX"
elif [ "$SYS" = MINGW ]; then
@@ -249,8 +238,9 @@ case $host_cpu in
;;
x86_64)
ARCH="X86_64"
+ AS="yasm"
if [ "$SYS" = MACOSX ];then
- ASFLAGS="-f macho64 -m amd64 -DPIC -DPREFIX"
+ ASFLAGS="$ASFLAGS -f macho64 -m amd64 -DPIC -DPREFIX"
CFLAGS="$CFLAGS -arch x86_64"
LDFLAGS="$LDFLAGS -arch x86_64"
else
@@ -272,7 +262,7 @@ case $host_cpu in
CFLAGS="$CFLAGS -mcpu=ultrasparc"
LDFLAGS="$LDFLAGS -mcpu=ultrasparc"
AS="as"
- ASFLAGS="-xarch=v8plusa"
+ ASFLAGS="$ASFLAGS -xarch=v8plusa"
else
ARCH="Sparc"
fi
@@ -310,9 +300,9 @@ if [ $asm = yes -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
echo "If you really want to compile without asm, configure with --disable-asm."
exit 1
fi
-else
- AS=""
fi
+[ $asm = no ] && AS=""
+[ "x$AS" = x ] && asm="no"
CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS"
@@ -425,15 +415,8 @@ EXE=$EXE
VIS=$vis
HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
DEVNULL=$DEVNULL
-ECHON=$ECHON
EOF
-$ECHON 'CONFIGURE_ARGS=' >> config.mak
-for A in "$@" ; do
- $ECHON " '$A'" >> config.mak
-done
-echo '' >> config.mak
-
if [ "$shared" = "yes" ]; then
API=$(grep '#define X264_BUILD' < x264.h | cut -f 3 -d ' ')
if [ "$SYS" = "MINGW" ]; then
diff --git a/version.sh b/version.sh
index 9439702..c877847 100755
--- a/version.sh
+++ b/version.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
git rev-list HEAD | sort > config.git-hash
LOCALVER=`wc -l config.git-hash | awk '{print $1}'`
if [ $LOCALVER \> 1 ] ; then
More information about the x264-devel
mailing list