It seems defining variables like `{libname}_AR` has no effect if {libname} is defined as `LTLIBRARIES` target, libtool script just used AR set during configuration. This method works only with `LIBRARIES` targets.
The best I could achieve with `LTLIBRARIES = libpthread.la` is to record dependency on winpthreads.la in pthread.la. I tried to experiment with libtool's --mode=execute hoping it would substitute .la with a library filename, but --mode=execute works only with executables. - Kirill Makurin ________________________________ From: LIU Hao <lh_mo...@126.com> Sent: Sunday, February 9, 2025 8:18 PM To: mingw-w64-public@lists.sourceforge.net <mingw-w64-public@lists.sourceforge.net> Subject: Re: [Mingw-w64-public] make sure WINPTHREAD_API is correctly defined in pthread_time.h 在 2025-02-09 19:10, LIU Hao 写道: > libpthread_a_AR = ${LIBTOOL} --tag=CCLD --mode=link -static \ > $(LN_S) libwinpthread.la libpthread.la > > libpthread_dll_a_AR = ${LIBTOOL} --tag=CCLD --mode=link \ > $(LN_S) libwinpthread.la libpthread.la > > The point is that if libtool sees libtool libraries (.la files) on the > command line, it will replace > those arguments with paths to 'real' libraries (.a or .dll files), which > ensures you get correct > paths to either libwinpthread.dll.a or winpthread.lib. I hope you can figure > out the correct values > for `--tag` and `--mode` yourself. I think that, in this way we can declare libpthread.la in LTLIBRARIES; it will be unnecessary to have separate rules to copy the static library and shared library, since libtool will run the same command respectively. -- Best regards, LIU Hao _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public