On 2011/12/05 11:02, David Coppa wrote: > On Mon, Dec 5, 2011 at 10:31 AM, Stuart Henderson <s...@spacehopper.org> > wrote: > > On 2011/12/05 10:00, Vitali wrote: > >> Anyway I decided to go on with the experiments and poked about > >> libproxy in ports. > >> In the patch file > >> "/usr/ports/net/libproxy/patches/patch-libproxy_cmake_libproxy_cmk" > >> there was a replacement line: > >> > >> - target_link_libraries(libproxy modman;m;pthread;dl;${LIBPROXY_LIBRARIES}) > >> + target_link_libraries(libproxy modman;m;${LIBPROXY_LIBRARIES}) > >> > >> which I edited for: > >> > >> + target_link_libraries(libproxy modman;m;pthread;${LIBPROXY_LIBRARIES}) > >> > >> I put back only "pthread" as you see, rebuilt libproxy and gave > >> openconnect a new try, and this time it built with no errors. > >> > >> Here is my conversation with the openconnect developer > >> https://plus.google.com/u/0/113990329890790578682/posts/fxytv9BTkcY > >> > >> I wonder why "pthread" had been removed from libproxy? Or maybe I've > >> lost something? I found no information on the OpenBSD site about this. > > > > The problem is you are then linking with -lpthread, which is incorrect, > > on OpenBSD this should be -pthread instead. I don't know of a good way to > > express this via a .cmk file but I think maybe we could patch the > > generated pkg-config file. > > Or, with cmake, you can use the right way: > > FIND_PACKAGE(Threads) > > This correctly links with "-pthread", since it's patched (see: > ports/devel/cmake/patches/patch-Modules_FindThreads_cmake)
Oh actually... this only needs to touch the .pc.in file, the .cmk file should be left alone. I see why adding pthread back there "fixed" it but it's incorrect. Index: Makefile =================================================================== RCS file: /cvs/ports/net/libproxy/Makefile,v retrieving revision 1.22 diff -u -p -r1.22 Makefile --- Makefile 29 Oct 2011 08:12:32 -0000 1.22 +++ Makefile 5 Dec 2011 10:20:51 -0000 @@ -13,7 +13,7 @@ PKGNAME-main= libproxy-${VERSION} PKGNAME-mozilla= libproxy-mozilla-${VERSION} PKGNAME-webkit= libproxy-webkit-${VERSION} -REVISION-main= 6 +REVISION-main= 7 REVISION-mozilla= 4 REVISION-webkit= 6 Index: patches/patch-libproxy_libproxy-1_0_pc_in =================================================================== RCS file: patches/patch-libproxy_libproxy-1_0_pc_in diff -N patches/patch-libproxy_libproxy-1_0_pc_in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-libproxy_libproxy-1_0_pc_in 5 Dec 2011 10:20:51 -0000 @@ -0,0 +1,10 @@ +$OpenBSD$ +--- libproxy/libproxy-1.0.pc.in.orig Mon Dec 5 10:16:33 2011 ++++ libproxy/libproxy-1.0.pc.in Mon Dec 5 10:16:20 2011 +@@ -5,5 +5,5 @@ includedir=@PKGCONFIG_INCLUDEDIR@ + Name: libproxy-1.0 + Description: Proxy Configuration Library + Version: @PROJECT_VERSION@ +-Libs: -L${libdir} -lproxy ++Libs: -L${libdir} -lproxy -pthread + Cflags: -I${includedir}