Browse Source

Update configure.ac

pull/1102/head
Max Lv 8 years ago
parent
commit
520290349e
2 changed files with 33 additions and 6 deletions
  1. 9
      configure.ac
  2. 30
      m4/sodium.m4

9
configure.ac

@ -108,6 +108,7 @@ case "${with_crypto_library}" in
AC_DEFINE([USE_CRYPTO_MBEDTLS], [1], [Use mbed TLS library]) AC_DEFINE([USE_CRYPTO_MBEDTLS], [1], [Use mbed TLS library])
;; ;;
esac esac
ss_SODIUM
dnl Checks for Apple CommonCrypto API dnl Checks for Apple CommonCrypto API
AC_ARG_ENABLE(applecc, AC_ARG_ENABLE(applecc,
@ -299,16 +300,12 @@ AC_CHECK_LIB(socket, connect)
dnl Checks for library functions. dnl Checks for library functions.
AC_CHECK_FUNCS([malloc memset socket]) AC_CHECK_FUNCS([malloc memset socket])
AC_CHECK_LIB([sodium], [sodium_init], ,
[ AC_MSG_ERROR([Couldn't find libsodium. Try installing libsodium-dev@<:@el@:>@.])])
dnl Add define for libudns to enable IPv6 support dnl Add define for libudns to enable IPv6 support
dnl This is an option defined in the origin configure script dnl This is an option defined in the origin configure script
AC_DEFINE([HAVE_IPv6], [1], [Enable IPv6 support in libudns]) AC_DEFINE([HAVE_IPv6], [1], [Enable IPv6 support in libudns])
AC_CHECK_LIB([udns], [dns_dnlen], ,[AC_MSG_ERROR([Couldn't find libudns. Try installing libudns-dev or udns-devel.])])
AC_CHECK_LIB([ev], [ev_loop_destroy], ,[AC_MSG_ERROR([Couldn't find libev. Try installing libev-dev@<:@el@:>@.])])
AC_CHECK_LIB([udns], [dns_dnlen], [LIBS="-ludns $LIBS"], [AC_MSG_ERROR([Couldn't find libudns. Try installing libudns-dev or udns-devel.])])
AC_CHECK_LIB([ev], [ev_loop_destroy], [LIBS="-lev $LIBS"], [AC_MSG_ERROR([Couldn't find libev. Try installing libev-dev@<:@el@:>@.])])
AM_COND_IF([ENABLE_DOCUMENTATION], AM_COND_IF([ENABLE_DOCUMENTATION],
[AC_CONFIG_FILES([doc/Makefile]) [AC_CONFIG_FILES([doc/Makefile])

30
m4/sodium.m4

@ -0,0 +1,30 @@
dnl Check to find the libsodium headers/libraries
AC_DEFUN([ss_SODIUM],
[
AC_ARG_WITH(sodium,
AS_HELP_STRING([--with-sodium=DIR], [The Sodium crypto library base directory, or:]),
[sodium="$withval"
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"]
)
AC_ARG_WITH(sodium-include,
AS_HELP_STRING([--with-sodium-include=DIR], [The Sodium crypto library headers directory (without trailing /sodium)]),
[sodium_include="$withval"
CFLAGS="$CFLAGS -I$withval"]
)
AC_ARG_WITH(sodium-lib,
AS_HELP_STRING([--with-sodium-lib=DIR], [The Sodium crypto library library directory]),
[sodium_lib="$withval"
LDFLAGS="$LDFLAGS -L$withval"]
)
AC_CHECK_LIB(sodium, sodium_init,
[LIBS="-lsodium $LIBS"],
[AC_MSG_ERROR([The Sodium crypto library libraries not found.])]
)
])
Loading…
Cancel
Save