configure.ac 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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/pstat.h \
  93. linux/fiemap.h \
  94. ])
  95. # Checks for typedefs, structures, and compiler characteristics.
  96. AC_C_BIGENDIAN
  97. AC_C_CONST
  98. AC_C_INLINE
  99. AC_C_VOLATILE
  100. AC_TYPE_MODE_T
  101. AC_TYPE_PID_T
  102. AC_TYPE_SIZE_T
  103. DPKG_TYPES_U_INT_T
  104. DPKG_TYPE_PTRDIFF_T
  105. AC_CHECK_SIZEOF([unsigned int])
  106. AC_CHECK_SIZEOF([unsigned long])
  107. DPKG_DECL_SYS_SIGLIST
  108. DPKG_DECL_SYS_ERRLIST
  109. # Checks for library functions.
  110. DPKG_FUNC_VA_COPY
  111. DPKG_FUNC_C99_SNPRINTF
  112. DPKG_CHECK_DECL([offsetof], [stddef.h])
  113. DPKG_CHECK_DECL([makedev], [sys/types.h])
  114. DPKG_CHECK_DECL([WCOREDUMP], [sys/wait.h])
  115. DPKG_CHECK_DECL([TIOCNOTTY], [sys/ioctl.h])
  116. DPKG_CHECK_DECL([O_NOFOLLOW], [fcntl.h])
  117. DPKG_CHECK_DECL([F_ALLOCSP64], [fcntl.h])
  118. DPKG_CHECK_DECL([F_PREALLOCATE], [fcntl.h])
  119. DPKG_CHECK_DECL([P_tmpdir], [stdio.h])
  120. DPKG_CHECK_PROGNAME
  121. DPKG_CHECK_COMPAT_FUNCS([\
  122. getopt \
  123. getopt_long \
  124. obstack_free \
  125. strnlen \
  126. strndup \
  127. strerror \
  128. strsignal \
  129. asprintf \
  130. scandir \
  131. alphasort \
  132. unsetenv \
  133. ])
  134. AC_CHECK_FUNCS([memcpy lchown],
  135. [], [AC_MSG_ERROR([missing required function])])
  136. AC_CHECK_FUNCS([\
  137. strtoimax \
  138. isascii \
  139. setsid \
  140. getdtablesize \
  141. getprogname \
  142. getexecname \
  143. lutimes \
  144. fallocate \
  145. posix_fallocate \
  146. posix_fadvise \
  147. ])
  148. DPKG_MMAP
  149. # Checks for the build machinery.
  150. AC_DEFINE([LIBDPKG_VOLATILE_API], [1], [Acknowledge the volatility of the API.])
  151. DPKG_COMPILER_WARNINGS
  152. DPKG_COMPILER_OPTIMIZATIONS
  153. DPKG_LINKER_OPTIMIZATIONS
  154. DPKG_ARCHITECTURE
  155. AC_DEFINE([PACKAGE_RELEASE], [PACKAGE_VERSION " (" ARCHITECTURE ")"],
  156. [Define the project release information, version and architecture])
  157. AC_CONFIG_FILES([
  158. Makefile
  159. dpkg-deb/Makefile
  160. dpkg-split/Makefile
  161. dselect/Makefile
  162. dselect/methods/Makefile
  163. dselect/po/Makefile.in
  164. lib/Makefile
  165. lib/compat/Makefile
  166. lib/dpkg/Makefile
  167. lib/dpkg/libdpkg.pc
  168. lib/dpkg/t/Makefile
  169. doc/Doxyfile
  170. man/Makefile
  171. po/Makefile.in
  172. scripts/Makefile
  173. scripts/mk/Makefile
  174. scripts/po/Makefile.in
  175. src/Makefile
  176. utils/Makefile
  177. ])
  178. AC_CONFIG_HEADERS([config.h])
  179. AC_OUTPUT
  180. # Print the current configuration
  181. cat <<CONFIG
  182. Configuration:
  183. Features:
  184. native language support . . . : $USE_NLS
  185. unicode support . . . . . . . : $USE_UNICODE
  186. development documentation . . : $build_devel_docs
  187. code coverage . . . . . . . . : $enable_coverage
  188. build shared libraries . . . : $enable_shared
  189. mmap loaders . . . . . . . . : $enable_mmap
  190. default dpkg-deb compressor . : $with_dpkg_deb_compressor
  191. Paths:
  192. devlibdir . . . . . . . . . . : $devlibdir
  193. pkgconfdir . . . . . . . . . : $pkgconfdir
  194. admindir . . . . . . . . . . : $admindir
  195. logdir . . . . . . . . . . . : $logdir
  196. perl interpreter . . . . . . : $PERL
  197. perl libdir . . . . . . . . . : $PERL_LIBDIR
  198. Programs:
  199. update-alternatives . . . . . : $build_update_alternatives
  200. start-stop-daemon . . . . . . : $build_start_stop_daemon
  201. dselect . . . . . . . . . . . : $build_dselect
  202. System Libraries:
  203. libps . . . . . . . . . . . . : ${have_libps:-no}
  204. libkvm . . . . . . . . . . . : ${have_libkvm:-no}
  205. libselinux . . . . . . . . . : $have_libselinux
  206. libmd . . . . . . . . . . . . : $have_libmd
  207. libz . . . . . . . . . . . . : $have_libz
  208. liblzma . . . . . . . . . . . : $have_liblzma
  209. libbz2 . . . . . . . . . . . : $have_libbz2
  210. libcurses . . . . . . . . . . : ${have_libcurses:-no}
  211. CONFIG