From: Frantisek D. <va...@us...> - 2005-02-20 10:08:13
|
Update of /cvsroot/xine/xine-lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25336 Modified Files: ChangeLog configure.ac Log Message: **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. Index: ChangeLog =================================================================== RCS file: /cvsroot/xine/xine-lib/ChangeLog,v retrieving revision 1.572 retrieving revision 1.573 diff -u -r1.572 -r1.573 --- ChangeLog 20 Feb 2005 09:36:00 -0000 1.572 +++ ChangeLog 20 Feb 2005 10:08:01 -0000 1.573 @@ -28,7 +28,7 @@ * 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 Index: configure.ac =================================================================== RCS file: /cvsroot/xine/xine-lib/configure.ac,v retrieving revision 1.312 retrieving revision 1.313 diff -u -r1.312 -r1.313 --- configure.ac 19 Feb 2005 13:11:52 -0000 1.312 +++ configure.ac 20 Feb 2005 10:08:02 -0000 1.313 @@ -1315,34 +1315,74 @@ ],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 \ |