Browse Source

Add check whether Ruby requires explicit specification of C++ standard.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
master
Slávek Banko 8 months ago
parent
commit
8301a3c8e5
Signed by: SlavekB
GPG Key ID: 608F5293A04BE668
  1. 2
      korundum/bin/Makefile.am
  2. 35
      korundum/configure.in.in
  3. 2
      korundum/rubylib/korundum/Makefile.am
  4. 2
      qtruby/bin/Makefile.am
  5. 35
      qtruby/configure.in.in
  6. 2
      qtruby/rubylib/designer/uilib/Makefile.am
  7. 2
      qtruby/rubylib/qtruby/Makefile.am

2
korundum/bin/Makefile.am

@ -1,3 +1,5 @@
CXXFLAGS += $(RUBY_CXXFLAGS)
INCLUDES = $(all_includes) -I$(RUBY_ARCHDIR) $(RUBY_CFLAGS)
bin_PROGRAMS = krubyinit

35
korundum/rubylib/korundum/configure.in.in → korundum/configure.in.in

@ -32,6 +32,37 @@ else
RUBY_CFLAGS="-I${RUBY_INCLUDEDIR}"
fi
# check if Ruby requires explicit specification of C++ standard
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
SAVED_CXXFLAGS="$CXXFLAGS"
for CXX_STD_TEST in "" 11 14 17; do
CXXFLAGS="$SAVED_CXXFLAGS"
if test "x$CXX_STD_TEST" = "x"; then
AC_MSG_CHECKING([Ruby build with default C++ standard])
RUBY_CXXFLAGS=""
else
AC_MSG_CHECKING([Ruby build with C++$CXX_STD_TEST])
RUBY_CXXFLAGS="-std=c++$CXX_STD_TEST"
fi
CXXFLAGS="$SAVED_CXXFLAGS $RUBY_CFLAGS $RUBY_CXXFLAGS"
AC_TRY_COMPILE([
#include <ruby.h>
],[ ],
ruby_cxx_std=yes,
ruby_cxx_std=no
)
if test "x$ruby_cxx_std" = "xyes"; then
AC_SUBST(RUBY_CXXFLAGS)
AC_MSG_RESULT(yes)
break
else
AC_MSG_RESULT(no)
fi
done
CXXFLAGS="$SAVED_CXXFLAGS"
AC_LANG_RESTORE
# Removes trailing slashes, if any, to avoid fail to install with recent libtool.
RUBY_ARCHDIR=${RUBY_ARCHDIR%/}
RUBY_SITEDIR=${RUBY_SITEDIR%/}
@ -46,7 +77,8 @@ else
libdir $RUBY_LIBDIR,
includedir $RUBY_INCLUDEDIR,
librubyarg $RUBY_LIBRUBYARG,
cflags $RUBY_CFLAGS])
cflags $RUBY_CFLAGS,
cxxflags $RUBY_CXXFLAGS])
AC_SUBST(RUBY_ARCHDIR)
AC_SUBST(RUBY_SITEARCHDIR)
AC_SUBST(RUBY_SITEDIR)
@ -56,4 +88,3 @@ else
AC_SUBST(RUBY_LIBRUBYARG)
AC_SUBST(RUBY_CFLAGS)
fi

2
korundum/rubylib/korundum/Makefile.am

@ -1,3 +1,5 @@
CXXFLAGS += $(RUBY_CXXFLAGS)
INCLUDES = -I$(top_srcdir)/smoke -I$(top_srcdir)/qtruby/rubylib/qtruby $(all_includes) -I$(RUBY_ARCHDIR) $(RUBY_CFLAGS)
rubylibdir = $(RUBY_ARCHDIR)

2
qtruby/bin/Makefile.am

@ -1,3 +1,5 @@
CXXFLAGS += $(RUBY_CXXFLAGS)
INCLUDES = $(all_includes) -I$(RUBY_ARCHDIR) $(RUBY_CFLAGS)
bin_PROGRAMS = qtrubyinit

35
qtruby/rubylib/qtruby/configure.in.in → qtruby/configure.in.in

@ -32,6 +32,37 @@ else
RUBY_CFLAGS="-I${RUBY_INCLUDEDIR}"
fi
# check if Ruby requires explicit specification of C++ standard
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
SAVED_CXXFLAGS="$CXXFLAGS"
for CXX_STD_TEST in "" 11 14 17; do
CXXFLAGS="$SAVED_CXXFLAGS"
if test "x$CXX_STD_TEST" = "x"; then
AC_MSG_CHECKING([Ruby build with default C++ standard])
RUBY_CXXFLAGS=""
else
AC_MSG_CHECKING([Ruby build with C++$CXX_STD_TEST])
RUBY_CXXFLAGS="-std=c++$CXX_STD_TEST"
fi
CXXFLAGS="$SAVED_CXXFLAGS $RUBY_CFLAGS $RUBY_CXXFLAGS"
AC_TRY_COMPILE([
#include <ruby.h>
],[ ],
ruby_cxx_std=yes,
ruby_cxx_std=no
)
if test "x$ruby_cxx_std" = "xyes"; then
AC_SUBST(RUBY_CXXFLAGS)
AC_MSG_RESULT(yes)
break
else
AC_MSG_RESULT(no)
fi
done
CXXFLAGS="$SAVED_CXXFLAGS"
AC_LANG_RESTORE
# Removes trailing slashes, if any, to avoid fail to install with recent libtool.
RUBY_ARCHDIR=${RUBY_ARCHDIR%/}
RUBY_SITEDIR=${RUBY_SITEDIR%/}
@ -46,7 +77,8 @@ else
libdir $RUBY_LIBDIR,
includedir $RUBY_INCLUDEDIR,
librubyarg $RUBY_LIBRUBYARG,
cflags $RUBY_CFLAGS])
cflags $RUBY_CFLAGS,
cxxflags $RUBY_CXXFLAGS])
AC_SUBST(RUBY_ARCHDIR)
AC_SUBST(RUBY_SITEARCHDIR)
AC_SUBST(RUBY_SITEDIR)
@ -56,4 +88,3 @@ else
AC_SUBST(RUBY_LIBRUBYARG)
AC_SUBST(RUBY_CFLAGS)
fi

2
qtruby/rubylib/designer/uilib/Makefile.am

@ -1,3 +1,5 @@
CXXFLAGS += $(RUBY_CXXFLAGS)
INCLUDES = -I$(top_srcdir)/smoke -I$(top_srcdir)/qtruby/rubylib/qtruby $(all_includes) -I$(RUBY_ARCHDIR) $(RUBY_CFLAGS)
rubylibdir = $(RUBY_ARCHDIR)

2
qtruby/rubylib/qtruby/Makefile.am

@ -1,3 +1,5 @@
CXXFLAGS += $(RUBY_CXXFLAGS)
INCLUDES = -I$(top_srcdir)/smoke $(all_includes) -I$(RUBY_ARCHDIR) $(RUBY_CFLAGS)
noinst_HEADERS = qtruby.h marshall.h smokeruby.h extconf.rb

Loading…
Cancel
Save