+
+echo "$as_me:16009: checking if ssp library is needed" >&5
+echo $ECHO_N "checking if ssp library is needed... $ECHO_C" >&6
+if test "${cf_cv_need_libssp+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >"conftest.$ac_ext" <<_ACEOF
+#line 16016 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <dirent.h>
+
+int
+main (void)
+{
+
+ DIR *dp = opendir(".");
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f "conftest.$ac_objext" "conftest$ac_exeext"
+if { (eval echo "$as_me:16033: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:16036: \$? = $ac_status" >&5
+ (exit "$ac_status"); } &&
+ { ac_try='test -s "conftest$ac_exeext"'
+ { (eval echo "$as_me:16039: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:16042: \$? = $ac_status" >&5
+ (exit "$ac_status"); }; }; then
+ cf_cv_need_libssp=no
+else
+ echo "$as_me: failed program was:" >&5
+cat "conftest.$ac_ext" >&5
+
+ cf_save_LIBS="$LIBS"
+ LIBS="$LIBS -lssp"
+ cat >"conftest.$ac_ext" <<_ACEOF
+#line 16052 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <dirent.h>
+
+int
+main (void)
+{
+
+ DIR *dp = opendir(".");
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f "conftest.$ac_objext" "conftest$ac_exeext"
+if { (eval echo "$as_me:16069: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:16072: \$? = $ac_status" >&5
+ (exit "$ac_status"); } &&
+ { ac_try='test -s "conftest$ac_exeext"'
+ { (eval echo "$as_me:16075: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:16078: \$? = $ac_status" >&5
+ (exit "$ac_status"); }; }; then
+ cf_cv_need_libssp=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat "conftest.$ac_ext" >&5
+cf_cv_need_libssp=maybe
+fi
+rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
+ LIBS="$cf_save_LIBS"
+
+fi
+rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
+fi
+echo "$as_me:16092: result: $cf_cv_need_libssp" >&5
+echo "${ECHO_T}$cf_cv_need_libssp" >&6
+
+if test "x$cf_cv_need_libssp" = xyes
+then
+
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lssp; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
+done
+LIBS="$cf_add_libs"
+
+fi
+