configure.ac 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. dnl Wslay - The WebSocket Library
  2. dnl Copyright (c) 2011, 2012 Tatsuhiro Tsujikawa
  3. dnl Permission is hereby granted, free of charge, to any person obtaining
  4. dnl a copy of this software and associated documentation files (the
  5. dnl "Software"), to deal in the Software without restriction, including
  6. dnl without limitation the rights to use, copy, modify, merge, publish,
  7. dnl distribute, sublicense, and/or sell copies of the Software, and to
  8. dnl permit persons to whom the Software is furnished to do so, subject to
  9. dnl the following conditions:
  10. dnl The above copyright notice and this permission notice shall be
  11. dnl included in all copies or substantial portions of the Software.
  12. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  13. dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14. dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  15. dnl NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  16. dnl LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  17. dnl OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  18. dnl WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  19. AC_PREREQ(2.61)
  20. AC_INIT([wslay], [0.1.1], [t-tujikawa@users.sourceforge.net])
  21. LT_PREREQ([2.2.6])
  22. LT_INIT([disable-shared])
  23. AC_CONFIG_AUX_DIR([.])
  24. dnl See versioning rule:
  25. dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
  26. AC_SUBST(LT_CURRENT, 0)
  27. AC_SUBST(LT_REVISION, 0)
  28. AC_SUBST(LT_AGE, 0)
  29. AC_CANONICAL_BUILD
  30. AC_CANONICAL_HOST
  31. AC_CANONICAL_TARGET
  32. AC_CONFIG_MACRO_DIR([m4])
  33. AM_INIT_AUTOMAKE()
  34. AC_CONFIG_HEADERS([config.h])
  35. dnl Checks for programs
  36. AC_PROG_CC
  37. AC_PROG_INSTALL
  38. AC_PROG_LN_S
  39. AC_PROG_MAKE_SET
  40. AC_PATH_PROG([SPHINX_BUILD], [sphinx-build])
  41. AC_SUBST([SPHINX_BUILD])
  42. AM_CONDITIONAL([HAVE_SPHINX_BUILD], [ test "x$SPHINX_BUILD" != "x" ])
  43. # Checks for libraries.
  44. AC_CHECK_LIB([cunit], [CU_initialize_registry],
  45. [have_cunit=yes], [have_cunit=no])
  46. AM_CONDITIONAL([HAVE_CUNIT], [ test "x${have_cunit}" = "xyes" ])
  47. case "$target" in
  48. *mingw*)
  49. # Required for ntoh*/hton* functions.
  50. LIBS="-lws2_32 $LIBS"
  51. ;;
  52. esac
  53. # Checks for header files.
  54. AC_CHECK_HEADERS([ \
  55. arpa/inet.h \
  56. netinet/in.h \
  57. stddef.h \
  58. stdint.h \
  59. stdlib.h \
  60. string.h \
  61. unistd.h \
  62. ])
  63. # Need winsock2.h for ntoh*/hton* functions.
  64. case "$target" in
  65. *mingw*)
  66. AC_CHECK_HEADERS([winsock2.h])
  67. ;;
  68. esac
  69. # Checks for typedefs, structures, and compiler characteristics.
  70. AC_TYPE_SIZE_T
  71. AC_TYPE_SSIZE_T
  72. AC_TYPE_UINT8_T
  73. AC_TYPE_UINT16_T
  74. AC_TYPE_UINT32_T
  75. AC_TYPE_UINT64_T
  76. AC_CHECK_TYPES([ptrdiff_t])
  77. AC_C_BIGENDIAN
  78. # Checks for library functions.
  79. if test "x$cross_compiling" != "xyes"; then
  80. AC_FUNC_MALLOC
  81. fi
  82. AC_CHECK_FUNCS([ \
  83. memmove \
  84. memset \
  85. ntohl \
  86. ntohs \
  87. htons
  88. ])
  89. AC_CONFIG_FILES([
  90. Makefile
  91. lib/Makefile
  92. lib/libwslay.pc
  93. lib/includes/Makefile
  94. lib/includes/wslay/wslayver.h
  95. tests/Makefile
  96. ])
  97. AC_OUTPUT
  98. AC_MSG_NOTICE([summary of build options:
  99. version: ${VERSION} shared $LT_CURRENT:$LT_REVISION:$LT_AGE
  100. Host type: ${host}
  101. Install prefix: ${prefix}
  102. C compiler: ${CC}
  103. CFlags: ${CFLAGS}
  104. Library types: Shared=${enable_shared}, Static=${enable_static}
  105. CUnit: ${have_cunit}
  106. ])