gnuports@2rosenthals.com ?????????????? ????? #27

???: "Dave Yeo" <gnuports@2rosenthals.com> ?? ????
?????????
??: Re: [GNU Ports] Building privoxy - need to specify PTHREAD_LIB - why?
??: Tue, 1 Feb 2022 23:52:06 -0800
??: GNU Ports for eCS Mailing List <gnuports@2rosenthals.com>

On 01/31/22 08:34 PM, Lewis G Rosenthal wrote:
Hi, all...

I built (rather quickly, I might add) Privoxy 3.0.33, which is latest
stable. I was initially stuck with a bunch of undefined symbol errors
for pthread constructs, even though I did have pthread-devel installed
(0.2.6-1). (And yes, -pthread was specified in LDFLAGS.)

In GNUmakefile, there is a section:

# PThreads library, if needed.
PTHREAD_LIB  =

I found that I actually had to set this to the absolute path to
pthread.a, and I'm left wondering why. If pthread.a could not have been
found, why didn't configure balk at that? More importantly, why wouldn't
this have been locatable?

Neither LD_LIBRARY_PATH nor -Lj:/usr/lib (on the gcc command line) nor
-lpthread seemed to be able to find the pthreads library.

Here's the linker command which succeeds:

gcc.exe  -pthread -o privoxy.exe actions.o cgi.o cgiedit.o cgisimple.o
deanimate.o encode.o errlog.o \
 filters.o gateway.o jbsockets.o jcc.o list.o loadcfg.o loaders.o
miscutil.o parsers.o ssplit.o urlmatch.o \
 client-tags.o   pcrs.o     -llibgcc -lz -lpcre -lpcreposix
j:/usr/lib/pthread.a

Surely, I must be missing something very simple, here, but it is
escaping me, now.

This builds with a simple configure && make or make LDFLAGS=-lcx.
Not sure about the -Zhigh-mem and using libcx pulls in addrinfo etc and expects ipv6 support. Not sure about a simple portable fix. Could comment out the HAVE_RFC2553 in configure.in

diff --git a/configure.in b/configure.in
index e7e68be0..8f62dfb5 100644
--- a/configure.in
+++ b/configure.in
@@ -728,6 +728,26 @@ if test "$host_os" = haiku; then
   LIBS="-L/boot/common/lib $LIBS"
 fi

+dnl ================================================================
+dnl OS/2 specific
+dnl ================================================================
+
+case "$host" in
+*-os2*) SOCKET_LIB=
+  # Omit the "-pthread" flag to gcc
+  SPECIAL_CFLAGS=
+
+  # OS/2 pthreads implementation
+  PTHREAD_LIB=-lpthread
+
+  # OS/2 needs libcx for poll()
+# LIBS="-lcx $LIBS"
+
+  # OS/2 likes these
+  LDFLAGS="-Zomf -Zhigh-mem -Zmap -Zbin-files $LDFLAGS"
+;;
+esac
+
 dnl =================================================================
 dnl Check for standard compiler stuff
 dnl =================================================================


???????: ????, ??????, ??????.
?????????
??? ????????