configure.ac 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ(2.59)
  4. AC_INIT([zookeeper C client],2.1.1,[zookeeper-user@lists.sourceforge.net],[c-client-src])
  5. AC_CONFIG_SRCDIR([src/zookeeper.c])
  6. AC_CHECK_FILES([generated/zookeeper.jute.c generated/zookeeper.jute.h],[],
  7. [AC_MSG_ERROR([jute files are missing! Please run "ant compile_jute" while in the zookeeper top level directory.])
  8. ])
  9. # initialize Doxygen support
  10. DX_HTML_FEATURE(ON)
  11. DX_CHM_FEATURE(OFF)
  12. DX_CHI_FEATURE(OFF)
  13. DX_MAN_FEATURE(OFF)
  14. DX_RTF_FEATURE(OFF)
  15. DX_XML_FEATURE(OFF)
  16. DX_PDF_FEATURE(OFF)
  17. DX_PS_FEATURE(OFF)
  18. DX_INIT_DOXYGEN([zookeeper],[c-doc.Doxyfile],[docs])
  19. # initialize automake
  20. AM_INIT_AUTOMAKE([-Wall foreign])
  21. AC_CONFIG_HEADER([config.h])
  22. # Checks for programs.
  23. AM_PATH_CPPUNIT(1.10.2)
  24. AC_PROG_CC
  25. AM_PROG_CC_C_O
  26. AC_PROG_INSTALL
  27. AC_PROG_LN_S
  28. # AC_DISABLE_SHARED
  29. AC_PROG_LIBTOOL
  30. AC_ARG_ENABLE([debug],
  31. [AS_HELP_STRING([--enable-debug],[enable debug build [default=no]])],
  32. [CFLAGS="-g -O0";CXXFLAGS="-g -O0"],[CFLAGS="-g -O2";CXXFLAGS="-g -O2"])
  33. AC_ARG_WITH([syncapi],
  34. [AS_HELP_STRING([--with-syncapi],[build with support for SyncAPI [default=yes]])],
  35. [],[with_syncapi=yes])
  36. # Checks for libraries.
  37. AC_CHECK_LIB([pthread], [pthread_mutex_lock],[have_pthread=yes],[have_pthread=no])
  38. if test "x$with_syncapi" != xno && test "x$have_pthread" = xno; then
  39. AC_MSG_WARN([cannot build SyncAPI -- pthread not found])
  40. with_syncapi=no
  41. fi
  42. if test "x$with_syncapi" != xno; then
  43. AC_MSG_NOTICE([building with SyncAPI support])
  44. else
  45. AC_MSG_NOTICE([building without SyncAPI support])
  46. fi
  47. AM_CONDITIONAL([WANT_SYNCAPI],[test "x$with_syncapi" != xno])
  48. # Checks for header files.
  49. AC_HEADER_STDC
  50. AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
  51. # Checks for typedefs, structures, and compiler characteristics.
  52. AC_C_CONST
  53. AC_C_INLINE
  54. AC_HEADER_TIME
  55. AC_CHECK_TYPE([nfds_t],
  56. [AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[poll() second argument type])],
  57. [AC_DEFINE([POLL_NFDS_TYPE],[unsigned int],[poll() second argument type])],
  58. [#include <poll.h>])
  59. # Checks for library functions.
  60. AC_CHECK_FUNCS([gethostbyname gettimeofday memmove memset poll socket strchr strdup strerror strtol])
  61. AC_CONFIG_FILES([Makefile])
  62. AC_OUTPUT