[newlib-cygwin/main] Cygwin: configure: Only compute BFD_LIBS if building dumper
Jon Turney via Cygwin-cvs <[email protected]> Thu, 4 Jun 2026 19:26:49 +0000 (GMT)
| Newsgroups | gmane.os.cygwin.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dc703cfea729= 2258ac61022591dae7023e9e1d992 commit c703cfea7292258ac61022591dae7023e9e1d992 Author: Jon Turney <[email protected]> Date: Mon May 25 18:57:35 2026 +0100 Cygwin: configure: Only compute BFD_LIBS if building dumper =20 Don't bother trying to determine the flags needed to link the BFD library if we're not even building dumper. =20 (AC_NO_EXECUTABLES doesn't do what the name would simply suggest: It silently checks if a trivial program can link, and turns itself off if that suceeds. =20 Tests which rely on linking are only made to fail by AC_NO_EXECUTABLES if that trivial link has failed (which OK, were probably going to fail anyway, but now you get the error 'link tests are not allowed after AC_NO_EXECUTABLES', which is perhaps slightly more informative when you are cross-compiling with a bootstrap compiler).) =20 Anyhow, if we're using a compiler which can't link executables, these instances of AC_CHECK_LIB will definitely fail. But we can't possibly build dumper in that situation, so we'll be configuring with --disable-dumper, and doing those checks serves no purpose. =20 Signed-off-by: Jon Turney <[email protected]> Diff: --- winsup/configure.ac | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/winsup/configure.ac b/winsup/configure.ac index ac96968e4..ad63cbf95 100644 --- a/winsup/configure.ac +++ b/winsup/configure.ac @@ -153,12 +153,14 @@ AC_ARG_ENABLE([dumper], =20 AM_CONDITIONAL(BUILD_DUMPER, [test "x$build_dumper" =3D "xyes"]) =20 -# libbfd.a doesn't have a pkgconfig file, so we guess what it's dependenci= es -# are, based on what's present in the build environment -BFD_LIBS=3D"-lintl -liconv -liberty -lz" -AC_CHECK_LIB([sframe], [sframe_decode], [BFD_LIBS=3D"${BFD_LIBS} -lsframe"= ]) -AC_CHECK_LIB([zstd], [ZSTD_isError], [BFD_LIBS=3D"${BFD_LIBS} -lzstd"]) -AC_SUBST([BFD_LIBS]) +if test "x$build_dumper" !=3D "xno"; then + # libbfd.a doesn't have a pkgconfig file, so we guess what it's dependen= cies + # are, based on what's present in the build environment + BFD_LIBS=3D"-lintl -liconv -liberty -lz" + AC_CHECK_LIB([sframe], [sframe_decode], [BFD_LIBS=3D"${BFD_LIBS} -lsfram= e"]) + AC_CHECK_LIB([zstd], [ZSTD_isError], [BFD_LIBS=3D"${BFD_LIBS} -lzstd"]) + AC_SUBST([BFD_LIBS]) +fi =20 AC_CONFIG_FILES([ Makefile