Use CFLAGS flags from environment (dpkg-buildflags). Necessary for hardening flags. . No idea why the developer disables them like this. . Also needs dh-autoreconf to apply the changes during the build.
Fix cross building by using AC_CHECK_SIZEOF instead of AC_TRY_RUN (Closes: #948138)
gentoo fails to cross build from source, becasue it uses AC_TRY_RUN to figure out whether it needs _FILE_OFFSET_BITS. This can be implemented using a cross-compatible AC_CHECK_SIZEOF though.