Index: aclocal/shobj.m4 ================================================================== --- aclocal/shobj.m4 +++ aclocal/shobj.m4 @@ -233,10 +233,19 @@ define([VAR_TO_UPDATE], [$3]) ]) AC_MSG_CHECKING([for how to statically link to $1]) + + trylink_ADD_LDFLAGS='' + for arg in $VAR_TO_UPDATE; do + case "${arg}" in + -L*) + trylink_ADD_LDFLAGS="${arg}" + ;; + esac + done SAVELIBS="$LIBS" staticlib="" found="0" dnl HP/UX uses -Wl,-a,archive ... -Wl,-a,shared_archive @@ -247,11 +256,11 @@ if test "${trylink}" != "$2"; then continue fi fi - LIBS="${SAVELIBS} ${trylink}" + LIBS="${SAVELIBS} ${trylink_ADD_LDFLAGS} ${trylink}" AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [ staticlib="${trylink}" found="1" Index: aclocal/tcltls_openssl.m4 ================================================================== --- aclocal/tcltls_openssl.m4 +++ aclocal/tcltls_openssl.m4 @@ -82,11 +82,15 @@ dnl Split the libraries into SSL and non-SSL libraries new_TCLTLS_SSL_LIBS_normal='' new_TCLTLS_SSL_LIBS_static='' for arg in $TCLTLS_SSL_LIBS; do case "${arg}" in - -ldl|-lrt|-lc|-lpthread|-lm|-lcrypt|-lidn|-lresolv|-lgcc|-lgcc_s|-L*) + -L*) + new_TCLTLS_SSL_LIBS_normal="${new_TCLTLS_SSL_LIBS_normal} ${arg}" + new_TCLTLS_SSL_LIBS_static="${new_TCLTLS_SSL_LIBS_static} ${arg}" + ;; + -ldl|-lrt|-lc|-lpthread|-lm|-lcrypt|-lidn|-lresolv|-lgcc|-lgcc_s) new_TCLTLS_SSL_LIBS_normal="${new_TCLTLS_SSL_LIBS_normal} ${arg}" ;; -l*) new_TCLTLS_SSL_LIBS_static="${new_TCLTLS_SSL_LIBS_static} ${arg}" ;;