Thanks for all the comments and help. I have added the patch to the January CF.
It looks like meson does not currently support building for android, the following output is what I get (but I have actually no experience with meson): meson.build:320:2: ERROR: Problem encountered: unknown host system: android Please find an attached patch which also includes a documentation section. I am happy to adjust if needed. Kind regards Matthias
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index 75dc81a..9c88558 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -1989,6 +1989,14 @@ build-postgresql: among developers is to use <envar>PROFILE</envar> for one-time flag adjustments, while <envar>COPT</envar> might be kept set all the time. </para> + + <para> + When building libpq as shared libraries, the resulting files are suffixed + with the version <literal>libpq.5.[version]</literal> and an unversioned + symlink <literal>libpq.so</literal>to the versioned file is created. An + exception to that is Android where library file names must end with + <literal>.so</literal>. Building for Android is only supported using make. + </para> </note> </sect2> </sect1> diff --git a/src/Makefile.shlib b/src/Makefile.shlib index 92d893e..4801b7a 100644 --- a/src/Makefile.shlib +++ b/src/Makefile.shlib @@ -187,7 +187,13 @@ endif ifeq ($(PORTNAME), linux) LINK.shared = $(COMPILER) -shared ifdef soname - LINK.shared += -Wl,-soname,$(soname) + ifeq (linux-android,$(findstring linux-android,$(host_os))) + #crosscompiling for android needs to create unvesioned libs + shlib = lib$(NAME)$(DLSUFFIX) + LINK.shared += -Wl,-soname,lib$(NAME)$(DLSUFFIX) + else + LINK.shared += -Wl,-soname,$(soname) + endif endif BUILD.exports = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@ exports_file = $(SHLIB_EXPORTS:%.txt=%.list)