Skip to content

Introduce meson.build - #14

Merged
lumag merged 6 commits into
linux-msm:masterfrom
superna9999:meson-build
Oct 2, 2023
Merged

lumag merged 6 commits into
linux-msm:masterfrom
superna9999:meson-build

Conversation

@superna9999

Copy link
Copy Markdown
Member

Introduce meson.build to be used with the Meson build system, which handles the dependency and advanced compiler options for when used on various linux distributions.

The libftdi .so for example has different names on different distribution, using meson makes sure we can handle those easily, and easily integrate with other package build systems like Yocto or Buildroot.

@konradybcio

Copy link
Copy Markdown
Member

should we settle on just one?

meson is fine in my eyes, it's pretty common

@superna9999
superna9999 force-pushed the meson-build branch 5 times, most recently from 9257ce4 to 0cea860 Compare September 21, 2023 08:32
@superna9999

Copy link
Copy Markdown
Member Author

@konradybcio drop makefile ? probably at some point, but we must be confident meson is ok

@konradybcio

Copy link
Copy Markdown
Member

please rebase

@superna9999
superna9999 force-pushed the meson-build branch 2 times, most recently from a7ef735 to e47e521 Compare September 21, 2023 10:32
@lumag
lumag marked this pull request as draft September 21, 2023 14:41
@superna9999
superna9999 force-pushed the meson-build branch 17 times, most recently from 257eae9 to 4dde958 Compare September 21, 2023 19:49
@superna9999
superna9999 force-pushed the meson-build branch 4 times, most recently from e5cf675 to 552d461 Compare September 21, 2023 20:09
@superna9999
superna9999 marked this pull request as ready for review September 21, 2023 20:11
Comment thread .github/workflows/ci.yml Resolved
Comment thread meson.build Resolved

@lumag lumag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I'm not sure what is the benefit of switching to meson, other than it being 'newer' than make.

Comment thread .github/workflows/ci.yml Resolved
Comment thread ci/archlinux.sh Resolved
Comment thread ci/debian.cross-compile.sh Resolved
Comment thread ci/debian.cross-compile.sh Resolved
Comment thread ci/debian.i386.sh Resolved
Comment thread meson.build Resolved
@superna9999
superna9999 force-pushed the meson-build branch 8 times, most recently from 3a01cd4 to 27f90aa Compare October 2, 2023 08:56
@superna9999

superna9999 commented Oct 2, 2023 •

Copy link
Copy Markdown
Member Author

Well, the biggest point about meson it it's very easy integration with package managers, like:

bitbake:

inherit meson

debian:

dh_auto_configure --buildsystem=meson

apkbuild:

newapkbuild -m https://github.com/linux-msm/cdba

arch:

makedepends=(meson)

build() {
  arch-meson $pkgname-$pkgver build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}

(ok not the best example here)

rpm spec:

BuildRequires: meson

gentoo:

inherit meson

buildroot:

$(eval $(meson-package))

openwrt:

# include $(INCLUDE_DIR)/meson.mk

Dmitry Baryshkov and others added 2 commits October 2, 2023 11:07
On ARM the conmux.c around gethostbyname() results in a compiler
warning/error:

conmux.c:269:27: error: cast increases required alignment of target type [-Werror=cast-align]
  269 |         saddr.sin_addr = *(struct in_addr *)hent->h_addr_list[0];

Instead of trying to fix the (deprecated) gethostbyname() call, switch
conmux to use getaddrinfo(), which is the proper way to resolve
addresses.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Introduce meson.build to be used with the Meson build system,
which handles the dependency and advanced compiler options
for when used on various linux distributions.

The libftdi .so for example has different names on different
distribution, using meson makes sure we can handle those easily,
and easily integrate with other package build systems like
Yocto or Buildroot.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>

@lumag lumag left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please also delete the Makefile? LGTM otherwise

Comment thread meson.build Resolved
Add x86_64 only meson build for now, meson requires some
cross-compile files to be passed.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Meson requires a cross_compile file for foreign architectures,
and also needs the CPU family.

Add FAMILY to all matrix entries
Remove unused MODE
Print PKG_CONFIG_PATH
Add i386 special Meson setup case
Add cross-compile Meson setup case

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
This detects Meson automatically and drops custom build step

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Remove the Makefile and all the references in the README
and CI scripts.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
@superna9999

Copy link
Copy Markdown
Member Author

@lumag done, dropped all references to makefile and switched CodeQL to autobuild

@lumag lumag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please also delete the Makefile?

@lumag
lumag merged commit f09b3e1 into linux-msm:master Oct 2, 2023
@lumag lumag mentioned this pull request Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants