[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to include out of tree source during the qemu build?
From: |
Peter Maydell |
Subject: |
Re: how to include out of tree source during the qemu build? |
Date: |
Thu, 20 May 2021 10:10:14 +0100 |
On Thu, 20 May 2021 at 06:11, <ckim@etri.re.kr> wrote:
> I’m trying to include a out-of-tree source in a peripheral model and want to
> connect to a .so file during qemu operation.
>
> (This .so files was made by my colleague and contains the behaviors of a
> peripheral.
>
> I want to place the codes needed to link to this .so file outside the source
> tree as much as possible and use #include or VPATH in Makefile.
>
> I’ll use dlopen and dlsym functions to the .so file and use the functions
> there).
>
> If I want to add an include path or VPATH, where should I give them during
> the configure/make process and how?
You're largely on your own here:
(1) you're using an old version of QEMU which predates the complete
overhaul of the build system
(2) you're trying to do something that upstream has very little
interest in
I would probably try to treat this .so file like any other library
that QEMU might need to use -- have configure find it and set up
any cflags/ldflags settings necessary to compile and link to it.
> Also, I started reading
> https://qemu.readthedocs.io/en/latest/devel/build-system.html but this is for
> the latest version.
>
> And in this documents, it says it shows how to build qemu under the source
> tree and out of tree.
>
> In the out of tree build option header, it says, “VPATH, build artifacts
> outside of QEMU source tree entirely” and I can’t understand why it contains
> the word VPATH.
The old (pre-meson) build system used GNU Make's VPATH feature
https://www.gnu.org/software/make/manual/html_node/General-Search.html
in order to support "run make in a build directory that is not the
same as the source directory". Under meson we still support that
(and indeed we now *only* support source-and-build-trees different),
but the mechanism has changed. The build-system docs should probably
not really use the word "VPATH" any longer as it's a bit confusing.
> And this document is for the latest version.(6.x.x) but where can I read the
> equivalent document for version 5.1.0?
It will be in the source tree for 5.1.0, or it won't exist at all
because we hadn't documented the build system yet.
thanks
-- PMM