Commit a020d6ec authored by Sam Hocevar's avatar Sam Hocevar

* Use the autotool's config.guess script instead of uname to check the

    system and CPU types, to avoid issues when using for instance a 32-bit
    userland on top of a 64-bit kernel.


git-svn-id: svn://svn.videolan.org/x264/trunk@560 df754926-b1dd-0310-bc7b-ec298dee348c
parent 477c5bfb
......@@ -66,62 +66,62 @@ ASFLAGS=""
EXE=""
UNAMES="`uname -s`"
case "$UNAMES" in
BeOS)
MACHINE="$(./config.guess)"
case "${MACHINE#*-*-}" in
beos*)
SYS="BEOS"
CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
;;
Darwin)
darwin*)
SYS="MACOSX"
CFLAGS="$CFLAGS -falign-loops=16"
LDFLAGS="$LDFLAGS -lm -lmx"
;;
FreeBSD)
freebsd*)
SYS="FREEBSD"
LDFLAGS="$LDFLAGS -lm"
;;
NetBSD)
netbsd*)
SYS="NETBSD"
LDFLAGS="$LDFLAGS -lm"
;;
OpenBSD)
openbsd*)
SYS="OPENBSD"
CFLAGS="$CFLAGS -I/usr/X11R6/include"
LDFLAGS="$LDFLAGS -lm"
;;
Linux)
linux*)
SYS="LINUX"
CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
LDFLAGS="$LDFLAGS -lm"
;;
CYGWIN*)
cygwin*)
SYS="CYGWIN"
CFLAGS="$CFLAGS -mno-cygwin"
LDFLAGS="$LDFLAGS -mno-cygwin"
EXE=".exe"
DEVNULL="NUL"
;;
MINGW*)
mingw*)
SYS="MINGW"
EXE=".exe"
DEVNULL="NUL"
;;
SunOS)
sunos*|solaris*)
SYS="SunOS"
CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
LDFLAGS="$LDFLAGS -lm"
HAVE_GETOPT_LONG=0
;;
*)
echo "Unknown system $UNAMES, edit the configure"
echo "Unknown system $MACHINE, edit the configure"
exit 1
;;
esac
UNAMEM="`uname -m`"
case "$UNAMEM" in
i386|i486|i586|i686|BePC)
case "${MACHINE%%-*}" in
i*86)
ARCH="X86"
CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2"
AS="nasm"
......@@ -142,7 +142,7 @@ case "$UNAMEM" in
AS="yasm"
ASFLAGS="-f elf -m amd64"
;;
"Power Macintosh"|ppc|ppc64)
powerpc|powerpc64)
ARCH="PPC"
if [ $SYS = MACOSX ]
then
......@@ -151,29 +151,21 @@ case "$UNAMEM" in
CFLAGS="$CFLAGS -maltivec -mabi=altivec"
fi
;;
sun4m|sun4d|sparc|sparc64)
ARCH="Sparc"
;;
sun4u)
ARCH="UltraSparc"
CFLAGS="$CFLAGS -mcpu=ultrasparc"
LDFLAGS="$LDFLAGS -mcpu=ultrasparc"
AS="as"
ASFLAGS="-xarch=v8plusa"
;;
ia64)
ARCH="IA64"
;;
alpha)
ARCH="ALPHA"
sparc)
if test "$(uname -m)" = "sun4u"; then
ARCH="UltraSparc"
CFLAGS="$CFLAGS -mcpu=ultrasparc"
LDFLAGS="$LDFLAGS -mcpu=ultrasparc"
AS="as"
ASFLAGS="-xarch=v8plusa"
else
ARCH="Sparc"
fi
;;
mips|mipsel|mips64)
mips|mipsel|mips64|mips64el)
ARCH="MIPS"
;;
m68k)
ARCH="M68K"
;;
arm|armv5tel|armv4l)
arm*)
ARCH="ARM"
;;
s390|s390x)
......@@ -183,8 +175,7 @@ case "$UNAMEM" in
ARCH="PARISC"
;;
*)
echo "Unknown platform $UNAMEM, edit the configure"
exit 1
ARCH="$(echo ${MACHINE%%-*} | tr a-z A-Z)"
;;
esac
......@@ -393,7 +384,7 @@ EOF
fi
if [ "$shared" = "yes" ]; then
API=`grep '#define X264_BUILD' < x264.h | cut -f 3 -d ' '`
API=$(grep '#define X264_BUILD' < x264.h | cut -f 3 -d ' ')
echo "SONAME=libx264.so.$API" >> config.mak
echo 'default: $(SONAME)' >> config.mak
if [ "$gtk" = "yes" ]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment