1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
|
dnl configuration script for Guile-SSH
dnl Process this file with autoconf to produce configure.
dnl
define(GUILE_SSH_CONFIGURE_COPYRIGHT, [[
Copyright (C) 2013-2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
This file is part of Guile-SSH.
Guile-SSH is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Guile-SSH is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with Guile-SSH. If not, see <http://www.gnu.org/licenses/>.
]])
AC_INIT([Guile-SSH], [0.18.0], [poptsov.artyom@gmail.com],
[guile-ssh],
[https://github.com/artyom-poptsov/guile-ssh])
AC_COPYRIGHT(GUILE_SSH_CONFIGURE_COPYRIGHT)
dnl See
dnl <https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html>
LIBGUILE_SSH_INTERFACE="18:0:0"
AC_SUBST(LIBGUILE_SSH_INTERFACE)
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([build-aux/m4])
AC_CONFIG_HEADER([libguile-ssh/config.h])
AM_INIT_AUTOMAKE([color-tests])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [AC_SUBST([AM_DEFAULT_VERBOSITY],1)])
AC_PROG_CC
LT_INIT([disable-static])
if test "x$GCC" = "xyes"; then
# Use compiler warnings.
WARN_CFLAGS="-Wall"
else
WARN_CFLAGS=""
fi
AC_SUBST([WARN_CFLAGS])
AC_ARG_WITH([guilesitedir],
[AS_HELP_STRING([--with-guilesitedir],
[use the specified installation path for Guile modules])],
[case "x$withval" in
xyes|xno) guilesitedir="";;
*) guilesitedir="$withval";;
esac],
[guilesitedir=""])
AC_ARG_ENABLE([dsa],
[AS_HELP_STRING([--enable-dsa],
[Enable DSA support.])])
AS_IF([test "x$enable_dsa" = "xyes"],
[
AC_DEFINE(ENABLE_DSA, 1, [Enable DSA support.])
],
[
AC_DEFINE(ENABLE_DSA, 0, [Disable DSA support.])
])
AM_CONDITIONAL(ENABLE_DSA, $ENABLE_DSA)
# -------------------------------------------------------------------------------
# Check for needed libraries
# -------------------------------------------------------------------------------
dnl Checking for libssh 0.8.x.
PKG_CHECK_MODULES(
[LIBSSH_0_8],
[libssh >= 0.8.0],
[AC_DEFINE(HAVE_LIBSSH_0_8, 1, [Use libssh 0.8])],
[AC_DEFINE(HAVE_LIBSSH_0_8, 0, [Use libssh < 0.8])])
AM_CONDITIONAL(HAVE_LIBSSH_0_8, $HAVE_LIBSSH_0_8)
dnl NOTE that Ubuntu 18.04 LTS have "fake" libssh 0.8
dnl (0.8.0~20170825.94fa1e38-1ubuntu0.6) that is actually 0.7, so we need to
dnl check 0.8.1+ to make sure we have a valid libssh 0.8.
PKG_CHECK_MODULES([LIBSSH_0_8_1], [libssh >= 0.8.1],
[AC_DEFINE(HAVE_LIBSSH_0_8_1, 1, [Use libssh 0.8.1])],
[AC_DEFINE(HAVE_LIBSSH_0_8_1, 0, [Use libssh < 0.8.1])])
AM_CONDITIONAL(HAVE_LIBSSH_0_8_1, $HAVE_LIBSSH_0_8_1)
PKG_CHECK_MODULES(
[LIBSSH_0_8_3],
[libssh >= 0.8.3],
[AC_DEFINE(HAVE_LIBSSH_0_8_3, 1, [Use libssh >= 0.8.3])],
[AC_DEFINE(HAVE_LIBSSH_0_8_3, 0, [Use libssh < 0.8.3])
AC_WARN([
You are using an old version of libssh;
some Guile-SSH API may not work properly.
Please upgrade as soon as possible.
Support for libssh versions older than 0.8.3
will be dropped in the future Guile-SSH
releases.
])])
AM_CONDITIONAL(HAVE_LIBSSH_0_8_3, $HAVE_LIBSSH_0_8_3)
PKG_CHECK_MODULES([LIBSSH_0_9], [libssh >= 0.9.0],
[AC_DEFINE(HAVE_LIBSSH_0_9, 1, [Use libssh 0.9])],
[AC_DEFINE(HAVE_LIBSSH_0_9, 0, [Use libssh < 0.9])])
AM_CONDITIONAL(HAVE_LIBSSH_0_9, $HAVE_LIBSSH_0_9)
PKG_CHECK_MODULES([LIBSSH_0_10],
[libssh >= 0.10.0],
[AC_DEFINE(HAVE_LIBSSH_0_10, 1, [Use libssh 0.10])],
[AC_DEFINE(HAVE_LIBSSH_0_10, 0, [Use libssh < 0.10])])
AM_CONDITIONAL(HAVE_LIBSSH_0_10, $HAVE_LIBSSH_0_10)
PKG_CHECK_MODULES([LIBSSH_0_11],
[libssh >= 0.11.0],
[AC_DEFINE(HAVE_LIBSSH_0_11, 1, [Use libssh 0.11])],
[AC_DEFINE(HAVE_LIBSSH_0_11, 0, [Use libssh < 0.11])])
AM_CONDITIONAL(HAVE_LIBSSH_0_11, $HAVE_LIBSSH_0_11)
# -------------------------------------------------------------------------------
dnl These macros must be provided by guile.m4.
m4_pattern_forbid([^GUILE_PKG$])
m4_pattern_forbid([^GUILE_PROGS$])
dnl Use this macro so that 'GUILE_EFFECTIVE_VERSION' is defined here.
dnl Try Guile 3.0, then 2.2, and finally 2.0.
GUILE_PKG([3.0 2.2 2.0])
GUILE_PROGS
GUILE_FLAGS
GUILE_SITE_DIR
AC_PATH_PROG([guile_snarf], [guile-snarf], [not-found])
if test "x$guile_snarf" = "xnot-found"; then
AC_MSG_ERROR([`guile-snarf' not found. Please install Guile 2.x, 3.x or later.])
fi
if test "x$GUILD" = "x"; then
GUILD=`which guild`
AC_SUBST(GUILD)
fi
dnl (srfi srfi-64) appeared in Guile 2.0.10. Make sure we have it.
GUILE_MODULE_AVAILABLE([have_srfi64], [(srfi srfi-64)])
if test "x$have_srfi64" != "xyes"; then
AC_MSG_ERROR([(srfi srfi-64) is missing; please install a more recent Guile.])
fi
LT_INIT()
if test "x$guilesitedir" = "x"; then
guilesitedir="$datadir/guile/site/$GUILE_EFFECTIVE_VERSION"
fi
AC_SUBST([guilesitedir])
GUILE_EFFECTIVE_VERSION=`$GUILE -c '(display (effective-version))'`
AC_SUBST(GUILE_EFFECTIVE_VERSION)
AC_CONFIG_FILES([Makefile libguile-ssh/Makefile examples/Makefile build-aux/Makefile])
AC_CONFIG_FILES([build-aux/m4/Makefile doc/Makefile tests/Makefile build-aux/am/Makefile])
AC_CONFIG_FILES([modules/Makefile modules/ssh/Makefile modules/ssh/dist/Makefile])
AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" = "xyes"])
# Generate a Makefile, based on the results.
AC_OUTPUT
if test "$guilesitedir" != "$GUILE_SITE"; then
# Guile has a different prefix than this module
AC_MSG_WARN([]
[The Guile modules will be installed in ${guilesitedir}.]
[You should probably re-run `configure' with]
[`--with-guilesitedir=$GUILE_SITE']
[Otherwise, you will have to adjust the `GUILE_LOAD_PATH' environment]
[variable.])
fi
AS_IF(
[test "x$enable_dsa" = "xyes"],
[
AC_MSG_WARN(
[]
[Guile-SSH is configured with DSA public key algorithm support.]
[Note that DSA support is disabled by default in libssh 0.10.]
[<https://salsa.debian.org/debian/libssh/-/blob/debian/CHANGELOG#L37>]
[]
[If your version of libssh does not support DSA public key algorithm]
[it will lead to errors in Guile-SSH.]
)
],
[
AC_MSG_NOTICE(
[Guile-SSH configured without DSA public key algorithm support.]
)
]
)
|