configure.ac 6.7 KB

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