mirror of
https://github.com/apache/nuttx.git
synced 2026-08-20 04:58:28 +00:00
docs: describe shared library module declarations
Document the nuttx-apps BUILD_SHARED_LIBRARY interface and its supported module variables. Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
This commit is contained in:
parent
769862ac6a
commit
ee07c9212f
1 changed files with 25 additions and 0 deletions
|
|
@ -57,6 +57,31 @@ as the application that uses the shared library.
|
|||
So, they are shared in the sense that the ``.text`` is shared.
|
||||
|
||||
|
||||
Building a Shared Library
|
||||
=========================
|
||||
|
||||
Applications can declare a loadable shared library with the Android.mk-style
|
||||
helper in ``nuttx-apps``. Include ``Make.defs``, set the module name and its C
|
||||
or C++ sources, then include ``BUILD_SHARED_LIBRARY``::
|
||||
|
||||
include $(APPDIR)/Make.defs
|
||||
|
||||
LOCAL_PATH := $(CURDIR)
|
||||
LOCAL_MODULE := my-new-lib
|
||||
LOCAL_SRC_FILES := my-source-file.cpp another-file.cpp
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
The build writes the relocatable ELF library to
|
||||
``$(BINDIR)/$(LOCAL_MODULE)``. Set ``LOCAL_MODULE_FILENAME`` when the runtime
|
||||
interface requires another name, such as ``libmy-new-lib.so``.
|
||||
|
||||
``LOCAL_CFLAGS``, ``LOCAL_CXXFLAGS``, ``LOCAL_LDFLAGS``, and ``LOCAL_LDLIBS``
|
||||
add module-specific options. The selected architecture must provide the NuttX
|
||||
module compiler and linker flags. Exported symbols must have default
|
||||
visibility for ``dlsym()`` or use by another library.
|
||||
|
||||
|
||||
FLAT Build
|
||||
==========
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue