From 925a2fe55cbe25fc700972b51e7aa84a5fd18f65 Mon Sep 17 00:00:00 2001 From: Parthasarathy Bhuvaragan Date: Mon, 16 Feb 2015 14:57:36 +0100 Subject: ID:370 - add anonymous union support in CFLAGS for older gcc In older GCC versions when an element in an anonymous unions/structures are addressed by name, gcc must use -fms-extensions. Change-Id: Id80617ad9336c7a02fbe613b58e3f337fa4baeee Signed-off-by: Parthasarathy Bhuvaragan --- configure.ac | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index d7c5620..a425bf5 100644 --- a/configure.ac +++ b/configure.ac @@ -130,6 +130,24 @@ if test "x$xenable_all_options" = "xyes" || test "x$xenable_solaris_opt" = "xyes AC_DEFINE(ENABLE_ALL_OPTIONS, [1], [Define to 1 to enable all command line options.]) fi +dnl Determine anonymous union/structure support in GCC +AC_TRY_COMPILE([ +#include + ], [ + struct test { + union { + int a; + unsigned int b; + }; + } test; + + printf("a is %d", test.a); + ], ac_need_fms_extension=no, ac_need_fms_extension=yes) +if test "x$ac_need_fms_extension" = "xyes"; then + CFLAGS="$CFLAGS -fms-extensions" + AC_SUBST(CFLAGS) +fi + dnl check for OpenSSL functionality AC_ARG_ENABLE([internal-md5], [AC_HELP_STRING([--enable-internal-md5], -- cgit v1.2.1