configure.ac 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. # Process this file with autoconf to produce a configure script.
  2. m4_pattern_forbid([^_?DPKG_])
  3. AC_PREREQ(2.60)
  4. AC_INIT([dpkg], m4_esyscmd([./get-version]), [debian-dpkg@lists.debian.org])
  5. AC_SUBST([PACKAGE_COPYRIGHT_HOLDER], ['Dpkg Developers'])
  6. AC_CONFIG_SRCDIR([lib/dpkg/dpkg.h])
  7. AC_CONFIG_MACRO_DIR([m4])
  8. AC_CONFIG_AUX_DIR([build-aux])
  9. AC_USE_SYSTEM_EXTENSIONS
  10. AM_INIT_AUTOMAKE([1.11 -Wall foreign nostdinc no-dist-gzip dist-xz])
  11. AM_SILENT_RULES([yes])
  12. # Do not unconditionally use the following macro, as Debian jessie does not
  13. # have a recent enough gettext.
  14. m4_ifdef([AM_GNU_GETTEXT_REQUIRE_VERSION],
  15. [AM_GNU_GETTEXT_REQUIRE_VERSION([0.19])])
  16. # We cannot remove the following macro due to backwards compatibility reasons.
  17. # In the future when the gettext version is bumped, we have to set the above
  18. # macro unconditionally to the minimal version, and set the below to 0.19.6,
  19. # the first version introducing the AM_GNU_GETTEXT_REQUIRE_VERSION macro.
  20. AM_GNU_GETTEXT_VERSION([0.19])
  21. AM_GNU_GETTEXT([external])
  22. DPKG_DIST_CHECK([test "$GMSGFMT" = ":" && test "$USE_NLS" = "yes"],
  23. [gettext required when NLS support enabled])
  24. # Shared libraries are disabled on purpose, currently there is no ABI stability
  25. # guarantee, and it will be broken at will. The infrastructure is in place just
  26. # to be able to test that its future activation will work.
  27. AM_PROG_AR
  28. LT_INIT([disable-shared])
  29. DPKG_BUILD_SHARED_LIBS
  30. DPKG_LINKER_VERSION_SCRIPT
  31. # Allow compilation without optional programs
  32. DPKG_BUILD_PROG([dselect])
  33. DPKG_BUILD_PROG([start-stop-daemon])
  34. DPKG_BUILD_PROG([update-alternatives])
  35. DPKG_BUILD_DEVEL_DOCS
  36. # Allow alternate directories
  37. DPKG_WITH_DIR([devlibdir], [${libdir}],
  38. [dpkg development library directory [LIBDIR]])
  39. DPKG_WITH_DIR([pkgconfdir], [${sysconfdir}/${PACKAGE_NAME}],
  40. [dpkg configuration directory [SYSCONFDIR/dpkg]])
  41. DPKG_WITH_DIR([admindir], [${localstatedir}/lib/${PACKAGE_NAME}],
  42. [dpkg database directory [LOCALSTATEDIR/lib/dpkg]])
  43. DPKG_WITH_DIR([logdir], [${localstatedir}/log],
  44. [system logging directory [LOCALSTATEDIR/log]])
  45. # Set default dpkg-deb values
  46. DPKG_DEB_COMPRESSOR([xz])
  47. DPKG_DEB_PROG_TAR
  48. # Checks for programs.
  49. AC_PROG_CC
  50. DPKG_C_C99
  51. AC_PROG_CXX
  52. DPKG_CXX_CXX11
  53. AC_PROG_LEX
  54. DPKG_DIST_CHECK([test "$LEX" = ":"], [lex program required])
  55. AC_CHECK_PROGS([DOXYGEN], [doxygen])
  56. AC_CHECK_PROG([HAVE_DOT], [dot], [YES], [NO])
  57. DPKG_PROG_PO4A
  58. DPKG_PROG_PERL
  59. DPKG_PROG_POD2MAN
  60. DPKG_CODE_COVERAGE
  61. # Checks for operating system services and capabilities.
  62. AC_SYS_LARGEFILE
  63. # Checks for libraries.
  64. DPKG_LIB_MD
  65. DPKG_LIB_ZLIB
  66. DPKG_LIB_BZ2
  67. DPKG_LIB_LZMA
  68. DPKG_LIB_SELINUX
  69. if test "x$build_dselect" = "xyes"; then
  70. DPKG_LIB_CURSES
  71. fi
  72. if test "x$build_start_stop_daemon" = "xyes"; then
  73. DPKG_LIB_SSD
  74. fi
  75. # Checks for header files.
  76. AC_HEADER_STDC
  77. AC_CHECK_HEADERS([stddef.h error.h err.h locale.h libintl.h kvm.h \
  78. sys/param.h sys/sysctl.h sys/syscall.h sys/user.h \
  79. sys/proc.h sys/pstat.h linux/fiemap.h])
  80. # Checks for typedefs, structures, and compiler characteristics.
  81. AC_C_BIGENDIAN
  82. AC_C_CONST
  83. AC_C_INLINE
  84. AC_C_VOLATILE
  85. AC_TYPE_MODE_T
  86. AC_TYPE_PID_T
  87. AC_TYPE_SIZE_T
  88. DPKG_TYPES_U_INT_T
  89. DPKG_TYPE_PTRDIFF_T
  90. AC_CHECK_SIZEOF([unsigned int])
  91. AC_CHECK_SIZEOF([unsigned long])
  92. DPKG_DECL_SYS_SIGLIST
  93. DPKG_DECL_SYS_ERRLIST
  94. # Checks for library functions.
  95. DPKG_FUNC_VA_COPY
  96. DPKG_FUNC_C99_SNPRINTF
  97. DPKG_CHECK_DECL([offsetof], [stddef.h])
  98. DPKG_CHECK_DECL([makedev], [sys/types.h])
  99. DPKG_CHECK_DECL([WCOREDUMP], [sys/wait.h])
  100. DPKG_CHECK_DECL([TIOCNOTTY], [sys/ioctl.h])
  101. DPKG_CHECK_DECL([O_NOFOLLOW], [fcntl.h])
  102. DPKG_CHECK_DECL([F_ALLOCSP64], [fcntl.h])
  103. DPKG_CHECK_DECL([F_PREALLOCATE], [fcntl.h])
  104. DPKG_CHECK_DECL([P_tmpdir], [stdio.h])
  105. DPKG_CHECK_PROGNAME
  106. DPKG_CHECK_COMPAT_FUNCS([getopt getopt_long obstack_free \
  107. strnlen strndup strerror strsignal asprintf \
  108. scandir alphasort unsetenv])
  109. AC_CHECK_FUNCS([memcpy lchown],
  110. [], [AC_MSG_ERROR([missing required function])])
  111. AC_CHECK_FUNCS([strtoimax isascii setsid getdtablesize \
  112. getprogname getexecname lutimes \
  113. fallocate posix_fallocate posix_fadvise])
  114. DPKG_MMAP
  115. # Checks for the build machinery.
  116. AC_DEFINE(LIBDPKG_VOLATILE_API, 1, [Acknowledge the volatility of the API.])
  117. DPKG_COMPILER_WARNINGS
  118. DPKG_COMPILER_OPTIMISATIONS
  119. DPKG_LINKER_OPTIMISATIONS
  120. DPKG_ARCHITECTURE
  121. AC_DEFINE([PACKAGE_RELEASE], [PACKAGE_VERSION " (" ARCHITECTURE ")"],
  122. [Define the project release information, version and architecture])
  123. AC_CONFIG_FILES([ Makefile
  124. dpkg-deb/Makefile
  125. dpkg-split/Makefile
  126. dselect/Makefile
  127. dselect/methods/Makefile
  128. dselect/po/Makefile.in
  129. lib/Makefile
  130. lib/compat/Makefile
  131. lib/dpkg/Makefile
  132. lib/dpkg/libdpkg.pc
  133. lib/dpkg/t/Makefile
  134. doc/Doxyfile
  135. man/Makefile
  136. po/Makefile.in
  137. scripts/Makefile
  138. scripts/mk/Makefile
  139. scripts/po/Makefile.in
  140. src/Makefile
  141. utils/Makefile ])
  142. AC_CONFIG_HEADERS([config.h])
  143. AC_OUTPUT