2005-07-05 05:21:44 +04:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
AC_PREREQ(2.57)
|
2008-03-07 05:26:24 +03:00
|
|
|
AC_INIT([libssh], 0.2.1-svn, [aris@0xbadc0de.be])
|
2007-07-31 21:54:25 +04:00
|
|
|
AM_INIT_AUTOMAKE(1.9)
|
2005-07-05 05:21:44 +04:00
|
|
|
AC_CONFIG_SRCDIR([sample.c])
|
|
|
|
AC_CONFIG_HEADER([config.h])
|
|
|
|
|
2007-07-31 21:54:25 +04:00
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
|
2005-10-26 03:11:41 +04:00
|
|
|
# LT Version numbers, remember to change them just *before* a release.
|
|
|
|
# (Interfaces removed: CURRENT++, AGE=0, REVISION=0)
|
|
|
|
# (Interfaces added: CURRENT++, AGE++, REVISION=0)
|
|
|
|
# (No interfaces changed: REVISION++)
|
2006-11-16 23:58:01 +03:00
|
|
|
LIBSSH_CURRENT=2
|
2005-10-26 03:11:41 +04:00
|
|
|
LIBSSH_AGE=0
|
|
|
|
LIBSSH_REVISION=0
|
|
|
|
AC_SUBST(LIBSSH_CURRENT)
|
|
|
|
AC_SUBST(LIBSSH_AGE)
|
|
|
|
AC_SUBST(LIBSSH_REVISION)
|
|
|
|
|
2005-07-05 05:21:44 +04:00
|
|
|
# Check for the OS.
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
case "$host" in
|
|
|
|
*-apple*)
|
2005-10-26 03:11:41 +04:00
|
|
|
LIBSSH_LDFLAGS="-prebind -seg1addr 0x3a000000 -headerpad_max_install_names"
|
2005-07-05 05:21:44 +04:00
|
|
|
;;
|
|
|
|
*)
|
2005-10-26 03:11:41 +04:00
|
|
|
LIBSSH_LDFLAGS=""
|
2005-07-05 05:21:44 +04:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AC_SUBST(LIBSSH_LDFLAGS)
|
|
|
|
|
2005-10-26 03:11:41 +04:00
|
|
|
AC_MSG_CHECKING([version script options])
|
|
|
|
case "$host" in
|
|
|
|
*-*-linux*)
|
2005-10-26 16:56:52 +04:00
|
|
|
LIBSSH_VERS="$LIBSSH_LDFLAGS -Wl,--version-script,libssh.vers"
|
2005-10-26 03:11:41 +04:00
|
|
|
;;
|
|
|
|
*-*-gnu*)
|
2005-10-26 16:56:52 +04:00
|
|
|
LIBSSH_VERS="$LIBSSH_LDFLAGS -Wl,--version-script,libssh.vers"
|
2005-10-26 03:11:41 +04:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AC_ARG_WITH([versioned-symbol],
|
|
|
|
AC_HELP_STRING([--with-versioned-symbol],[Use versioned symbols]),
|
2006-05-08 12:45:00 +04:00
|
|
|
[if test "$withval" = "yes"; then
|
2005-10-26 16:56:52 +04:00
|
|
|
LIBSSH_VERS="$LIBSSH_LDFLAGS -Wl,--version-script,libssh.vers"
|
2005-10-26 03:11:41 +04:00
|
|
|
else
|
|
|
|
LIBSSH_VERS=""
|
|
|
|
fi], [ : ])
|
|
|
|
|
|
|
|
AC_SUBST(LIBSSH_VERS)
|
|
|
|
|
2005-08-19 01:22:22 +04:00
|
|
|
enable_ssh1=${enable_ssh1:-"no"}
|
2008-01-31 14:11:21 +03:00
|
|
|
AC_ARG_ENABLE(ssh1, AC_HELP_STRING([--enable-ssh1], [enable SSH1 support]))
|
2005-08-19 01:22:22 +04:00
|
|
|
AC_MSG_CHECKING([for SSH1 support])
|
2006-05-08 12:45:00 +04:00
|
|
|
if test "$enable_ssh1" = "yes" ; then
|
2005-08-19 01:22:22 +04:00
|
|
|
AC_DEFINE(HAVE_SSH1,1,[Define to 1 if you want to enable SSH1])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT([$enable_ssh1])
|
|
|
|
|
2005-07-05 05:21:44 +04:00
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
2005-10-26 03:11:41 +04:00
|
|
|
AC_PROG_LIBTOOL
|
2005-07-05 05:21:44 +04:00
|
|
|
AC_C_BIGENDIAN
|
|
|
|
|
2007-07-31 21:54:25 +04:00
|
|
|
AC_CHECK_PROG([DOXYGEN], [doxygen], [yes], [no])
|
|
|
|
AM_CONDITIONAL([HAS_DOXYGEN], [test x"$DOXYGEN" = xyes])
|
|
|
|
|
2005-07-05 05:21:44 +04:00
|
|
|
# Checks for libraries.
|
2006-05-08 12:45:00 +04:00
|
|
|
with_gcrypt=${with_gcrypt:-"no"}
|
2005-10-26 16:06:11 +04:00
|
|
|
AC_ARG_WITH([libgcrypt],
|
2005-10-26 17:11:37 +04:00
|
|
|
AC_HELP_STRING([--with-libgcrypt],[Use libgcrypt instead of libcrypto]),
|
2006-05-08 12:45:00 +04:00
|
|
|
[if test "$withval" = "yes"; then
|
|
|
|
with_gcrypt="yes"
|
|
|
|
AC_CHECK_LIB([gcrypt], [gcry_md_open])
|
|
|
|
fi], [ : ])
|
2005-10-26 16:06:11 +04:00
|
|
|
|
2006-05-08 12:45:00 +04:00
|
|
|
if test "$with_gcrypt" = "no"; then
|
2005-10-26 03:11:41 +04:00
|
|
|
AC_CHECK_LIB([crypto], [BN_init])
|
|
|
|
fi
|
2005-10-26 16:06:11 +04:00
|
|
|
|
2005-07-05 05:21:44 +04:00
|
|
|
AC_CHECK_LIB([z], [deflateInit_])
|
2005-08-19 15:12:29 +04:00
|
|
|
AC_SEARCH_LIBS([hstrerror],[nsl resolv])
|
2006-11-12 03:57:48 +03:00
|
|
|
AC_SEARCH_LIBS([getaddrinfo],[nsl socket])
|
2005-08-19 15:12:29 +04:00
|
|
|
AC_SEARCH_LIBS([gethostbyname],[nsl resolv])
|
2005-07-05 05:21:44 +04:00
|
|
|
|
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
|
|
|
AC_CHECK_HEADERS([fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h \
|
2005-10-05 02:11:19 +04:00
|
|
|
sys/time.h termios.h unistd.h openssl/aes.h openssl/blowfish.h \
|
2005-12-12 15:21:09 +03:00
|
|
|
openssl/des.h zlib.h sys/poll.h stdint.h pty.h gcrypt.h])
|
2005-07-05 05:21:44 +04:00
|
|
|
|
2005-10-26 03:02:25 +04:00
|
|
|
#Warn user when no openssl available
|
2006-05-08 12:45:00 +04:00
|
|
|
if test "$with_gcrypt" = "no" && (test "$ac_cv_header_openssl_aes_h" != "yes" ||
|
|
|
|
test "$ac_cv_header_openssl_blowfish_h" != "yes"); then
|
|
|
|
echo "Can't find valid openssl files [e.g openssl/aes.h]"
|
|
|
|
echo "Please install Openssl-devel"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
#Warn user when no libgcrypt available
|
|
|
|
if test "$with_gcrypt" = "yes" && test "$ac_cv_header_gcrypt_h" != "yes"; then
|
|
|
|
echo "Can't find valid libgcrypt files [e.g gcrypt.h]"
|
|
|
|
echo "Please install libgcrypt-devel"
|
|
|
|
exit
|
|
|
|
fi
|
2005-10-26 03:02:25 +04:00
|
|
|
|
|
|
|
#if ! test x"$ac_cv_header_zlib_h" != x"yes"; then
|
|
|
|
# echo "Can't find zlib.h"
|
|
|
|
# echo "Compression support won't be compiled in"
|
|
|
|
#fi
|
|
|
|
|
2005-07-05 05:21:44 +04:00
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
AC_HEADER_TIME
|
|
|
|
|
|
|
|
# Checks for library functions.
|
|
|
|
AC_FUNC_MALLOC
|
|
|
|
AC_FUNC_MEMCMP
|
|
|
|
AC_FUNC_REALLOC
|
|
|
|
AC_FUNC_SELECT_ARGTYPES
|
|
|
|
AC_TYPE_SIGNAL
|
|
|
|
AC_FUNC_VPRINTF
|
2005-10-26 16:06:11 +04:00
|
|
|
AC_CHECK_FUNCS([endpwent getaddrinfo gethostbyname getpass memmove memset \
|
2005-10-05 02:11:19 +04:00
|
|
|
cfmakeraw select socket strchr strdup strerror strstr poll])
|
2005-07-05 05:21:44 +04:00
|
|
|
|
|
|
|
AC_CONFIG_FILES([Makefile
|
2007-07-27 07:54:32 +04:00
|
|
|
libssh/Makefile
|
|
|
|
include/Makefile
|
|
|
|
include/libssh/Makefile])
|
2005-07-05 05:21:44 +04:00
|
|
|
AC_OUTPUT
|