diff --git a/src/template/solaris b/src/template/solaris
index fbb574fe88f65e5f025ae6e125d85e13eb03bb56..6dd807859acab9888600b153f25a77895d32aca6 100644
--- a/src/template/solaris
+++ b/src/template/solaris
@@ -11,8 +11,8 @@ esac
 
 THREAD_SUPPORT=yes
 NEED_REENTRANT_FUNCS=yes	# 5.6 2003-09-13
-THREAD_LIBS="-pthread"
 if test "$GCC" != yes 
-then 	THREAD_LIBS="-mt $THREAD_LIBS"
+then 	THREAD_CPPFLAGS="-mt"
 fi
+THREAD_LIBS="-pthread"