On 01/10/20 18:19, Peter Maydell wrote: > Hi; this commit seems to have broken my static build. > Previously configure did not include libudev in the link > for a static build (there is no libudev.a, at least on my > system). Now it does, and then the link fails with > /usr/bin/ld: cannot find -ludev > >> ########################################## >> -# Do we have libudev >> -if test "$libudev" != "no" ; then >> - if $pkg_config libudev && test "$static" != "yes"; then >> - libudev="yes" >> - libudev_libs=$($pkg_config --libs libudev) >> - else >> - libudev="no" >> - fi >> -fi > > This is the old code, which doesn't enable libudev for > static builds. [...] > I'm not very confident about reading meson.build logic, but it > looks like this trusts meson/pkg-config to tell it about > whether it can do a static link against this library, > which doesn't work on my system, at least. (Ubuntu 18.04.4).
Yes, and the same was of course true of pkg-config without meson. You probably got the same warning that you reported on v7. In fact, my guess is that the "test $static != yes" was added in reply to a similar complaint; the commit that introduced it has a note that the test was added by the maintainer: commit 3efac6ebb88e4d099f07fef65178ebaa595ae770 Author: Tomáš Golembiovský <tgole...@redhat.com> Date: Tue Oct 23 13:23:10 2018 +0200 configure: add test for libudev Signed-off-by: Tomáš Golembiovský <tgole...@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> *make libudev optional to avoid breaking existing build/test environments *disable libudev for --static builds Signed-off-by: Michael Roth <mdr...@linux.vnet.ibm.com> But I don't think --static should affect the build this way, especially since libudev was the only library that had this test in the configure script (checked in 5.1). Debian doesn't package "libgtk-3.a" either and yet GTK+ it is not special cased in the configure script, so I'm not sure what it is that makes libudev special. Do you actually build just with "--static"? Or do you have a list of "--disable" options so you can add one more? Paolo