From d745ea99ecb587532af90830057b4bde5001e1de Mon Sep 17 00:00:00 2001 From: John Ralls Date: Mon, 2 Dec 2013 23:46:22 +0000 Subject: [PATCH] Protect older GCCs from -Wno-invalid-source-encoding Needed for clang, added in r23434 git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23475 57a11ea4-9604-0410-9ed3-97b8803252fd --- configure.ac | 17 +++++++++++++++++ src/engine/Makefile.am | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 9b99cf7beb..c40d211c3d 100644 --- a/configure.ac +++ b/configure.ac @@ -100,6 +100,23 @@ AM_GLIB_GNU_GETTEXT 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) diff --git a/src/engine/Makefile.am b/src/engine/Makefile.am index 16a28f9be1..42b5e9babd 100644 --- a/src/engine/Makefile.am +++ b/src/engine/Makefile.am @@ -130,8 +130,9 @@ noinst_HEADERS = \ 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 \