configure.in 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. AC_INIT(src/isync.h)
  2. AM_INIT_AUTOMAKE(isync,0.9)
  3. AM_PROG_CC_STDC
  4. if test "$GCC" = yes; then
  5. CFLAGS="$CFLAGS -pipe -W -Wall -Wshadow -Wmissing-prototypes"
  6. fi
  7. AC_ARG_WITH(ssl-dir, [ --with-ssl-dir=DIR location where OpenSSL is installed],
  8. [if test -d $withval/lib; then
  9. LIBS="$LIBS -L$withval/lib"
  10. CFLAGS="$CFLAGS -I$withval/include"
  11. else
  12. AC_MSG_ERROR(can't find OpenSSL in $withval)
  13. fi])
  14. AC_CHECK_FUNCS(getopt_long)
  15. AC_CHECK_LIB(socket,socket)
  16. AC_CHECK_LIB(nsl,inet_ntoa)
  17. AC_CHECK_LIB(crypto,ERR_error_string)
  18. AC_CHECK_LIB(ssl,SSL_library_init)
  19. AC_CACHE_CHECK(for dbm_open, ac_cv_dbmopen,
  20. [ac_cv_dbmopen=no
  21. AC_TRY_LINK([#include <ndbm.h>],
  22. [dbm_open(0,0,0);],[ac_cv_dbmopen=yes])])
  23. if test $ac_cv_dbmopen = no; then
  24. AC_CACHE_CHECK([for dbm_open in -ldb], ac_cv_libdb,
  25. [save_LIBS="$LIBS"
  26. LIBS="$LIBS -ldb"
  27. ac_cv_libdb=no
  28. AC_TRY_LINK([#define DB_DBM_HSEARCH 1
  29. #include <db.h>],
  30. [dbm_open(0,0,0);],
  31. [ac_cv_libdb=yes])
  32. LIBS="$save_LIBS"])
  33. if test $ac_cv_libdb = yes; then
  34. LIBS="$LIBS -ldb"
  35. AC_DEFINE(HAVE_LIBDB)
  36. else
  37. AC_MSG_ERROR([Could not find dbm_open(), you must install libdb])
  38. fi
  39. fi
  40. AC_OUTPUT(Makefile src/Makefile debian/Makefile isync.spec)