configure.ac 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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([
  15. AM_GNU_GETTEXT_REQUIRE_VERSION
  16. ], [
  17. AM_GNU_GETTEXT_REQUIRE_VERSION([0.19])
  18. ])
  19. # We cannot remove the following macro due to backwards compatibility reasons.
  20. # In the future when the gettext version is bumped, we have to set the above
  21. # macro unconditionally to the minimal version, and set the below to 0.19.6,
  22. # the first version introducing the AM_GNU_GETTEXT_REQUIRE_VERSION macro.
  23. AM_GNU_GETTEXT_VERSION([0.19])
  24. AM_GNU_GETTEXT([external])
  25. DPKG_DIST_CHECK([test "$GMSGFMT" = ":" && test "$USE_NLS" = "yes"],
  26. [gettext required when NLS support enabled])
  27. # Shared libraries are disabled on purpose, currently there is no ABI stability
  28. # guarantee, and it will be broken at will. The infrastructure is in place just
  29. # to be able to test that its future activation will work.
  30. AM_PROG_AR
  31. LT_INIT([disable-shared])
  32. DPKG_BUILD_SHARED_LIBS
  33. DPKG_LINKER_VERSION_SCRIPT
  34. # Allow compilation without optional programs
  35. DPKG_BUILD_PROG([dselect])
  36. DPKG_BUILD_PROG([start-stop-daemon])
  37. DPKG_BUILD_PROG([update-alternatives])
  38. DPKG_BUILD_RELEASE_DATE
  39. DPKG_BUILD_DEVEL_DOCS
  40. # Allow alternate directories
  41. DPKG_WITH_DIR([devlibdir], [${libdir}],
  42. [dpkg development library directory [LIBDIR]])
  43. DPKG_WITH_DIR([pkgconfdir], [${sysconfdir}/${PACKAGE_NAME}],
  44. [dpkg configuration directory [SYSCONFDIR/dpkg]])
  45. DPKG_WITH_DIR([admindir], [${localstatedir}/lib/${PACKAGE_NAME}],
  46. [dpkg database directory [LOCALSTATEDIR/lib/dpkg]])
  47. DPKG_WITH_DIR([logdir], [${localstatedir}/log],
  48. [system logging directory [LOCALSTATEDIR/log]])
  49. # Set default dpkg-deb values
  50. DPKG_DEB_COMPRESSOR([xz])
  51. DPKG_DEB_PROG_TAR
  52. # Checks for programs.
  53. AC_PROG_CC
  54. DPKG_C_C99
  55. AC_PROG_CXX
  56. DPKG_CXX_CXX11
  57. AC_CHECK_PROGS([DOXYGEN], [doxygen])
  58. AC_CHECK_PROG([HAVE_DOT], [dot], [YES], [NO])
  59. DPKG_PROG_PO4A
  60. DPKG_PROG_PERL
  61. DPKG_PROG_POD2MAN
  62. DPKG_CODE_COVERAGE
  63. # Checks for operating system services and capabilities.
  64. AC_SYS_LARGEFILE
  65. # Checks for libraries.
  66. DPKG_LIB_MD
  67. DPKG_LIB_Z
  68. DPKG_LIB_BZ2
  69. DPKG_LIB_LZMA
  70. DPKG_LIB_SELINUX
  71. AS_IF([test "x$build_dselect" = "xyes"], [
  72. DPKG_LIB_CURSES
  73. ])
  74. AS_IF([test "x$build_start_stop_daemon" = "xyes"], [
  75. DPKG_LIB_PS
  76. DPKG_LIB_KVM
  77. ])
  78. # Checks for header files.
  79. AC_HEADER_STDC
  80. AC_CHECK_HEADERS([\
  81. stddef.h \
  82. error.h \
  83. err.h \
  84. locale.h \
  85. libintl.h \
  86. kvm.h \
  87. sys/param.h \
  88. sys/sysctl.h \
  89. sys/syscall.h \
  90. sys/user.h \
  91. sys/proc.h \
  92. sys/procfs.h \
  93. sys/pstat.h \
  94. linux/fiemap.h \
  95. ])
  96. # Checks for typedefs, structures, and compiler characteristics.
  97. AC_C_BIGENDIAN
  98. AC_C_CONST
  99. AC_C_INLINE
  100. AC_C_VOLATILE
  101. AC_TYPE_MODE_T
  102. AC_TYPE_PID_T
  103. AC_TYPE_SIZE_T
  104. DPKG_TYPES_U_INT_T
  105. DPKG_TYPE_PTRDIFF_T
  106. AC_CHECK_SIZEOF([unsigned int])
  107. AC_CHECK_SIZEOF([unsigned long])
  108. DPKG_DECL_SYS_SIGLIST
  109. DPKG_DECL_SYS_ERRLIST
  110. # Checks for library functions.
  111. DPKG_FUNC_VA_COPY
  112. DPKG_FUNC_C99_SNPRINTF
  113. DPKG_CHECK_DECL([offsetof], [stddef.h])
  114. DPKG_CHECK_DECL([makedev], [sys/types.h])
  115. DPKG_CHECK_DECL([WCOREDUMP], [sys/wait.h])
  116. DPKG_CHECK_DECL([TIOCNOTTY], [sys/ioctl.h])
  117. DPKG_CHECK_DECL([O_NOFOLLOW], [fcntl.h])
  118. DPKG_CHECK_DECL([F_ALLOCSP64], [fcntl.h])
  119. DPKG_CHECK_DECL([F_PREALLOCATE], [fcntl.h])
  120. DPKG_CHECK_DECL([P_tmpdir], [stdio.h])
  121. DPKG_CHECK_PROGNAME
  122. DPKG_CHECK_COMPAT_FUNCS([\
  123. getopt \
  124. getopt_long \
  125. obstack_free \
  126. strnlen \
  127. strndup \
  128. strerror \
  129. strsignal \
  130. asprintf \
  131. scandir \
  132. alphasort \
  133. unsetenv \
  134. ])
  135. AC_CHECK_FUNCS([memcpy lchown],
  136. [], [AC_MSG_ERROR([missing required function])])
  137. AC_CHECK_FUNCS([\
  138. strtoimax \
  139. isascii \
  140. setsid \
  141. getdtablesize \
  142. getprogname \
  143. getexecname \
  144. lutimes \
  145. fallocate \
  146. posix_fallocate \
  147. posix_fadvise \
  148. ])
  149. DPKG_MMAP
  150. # Checks for the build machinery.
  151. AC_DEFINE([LIBDPKG_VOLATILE_API], [1], [Acknowledge the volatility of the API.])
  152. DPKG_COMPILER_WARNINGS
  153. DPKG_COMPILER_OPTIMIZATIONS
  154. DPKG_LINKER_OPTIMIZATIONS
  155. DPKG_ARCHITECTURE
  156. AC_DEFINE([PACKAGE_RELEASE], [PACKAGE_VERSION " (" ARCHITECTURE ")"],
  157. [Define the project release information, version and architecture])
  158. AC_CONFIG_TESTDIR([t-func])
  159. AM_MISSING_PROG([AUTOM4TE], [autom4te])
  160. AC_CONFIG_FILES([
  161. Makefile
  162. t-func/Makefile
  163. t-func/atlocal
  164. dpkg-deb/Makefile
  165. dpkg-split/Makefile
  166. dselect/Makefile
  167. dselect/methods/Makefile
  168. dselect/po/Makefile.in
  169. lib/Makefile
  170. lib/compat/Makefile
  171. lib/dpkg/Makefile
  172. lib/dpkg/libdpkg.pc
  173. lib/dpkg/t/Makefile
  174. doc/Doxyfile
  175. man/Makefile
  176. po/Makefile.in
  177. scripts/Makefile
  178. scripts/mk/Makefile
  179. scripts/po/Makefile.in
  180. src/Makefile
  181. utils/Makefile
  182. ])
  183. AC_CONFIG_HEADERS([config.h])
  184. AC_OUTPUT
  185. # Print the current configuration
  186. cat <<CONFIG
  187. Configuration:
  188. Features:
  189. native language support . . . : $USE_NLS
  190. unicode support . . . . . . . : $USE_UNICODE
  191. development documentation . . : $build_devel_docs
  192. code coverage . . . . . . . . : $enable_coverage
  193. build shared libraries . . . : $enable_shared
  194. mmap loaders . . . . . . . . : $enable_mmap
  195. default dpkg-deb compressor . : $with_dpkg_deb_compressor
  196. Paths:
  197. devlibdir . . . . . . . . . . : $devlibdir
  198. pkgconfdir . . . . . . . . . : $pkgconfdir
  199. admindir . . . . . . . . . . : $admindir
  200. logdir . . . . . . . . . . . : $logdir
  201. perl interpreter . . . . . . : $PERL
  202. perl libdir . . . . . . . . . : $PERL_LIBDIR
  203. Programs:
  204. update-alternatives . . . . . : $build_update_alternatives
  205. start-stop-daemon . . . . . . : $build_start_stop_daemon
  206. dselect . . . . . . . . . . . : $build_dselect
  207. System Libraries:
  208. libps . . . . . . . . . . . . : ${have_libps:-no}
  209. libkvm . . . . . . . . . . . : ${have_libkvm:-no}
  210. libselinux . . . . . . . . . : $have_libselinux
  211. libmd . . . . . . . . . . . . : $have_libmd
  212. libz . . . . . . . . . . . . : $have_libz
  213. liblzma . . . . . . . . . . . : $have_liblzma
  214. libbz2 . . . . . . . . . . . : $have_libbz2
  215. libcurses . . . . . . . . . . : ${have_libcurses:-no}
  216. CONFIG