org: detect C++ errors

* doc/org/g++wrap.in: Save error messages.
* doc/Makefile.am: Display them at the end of the compilation.
This commit is contained in:
Alexandre Duret-Lutz 2017-03-10 16:52:54 +01:00
parent f9eefdc295
commit 55a524cf3c
2 changed files with 18 additions and 4 deletions

View file

@ -1,6 +1,17 @@
#!/bin/sh
# This is a wrapper around the compiler, to ensure that the code
# example run from the org-mode file are all linked with Spot.
exec @top_builddir@/libtool link @CXX@ -std=c++11 -Wall \
-I@abs_top_builddir@ -I@abs_top_srcdir@ -I@abs_top_srcdir@/buddy/src \
"$@" @abs_top_builddir@/spot/libspot.la
#
# Also we save errors to org.errors, so that we can detect issues
# after org-mode has exported everything. Otherwise these errors
# would go undetected.
@top_builddir@/libtool link @CXX@ @CXXFLAGS@ -Wall -Werror \
-I@abs_top_builddir@ -I@abs_top_srcdir@ -I@abs_top_srcdir@/buddy/src \
"$@" @abs_top_builddir@/spot/libspot.la 2> errors.$$
code=$?
if test $code -ne 0 && test -s errors.$$; then
cat errors.$$ >>org.errors
cat errors.$$ >&2
fi
rm -f errors.$$
exit $code