diff --git a/configure b/configure
index 0fdbf8f9cbac798cd7268da498aea272ce61bd21..cf5665c06d1dd7f022b0411e0cfd8a169b0c8b5d 100755
--- a/configure
+++ b/configure
@@ -29669,15 +29669,28 @@ fi
 
 if test ! x"${CURL}" = xNo; then
 # check for version
-   if test 0x`curl-config --vernum` -ge 0x70907 ; then
-      CURL_INCLUDE=$(${CURL} --cflags)
-      CURL_LIB=$(${CURL} --libs)
-      PBX_CURL=1
+   if test "${host_os}" = "SunOS"; then
+      if [ 0x`curl-config --vernum` -ge 0x70907 ]; then
+         CURL_INCLUDE=$(${CURL} --cflags)
+         CURL_LIB=$(${CURL} --libs)
+         PBX_CURL=1
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_CURL 1
 _ACEOF
 
+      fi
+   else
+      if [[ 0x`curl-config --vernum` -ge 0x70907 ]]; then
+         CURL_INCLUDE=$(${CURL} --cflags)
+         CURL_LIB=$(${CURL} --libs)
+         PBX_CURL=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CURL 1
+_ACEOF
+
+      fi
    fi
 fi
 
diff --git a/configure.ac b/configure.ac
index c5988b406da5eb48da7bc5f843c1dd754a622ea0..f6c066802afd96a2de3e347ded217a059f39b720 100644
--- a/configure.ac
+++ b/configure.ac
@@ -960,11 +960,20 @@ PBX_CURL=0
 AC_PATH_TOOL([CURL], [curl-config], No)
 if test ! x"${CURL}" = xNo; then
 # check for version
-   if test 0x`curl-config --vernum` -ge 0x70907 ; then
-      CURL_INCLUDE=$(${CURL} --cflags)
-      CURL_LIB=$(${CURL} --libs)
-      PBX_CURL=1
-      AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
+   if test "${host_os}" = "SunOS"; then
+      if [[ 0x`curl-config --vernum` -ge 0x70907 ]]; then
+         CURL_INCLUDE=$(${CURL} --cflags)
+         CURL_LIB=$(${CURL} --libs)
+         PBX_CURL=1
+         AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
+      fi
+   else
+      if [[[ 0x`curl-config --vernum` -ge 0x70907 ]]]; then
+         CURL_INCLUDE=$(${CURL} --cflags)
+         CURL_LIB=$(${CURL} --libs)
+         PBX_CURL=1
+         AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
+      fi
    fi
 fi
 AC_SUBST(PBX_CURL)