From 506d3e073700c5fdf7f374b16fc0217185d70ac0 Mon Sep 17 00:00:00 2001 From: NicJA Date: Thu, 25 Jun 2015 00:25:39 +0000 Subject: [PATCH] for gcc >= 4.7, we need to specify -mno-ms-bitfields git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@50877 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- configure | 18 ++++++++++++++++++ configure.in | 19 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/configure b/configure index f77f537452..0817d1e410 100755 --- a/configure +++ b/configure @@ -8695,6 +8695,24 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $target_gcc_version" >&5 $as_echo "$target_gcc_version" >&6; } +GCC_VERSION_MAJOR=$(echo $target_gcc_version | cut -d'.' -f1) +GCC_VERSION_MINOR=$(echo $target_gcc_version | cut -d'.' -f2) +GCC_VERSION_PATCH=$(echo $target_gcc_version | cut -d'.' -f3) + +if test "$GCC_VERSION_MAJOR" -gt "4" ; then + gcc_fix_bitfields="true" +else + if test "$GCC_VERSION_MAJOR" -gt "3" ; then + if test "$GCC_VERSION_MINOR" -gt "6" ; then + gcc_fix_bitfields="true" + fi + fi +fi + +if test "$gcc_fix_bitfields" = "true" ; then + aros_target_cflags="$aros_target_cflags -mno-ms-bitfields" +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable Objective-C suppport" >&5 $as_echo_n "checking whether to enable Objective-C suppport... " >&6; } # Check whether --enable-objc was given. diff --git a/configure.in b/configure.in index 96ff321b01..4174d92427 100644 --- a/configure.in +++ b/configure.in @@ -1602,6 +1602,25 @@ else fi AC_MSG_RESULT($target_gcc_version) +GCC_VERSION_MAJOR=$(echo $target_gcc_version | cut -d'.' -f1) +GCC_VERSION_MINOR=$(echo $target_gcc_version | cut -d'.' -f2) +GCC_VERSION_PATCH=$(echo $target_gcc_version | cut -d'.' -f3) + +gcc_fix_bitfields="false" +if test "$GCC_VERSION_MAJOR" -gt "4" ; then + gcc_fix_bitfields="true" +else + if test "$GCC_VERSION_MAJOR" -gt "3" ; then + if test "$GCC_VERSION_MINOR" -gt "6" ; then + gcc_fix_bitfields="true" + fi + fi +fi + +if test "$gcc_fix_bitfields" = "true" ; then + aros_target_cflags="$aros_target_cflags -mno-ms-bitfields" +fi + AC_MSG_CHECKING([whether to enable Objective-C suppport]) AC_ARG_ENABLE(objc,AC_HELP_STRING([--enable-objc],[Enable Objectve-C support (default=no)]),objc="$enableval",objc="no") AC_MSG_RESULT($objc) -- 2.11.4.GIT