From 1826deeba173952f9b078266c6b6be03d4f94789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 8 Sep 2019 15:58:38 +0200 Subject: Fix FTBFS with gpsim >= 0.31 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- config.h.in | 3 +++ configure.in.in | 32 ++++++++++++++++++++++++++------ src/electronics/Makefile.am | 2 ++ src/electronics/components/Makefile.am | 2 ++ 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/config.h.in b/config.h.in index c8499c0..fb150ce 100644 --- a/config.h.in +++ b/config.h.in @@ -12,6 +12,9 @@ /* Gpsim 0.27.0 was found */ #undef GPSIM_0_27_0 +/* Gpsim 0.31.0 was found */ +#undef GPSIM_0_31_0 + /* Define to 1 if you have the header file. */ #undef HAVE_CARBON_CARBON_H diff --git a/configure.in.in b/configure.in.in index e1fdd88..664976a 100644 --- a/configure.in.in +++ b/configure.in.in @@ -7,9 +7,9 @@ AC_C_BIGENDIAN AC_CHECK_KDEMAXPATHLEN -################################ -## BEGIN Check for gpsim 0.21 ## -################################ +################################### +## BEGIN Check for gpsim version ## +################################### AC_LANG_SAVE AC_LANG_CPLUSPLUS @@ -80,12 +80,27 @@ void func() { pic_processor *Processor; sizeof(Processor->Wreg); } AC_MSG_RESULT( no ) ) +CXXFLAGS="$glib_cflags $ktechlab_save_CXXFLAGS" + +AC_MSG_CHECKING([if gpsim requires C++11]) +AC_TRY_COMPILE( + [ +#include +void func() { gpsimObject *gpsimObj; sizeof(gpsimObj); } + ], + [], + AC_MSG_RESULT( no ), + have_gpsim_0_31_0=yes + GPSIM_CXXFLAGS="-std=c++11" + AC_MSG_RESULT( yes ) +) + CXXFLAGS="$ktechlab_save_CXXFLAGS" AC_LANG_RESTORE -############################## -## END Check for gpsim 0.21 ## -############################## +################################# +## END Check for gpsim version ## +################################# @@ -152,7 +167,12 @@ if test x$have_gpsim_0_27_0 == xyes; then AC_DEFINE([GPSIM_0_27_0],[],[Gpsim 0.27.0 was found]) fi +if test x$have_gpsim_0_31_0 == xyes; then + AC_DEFINE([GPSIM_0_31_0],[],[Gpsim 0.31.0 was found]) +fi + AC_SUBST(LIB_GPSIM) +AC_SUBST(GPSIM_CXXFLAGS) ############################## ## END DO_NOT_COMPILE CHECK ## diff --git a/src/electronics/Makefile.am b/src/electronics/Makefile.am index c15e689..688de94 100644 --- a/src/electronics/Makefile.am +++ b/src/electronics/Makefile.am @@ -1,3 +1,5 @@ +CXXFLAGS += $(GPSIM_CXXFLAGS) + INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/electronics \ -I$(top_srcdir)/src/electronics/components -I$(top_srcdir)/src/electronics/simulation \ -I$(top_srcdir)/src/flowparts -I$(top_srcdir)/src/gui -I$(top_srcdir)/src/languages \ diff --git a/src/electronics/components/Makefile.am b/src/electronics/components/Makefile.am index c388cf6..91336ae 100644 --- a/src/electronics/components/Makefile.am +++ b/src/electronics/components/Makefile.am @@ -1,3 +1,5 @@ +CXXFLAGS += $(GPSIM_CXXFLAGS) + INCLUDES = -I$(top_srcdir)/src \ -I$(top_srcdir)/src/electronics -I$(top_srcdir)/src/electronics/components \ -I$(top_srcdir)/src/electronics/simulation -I$(top_srcdir)/src/gui -I$(top_srcdir)/src/languages \ -- cgit v1.2.3