summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2007-01-15 01:53:06 +0000
committerTor Lillqvist <tml@src.gnome.org>2007-01-15 01:53:06 +0000
commitcd03867b7feaa1351479844249a596688eaab271 (patch)
tree44fa33df153109e5ce510a51f6761123b6f9f8f7
parent6beb2756e0c5c056a320419f4ac56d235b587b05 (diff)
downloadpango-cd03867b7feaa1351479844249a596688eaab271.tar.gz
Automatically use -mms-bitfields on Windows when building with gcc.
2007-01-15 Tor Lillqvist <tml@novell.com> * configure.in: Automatically use -mms-bitfields on Windows when building with gcc. (#394453) svn path=/branches/pango-1-14/; revision=2141
-rw-r--r--ChangeLog5
-rw-r--r--configure.in35
2 files changed, 40 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6d46f4aa..9fba517e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-15 Tor Lillqvist <tml@novell.com>
+
+ * configure.in: Automatically use -mms-bitfields on Windows when
+ building with gcc. (#394453)
+
2007-01-07 Behdad Esfahbod <behdad@gnome.org>
* docs/tmpl/engines.sgml:
diff --git a/configure.in b/configure.in
index 152b9d35..3092b54e 100644
--- a/configure.in
+++ b/configure.in
@@ -279,6 +279,41 @@ fi
AC_SUBST(WIN32_LIBS)
AM_CONDITIONAL(HAVE_WIN32, $have_win32)
+# Ensure MSVC-compatible struct packing convention is used when
+# compiling for Win32 with gcc.
+# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
+# gcc2 uses "-fnative-struct".
+if test "$pango_os_win32" = "yes"; then
+ if test x"$GCC" = xyes; then
+ msnative_struct=''
+ AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
+ if test -z "$ac_cv_prog_CC"; then
+ our_gcc="$CC"
+ else
+ our_gcc="$ac_cv_prog_CC"
+ fi
+ case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
+ 2.)
+ if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
+ msnative_struct='-fnative-struct'
+ fi
+ ;;
+ *)
+ if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
+ msnative_struct='-mms-bitfields'
+ fi
+ ;;
+ esac
+ if test x"$msnative_struct" = x ; then
+ AC_MSG_RESULT([no way])
+ AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code])
+ else
+ CFLAGS="$CFLAGS $msnative_struct"
+ AC_MSG_RESULT([${msnative_struct}])
+ fi
+ fi
+fi
+
#
# Checks for ATSUI
#