diff options
author | František Dvořák <valtri@users.sourceforge.net> | 2005-02-20 10:08:01 +0000 |
---|---|---|
committer | František Dvořák <valtri@users.sourceforge.net> | 2005-02-20 10:08:01 +0000 |
commit | 093464717c406e42a6599e4dad367248e1e37983 (patch) | |
tree | 9d3a98dcd842ada965ee03fa0d938bc446dfd466 | |
parent | 5d93f582cc0aafbc66134d46e79d73ab941f6c7e (diff) | |
download | xine-lib-093464717c406e42a6599e4dad367248e1e37983.tar.gz xine-lib-093464717c406e42a6599e4dad367248e1e37983.tar.bz2 |
**BUGFIX**
Replaced AC_TRY_RUN by AC_RUN_IFELSE. Now, if cross compiled, field ordering is hardcoded for Windows platform.
New common test just for availibility of bit fields works for all platforms.
CVS patchset: 7420
CVS date: 2005/02/20 10:08:01
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | configure.ac | 66 |
2 files changed, 54 insertions, 14 deletions
@@ -28,7 +28,7 @@ xine-lib (1.0.1) * updated vidix to 0.9.9 * plugin description accessor functions (may load plugins) * fixed translations, they wasn't used in some cases - * MSVC Win32 port update + * Win32 port updates: cross compilation of VCD, external ffmpeg with MSVC xine-lib (1.0) * unbreak DXR3 plugin diff --git a/configure.ac b/configure.ac index 9f15ae14c..a363e4ffb 100644 --- a/configure.ac +++ b/configure.ac @@ -1315,34 +1315,74 @@ if test x"$enable_vcd" = "xyes"; then ],ISOC99_PRAGMA=no) AC_MSG_RESULT($ISOC99_PRAGMA) + dnl dnl bitfield order - AC_MSG_CHECKING(bitfield ordering in structs) - AC_TRY_RUN([ -int - main() { + dnl + AC_MSG_CHECKING([bitfield ordering in structs]) + + dnl basic compile test for all platforms + AC_COMPILE_IFELSE([ +int main() { struct { char bit_0:1, bit_12:2, bit_345:3, bit_67:2; } #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) __attribute__((packed)) #endif bf = { 1,1,1,1 }; - if (sizeof (bf) != 1) return 1; - return *((unsigned char*) &bf) != 0x4b; } -], bf_lsbf=1, AC_TRY_RUN([ -int -main() { + switch (0) case 0: case sizeof(bf) == 1:; + return 0; +} +], [], AC_MSG_ERROR([compiler doesn't support bitfield structs])) + + + dnl run test + AC_RUN_IFELSE([ +int main() { struct { char bit_0:1, bit_12:2, bit_345:3, bit_67:2; } #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) __attribute__((packed)) #endif bf = { 1,1,1,1 }; if (sizeof (bf) != 1) return 1; - return *((unsigned char*) &bf) != 0xa5; } -], bf_lsbf=0, AC_MSG_ERROR([unsupported bitfield ordering]))) + return *((unsigned char*) &bf) != 0x4b; } +], bf_lsbf=1, [ + AC_RUN_IFELSE([ +int main() { + struct { char bit_0:1, bit_12:2, bit_345:3, bit_67:2; } +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) + __attribute__((packed)) +#endif + bf = { 1,1,1,1 }; + if (sizeof (bf) != 1) return 1; + return *((unsigned char*) &bf) != 0xa5; } +], bf_lsbf=0, AC_MSG_ERROR([unsupported bitfield ordering])) + ], + [case "$host" in + *-*-mingw32* | *-*-cygwin*) + bf_lsbf=1 + ;; + *) + AC_MSG_RESULT([unknown]) + AC_MSG_ERROR([value of bitfield test isn't known for $host +********************************************************************* +Value of bitfield test can't be found out for cross-compiling and we +don't know its value for host "$host". + +Because it's needed for VCD plugin, disable VCD by configure option +--disable-vcd or use external VCD library. +*********************************************************************]) + esac] +) + + if test "x$cross_compiling" = "xyes"; then + TEXT=" (guessed)" + else + TEXT="" + fi if test "x$bf_lsbf" = "x1"; then - AC_MSG_RESULT(LSBF) + AC_MSG_RESULT(LSBF${TEXT}) AC_DEFINE(BITFIELD_LSBF, [], [compiler does lsbf in struct bitfields]) else - AC_MSG_RESULT(MSBF) + AC_MSG_RESULT(MSBF${TEXT}) fi AC_HAVE_HEADERS( errno.h fcntl.h \ |