summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2019-09-08 15:58:38 +0200
committerSlávek Banko <[email protected]>2019-09-08 15:58:38 +0200
commit1826deeba173952f9b078266c6b6be03d4f94789 (patch)
tree7fec975903f0777cf094d49796a47231eabdb3d0
parent94a3d972a5aa509e68f658346caddf8e212a0f2b (diff)
downloadktechlab-1826deeba173952f9b078266c6b6be03d4f94789.tar.gz
ktechlab-1826deeba173952f9b078266c6b6be03d4f94789.zip
Fix FTBFS with gpsim >= 0.31
Signed-off-by: Slávek Banko <[email protected]>
-rw-r--r--config.h.in3
-rw-r--r--configure.in.in32
-rw-r--r--src/electronics/Makefile.am2
-rw-r--r--src/electronics/components/Makefile.am2
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 <Carbon/Carbon.h> 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 <gpsim/gpsim_object.h>
+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 \