pjproject icon indicating copy to clipboard operation
pjproject copied to clipboard

Meson build system

Open vit1251 opened this issue 5 years ago • 5 comments

Could you please start distribute PJSIP modules as meson subproject?

vit1251 avatar Apr 13 '20 10:04 vit1251

From https://mesonbuild.com:

Meson is an open source build system meant to be both extremely fast, and, even more importantly, as user friendly as possible.

Features
- multiplatform support for Linux, macOS, Windows, GCC, Clang, Visual Studio and others 

Sounds interesting, unfortunately we have no plan to support this currently. If there's more interest, then perhaps we'll reconsider in the future. Thanks for the suggestion.

sauwming avatar Apr 30 '20 08:04 sauwming

Meson is most important replace autotools and provide reuse via subprojects. I think that it way to simplyfy distribution channel. I already use meson with PJ and may provide basic example if usage in fork. But I use only on Linux and make meson on top of make output.

vit1251 avatar Apr 30 '20 13:04 vit1251

Let's I make fork for example current release version 2.10 and we return back to that conversation about using meson?

vit1251 avatar May 01 '20 08:05 vit1251

Yes, please share with us your Linux meson build. It should serve as a good starting point for us or others to expand it to other platforms later in the future.

sauwming avatar May 01 '20 09:05 sauwming

Greetings. I made fork and start branch 2.10+meson on https://github.com/vit1251/pjproject/commit/2119deaf7007ddebf010f36b3cf26b444826114e

I tried to build with classic ./configure, make dep, make. As a result of the work of these scenarios, I received script output with gcc calls with parameters. I began to build my meson assembly over that script output. I understand that this is a simplified solution, but I don’t have many resources right now to deeply explore the original build system. If you like this direction, it will make sense to continue improve the assembly on the meson.

The assembly began with the link of the static library pjlib. In the beginning I replace macro definition PJ_AUTOCONF on PJ_LINUX. In the future, we can create configuring meson code with environment research and create the necessary files and add variables for compilation. See more on https://mesonbuild.com/Configuration.html

Taking the first steps I immediately got a compilation error:

[14/47] Compiling C object 'pjlib@sta/pjlib_src_pj_sock_bsd.c.o'.
FAILED: pjlib@sta/pjlib_src_pj_sock_bsd.c.o 
clang -Ipjlib@sta -I. -I.. -I../pjlib/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -g -fPIC -Wall -DPJ_LINUX=1 -O2 -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -MD -MQ 'pjlib@sta/pjlib_src_pj_sock_bsd.c.o' -MF 'pjlib@sta/pjlib_src_pj_sock_bsd.c.o.d' -o 'pjlib@sta/pjlib_src_pj_sock_bsd.c.o' -c ../pjlib/src/pj/sock_bsd.c
../pjlib/src/pj/sock_bsd.c:147:35: error: use of undeclared identifier 'TCP_NODELAY'
const pj_uint16_t PJ_TCP_NODELAY= TCP_NODELAY;
                                  ^
1 error generated.
[16/47] Compiling C object 'pjlib@sta/pjlib_src_pj_activesock.c.o'.
ninja: build stopped: subcommand failed.

I added the necessary header file to pjlib/src/pj/sock_bsd.c. As a result, I got a pjlib static library.

I would be happy to know your opinion on further direction and participation in meson assemblies for the pjproject.

I also have plan to setup continuous integration and continue integration on GitHub Actions. I will add a link on GitHub Actions a little later in this discussion as it will be ready.

vit1251 avatar May 14 '20 22:05 vit1251