configure.ac 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. dnl configuration script for Guile-SSH
  2. dnl Process this file with autoconf to produce configure.
  3. dnl
  4. define(GUILE_SSH_CONFIGURE_COPYRIGHT, [[
  5. Copyright (C) 2013, 2014, 2015, 2016 Artyom V. Poptsov <poptsov.artyom@gmail.com>
  6. This file is part of Guile-SSH.
  7. Guile-SSH is free software: you can redistribute it and/or
  8. modify it under the terms of the GNU General Public License as
  9. published by the Free Software Foundation, either version 3 of the
  10. License, or (at your option) any later version.
  11. Guile-SSH is distributed in the hope that it will be useful, but
  12. WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with Guile-SSH. If not, see <http://www.gnu.org/licenses/>.
  17. ]])
  18. AC_INIT([Guile-SSH], [0.10.2], [poptsov.artyom@gmail.com],
  19. [guile-ssh],
  20. [https://github.com/artyom-poptsov/guile-ssh])
  21. AC_COPYRIGHT(GUILE_SSH_CONFIGURE_COPYRIGHT)
  22. AC_CONFIG_AUX_DIR([build-aux])
  23. AC_CONFIG_MACRO_DIR([m4])
  24. AC_CONFIG_HEADER([libguile-ssh/config.h])
  25. AM_INIT_AUTOMAKE([color-tests])
  26. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [AC_SUBST([AM_DEFAULT_VERBOSITY],1)])
  27. AC_PROG_CC
  28. if test "x$GCC" = "xyes"; then
  29. # Use compiler warnings.
  30. WARN_CFLAGS="-Wall"
  31. else
  32. WARN_CFLAGS=""
  33. fi
  34. AC_SUBST([WARN_CFLAGS])
  35. AC_ARG_WITH([guilesitedir],
  36. [AS_HELP_STRING([--with-guilesitedir],
  37. [use the specified installation path for Guile modules])],
  38. [case "x$withval" in
  39. xyes|xno) guilesitedir="";;
  40. *) guilesitedir="$withval";;
  41. esac],
  42. [guilesitedir=""])
  43. # -------------------------------------------------------------------------------
  44. # Check for needed libraries
  45. # -------------------------------------------------------------------------------
  46. PKG_CHECK_MODULES([LIBSSH], [libssh >= 0.6.4])
  47. PKG_CHECK_MODULES([LIBSSH_0_7_3], [libssh >= 0.7.3],
  48. [AC_DEFINE(HAVE_LIBSSH_0_7_3, 1, [Use libssh 0.7.3])],
  49. [AC_WARN([
  50. Using a potentially vulnerable version of libssh
  51. <https://www.libssh.org/2016/02/23/libssh-0-7-3-security-and-bugfix-release/>])])
  52. # -------------------------------------------------------------------------------
  53. dnl These macros must be provided by guile.m4.
  54. m4_pattern_forbid([^GUILE_PKG$])
  55. m4_pattern_forbid([^GUILE_PROGS$])
  56. dnl Use this macro so that 'GUILE_EFFECTIVE_VERSION' is defined here.
  57. dnl Try Guile 2.2, then Guile 2.0.
  58. GUILE_PKG([2.2 2.0])
  59. GUILE_PROGS
  60. GUILE_FLAGS
  61. GUILE_SITE_DIR
  62. LT_INIT()
  63. if test "x$guilesitedir" = "x"; then
  64. guilesitedir="$datadir/guile/site/$GUILE_EFFECTIVE_VERSION"
  65. fi
  66. AC_SUBST([guilesitedir])
  67. LIBGUILE_SSH_INTERFACE="10:2:0"
  68. AC_SUBST(LIBGUILE_SSH_INTERFACE)
  69. GUILE_EFFECTIVE_VERSION=`$GUILE -c '(display (effective-version))'`
  70. AC_SUBST(GUILE_EFFECTIVE_VERSION)
  71. AC_CONFIG_FILES([Makefile libguile-ssh/Makefile examples/Makefile build-aux/Makefile])
  72. AC_CONFIG_FILES([m4/Makefile doc/Makefile tests/Makefile am/Makefile])
  73. AC_CONFIG_FILES([modules/Makefile modules/ssh/Makefile modules/ssh/dist/Makefile])
  74. AC_CONFIG_FILES([modules/srfi/Makefile])
  75. # Generate a Makefile, based on the results.
  76. AC_OUTPUT
  77. if test "$guilesitedir" != "$GUILE_SITE"; then
  78. # Guile has a different prefix than this module
  79. AC_MSG_WARN([]
  80. [The Guile modules will be installed in ${guilesitedir}.]
  81. [You should probably re-run `configure' with]
  82. [`--with-guilesitedir=$GUILE_SITE']
  83. [Otherwise, you will have to adjust the `GUILE_LOAD_PATH' environment]
  84. [variable.])
  85. fi