r23475 - gnucash/trunk - Protect older GCCs from -Wno-invalid-source-encoding
John Ralls
jralls at code.gnucash.org
Mon Dec 2 18:46:23 EST 2013
Author: jralls
Date: 2013-12-02 18:46:22 -0500 (Mon, 02 Dec 2013)
New Revision: 23475
Trac: http://svn.gnucash.org/trac/changeset/23475
Modified:
gnucash/trunk/configure.ac
gnucash/trunk/src/engine/Makefile.am
Log:
Protect older GCCs from -Wno-invalid-source-encoding
Needed for clang, added in r23434
Modified: gnucash/trunk/configure.ac
===================================================================
--- gnucash/trunk/configure.ac 2013-12-02 16:05:44 UTC (rev 23474)
+++ gnucash/trunk/configure.ac 2013-12-02 23:46:22 UTC (rev 23475)
@@ -100,7 +100,24 @@
AC_PROG_INSTALL
PKG_PROG_PKG_CONFIG
+dnl clang wants to check file encodings, and we need to tell it not to
+dnl becuase of the unicode currency symbols. But older versions of GCC
+dnl don't like the warning suppression option, so we need to set it only
+dnl with clang.
+AC_MSG_CHECKING([if compiling with clang])
+
+AC_COMPILE_IFELSE(
+[AC_LANG_PROGRAM([], [[
+#ifndef __clang__
+ not clang
+#endif
+]])],
+[ac_cv_CLANG=yes], [ac_cv_CLANG=no])
+
+AC_MSG_RESULT([$ac_cv_CLANG])
+AM_CONDITIONAL([CLANG], [test "x$ac_cv_CLANG" = "xyes"])
+
###--------------------------------------------------------
### Optionally enable gtkmm plugin (requires c++ compiler)
###--------------------------------------------------------
Modified: gnucash/trunk/src/engine/Makefile.am
===================================================================
--- gnucash/trunk/src/engine/Makefile.am 2013-12-02 16:05:44 UTC (rev 23474)
+++ gnucash/trunk/src/engine/Makefile.am 2013-12-02 23:46:22 UTC (rev 23475)
@@ -130,8 +130,9 @@
noinst_SCRIPTS = iso-currencies-to-c
libgncmod_engine_la_LDFLAGS = -avoid-version
+if CLANG
libgncmod_engine_la_CFLAGS = -Wno-invalid-source-encoding
-
+endif
libgncmod_engine_la_LIBADD = \
../gnc-module/libgnc-module.la \
../core-utils/libgnc-core-utils.la \
More information about the gnucash-changes
mailing list