doc: pass AR when building examples
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 18 Nov 2019 17:07:50 +0000 (12:07 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 18 Nov 2019 17:11:36 +0000 (12:11 -0500)
commit8aeb3cae3d7a1c2cf0fb24d8d83c94e32d5622dd
tree811b4ddd08c8b71dc0d18a6f2ca53e58255e8978
parente8e8357cb5f6d006c60418a047fd17295cde0b3d
doc: pass AR when building examples

As reported here [1], when cross-compiling lttng-ust, the
"hello-static-lib" example uses the ar tool made for the --build machine
instead of the prefixed one, for the --host machine.

The Makefiles in the subdirectories of doc/examples are written by hand,
so that they can be easily copied and modified by users.  They are
therefore not integrated in the automake build system, and any value
detected by configure must be passed explicitly when invoking it.
For example, the CC value is already explicitly passed, so that the
compiler value found by configure is passed down.  We just need to do
the same for AR.

This patch adds AM_PROG_AR in configure.ac, so that configure finds the
prefixed version of ar, if cross-compiling.

It then sets the AR variable in doc/examples/Makefile.am, when invoking
sub-Makefiles.  I don't think we really need it in the cmake case, but
it doesn't hurt to have it there.

[1] https://lists.lttng.org/pipermail/lttng-dev/2019-November/029388.html

Reported-by: Rolf Eike Beer <eb@emlix.com>
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
configure.ac
doc/examples/Makefile.am
This page took 0.024503 seconds and 4 git commands to generate.