ID: 3608759 - Fix bug in configure.in when cross compiling

The previous test to see if we need pragma pack(1) was failing if we
cross compile because there was no way to run the test.

We now use AC_TRY_COMPILE and add the pragma pack(1) to the test code.
If it compiles, it must be good, so add the define.

Commit for Dan Gora
This commit is contained in:
Zdenek Styblik 2013-04-08 17:29:24 +00:00
parent eb63058bc3
commit 627cadaa39

View File

@ -513,7 +513,7 @@ if test "x$xenable_file_security" != "xno"; then
fi fi
AC_TRY_RUN([ AC_TRY_COMPILE([],[
#include <stdio.h> #include <stdio.h>
struct packstruct { struct packstruct {
@ -532,7 +532,9 @@ AC_TRY_RUN([
else else
return(0); return(0);
} }
],[],[AC_DEFINE(HAVE_PRAGMA_PACK,[1], ],
[],
[AC_DEFINE(HAVE_PRAGMA_PACK,[1],
[Define to 1 if you need to use #pragma pack instead of __attribute__ ((packed))])] [Define to 1 if you need to use #pragma pack instead of __attribute__ ((packed))])]
) )