aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rwxr-xr-xconfigure.ac111
1 files changed, 105 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index a72a612f..c223a043 100755
--- a/configure.ac
+++ b/configure.ac
@@ -51,7 +51,6 @@ CURL_CHECK_OPTION_ARES
CURL_CHECK_OPTION_RT
XC_CHECK_PATH_SEPARATOR
-AX_CODE_COVERAGE
#
# save the configure arguments
@@ -124,6 +123,13 @@ AC_SUBST(libext)
dnl figure out the libcurl version
CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h`
XC_CHECK_PROG_CC
+
+dnl Check if gcc is being used before adding AX_CODE_COVERAGE
+AS_IF([ test "$GCC" = "yes" ], [AX_CODE_COVERAGE],
+ # not using GCC so pass a test below - CODE_COVERAGE_ENABLED_TRUE is not zero length
+ CODE_COVERAGE_ENABLED_TRUE='#'
+)
+
XC_AUTOMAKE
AC_MSG_CHECKING([curl version])
AC_MSG_RESULT($CURLVERSION)
@@ -1206,6 +1212,9 @@ if test "$ipv6" = yes; then
#include <ws2tcpip.h>
#else
#include <netinet/in.h>
+#if defined (__TANDEM)
+# include <netinet/in6.h>
+#endif
#endif] ,
struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
if test "$have_sin6_scope_id" = yes; then
@@ -1647,7 +1656,7 @@ if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
dnl still no, but what about with -ldl?
AC_MSG_CHECKING([OpenSSL linking with -ldl])
- LIBS="-ldl $LIBS"
+ LIBS="$LIBS -ldl"
AC_TRY_LINK(
[
#include <openssl/err.h>
@@ -1664,7 +1673,7 @@ if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
dnl ok, so what about bouth -ldl and -lpthread?
AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread])
- LIBS="-lpthread $LIBS"
+ LIBS="$LIBS -lpthread"
AC_TRY_LINK(
[
#include <openssl/err.h>
@@ -2716,8 +2725,15 @@ dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
OPT_LIBSSH2=off
AC_ARG_WITH(libssh2,dnl
AC_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the LIBSSH2 installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
-AC_HELP_STRING([--without-libssh2], [disable LIBSSH2]),
- OPT_LIBSSH2=$withval)
+AC_HELP_STRING([--with-libssh2], [enable LIBSSH2]),
+ OPT_LIBSSH2=$withval, OPT_LIBSSH2=no)
+
+
+OPT_LIBSSH=off
+AC_ARG_WITH(libssh,dnl
+AC_HELP_STRING([--with-libssh=PATH],[Where to look for libssh, PATH points to the LIBSSH installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
+AC_HELP_STRING([--with-libssh], [enable LIBSSH]),
+ OPT_LIBSSH=$withval, OPT_LIBSSH=no)
if test X"$OPT_LIBSSH2" != Xno; then
dnl backup the pre-libssh2 variables
@@ -2792,6 +2808,79 @@ if test X"$OPT_LIBSSH2" != Xno; then
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
fi
+elif test X"$OPT_LIBSSH" != Xno; then
+ dnl backup the pre-libssh variables
+ CLEANLDFLAGS="$LDFLAGS"
+ CLEANCPPFLAGS="$CPPFLAGS"
+ CLEANLIBS="$LIBS"
+
+ case "$OPT_LIBSSH" in
+ yes)
+ dnl --with-libssh (without path) used
+ CURL_CHECK_PKGCONFIG(libssh)
+
+ if test "$PKGCONFIG" != "no" ; then
+ LIB_SSH=`$PKGCONFIG --libs-only-l libssh`
+ LD_SSH=`$PKGCONFIG --libs-only-L libssh`
+ CPP_SSH=`$PKGCONFIG --cflags-only-I libssh`
+ version=`$PKGCONFIG --modversion libssh`
+ DIR_SSH=`echo $LD_SSH | $SED -e 's/-L//'`
+ fi
+
+ ;;
+ off)
+ dnl no --with-libssh option given, just check default places
+ ;;
+ *)
+ dnl use the given --with-libssh spot
+ PREFIX_SSH=$OPT_LIBSSH
+ ;;
+ esac
+
+ dnl if given with a prefix, we set -L and -I based on that
+ if test -n "$PREFIX_SSH"; then
+ LIB_SSH="-lssh"
+ LD_SSH=-L${PREFIX_SSH}/lib$libsuff
+ CPP_SSH=-I${PREFIX_SSH}/include
+ DIR_SSH=${PREFIX_SSH}/lib$libsuff
+ fi
+
+ LDFLAGS="$LDFLAGS $LD_SSH"
+ CPPFLAGS="$CPPFLAGS $CPP_SSH"
+ LIBS="$LIB_SSH $LIBS"
+
+ AC_CHECK_LIB(ssh, ssh_new)
+
+ AC_CHECK_HEADERS(libssh/libssh.h,
+ curl_ssh_msg="enabled (libSSH)"
+ LIBSSH_ENABLED=1
+ AC_DEFINE(USE_LIBSSH, 1, [if libSSH is in use])
+ AC_SUBST(USE_LIBSSH, [1])
+ )
+
+ if test X"$OPT_LIBSSH" != Xoff &&
+ test "$LIBSSH_ENABLED" != "1"; then
+ AC_MSG_ERROR([libSSH libs and/or directories were not found where specified!])
+ fi
+
+ if test "$LIBSSH_ENABLED" = "1"; then
+ if test -n "$DIR_SSH"; then
+ dnl when the libssh shared libs were found in a path that the run-time
+ dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
+ dnl to prevent further configure tests to fail due to this
+
+ if test "x$cross_compiling" != "xyes"; then
+ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH"
+ export LD_LIBRARY_PATH
+ AC_MSG_NOTICE([Added $DIR_SSH to LD_LIBRARY_PATH])
+ fi
+ fi
+ else
+ dnl no libssh, revert back to clean variables
+ LDFLAGS=$CLEANLDFLAGS
+ CPPFLAGS=$CLEANCPPFLAGS
+ LIBS=$CLEANLIBS
+ fi
fi
dnl **********************************************************************
@@ -3270,10 +3359,10 @@ AC_CHECK_HEADERS(
assert.h \
unistd.h \
stdlib.h \
- limits.h \
arpa/inet.h \
net/if.h \
netinet/in.h \
+ netinet/in6.h \
sys/un.h \
linux/tcp.h \
netinet/tcp.h \
@@ -3324,6 +3413,9 @@ dnl default includes
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
@@ -4009,6 +4101,10 @@ if test "x$USE_LIBSSH2" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
fi
+if test "x$USE_LIBSSH" = "x1"; then
+ SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
+ SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
+fi
if test "x$CURL_DISABLE_RTSP" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
fi
@@ -4040,6 +4136,9 @@ squeeze SUPPORT_PROTOCOLS
XC_CHECK_BUILD_FLAGS
+SSL_BACKENDS=${ssl_backends}
+AC_SUBST(SSL_BACKENDS)
+
if test "x$want_curldebug_assumed" = "xyes" &&
test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
ac_configure_args="$ac_configure_args --enable-curldebug"