configure.in 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. AC_INIT(src/isync.h)
  2. AM_CONFIG_HEADER(config.h)
  3. AM_INIT_AUTOMAKE(isync, 0.9.2)
  4. AM_MAINTAINER_MODE
  5. AM_PROG_CC_STDC
  6. if test "$GCC" = yes; then
  7. CFLAGS="$CFLAGS -pipe -W -Wall -Wshadow -Wmissing-prototypes"
  8. fi
  9. AC_CHECK_FUNCS(getopt_long)
  10. AC_CHECK_LIB(socket, socket)
  11. AC_CHECK_LIB(nsl, inet_ntoa)
  12. ssl=false
  13. AC_ARG_WITH(ssl,
  14. [ --with-ssl=DIR yes/no/OpenSSL installation root [detect]],
  15. [ob_cv_with_ssl=$withval])
  16. if test "x$ob_cv_with_ssl" != xno; then
  17. if test -d "$ob_cv_with_ssl/lib"; then
  18. CPFLAGS="$CPPFLAGS -I$ob_cv_with_ssl/include"
  19. LDFLAGS="$LDFLAGS -L$ob_cv_with_ssl/lib"
  20. fi
  21. AC_CHECK_LIB(crypto, ERR_error_string, [cryptolib=" -lcrypto"])
  22. AC_CHECK_LIB(ssl, SSL_library_init, [
  23. LIBS="-lssl$cryptolib $LIBS"
  24. AC_DEFINE(HAVE_LIBSSL, 1, [Define if you want SSL support])
  25. ssl=true
  26. ],[
  27. if test -n "$ob_cv_with_ssl"; then
  28. AC_MSG_ERROR([can't find OpenSSL])
  29. fi
  30. ])
  31. fi
  32. AC_CACHE_CHECK(for db_create in -ldb, ac_cv_db_db_create,
  33. [ac_cv_db_dbcreate=no
  34. AC_TRY_LINK([#include <db.h>],
  35. [db_create();],[ac_cv_db_db_create=yes])])
  36. if test $ac_cv_db_db_create=yes; then
  37. LIBS="$LIBS -ldb"
  38. else
  39. AC_MSG_ERROR([Berkley DB not found.
  40. You must install libdb including the respective development files/headers.])
  41. fi
  42. AC_OUTPUT(Makefile src/Makefile isync.spec)
  43. if $ssl; then
  44. AC_MSG_RESULT([
  45. Using SSL
  46. ])
  47. else
  48. AC_MSG_RESULT([
  49. Not using SSL
  50. ])
  51. fi