configure.ac 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ([2.59])
  4. AC_INIT(bind, 10.0.0, bind10-bugs@isc.org)
  5. AC_CONFIG_SRCDIR(README)
  6. AM_INIT_AUTOMAKE
  7. AC_CONFIG_HEADERS([config.h])
  8. # Checks for programs.
  9. AC_PROG_CXX
  10. AC_PROG_CC
  11. AC_PROG_RANLIB
  12. m4_define([_AM_PYTHON_INTERPRETER_LIST], [python python3 python3.1])
  13. AM_PATH_PYTHON([3.1])
  14. # Checks for libraries.
  15. # Checks for header files.
  16. # Checks for typedefs, structures, and compiler characteristics.
  17. AC_HEADER_STDBOOL
  18. AC_TYPE_SIZE_T
  19. AC_MSG_CHECKING(for sa_len in struct sockaddr)
  20. AC_TRY_COMPILE([
  21. #include <sys/types.h>
  22. #include <sys/socket.h>],
  23. [struct sockaddr sa; sa.sa_len = 0; return (0);],
  24. [AC_MSG_RESULT(yes)
  25. AC_DEFINE(HAVE_SIN_LEN, 1, Define to 1 if sockaddr_in has a sin_len member)],
  26. AC_MSG_RESULT(no))
  27. #
  28. # Check availablity of gtest, which will be used for unit tests.
  29. #
  30. AC_ARG_WITH(gtest,
  31. [ --with-gtest=PATH specify a path to gtest header files (PATH/include) and library (PATH/lib)],
  32. gtest_path="$withval", gtest_path="no")
  33. if test "$gtest_path" != "no"
  34. then
  35. if test "$gtest_path" != "yes"; then
  36. GTEST_PATHS=$gtest_path
  37. else
  38. GTEST_PATHS="/usr /usr/local"
  39. fi
  40. GTEST_FOUND="false"
  41. for dir in $GTEST_PATHS; do
  42. if test -f "$dir/include/gtest/gtest.h"; then
  43. GTEST_INCLUDES="-I$dir/include"
  44. GTEST_LDFLAGS="-L$dir/lib"
  45. GTEST_LDADD="-lgtest"
  46. GTEST_FOUND="true"
  47. fi
  48. done
  49. if test $GTEST_FOUND != "true"; then
  50. AC_MSG_ERROR([Cannot find gtest in: $GTEST_PATHS])
  51. fi
  52. else
  53. GTEST_INCLUDES=
  54. GTEST_LDFLAGS=
  55. GTEST_LDADD=
  56. fi
  57. AM_CONDITIONAL(HAVE_GTEST, test $gtest_path != "no")
  58. AC_SUBST(GTEST_INCLUDES)
  59. AC_SUBST(GTEST_LDFLAGS)
  60. AC_SUBST(GTEST_LDADD)
  61. # Checks for library functions.
  62. AC_CONFIG_FILES([Makefile
  63. src/Makefile
  64. src/bin/Makefile
  65. src/bin/bigtool/Makefile
  66. src/bin/bind10/Makefile
  67. src/bin/host/Makefile
  68. src/bin/msgq/Makefile
  69. src/bin/parkinglot/Makefile
  70. src/lib/Makefile
  71. src/lib/cc/Makefile
  72. src/lib/cc/cpp/Makefile
  73. src/lib/dns/Makefile
  74. ])
  75. AC_OUTPUT([src/bin/bind-cfgd/bind-cfgd
  76. src/bin/bigtool/run_bigtool
  77. src/bin/bind10/bind10
  78. src/bin/msgq/msgq
  79. src/bin/msgq/msgq_test
  80. src/bin/parkinglot/config.h
  81. ], [
  82. chmod +x src/bin/bind-cfgd/bind-cfgd
  83. chmod +x src/bin/bigtool/run_bigtool
  84. chmod +x src/bin/bind10/bind10
  85. chmod +x src/bin/msgq/msgq
  86. chmod +x src/bin/msgq/msgq_test
  87. ])
  88. AC_OUTPUT