在 2025-6-3 17:44, Kirill Makurin 写道:
This is a good idea. Plain `LDADD` (not `LIBADD`) is used to add libraries to all programs in current Makefile.am.

Oh thank you. I keep forgetting that.


From 2347a4099e1340a2789ac9f11001c25548463e69 Mon Sep 17 00:00:00 2001
From: Kirill Makurin <maiddais...@outlook.com>
Date: Tue, 3 Jun 2025 18:34:24 +0900
Subject: [PATCH] winpthreads: make testing shared library work

Running `make check` when configured with `--disable-static`,
depending on whether an installed winpthread library can be found
when linking tests, has the following consequences:

If an installed winpthread library is found, tests will be linked
against installed library instead of the one we just built.

If there is no installed winpthread library, tests will be linked
against shared library. This will result in tests failing, since
they will fail to locate just built DLL at runtime.

To fix this:

Use `libtool --mode=execute` to run tests. Libtool will handle
runtime search path.

I suspect this change is unnecessary now? libtool should take care of that.


Remove `-static` from `AM_LDFLAGS`, so we can link against the DLL.

During link, pass libwinpthread.la instead of `-lwinpthread`. This
will prevent libtool from linking against an installed winpthread library.

I suggest you rephrase. `-l` is for linking against a preinstalled library. Libraries that are to be built should almost always be linked in LDADD.






--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to