$OpenBSD: patch-ext_tiny_tds_extconf_rb,v 1.1 2011/04/15 16:13:23 ajacoutot Exp $
--- ext/tiny_tds/extconf.rb.orig	Thu Apr 14 19:42:32 2011
+++ ext/tiny_tds/extconf.rb	Thu Apr 14 19:42:21 2011
@@ -27,8 +27,8 @@ def find_freetds_libraries_path
       message = "looking for library directory #{dir} ..."
       if File.directory?(dir)
         puts "#{message} yes"
-        if with_ldflags("#{$LDFLAGS} -L#{dir}".strip) { have_freetds_libraries?(*FREETDS_LIBRARIES) }
-          $LDFLAGS = "-L#{dir} #{$LDFLAGS}".strip
+        if with_ldflags("#{$LDFLAGS} -pthread -L#{dir}".strip) { have_freetds_libraries?(*FREETDS_LIBRARIES) }
+          $LDFLAGS = "-L#{dir} -pthread #{$LDFLAGS}".strip
           true
         else
           false
