$NetBSD$

--- configure.orig	2008-05-12 22:14:14.000000000 +0200
+++ configure
@@ -6255,7 +6255,7 @@ fi
 
 
 # Do we use uclibc++?
-if test "$foundcxxl"x == "x"; then
+if test "$foundcxxl"x = "x"; then
 	{ echo "$as_me:$LINENO: checking for main in -lstdc++" >&5
 echo $ECHO_N "checking for main in -lstdc++... $ECHO_C" >&6; }
 if test "${ac_cv_lib_stdcpp_main+set}" = set; then
@@ -6317,7 +6317,7 @@ fi
 
 fi
 
-if test "$foundcxxl"x == "x"; then
+if test "$foundcxxl"x = "x"; then
 	{ { echo "$as_me:$LINENO: error: Neither uclibc uClibc++ or standard gcc stdc++ libraries found." >&5
 echo "$as_me: error: Neither uclibc uClibc++ or standard gcc stdc++ libraries found." >&2;}
    { (exit 1); exit 1; }; }
@@ -9614,7 +9614,7 @@ if test "${ac_cv_lib_pthread_pthread_cre
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
+LIBS="${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -9690,7 +9690,7 @@ fi
 echo "$as_me: WARNING: *** GPSMap will be built without pthread support. ***" >&2;};
 		threadlib=""
 	else
-		threadlib="-lpthread"
+		threadlib="${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}"
 	fi
 
 	# Update the companion to this...
