diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2022-03-23 18:13:35 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2022-03-23 18:23:36 +0100 |
commit | b8c35f29dbb685428b5e94189e25d7a068e4fbe6 (patch) | |
tree | 7f51b5d900f0c6942481c0182e5d4416d304a610 | |
parent | 37fb4f1823f38dbf31b26167e52b33117581d139 (diff) | |
download | koffice-b8c35f29.tar.gz koffice-b8c35f29.zip |
Fix FTBFS because of conflict between config.h generated by automake
and Ruby headers.
Instead of using config.h in Ruby related code, the definitions
related to Ruby version are added to CFLAGS.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 5daf2fbc51682f117572fe1f6a78522177dedef5)
-rw-r--r-- | lib/kross/configure.in.in | 4 | ||||
-rw-r--r-- | lib/kross/ruby/Makefile.am | 2 | ||||
-rw-r--r-- | lib/kross/ruby/rubyinterpreter.cpp | 1 | ||||
-rw-r--r-- | lib/kross/ruby/rubywrapper.c | 1 |
4 files changed, 5 insertions, 3 deletions
diff --git a/lib/kross/configure.in.in b/lib/kross/configure.in.in index c9acf48b1..67e9aaf57 100644 --- a/lib/kross/configure.in.in +++ b/lib/kross/configure.in.in @@ -40,11 +40,14 @@ if test "x$compile_kross" = "xyes" ; then fi RUBY_SERIES="$RUBY_MAJOR$RUBY_MINOR" + RUBY_VERSION_DEFS="" if test "$RUBY_SERIES" -ge "19"; then AC_DEFINE_UNQUOTED(HAVE_RUBY_1_9, 1, [Defines if your system has Ruby 1.9.x]) + RUBY_VERSION_DEFS="${RUBY_VERSION_DEFS} -DHAVE_RUBY_1_9" fi if test "$RUBY_SERIES" -ge "30"; then AC_DEFINE_UNQUOTED(HAVE_RUBY_3, 1, [Defines if your system has Ruby 3.x]) + RUBY_VERSION_DEFS="${RUBY_VERSION_DEFS} -DHAVE_RUBY_3" fi if test `${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.key?(%q(rubyhdrdir))"` = "true"; then @@ -85,6 +88,7 @@ if test "x$compile_kross" = "xyes" ; then AC_SUBST(RUBY_LIBRUBYARG) AC_SUBST(RUBY_CFLAGS) AC_SUBST(RUBY_ENABLESHARED) + AC_SUBST(RUBY_VERSION_DEFS) AC_MSG_CHECKING(Ruby shared library) diff --git a/lib/kross/ruby/Makefile.am b/lib/kross/ruby/Makefile.am index fadee61ee..c3080962f 100644 --- a/lib/kross/ruby/Makefile.am +++ b/lib/kross/ruby/Makefile.am @@ -2,7 +2,7 @@ include $(top_srcdir)/lib/kross/Makefile.global CXXFLAGS += $(USE_EXCEPTIONS) -INCLUDES = -I$(top_srcdir)/lib/kross -I$(RUBY_INCLUDEDIR) $(RUBY_CFLAGS) $(all_includes) +INCLUDES = -I$(top_srcdir)/lib/kross -I$(RUBY_INCLUDEDIR) $(RUBY_CFLAGS) $(RUBY_VERSION_DEFS) $(all_includes) METASOURCES = AUTO kde_module_LTLIBRARIES = krossruby.la diff --git a/lib/kross/ruby/rubyinterpreter.cpp b/lib/kross/ruby/rubyinterpreter.cpp index 3504ca7c4..b453a238f 100644 --- a/lib/kross/ruby/rubyinterpreter.cpp +++ b/lib/kross/ruby/rubyinterpreter.cpp @@ -17,7 +17,6 @@ * Boston, MA 02110-1301, USA. ***************************************************************************/ -#include "config.h" #include "rubyinterpreter.h" #include <map> diff --git a/lib/kross/ruby/rubywrapper.c b/lib/kross/ruby/rubywrapper.c index a25b1b282..5fafd6b80 100644 --- a/lib/kross/ruby/rubywrapper.c +++ b/lib/kross/ruby/rubywrapper.c @@ -17,7 +17,6 @@ * Boston, MA 02110-1301, USA. ***************************************************************************/ -#include "config.h" #include "ruby.h" void kross_rb_set_safe_level(int safelevel) { |