configure.ac 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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.2, 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. AC_ARG_WITH([libxml2], [ --with-libxml2 use libxml2 library if installed. Default: yes], [with_libxml2=$enableval], [with_libxml2=yes])
  17. # Checks for programs.
  18. AC_PROG_CXX
  19. AC_PROG_CC
  20. AC_PROG_INSTALL
  21. AC_PROG_RANLIB
  22. AC_PROG_YACC
  23. # Checks for libraries.
  24. if test "x$with_libxml2" = "xyes"; then
  25. AM_PATH_XML2([2.6.26], [have_libxml2=yes])
  26. if test "x$have_libxml2" = "xyes"; then
  27. AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if you have libxml2.])
  28. fi
  29. fi
  30. if test "x$with_gnutls" = "xyes"; then
  31. AM_PATH_LIBGNUTLS([1.2.9], [have_libgnutls=yes])
  32. if test "x$have_libgnutls" = "xyes"; then
  33. AC_DEFINE([HAVE_LIBGNUTLS], [1], [Define to 1 if you have libgnutls.])
  34. fi
  35. fi
  36. if test "x$have_libgnutls" = "xyes"; then
  37. AM_PATH_LIBGCRYPT([1.2.2], [have_libgcrypt=yes])
  38. if test "x$have_libgcrypt" = "xyes"; then
  39. AC_DEFINE([HAVE_LIBGCRYPT], [1], [Define to 1 if you have libgcrypt.])
  40. fi
  41. fi
  42. if test "x$with_openssl" = "xyes" && test "x$have_libgnutls" != "xyes"; then
  43. # AC_CHECK_LIB([ssl], [SSL_library_init], [have_openssl=yes])
  44. # if test "x$have_openssl" = "xyes"; then
  45. # AC_DEFINE([HAVE_LIBSSL], [1], [Define to 1 if you have openssl.])
  46. # OPENSSL_LIBS="-lssl"
  47. # OPENSSL_CFLAGS=""
  48. # AC_SUBST(OPENSSL_LIBS)
  49. # AC_SUBST(OPENSSL_CFLAGS)
  50. # fi
  51. AM_PATH_OPENSSL
  52. fi
  53. if test "x$have_libxml2" = "xyes"; then
  54. AC_DEFINE([ENABLE_METALINK], [1], [Define to 1 if Metalink support is enabled.])
  55. fi
  56. if test "x$have_libgnutls" = "xyes" || test "x$have_openssl" = "xyes"; then
  57. AC_DEFINE([ENABLE_SSL], [1], [Define to 1 if ssl support is enabled.])
  58. fi
  59. if test "x$have_libgcrypt" = "xyes" || test "x$have_openssl" = "xyes"; then
  60. AC_DEFINE([ENABLE_SHA1DIGEST], [1], [Define to 1 if SHA1 Digest support is enabled.])
  61. AC_DEFINE([ENABLE_BITTORRENT], [1], [Define to 1 if BitTorrent support is enabled.])
  62. fi
  63. # Checks for header files.
  64. AC_FUNC_ALLOCA
  65. AC_HEADER_STDC
  66. 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])
  67. # Checks for typedefs, structures, and compiler characteristics.
  68. AC_HEADER_STDBOOL
  69. AC_C_CONST
  70. AC_C_INLINE
  71. AC_TYPE_SIZE_T
  72. AC_HEADER_TIME
  73. AC_STRUCT_TM
  74. AC_C_VOLATILE
  75. # Checks for library functions.
  76. AM_GNU_GETTEXT
  77. AM_GNU_GETTEXT_VERSION(0.12.1)
  78. AC_FUNC_ERROR_AT_LINE
  79. AC_FUNC_MALLOC
  80. AC_FUNC_MEMCMP
  81. AC_FUNC_MMAP
  82. AC_FUNC_REALLOC
  83. AC_FUNC_SELECT_ARGTYPES
  84. AC_FUNC_STAT
  85. AC_FUNC_VPRINTF
  86. 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])
  87. AC_CONFIG_FILES([Makefile
  88. src/Makefile
  89. test/Makefile
  90. po/Makefile.in
  91. m4/Makefile
  92. intl/Makefile])
  93. AC_OUTPUT