configure.ac 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. #
  4. AC_PREREQ(2.59)
  5. AC_INIT(aria2c, 0.5.0, tujikawa@rednoah.com)
  6. AM_INIT_AUTOMAKE()
  7. AM_PATH_CPPUNIT(1.10.2)
  8. AC_CONFIG_SRCDIR([src/Socket.h])
  9. AC_CONFIG_HEADERS([config.h])
  10. # Set localedir
  11. localedir=${datadir}/locale
  12. AC_SUBST(localedir)
  13. # Checks for arguments.
  14. AC_ARG_WITH([gnutls], [ --with-gnutls use gnutls library if installed. Default: yes], [with_gnutls=$enableval], [with_gnutls=yes])
  15. AC_ARG_WITH([openssl], [ --with-openssl use openssl library if installed. Default: yes], [with_openssl=$enableval], [with_openssl=yes])
  16. # Checks for programs.
  17. AC_PROG_CXX
  18. AC_PROG_CC
  19. AC_PROG_INSTALL
  20. AC_PROG_RANLIB
  21. AC_PROG_YACC
  22. # Checks for libraries.
  23. if test "x$with_gnutls" = "xyes"; then
  24. AM_PATH_LIBGNUTLS([1.2.9], [have_libgnutls=yes])
  25. if test "x$have_libgnutls" = "xyes"; then
  26. AC_DEFINE([HAVE_LIBGNUTLS], [1], [Define to 1 if you have libgnutls.])
  27. fi
  28. fi
  29. if test "x$have_libgnutls" = "xyes"; then
  30. AM_PATH_LIBGCRYPT([1.2.2], [have_libgcrypt=yes])
  31. if test "x$have_libgcrypt" = "xyes"; then
  32. AC_DEFINE([HAVE_LIBGCRYPT], [1], [Define to 1 if you have libgcrypt.])
  33. fi
  34. fi
  35. if test "x$with_openssl" = "xyes" && test "x$have_libgnutls" != "xyes"; then
  36. # AC_CHECK_LIB([ssl], [SSL_library_init], [have_openssl=yes])
  37. # if test "x$have_openssl" = "xyes"; then
  38. # AC_DEFINE([HAVE_LIBSSL], [1], [Define to 1 if you have openssl.])
  39. # OPENSSL_LIBS="-lssl"
  40. # OPENSSL_CFLAGS=""
  41. # AC_SUBST(OPENSSL_LIBS)
  42. # AC_SUBST(OPENSSL_CFLAGS)
  43. # fi
  44. AM_PATH_OPENSSL
  45. fi
  46. if test "x$have_libgnutls" = "xyes" || test "x$have_openssl" = "xyes"; then
  47. AC_DEFINE([ENABLE_SSL], [1], [Define to 1 if ssl support is enabled.])
  48. fi
  49. if test "x$have_libgcrypt" = "xyes" || test "x$have_openssl" = "xyes"; then
  50. AC_DEFINE([ENABLE_SHA1DIGEST], [1], [Define to 1 if SHA1 Digest support is enabled.])
  51. AC_DEFINE([ENABLE_BITTORRENT], [1], [Define to 1 if BitTorrent support is enabled.])
  52. fi
  53. # Checks for header files.
  54. AC_FUNC_ALLOCA
  55. AC_HEADER_STDC
  56. AC_CHECK_HEADERS([argz.h arpa/inet.h fcntl.h inttypes.h langinfo.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdio_ext.h stdlib.h string.h strings.h sys/param.h sys/socket.h sys/time.h unistd.h])
  57. # Checks for typedefs, structures, and compiler characteristics.
  58. AC_HEADER_STDBOOL
  59. AC_C_CONST
  60. AC_C_INLINE
  61. AC_TYPE_SIZE_T
  62. AC_HEADER_TIME
  63. AC_STRUCT_TM
  64. AC_C_VOLATILE
  65. # Checks for library functions.
  66. AM_GNU_GETTEXT
  67. AM_GNU_GETTEXT_VERSION(0.12.1)
  68. AC_FUNC_ERROR_AT_LINE
  69. AC_FUNC_MALLOC
  70. AC_FUNC_MEMCMP
  71. AC_FUNC_MMAP
  72. AC_FUNC_REALLOC
  73. AC_FUNC_SELECT_ARGTYPES
  74. AC_FUNC_STAT
  75. AC_FUNC_VPRINTF
  76. AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify ftruncate getcwd getpagesize gettimeofday inet_ntoa memchr mempcpy memset mkdir munmap nl_langinfo rmdir select setlocale socket stpcpy strcasecmp strchr strcspn strdup strerror strstr strtol strtoul])
  77. AC_CONFIG_FILES([Makefile
  78. src/Makefile
  79. test/Makefile
  80. po/Makefile.in
  81. m4/Makefile
  82. intl/Makefile])
  83. AC_OUTPUT