return 0;
}
_ACEOF
-for ac_lib in '' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken' com_err; do
+for ac_lib in '' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'
+ com_err 'com_err -lssl -lcrypto'; do
if test -z "$ac_lib"; then
ac_res="none required"
else
fi
fi
-# If compiler will take -Wl,--as-needed then add that to LDFLAGS.
-# This is much easier than trying to filter LIBS to the minimum for each
-# executable. (Note that shared library links won't use this switch, though.)
+# If compiler will take -Wl,--as-needed (or various platform-specific
+# spellings thereof) then add that to LDFLAGS. This is much easier than
+# trying to filter LIBS to the minimum for each executable.
+# (Note that shared library links won't use this switch, though.)
# On (at least) some Red-Hat-derived systems, this switch breaks linking to
# libreadline; therefore we postpone testing it until we know what library
# dependencies readline has. The test code will try to link with $LIBS.
else
link_test_func=exit
fi
-if test "$PORTNAME" != "darwin"; then
- { echo "$as_me:$LINENO: checking if $CC supports -Wl,--as-needed" >&5
-echo $ECHO_N "checking if $CC supports -Wl,--as-needed... $ECHO_C" >&6; }
+
+if test "$PORTNAME" = "darwin"; then
+ { echo "$as_me:$LINENO: checking if $CC supports -Wl,-dead_strip_dylibs" >&5
+echo $ECHO_N "checking if $CC supports -Wl,-dead_strip_dylibs... $ECHO_C" >&6; }
pgac_save_LDFLAGS=$LDFLAGS
-LDFLAGS="$pgac_save_LDFLAGS -Wl,--as-needed"
+LDFLAGS="$pgac_save_LDFLAGS -Wl,-dead_strip_dylibs"
if test "$cross_compiling" = yes; then
LDFLAGS="$pgac_save_LDFLAGS"
{ echo "$as_me:$LINENO: result: assuming no" >&5
+elif test "$PORTNAME" = "openbsd"; then
+ { echo "$as_me:$LINENO: checking if $CC supports -Wl,-Bdynamic" >&5
+echo $ECHO_N "checking if $CC supports -Wl,-Bdynamic... $ECHO_C" >&6; }
+pgac_save_LDFLAGS=$LDFLAGS
+LDFLAGS="$pgac_save_LDFLAGS -Wl,-Bdynamic"
+if test "$cross_compiling" = yes; then
+ LDFLAGS="$pgac_save_LDFLAGS"
+ { echo "$as_me:$LINENO: result: assuming no" >&5
+echo "${ECHO_T}assuming no" >&6; }
else
- # On Darwin it's spelled -Wl,-dead_strip_dylibs, but don't try that elsewhere
- { echo "$as_me:$LINENO: checking if $CC supports -Wl,-dead_strip_dylibs" >&5
-echo $ECHO_N "checking if $CC supports -Wl,-dead_strip_dylibs... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+extern void $link_test_func (); void (*fptr) () = $link_test_func;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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; }
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+LDFLAGS="$pgac_save_LDFLAGS"
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+else
+ { echo "$as_me:$LINENO: checking if $CC supports -Wl,--as-needed" >&5
+echo $ECHO_N "checking if $CC supports -Wl,--as-needed... $ECHO_C" >&6; }
pgac_save_LDFLAGS=$LDFLAGS
-LDFLAGS="$pgac_save_LDFLAGS -Wl,-dead_strip_dylibs"
+LDFLAGS="$pgac_save_LDFLAGS -Wl,--as-needed"
if test "$cross_compiling" = yes; then
LDFLAGS="$pgac_save_LDFLAGS"
{ echo "$as_me:$LINENO: result: assuming no" >&5
dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.597 2009/05/19 22:32:41 petere Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.598 2009/06/10 21:24:10 tgl Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
if test "$with_krb5" = yes ; then
if test "$PORTNAME" != "win32"; then
- AC_SEARCH_LIBS(com_err, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken' com_err], [],
+ AC_SEARCH_LIBS(com_err, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'
+ com_err 'com_err -lssl -lcrypto'], [],
[AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
[AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
fi
fi
-# If compiler will take -Wl,--as-needed then add that to LDFLAGS.
-# This is much easier than trying to filter LIBS to the minimum for each
-# executable. (Note that shared library links won't use this switch, though.)
+# If compiler will take -Wl,--as-needed (or various platform-specific
+# spellings thereof) then add that to LDFLAGS. This is much easier than
+# trying to filter LIBS to the minimum for each executable.
+# (Note that shared library links won't use this switch, though.)
# On (at least) some Red-Hat-derived systems, this switch breaks linking to
# libreadline; therefore we postpone testing it until we know what library
# dependencies readline has. The test code will try to link with $LIBS.
else
link_test_func=exit
fi
-if test "$PORTNAME" != "darwin"; then
- PGAC_PROG_CC_LDFLAGS_OPT([-Wl,--as-needed], $link_test_func)
-else
- # On Darwin it's spelled -Wl,-dead_strip_dylibs, but don't try that elsewhere
+
+if test "$PORTNAME" = "darwin"; then
PGAC_PROG_CC_LDFLAGS_OPT([-Wl,-dead_strip_dylibs], $link_test_func)
+elif test "$PORTNAME" = "openbsd"; then
+ PGAC_PROG_CC_LDFLAGS_OPT([-Wl,-Bdynamic], $link_test_func)
+else
+ PGAC_PROG_CC_LDFLAGS_OPT([-Wl,--as-needed], $link_test_func)
fi