$OpenBSD: patch-Makefile_in,v 1.9 2020/06/01 07:17:28 giovanni Exp $
Index: Makefile.in
--- Makefile.in.orig
+++ Makefile.in
@@ -725,7 +725,7 @@ CLEANFILES = authldaprc.h authmysqlrc.h authsqliterc.h
 
 DISTCLEANFILES = dbobj.config README_authlib.html
 commonlibdep = libcourierauthcommon.la
-commonldflags = -module -rpath $(pkglibdir) -export-symbols-regex 'courier_auth.*_init' -avoid-version
+commonldflags = -module -rpath $(pkglibdir) -export-symbols-regex 'courier_auth.*_init'
 commonlibadd = libcourierauthcommon.la
 libcourierauthcommon_t = @CRYPTLIBS@
 libcourierauthcommon_la_SOURCES = \
@@ -743,7 +743,7 @@ libcourierauthcommon_la_SOURCES = \
 
 libcourierauthcommon_la_DEPENDENCIES = libcourierauth.la
 libcourierauthcommon_la_LIBADD = libcourierauth.la
-libcourierauthcommon_la_LDFLAGS = $(libcourierauthcommon_t:%=-Wl,%) -avoid-version
+libcourierauthcommon_la_LDFLAGS = $(libcourierauthcommon_t:%=-Wl,%)
 libcourierauth_la_SOURCES = authdaemon.c authdaemonlib.c preauthdaemon.c \
 	authmoduser2.c authmoduser3.c debug.c \
 	courierauthdebug.h \
@@ -752,7 +752,7 @@ libcourierauth_la_SOURCES = authdaemon.c authdaemonlib
 libcourierauth_la_LIBADD = libs/libhmac/libhmac.la libs/md5/libmd5.la libs/sha1/libsha1.la libs/numlib/libnumlib.la \
 	libs/random128/librandom128.la libs/rfc822/libencode.la
 
-libcourierauth_la_LDFLAGS = @NETLIBS@ -avoid-version
+libcourierauth_la_LDFLAGS = @NETLIBS@
 
 # The userdb module
 libauthuserdb_t = userdb/libuserdb.la @dblibrary@ @LIBGDBM@ @LIBDB@
@@ -854,7 +854,7 @@ libcourierauthsasl_la_SOURCES = \
 	authsaslfrombase64.c authsasltobase64.c
 
 libcourierauthsasl_la_LIBADD = libcourierauthcommon.la libcourierauth.la
-libcourierauthsasl_la_LDFLAGS = -export-symbols-regex '^auth_sasl|auth_sasl_ex|auth_sasl_extract_userid$$' -avoid-version
+libcourierauthsasl_la_LDFLAGS = -export-symbols-regex '^auth_sasl|auth_sasl_ex|auth_sasl_extract_userid$$'
 libcourierauthsaslclient_la_SOURCES = courierauthsaslclient.h \
 	authsaslclient.c authsaslclient.h authsaslclientcram.c \
 	authsaslclientcrammd5.c authsaslclientcramsha1.c \
@@ -863,7 +863,7 @@ libcourierauthsaslclient_la_SOURCES = courierauthsaslc
 	authsaslfrombase64.c authsasltobase64.c
 
 libcourierauthsaslclient_la_LIBADD = libcourierauth.la
-libcourierauthsaslclient_la_LDFLAGS = -export-symbols-regex '^auth_sasl_client$$' -avoid-version
+libcourierauthsaslclient_la_LDFLAGS = -export-symbols-regex '^auth_sasl_client$$'
 include_HEADERS = courier_auth_config.h courierauth.h courierauthsasl.h \
 	courierauthsaslclient.h courierauthdebug.h courierauthstaticlist.h
 
@@ -897,7 +897,7 @@ authdaemondprog_LDADD = $(LIBLTDL) libcourierauthcommo
 	libs/libhmac/libhmac.la libs/md5/libmd5.la libs/sha1/libsha1.la \
 	libs/rfc822/libencode.la libs/numlib/libnumlib.la
 
-authdaemondprog_LDFLAGS = -export-dynamic $(modules:%=-dlopen %) @NETLIBS@
+authdaemondprog_LDFLAGS = -export-dynamic $(modules:%=-dlopen %) -lpthread @NETLIBS@
 authdaemontest_SOURCES = authdaemontest.c
 authdaemontest_DEPENDENCIES = libcourierauthcommon.la
 authdaemontest_LDADD = libcourierauthcommon.la @NETLIBS@
