configure.ac 6.1 KB

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