Fix compilation of gb.pdf on old gcc, by checking if the '-std=c++11' flag is available.

[INTERPRETER]
* NEW: Write the name of optional libraries in the warning message displayed when not found.

[GB.PDF]
* BUG: Fix compilation of gb.pdf on old gcc, by checking if the '-std=c++11' flag is available.
This commit is contained in:
gambas 2018-09-01 20:05:44 +02:00
parent ce37927180
commit d3a145655a
3 changed files with 16 additions and 4 deletions

View file

@ -346,6 +346,17 @@ AC_DEFUN([GB_INIT],
AC_DEFINE(HAVE_GCC_LTO, 1, [Whether gcc supports -flto]) AC_DEFINE(HAVE_GCC_LTO, 1, [Whether gcc supports -flto])
fi fi
dnl ---- check for -std=c++11 compiler flag
GB_CFLAGS_GCC_OPTION([-std=c++11],,
[
GB_CXXFLAGS_STD_CPP11=" -std=c11x"
have_gcc_std_c11x=yes
])
if test "$have_gcc_std_cpp11" = "yes"; then
AC_DEFINE(HAVE_GCC_STD_CPP11, 1, [Whether g++ supports -std=c++11])
fi
dnl ---- Debug flags dnl ---- Debug flags
@ -376,6 +387,7 @@ AC_DEFUN([GB_INIT],
AC_SUBST(AM_CXXFLAGS) AC_SUBST(AM_CXXFLAGS)
AC_SUBST(AM_CXXFLAGS_OPT) AC_SUBST(AM_CXXFLAGS_OPT)
AC_SUBST(GB_CFLAGS_LTO) AC_SUBST(GB_CFLAGS_LTO)
AC_SUBST(GB_CXXFLAGS_STD_CPP11)
rm -f DISABLED DISABLED.* rm -f DISABLED DISABLED.*
]) ])

View file

@ -5,7 +5,7 @@ gblib_LTLIBRARIES = gb.pdf.la
gb_pdf_la_LIBADD = @POPPLER_LIB@ gb_pdf_la_LIBADD = @POPPLER_LIB@
gb_pdf_la_LDFLAGS = -module @LD_FLAGS@ @POPPLER_LDFLAGS@ gb_pdf_la_LDFLAGS = -module @LD_FLAGS@ @POPPLER_LDFLAGS@
gb_pdf_la_CXXFLAGS = $(AM_CXXFLAGS) -std=c++11 gb_pdf_la_CXXFLAGS = $(AM_CXXFLAGS) $(GB_CXXFLAGS_STD_CPP11)
gb_pdf_la_CPPFLAGS = @POPPLER_INC@ gb_pdf_la_CPPFLAGS = @POPPLER_INC@
gb_pdf_la_SOURCES = main.h main.cpp \ gb_pdf_la_SOURCES = main.h main.cpp \

View file

@ -22,7 +22,7 @@ GB_COMPONENT(
[GB_FIND(libintl.$SHLIBEXT, /opt/local /usr/local /usr /, lib)], [GB_FIND(libintl.$SHLIBEXT, /opt/local /usr/local /usr /, lib)],
[-lintl], [-lintl],
[], [],
[This library may be located inside the system C library, so you can ignore that warning...]) [Cannot find 'libintl' library. It may be located inside the system C library, so you can ignore that warning...])
dnl ---- Remove DISABLED file that could have been generated before dnl ---- Remove DISABLED file that could have been generated before
@ -36,7 +36,7 @@ GB_COMPONENT(
[GB_FIND(libiconv.$SHLIBEXT, /opt/local /usr/local /usr, lib)], [GB_FIND(libiconv.$SHLIBEXT, /opt/local /usr/local /usr, lib)],
[-liconv], [-liconv],
[], [],
[This library may be located inside the system C library, so you can ignore that warning...]) [Cannot find 'libiconv' library. It may be located inside the system C library, so you can ignore that warning...])
dnl ---- Remove DISABLED file that could have been generated before dnl ---- Remove DISABLED file that could have been generated before
@ -52,7 +52,7 @@ GB_COMPONENT(
[GB_FIND(libgettextlib.$SHLIBEXT, /opt/local /usr/local /usr, lib)], [GB_FIND(libgettextlib.$SHLIBEXT, /opt/local /usr/local /usr, lib)],
[-lgettextlib], [-lgettextlib],
[], [],
[This library may be located inside the system C library, so you can ignore that warning...]) [Cannot find 'libgettextlib' library. It may be located inside the system C library, so you can ignore that warning...])
fi fi