configure.ac 6.7 KB

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