$NetBSD: patch-ab,v 1.4 2006/09/16 15:29:36 hira Exp $

diff -uNr sylpheed-claws-1.0.4.orig/configure sylpheed-claws-1.0.4/configure
--- configure.orig	2006-03-24 09:17:34.000000000 +0000
+++ configure	2006-03-24 09:17:47.000000000 +0000
@@ -27599,114 +27724,75 @@
 else
   ac_cv_enable_openssl=yes
 fi;
-if test x"$ac_cv_enable_openssl" = xyes; then
-
-  succeeded=no
-
-  if test -z "$PKG_CONFIG"; then
-    # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
-  ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-
-if test -n "$PKG_CONFIG"; then
-  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
-echo "${ECHO_T}$PKG_CONFIG" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  fi
+if test $ac_cv_enable_openssl = yes; then
+        echo "$as_me:$LINENO: checking if openssl is available" >&5
+echo $ECHO_N "checking if openssl is available... $ECHO_C" >&6
+        OPENSSL_LIBS="$LIBS -lssl -lcrypto"
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-  if test "$PKG_CONFIG" = "no" ; then
-     echo "*** The pkg-config script could not be found. Make sure it is"
-     echo "*** in your path, or set the PKG_CONFIG environment variable"
-     echo "*** to the full path to pkg-config."
-     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
-  else
-     PKG_CONFIG_MIN_VERSION=0.9.0
-     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
-        echo "$as_me:$LINENO: checking for openssl >= 0.9.7" >&5
-echo $ECHO_N "checking for openssl >= 0.9.7... $ECHO_C" >&6
+#include <openssl/opensslv.h>
 
-        if $PKG_CONFIG --exists "openssl >= 0.9.7" ; then
-            echo "$as_me:$LINENO: result: yes" >&5
+int
+main ()
+{
+ return OPENSSL_VERSION_NUMBER;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+   echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6
-            succeeded=yes
-
-            echo "$as_me:$LINENO: checking OPENSSL_CFLAGS" >&5
-echo $ECHO_N "checking OPENSSL_CFLAGS... $ECHO_C" >&6
-            OPENSSL_CFLAGS=`$PKG_CONFIG --cflags "openssl >= 0.9.7"`
-            echo "$as_me:$LINENO: result: $OPENSSL_CFLAGS" >&5
-echo "${ECHO_T}$OPENSSL_CFLAGS" >&6
-
-            echo "$as_me:$LINENO: checking OPENSSL_LIBS" >&5
-echo $ECHO_N "checking OPENSSL_LIBS... $ECHO_C" >&6
-            OPENSSL_LIBS=`$PKG_CONFIG --libs "openssl >= 0.9.7"`
-            echo "$as_me:$LINENO: result: $OPENSSL_LIBS" >&5
-echo "${ECHO_T}$OPENSSL_LIBS" >&6
-        else
-            OPENSSL_CFLAGS=""
-            OPENSSL_LIBS=""
-            ## If we have a custom action on failure, don't print errors, but
-            ## do set a variable so people can do so.
-            OPENSSL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "openssl >= 0.9.7"`
-
-        fi
-
-
-
-     else
-        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
-        echo "*** See http://www.freedesktop.org/software/pkgconfig"
-     fi
-  fi
-
-  if test $succeeded = yes; then
-     :
-  else
-     ac_cv_enable_openssl=no
-  fi
-
-	if test x$ac_cv_enable_openssl = xyes; then
 
 cat >>confdefs.h <<\_ACEOF
 #define USE_OPENSSL 1
 _ACEOF
 
-	fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+          OPENSSL_LIBS="$ac_save_LIBS"
+	  ac_cv_enable_openssl=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+else
+	echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
 
 
+
 OLDLIBS=$LIBS
 LIBS=
 echo "$as_me:$LINENO: checking for library containing encrypt" >&5
@@ -27768,7 +27855,7 @@
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 if test "$ac_cv_search_encrypt" = no; then
-  for ac_lib in crypt; do
+  for ac_lib in crypt cipher; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
