configure.ac 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. AC_PREREQ([2.53])
  2. AC_INIT([libdsm], [m4_esyscmd([./package_version.sh])],
  3. [], [libdsm], [])
  4. AC_CONFIG_HEADER(config.h)
  5. AC_CONFIG_SRCDIR([include/bdsm.h])
  6. AC_CONFIG_LIBOBJ_DIR([compat])
  7. AM_INIT_AUTOMAKE([1.6 foreign subdir-objects tar-ustar dist-zip])
  8. m4_ifdef([AM_SILENT_RULES], [
  9. AM_SILENT_RULES([yes])
  10. ])
  11. AC_CANONICAL_HOST
  12. BDSM_ABI_VERSION=m4_esyscmd([./abi_version.sh])
  13. BDSM_PACKAGE_VERSION=m4_esyscmd([./package_version.sh])
  14. BDSM_LIBTOOL_VERSION=m4_esyscmd([./abi_version.sh -libtool])
  15. AC_SUBST(BDSM_ABI_VERSION)
  16. AC_SUBST(BDSM_PACKAGE_VERSION)
  17. AC_SUBST(BDSM_LIBTOOL_VERSION)
  18. AC_MSG_NOTICE([dsm package version: $BDSM_PACKAGE_VERSION])
  19. AC_MSG_NOTICE([dsm ABI version: $BDSM_ABI_VERSION])
  20. AC_PROG_CC_C99
  21. AM_PROG_CC_C_O
  22. dnl Where is iconv? In libc or separate lib?
  23. AM_ICONV
  24. AC_ARG_ENABLE([programs],
  25. AS_HELP_STRING([--enable-programs], [Build additional programs [default=yes]])
  26. )
  27. AC_ARG_ENABLE([debug],
  28. AS_HELP_STRING([--enable-debug], [Additional debugging features [default=yes]])
  29. )
  30. AS_IF([test x"$enable_debug" != x"no"], [
  31. AC_DEFINE([BDSM_DEBUG], [1], [Enable debug message and compile flags])
  32. ])
  33. AM_CONDITIONAL([DEBUG], [test x"$enable_debug" != x"no"])
  34. AM_CONDITIONAL([PROGRAMS], [test x"$enable_programs" != x"no"])
  35. LT_INIT
  36. DOLT
  37. AC_CONFIG_MACRO_DIR([m4])
  38. ##############################
  39. ## Checks for the ASN.1 parser
  40. PKG_CHECK_MODULES([TASN1], [libtasn1])
  41. ## Check if it supports new types
  42. AC_MSG_CHECKING([whether libtasn1 version >= 3.0])
  43. CFLAGS="$CFLAGS $TASN1_CFLAGS"
  44. AC_COMPILE_IFELSE([
  45. AC_LANG_PROGRAM([#include <libtasn1.h>], [ asn1_node test; ])
  46. ], [
  47. AC_MSG_RESULT([yes])
  48. HAVE_TASN1_3PLUS=yes
  49. ], [
  50. AC_MSG_RESULT([no])
  51. HAVE_TASN1_3PLUS=no
  52. ])
  53. AM_CONDITIONAL([HAVE_TASN1_3PLUS],[test x$HAVE_TASN1_3PLUS = xyes])
  54. AS_IF([test x"$HAVE_TASN1_3PLUS" = x"yes"], [
  55. AC_DEFINE([HAVE_TASN1_3PLUS], [1], [libtasn1 has v 3.0 downcase types])
  56. dnl Ugly compatibility with old 2.x types
  57. AC_DEFINE([ASN1_ARRAY_TYPE], [asn1_static_node], [...])
  58. ], [
  59. dnl Ugly compatibility with new 3.x types
  60. AC_DEFINE([asn1_static_node], [ASN1_ARRAY_TYPE], [...])
  61. ])
  62. AC_SEARCH_LIBS([strlcpy], [bsd], [
  63. AC_DEFINE([HAVE_LIBBSD], [1], [Does this system have libbsd strl*** functions implementation])
  64. ])
  65. AC_REPLACE_FUNCS([strlcpy])
  66. AC_CHECK_HEADERS([bsd/string.h])
  67. AC_CHECK_HEADERS([langinfo.h])
  68. ## Configure random device path
  69. AC_ARG_WITH([urandom],
  70. [AS_HELP_STRING([--with-urandom=PATH],
  71. [Configure the path of the random generation device used @<:@default=/dev/urandom@:>@ ])],
  72. [], [with_urandom=/dev/urandom])
  73. AC_DEFINE_UNQUOTED([URANDOM], ["$with_urandom"], [Path of the random number generation device])
  74. ## Check for doxygen presence
  75. AC_CHECK_PROGS([DOXYGEN], [doxygen])
  76. AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
  77. if test -z "$DOXYGEN";
  78. then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
  79. else
  80. AC_CONFIG_FILES([doc/Doxyfile])
  81. fi
  82. AC_OUTPUT([
  83. Makefile
  84. libdsm.pc
  85. ])