configure.in 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. #
  4. AC_PREREQ(2.59)
  5. AC_INIT(aria2c, 0.3.1, 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_ENABLE([ssl], [ --enable-ssl enalbe SSL support if libssl is installed. Default: yes], [enable_ssl=$enableval], [enable_ssl=yes])
  15. AC_ARG_WITH([gnutls], [ --with-gnutls use gnutls library if installed. Default: yes], [with_gnutls=$enableval], [with_gnutls=yes])
  16. AC_ARG_WITH([openssl], [ --with-openssl use openssl library if installed. Default: yes], [with_openssl=$enableval], [with_openssl=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_gnutls" = "xyes"; then
  25. AM_PATH_LIBGNUTLS([1.2.9], [have_libgnutls=yes])
  26. if test "x$have_libgnutls" = "xyes"; then
  27. AC_DEFINE([HAVE_LIBGNUTLS], [1], [Define to 1 if you have libgnutls.])
  28. fi
  29. fi
  30. if test "x$have_libgnutls" = "xyes"; then
  31. AM_PATH_LIBGCRYPT([1.2.2], [have_libgcrypt=yes])
  32. if test "x$have_libgcrypt" = "xyes"; then
  33. AC_DEFINE([HAVE_LIBGCRYPT], [1], [Define to 1 if you have libgcrypt.])
  34. fi
  35. fi
  36. if test "x$with_openssl" = "xyes" && test "x$have_libgnutls" != "xyes"; then
  37. # AC_CHECK_LIB([ssl], [SSL_library_init], [have_openssl=yes])
  38. # if test "x$have_openssl" = "xyes"; then
  39. # AC_DEFINE([HAVE_LIBSSL], [1], [Define to 1 if you have openssl.])
  40. # OPENSSL_LIBS="-lssl"
  41. # OPENSSL_CFLAGS=""
  42. # AC_SUBST(OPENSSL_LIBS)
  43. # AC_SUBST(OPENSSL_CFLAGS)
  44. # fi
  45. AM_PATH_OPENSSL
  46. fi
  47. if test "x$have_libgnutls" = "xyes" || test "x$have_openssl" = "xyes"; then
  48. AC_DEFINE([ENABLE_SSL], [1], [Define to 1 if ssl support is enabled.])
  49. fi
  50. if test "x$have_libgcrypt" = "xyes" || test "x$have_openssl" = "xyes"; then
  51. AC_DEFINE([ENABLE_SHA1DIGEST], [1], [Define to 1 if SHA1 Digest support is enabled.])
  52. AC_DEFINE([ENABLE_BITTORRENT], [1], [Define to 1 if BitTorrent support is enabled.])
  53. fi
  54. # Checks for header files.
  55. AC_FUNC_ALLOCA
  56. AC_HEADER_STDC
  57. 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])
  58. # Checks for typedefs, structures, and compiler characteristics.
  59. AC_HEADER_STDBOOL
  60. AC_C_CONST
  61. AC_C_INLINE
  62. AC_TYPE_SIZE_T
  63. AC_HEADER_TIME
  64. AC_STRUCT_TM
  65. AC_C_VOLATILE
  66. # Checks for library functions.
  67. AM_GNU_GETTEXT
  68. AM_GNU_GETTEXT_VERSION(0.12.1)
  69. AC_FUNC_ERROR_AT_LINE
  70. AC_FUNC_MALLOC
  71. AC_FUNC_MEMCMP
  72. AC_FUNC_MMAP
  73. AC_FUNC_REALLOC
  74. AC_FUNC_SELECT_ARGTYPES
  75. AC_FUNC_STAT
  76. AC_FUNC_VPRINTF
  77. AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify 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])
  78. AC_CONFIG_FILES([Makefile
  79. src/Makefile
  80. test/Makefile
  81. po/Makefile.in
  82. m4/Makefile
  83. intl/Makefile])
  84. AC_OUTPUT