configure.ac 6.5 KB

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