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