diff options
| author | Tom Lane | 2009-06-10 21:24:11 +0000 |
|---|---|---|
| committer | Tom Lane | 2009-06-10 21:24:11 +0000 |
| commit | cb10e3af3a51bd7001547a5dc0034c398b87d44a (patch) | |
| tree | 31b9cb9dbccc55c8eb1c83c2b0159d60dd948c1a /configure | |
| parent | 14180f9214933169d287e537dfabb0e9286896a2 (diff) | |
Support Kerberos on platforms where libcom_err depends on OpenSSL, as
reportedly is true on OpenBSD. Also support OpenBSD's spelling of
-Wl,--as-needed. Per Simon Bertrang.
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 88 |
1 files changed, 76 insertions, 12 deletions
diff --git a/configure b/configure index 84da291df72..dd924176d1b 100755 --- a/configure +++ b/configure @@ -8252,7 +8252,8 @@ return com_err (); 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 @@ -27133,9 +27134,10 @@ echo "$as_me: WARNING: *** skipping thread test on Win32" >&2;} 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. @@ -27144,11 +27146,12 @@ if test "$with_readline" = yes; then 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 @@ -27206,12 +27209,73 @@ fi +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 |
