aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure
diff options
context:
space:
mode:
authorGravatar atmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-08-05 01:31:47 +0000
committerGravatar atmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-08-05 01:31:47 +0000
commit466100678883f720cb770fc3c54e7b27ae21be80 (patch)
treebf2f31b0fd97003e38b6c72d4d44aa93d019ab5e /configure
parenta04e780da0f4b5ffcdbde08da982bbcc753effa7 (diff)
endian autodetection by Bertrand + Michael, tested on x86, PPC, sparc, alpha
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6914 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure46
1 files changed, 35 insertions, 11 deletions
diff --git a/configure b/configure
index 7d7bfba0bd..0308bc1a73 100755
--- a/configure
+++ b/configure
@@ -165,6 +165,8 @@ Optional features:
--disable-mpdvdkit Disable mpdvdkit support [autodetect]
--disable-css Disable oldstyle libcss DVD support [autodetect]
--disable-cdparanoia Disable cdparanoia support [autodetect]
+ --disable-big-endian Force byte order to little endian [autodetect]
+ --enable-big-endian Force byte order to big endian [autodetect]
Video:
--enable-gl build with OpenGL render support [autodetect]
@@ -341,6 +343,7 @@ if test -z "$_target" ; then
arm*) host_arch=arm ;;
s390) host_arch=s390 ;;
s390x) host_arch=s390x ;;
+ mips) host_arch=mips ;;
*) host_arch=UNKNOWN ;;
esac
;;
@@ -572,7 +575,6 @@ case "$host_arch" in
i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
_def_arch="#define ARCH_X86 1"
_target_arch="TARGET_ARCH_X86 = yes"
- _def_words_endian="#undef WORDS_BIGENDIAN"
case "$pvendor" in
AuthenticAMD)
@@ -741,7 +743,6 @@ EOF
ia64)
_def_arch='#define ARCH_IA64 1'
_target_arch='TARGET_ARCH_IA64 = yes'
- _def_words_endian='#undef WORDS_BIGENDIAN'
iproc='ia64'
proc=''
_march=''
@@ -751,7 +752,6 @@ EOF
x86_64)
_def_arch='#define ARCH_X86_64 1'
_target_arch='TARGET_ARCH_X86_64 = yes'
- _def_words_endian='#undef WORDS_BIGENDIAN'
iproc='x86_64'
proc=''
_march=''
@@ -761,7 +761,6 @@ EOF
sparc)
_def_arch='#define ARCH_SPARC 1'
_target_arch='TARGET_ARCH_SPARC = yes'
- _def_words_endian='#define WORDS_BIGENDIAN 1'
iproc='sparc'
proc='v8'
_march=''
@@ -771,7 +770,6 @@ EOF
arm)
_def_arch='#define ARCH_ARM 1'
_target_arch='TARGET_ARCH_ARM = yes'
- _def_words_endian='#undef WORDS_BIGENDIAN'
iproc=arm
proc=''
_march=''
@@ -781,7 +779,6 @@ EOF
ppc)
_def_arch='#define ARCH_PPC 1'
_target_arch='TARGET_ARCH_PPC = yes'
- _def_words_endian='#define WORDS_BIGENDIAN 1'
iproc='ppc'
proc=''
_march=''
@@ -796,7 +793,6 @@ EOF
alpha)
_def_arch='#define ARCH_ALPHA 1'
_target_arch='TARGET_ARCH_ALPHA = yes'
- _def_words_endian='#undef WORDS_BIGENDIAN'
iproc='alpha'
_march=''
echocheck "GCC & CPU optimization abilities"
@@ -813,7 +809,6 @@ EOF
mips)
_def_arch='#define ARCH_SGI_MIPS 1'
_target_arch='TARGET_ARCH_SGI_MIPS = yes'
- _def_words_endian='#define WORDS_BIGENDIAN 1'
iproc='sgi-mips'
proc=''
_march=''
@@ -823,7 +818,6 @@ EOF
s390)
_def_arch='#define ARCH_S390 1'
_target_arch='TARGET_ARCH_S390 = yes'
- _def_words_endian='#define WORDS_BIGENDIAN 1'
iproc='390'
proc=''
_march=''
@@ -833,7 +827,6 @@ EOF
s390x)
_def_arch='#define ARCH_S390X 1'
_target_arch='TARGET_ARCH_S390X = yes'
- _def_words_endian='#define WORDS_BIGENDIAN 1'
iproc='390x'
proc=''
_march=''
@@ -971,6 +964,7 @@ _i18n=no
_sighandler=yes
_libdv=auto
_cdparanoia=auto
+_big_endian=auto
for ac_option do
case "$ac_option" in
@@ -1129,6 +1123,8 @@ for ac_option do
--disable-linux-devfs) _linux_devfs=no ;;
--enable-cdparanoia) _cdparanoia=yes ;;
--disable-cdparanoia) _cdparanoia=no ;;
+ --enable-big-endian) _big_endian=yes ;;
+ --disable-big-endian) _big_endian=no ;;
--enable-dga) _dga=auto ;; # as we don't know if it's 1 or 2
--enable-dga=*) _dga=`echo $ac_option | cut -d '=' -f 2` ;;
@@ -3846,7 +3842,34 @@ else
fi
echores "$_streaming"
-
+# endian testing
+echocheck "byte order"
+if test "$_big_endian" = auto ; then
+ cat > $TMPC <<EOF
+#include <inttypes.h>
+int main(void) {
+ volatile uint32_t i=0x01234567;
+ return (*((uint8_t*)(&i))) == 0x67;
+}
+EOF
+ if cc_check ; then
+ if $TMPO ; then
+ _big_endian=yes
+ else
+ _big_endian=no
+ fi
+ else
+ echo -n "failed to autodetect byte order, defaulting to "
+ fi
+fi
+if test "$_big_endian" = yes ; then
+ _byte_order='Big Endian'
+ _def_words_endian='#define WORDS_BIGENDIAN 1'
+else
+ _byte_order='Little Endian'
+ _def_words_endian='#undef WORDS_BIGENDIAN'
+fi
+echores "$_byte_order"
# --------------- GUI specific tests begin -------------------
echocheck "GUI"
@@ -4657,6 +4680,7 @@ Config files successfully generated by ./configure !
Data directory: $_datadir
Config direct.: $_confdir
+ Byte order: $_byte_order
Optimizing for: $_optimizing
Enabled optional drivers: