1# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2m4_define([version_major], [2]) 3m4_define([version_minor], [1]) 4 5AC_INIT([libabigail], 6 [version_major.version_minor], 7 [http://sourceware.org/bugzilla], 8 [libabigail], 9 [http://sourceware.org/libabigail]) 10 11AC_PREREQ([2.63]) 12AC_CONFIG_AUX_DIR([build-aux]) 13AC_CONFIG_HEADERS([config.h]) 14AC_CONFIG_SRCDIR([README]) 15AC_CONFIG_MACRO_DIR([m4]) 16 17dnl Include some autoconf macros to check for python modules. 18dnl 19dnl These macros are coming from the autoconf archive at 20dnl http://www.gnu.org/software/autoconf-archive 21 22dnl This one is for the AX_CHECK_PYTHON_MODULES() macro. 23m4_include([autoconf-archive/ax_check_python_modules.m4]) 24 25dnl These two below are for the AX_PROG_PYTHON_VERSION() module. 26m4_include([autoconf-archive/ax_compare_version.m4]) 27m4_include([autoconf-archive/ax_prog_python_version.m4]) 28 29dnl This one is to be able to run "make check-valgrind" 30dnl and have unit tests run under der Valgrind. 31m4_include([autoconf-archive/ax_valgrind_check.m4]) 32 33AM_INIT_AUTOMAKE([1.11.1 foreign subdir-objects tar-ustar parallel-tests]) 34AM_MAINTAINER_MODE([enable]) 35 36AM_SILENT_RULES([yes]) 37 38VERSION_MAJOR=version_major 39VERSION_MINOR=version_minor 40VERSION_REVISION=0 41ABIXML_VERSION_MAJOR=2 42ABIXML_VERSION_MINOR=1 43 44AC_SUBST(VERSION_MAJOR) 45AC_SUBST(VERSION_MINOR) 46AC_SUBST(VERSION_REVISION) 47AC_SUBST(ABIXML_VERSION_MAJOR) 48AC_SUBST(ABIXML_VERSION_MINOR) 49 50dnl This VERSION_SUFFIX environment variable is to allow appending 51dnl arbitrary text to the libabigail version string representation. 52dnl That is useful to identify custom versions of the library 53dnl (e.g. development versions or versions of a particular origin). 54dnl 55dnl The feature can be enabled by passing VERSION_SUFFIX to `configure`, 56dnl e.g. 57dnl 58dnl $ configure VERSION_SUFFIX="-dev" 59AC_SUBST(VERSION_SUFFIX) 60 61AC_ARG_ENABLE(rpm, 62 AS_HELP_STRING([--enable-rpm=yes|no|auto], 63 [enable the support of rpm in abipkgdiff (default is auto)]), 64 ENABLE_RPM=$enableval, 65 ENABLE_RPM=auto) 66 67# '--enable-rpm415' option name preserved for backwards compatibility. 68AC_ARG_ENABLE(rpm415, 69 AS_HELP_STRING([--enable-rpm415=yes|no|auto], 70 [enable rpm/zstd in abipkgdiff testing (default is auto)]), 71 ENABLE_RPM_ZSTD=$enableval, 72 ENABLE_RPM_ZSTD=auto) 73 74AC_ARG_ENABLE(debug-self-comparison, 75 AS_HELP_STRING([--enable-debug-self-comparison=yes|no], 76 [enable debugging of self comparison with 'abidw --debug-abidiff'(default is no)]), 77 ENABLE_DEBUG_SELF_COMPARISON=$enableval, 78 ENABLE_DEBUG_SELF_COMPARISON=no) 79 80AC_ARG_ENABLE(debug-type-canonicalization, 81 AS_HELP_STRING([--enable-debug-type-canonicalization=yes|no], 82 [enable debugging of type canonicalization 'abidw --debug-tc'(default is no)]), 83 ENABLE_DEBUG_TYPE_CANONICALIZATION=$enableval, 84 ENABLE_DEBUG_TYPE_CANONICALIZATION=no) 85 86AC_ARG_ENABLE(show-type-use-in-abilint, 87 AS_HELP_STRING([--enable-show-type-use-in-abilint=yes|no], 88 ['enable abilint --show-type-use'(default is no)]), 89 ENABLE_SHOW_TYPE_USE_IN_ABILINT=$enableval, 90 ENABLE_SHOW_TYPE_USE_IN_ABILINT=no) 91 92AC_ARG_ENABLE(deb, 93 AS_HELP_STRING([--enable-deb=yes|no|auto], 94 [enable the support of deb in abipkgdiff (default is auto)]), 95 ENABLE_DEB=$enableval, 96 ENABLE_DEB=auto) 97 98AC_ARG_ENABLE(tar, 99 AS_HELP_STRING([--enable-tar=yes|no|auto], 100 [enable the support of GNU tar archives in abipkgdiff (default is auto)]), 101 ENABLE_TAR=$enableval, 102 ENABLE_TAR=auto) 103 104AC_ARG_ENABLE(apidoc, 105 AS_HELP_STRING([--enable-apidoc=yes|no|auto], 106 [enable generation of the apidoc in html]), 107 ENABLE_APIDOC=$enableval, 108 ENABLE_APIDOC=auto) 109 110AC_ARG_ENABLE(manual, 111 AS_HELP_STRING([--enable-manual=yes|no|auto], 112 [enable generation of the manual in html]), 113 ENABLE_MANUAL=$enableval, 114 ENABLE_MANUAL=auto) 115 116AC_ARG_ENABLE([bash-completion], 117 AS_HELP_STRING([--enable-bash-completion=yes|no|auto], 118 [enable using completion files for tools]), 119 ENABLE_BASH_COMPLETION=$enableval, 120 ENABLE_BASH_COMPLETION=auto) 121 122AC_ARG_ENABLE([fedabipkgdiff], 123 AS_HELP_STRING([--enable-fedabipkgdiff=yes|no|auto], 124 [enable the fedabipkgdiff tool]), 125 ENABLE_FEDABIPKGDIFF=$enableval, 126 ENABLE_FEDABIPKGDIFF=auto) 127 128AC_ARG_ENABLE([python3], 129 AS_HELP_STRING([--enable-python3=yes|no|auto], 130 [enable running abigail tools with python3 (default is auto)]), 131 ENABLE_PYTHON3=$enableval, 132 ENABLE_PYTHON3=auto) 133 134AC_ARG_ENABLE(asan, 135 AS_HELP_STRING([--enable-asan=yes|no], 136 [enable the support of building with -fsanitize=address)]), 137 ENABLE_ASAN=$enableval, 138 ENABLE_ASAN=no) 139 140AC_ARG_ENABLE(msan, 141 AS_HELP_STRING([--enable-msan=yes|no], 142 [enable the support of building with -fsanitize=memory)]), 143 ENABLE_MSAN=$enableval, 144 ENABLE_MSAN=no) 145 146AC_ARG_ENABLE(tsan, 147 AS_HELP_STRING([--enable-tsan=yes|no], 148 [enable the support of building with -fsanitize=thread)]), 149 ENABLE_TSAN=$enableval, 150 ENABLE_TSAN=no) 151 152AC_ARG_ENABLE(ubsan, 153 AS_HELP_STRING([--enable-ubsan=yes|no], 154 [enable the support of building with -fsanitize=undefined)]), 155 ENABLE_UBSAN=$enableval, 156 ENABLE_UBSAN=no) 157 158dnl check if user has enabled CTF code 159AC_ARG_ENABLE(ctf, 160 AS_HELP_STRING([--enable-ctf=yes|no], 161 [disable support of ctf files)]), 162 ENABLE_CTF=$enableval, 163 ENABLE_CTF=no) 164 165AC_ARG_ENABLE(cxx17, 166 AS_HELP_STRING([--enable-cxx17=yes|no], 167 [enable features that use the C++17 compiler]), 168 ENABLE_CXX17=$enableval, 169 ENABLE_CXX17=no) 170 171dnl ************************************************* 172dnl check for dependencies 173dnl ************************************************* 174 175AC_PROG_CXX 176AC_CANONICAL_HOST 177AC_USE_SYSTEM_EXTENSIONS 178AC_PROG_INSTALL 179 180LT_PREREQ([2.2]) 181LT_INIT 182 183AC_LANG([C++]) 184AC_LANG_COMPILER_REQUIRE 185 186dnl 187dnl We use C++11 or C++17 if enabled 188dnl 189CXX_STANDARD=c++11 190 191dnl 192dnl check if the c++ compiler has support __attribute__((visibility("hidden"))) 193dnl 194AC_MSG_NOTICE([checking for GCC visibility attribute support ...]) 195AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 196struct __attribute__((visibility("hidden"))) Foo 197{ 198 int m0; 199 200 Foo() 201 : m0() 202 {} 203}; 204 ]])], 205 [SUPPORTS_GCC_VISIBILITY_ATTRIBUTE=yes], 206 [SUPPORTS_GCC_VISIBILITY_ATTRIBUTE=no] 207) 208 209if test x$SUPPORTS_GCC_VISIBILITY_ATTRIBUTE = xyes; then 210 AC_MSG_NOTICE([GCC visibility attribute is supported]) 211 AC_DEFINE([HAS_GCC_VISIBILITY_ATTRIBUTE], 1, 212 [Defined if the compiler supports the attribution visibility syntax __attribute__((visibility("hidden")))]) 213 VISIBILITY_FLAGS="-fvisibility=hidden" 214else 215 AC_MSG_NOTICE([GCC visibility attribute is not supported]) 216 VISIBILITY_FLAGS= 217fi 218 219AC_SUBST(VISIBILITY_FLAGS) 220 221dnl Older glibc had a broken fts that didn't work with Large File Systems. 222dnl We want the version that can handler LFS, but include workaround if we 223dnl get a bad one. Add define to CFLAGS (not AC_DEFINE it) since we need to 224dnl check it before including config.h (which might define _FILE_OFFSET_BITS). 225AC_CACHE_CHECK([whether including fts.h with _FILE_OFFSET_BITS set breaks], ac_cv_bad_fts, 226 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ 227 #define _FILE_OFFSET_BITS 64 228 #include <fts.h> 229 ]])], 230 ac_cv_bad_fts=no, ac_cv_bad_fts=yes)]) 231AS_IF([test "x$ac_cv_bad_fts" = "xyes"], 232 [CFLAGS="$CFLAGS -DBAD_FTS=1", 233 CXXFLAGS="$CXXFLAGS -DBAD_FTS=1"]) 234 235dnl On musl, we need to find fts-standalone 236AS_CASE( 237 [${host_os}], [*-musl*], [ 238 PKG_CHECK_MODULES([FTS], [fts-standalone]) 239]) 240 241dnl Check for dependency: libelf, libdw, libebl (elfutils) 242dnl Note that we need to use at least elfutils 0.159 but 243dnl at that time elfutils didnt have pkgconfig capabilities 244dnl to easily query for its version. 245ELF_LIBS= 246AC_CHECK_LIB([elf], [elf_end], [ELF_LIBS="-lelf"]) 247AC_CHECK_HEADER([libelf.h], 248 [], 249 [AC_MSG_ERROR([could not find libelf.h])]) 250 251DW_LIBS= 252AC_CHECK_LIB(dw, dwfl_begin, [DW_LIBS=-ldw]) 253AC_CHECK_LIB(dw, dwarf_getalt, 254 [FOUND_DWARF_GETALT_IN_LIBDW=yes], 255 [FOUND_DWARF_GETALT_IN_LIBDW=no]) 256 257AC_CHECK_HEADER(elfutils/libdwfl.h, 258 [], 259 [AC_MSG_ERROR([could not find elfutils/libdwfl.h installed])]) 260 261dnl Allow users to compile with the NDEBUG macro defined, 262dnl meaning they are compiling in a mode where the 263dnl assert call does nothing. With the directive below, 264dnl users just need to pass the --disable-assert 265dnl option to configure. 266AC_HEADER_ASSERT 267 268if test x$ELF_LIBS = x; then 269 AC_MSG_ERROR([could not find elfutils elf library installed]) 270fi 271 272if test x$DW_LIBS = x; then 273 AC_MSG_ERROR([could not find elfutils dwarf library installed]) 274fi 275 276if test x$FOUND_DWARF_GETALT_IN_LIBDW = xyes; then 277 AC_DEFINE([LIBDW_HAS_DWARF_GETALT], 1, 278 [Defined if libdw has the function dwarf_getalt]) 279fi 280 281AC_SUBST(DW_LIBS) 282AC_SUBST([ELF_LIBS]) 283 284dnl check for libctf presence if CTF code has been enabled by command line 285dnl argument, and then define CTF flag (to build CTF file code) if libctf is 286dnl found on the system 287CTF_LIBS= 288if test x$ENABLE_CTF = xyes; then 289 LIBCTF= 290 AC_CHECK_LIB(ctf, ctf_open, [LIBCTF=yes], [LIBCTF=no]) 291 if test x$LIBCTF = xyes; then 292 AC_MSG_NOTICE([activating CTF code]) 293 AC_DEFINE([WITH_CTF], 1, 294 [Defined if user enables and system has the libctf library]) 295 CTF_LIBS=-lctf 296 else 297 AC_MSG_NOTICE([CTF enabled but no libctf found]) 298 ENABLE_CTF=no 299 fi 300fi 301 302dnl Check for dependency: libxml 303LIBXML2_VERSION=2.6.22 304PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_VERSION) 305 306AC_SUBST(LIBXML2_VERSION) 307AC_SUBST(XML_LIBS) 308AC_SUBST(XML_CFLAGS) 309 310dnl Check for some programs like rm, mkdir, etc ... 311AC_CHECK_PROG(HAS_RM, rm, yes, no) 312if test x$HAS_RM = xno; then 313 AC_MSG_ERROR([could not find the program 'rm' installed]) 314fi 315 316AC_CHECK_PROG(HAS_MKDIR, mkdir, yes, no) 317if test x$HAS_MKDIR = xno; then 318 AC_MSG_ERROR([could not find the program 'mkdir' installed]) 319fi 320 321dnl Check for the rpm2cpio and cpio programs 322if test x$ENABLE_RPM = xyes -o x$ENABLE_RPM = xauto; then 323 AC_CHECK_PROG(HAS_RPM2CPIO, rpm2cpio, yes, no) 324 AC_CHECK_PROG(HAS_CPIO, cpio, yes, no) 325 AC_CHECK_PROG(HAS_RPM, rpm, yes, no) 326 327 if test x$HAS_RPM2CPIO = xyes -a x$HAS_CPIO = xyes -a x$HAS_RPM = xyes; then 328 ENABLE_RPM=yes 329 else 330 if test x$ENABLE_RPM = xyes; then 331 AC_MSG_ERROR([rpm support in abipkgdiff needs 'rpm2cpio', 'cpio' and 'rpm' programs to be installed]) 332 fi 333 ENABLE_RPM=no 334 fi 335fi 336 337dnl Point to a rpm/zstd file, that is: 338dnl $ rpm -qp --qf '%{PAYLOADCOMPRESSOR}\n' [rpm_zstd_file] 339dnl zstd 340m4_define([rpm_zstd_file], [tests/data/test-diff-pkg/mesa-libGLU-9.0.1-3.fc33.x86_64.rpm]) 341AC_CONFIG_SRCDIR([rpm_zstd_file]) 342if test x$ENABLE_RPM_ZSTD = xyes -o x$ENABLE_RPM_ZSTD = xauto; then 343 if test x$ENABLE_RPM = xno; then 344 if test x$ENABLE_RPM_ZSTD = xyes; then 345 AC_MSG_ERROR([rpm/zstd support needs rpm support]) 346 fi 347 ENABLE_RPM_ZSTD=n/a 348 else 349 AC_MSG_CHECKING([for rpm/zstd support]) 350 rpm2cpio > /dev/null 2>&AS_MESSAGE_LOG_FD "$srcdir"/rpm_zstd_file 351 if test $? -eq 0; then 352 enable_rpm_zstd=yes 353 else 354 enable_rpm_zstd=no 355 fi 356 AC_MSG_RESULT([$enable_rpm_zstd]) 357 if test x$ENABLE_RPM_ZSTD:$enable_rpm_zstd = xyes:no; then 358 AC_MSG_ERROR([rpm/zstd support not available]) 359 fi 360 ENABLE_RPM_ZSTD=$enable_rpm_zstd 361 fi 362fi 363 364if test x$ENABLE_RPM = xyes; then 365 AC_DEFINE([WITH_RPM], 1, [compile the rpm package support in abipkgdiff]) 366 AC_MSG_NOTICE([rpm support in abipkgdiff is enabled]); 367 368 if test x$ENABLE_RPM_ZSTD = xyes; then 369 AC_DEFINE([WITH_RPM_ZSTD], 1, [has rpm/zstd support]) 370 AC_MSG_NOTICE([rpm/zstd in abipkgdiff testing is enabled]) 371 fi 372else 373 AC_MSG_NOTICE([rpm support in abipkgdiff is disabled]); 374fi 375 376AM_CONDITIONAL(ENABLE_RPM, test x$ENABLE_RPM = xyes) 377 378dnl enable the debugging of self comparison when doing abidw --debug-abidiff <binary> 379if test x$ENABLE_DEBUG_SELF_COMPARISON = xyes; then 380 AC_DEFINE([WITH_DEBUG_SELF_COMPARISON], 1, [compile support of debugging abidw --abidiff]) 381 AC_MSG_NOTICE([support of debugging self comparison is enabled]) 382else 383 AC_MSG_NOTICE([support of debugging self comparison is disabled]) 384fi 385 386AM_CONDITIONAL(ENABLE_DEBUG_SELF_COMPARISON, test x$ENABLE_DEBUG_SELF_COMPARISON = xyes) 387 388dnl enable support of abilint --show-type-use <type-id> 389if test x$ENABLE_SHOW_TYPE_USE_IN_ABILINT = xyes; then 390 AC_DEFINE([WITH_SHOW_TYPE_USE_IN_ABILINT], 1, [compile support of abilint --show-type-use]) 391 AC_MSG_NOTICE([support of abilint --show-type-use <type-id> is enabled]) 392else 393 AC_MSG_NOTICE([support of abilint --show-type-use <type-id> is disabled]) 394fi 395 396AM_CONDITIONAL(ENABLE_SHOW_TYPE_USE_IN_ABILINT, test x$ENABLE_SHOW_TYPE_USE_IN_ABILINT = xyes) 397 398dnl enable the debugging of type canonicalization when doing abidw --debug-tc <binary> 399if test x$ENABLE_DEBUG_TYPE_CANONICALIZATION = xyes; then 400 AC_DEFINE([WITH_DEBUG_TYPE_CANONICALIZATION], 401 1, 402 [compile support of debugging type canonicalization while using abidw --debug-tc]) 403 AC_MSG_NOTICE([support of debugging type canonicalization is enabled]) 404else 405 AC_MSG_NOTICE([support of debugging type canonicalization is disabled]) 406fi 407 408AM_CONDITIONAL(ENABLE_DEBUG_TYPE_CANONICALIZATION, test x$ENABLE_DEBUG_TYPE_CANONICALIZATION = xyes) 409 410dnl Check for the dpkg program 411if test x$ENABLE_DEB = xauto -o x$ENABLE_DEB = xyes; then 412 AC_CHECK_PROG(HAS_DPKG, dpkg, yes, no) 413 414 if test x$ENABLE_DEB = xauto; then 415 if test x$HAS_DPKG = xyes; then 416 ENABLE_DEB=yes 417 else 418 ENABLE_DEB=no 419 fi 420 fi 421fi 422 423if test x$ENABLE_DEB = xyes; then 424 AC_DEFINE([WITH_DEB], 1, [compile the deb package support in abipkgdiff]) 425 AC_MSG_NOTICE(deb support in abipkgdiff is enabled); 426else 427 AC_MSG_NOTICE(deb support in abipkgdiff is disabled); 428fi 429 430AM_CONDITIONAL(ENABLE_DEB, test x$ENABLE_DEB = xyes) 431 432dnl Check for the tar program 433if test x$ENABLE_TAR = xauto -o x$ENABLE_TAR = xyes; then 434 AC_CHECK_PROG(HAS_TAR, tar, yes, no) 435 436 if test x$ENABLE_TAR = xauto; then 437 if test x$HAS_TAR = xyes; then 438 ENABLE_TAR=yes 439 fi 440 fi 441fi 442 443if test x$ENABLE_TAR = xyes; then 444 AC_DEFINE([WITH_TAR], 1, [compile the GNU tar archive support in abipkgdiff]) 445 AC_MSG_NOTICE(GNU tar support in abipkgdiff is enabled); 446else 447 AC_MSG_NOTICE(GNU tar support in abipkgdiff is disabled); 448fi 449 450AM_CONDITIONAL(ENABLE_TAR, test x$ENABLE_TAR = xyes) 451 452dnl Check for the bash-completion package 453if test x$ENABLE_BASH_COMPLETION = xauto -o x$ENABLE_BASH_COMPLETION = xyes; then 454 AC_CHECK_PROG(HAS_BASH_COMPLETION, bash-completion, yes, no) 455 456 if test x$ENABLE_BASH_COMPLETION = xauto; then 457 if test x$HAS_BASH_COMPLETION = xyes; then 458 ENABLE_BASH_COMPLETION=yes 459 else 460 ENABLE_BASH_COMPLETION=no 461 fi 462 fi 463fi 464 465if test x$ENABLE_BASH_COMPLETION = xyes; then 466 AC_MSG_NOTICE(bash-completion support in libabigail is enabled); 467else 468 AC_MSG_NOTICE(bash-completion support in libabigail is disabled); 469fi 470 471AM_CONDITIONAL(ENABLE_BASH_COMPLETION, test x$ENABLE_BASH_COMPLETION = xyes) 472 473# The minimal python 2 version we want to support is 2.6.6 because EL6 474# distributions have that version installed. 475MINIMAL_PYTHON2_VERSION="2.6.6" 476 477AC_PATH_PROG(PYTHON, python, no) 478AX_PROG_PYTHON_VERSION($MINIMAL_PYTHON2_VERSION, 479 [MINIMAL_PYTHON_VERSION_FOUND=yes], 480 [MINIMAL_PYTHON_VERSION_FOUND=no]) 481 482# The minimal python 3 version we want to support is 3.5, which is 483# available in Fedora releases and in EL7. 484if test x$ENABLE_PYTHON3 != xno; then 485 AC_CHECK_PROGS(PYTHON3_INTERPRETER, [python3 python3.5 python3.6 python3.7], no) 486else 487 PYTHON3_INTERPRETER=no 488fi 489 490if test x$ENABLE_PYTHON3 = xauto; then 491 if test x$PYTHON3_INTERPRETER != xno; then 492 ENABLE_PYTHON3=yes 493 else 494 # When enabling python3 is auto, tests only run if the 495 # python3 interpreter was found on the system. Otherwise, 496 # just ignore it. 497 ENABLE_PYTHON3=no 498 AC_MSG_NOTICE([Python 3 was not found. Skip running tests with Python 3.]) 499 fi 500fi 501 502if test x$ENABLE_PYTHON3 = xyes; then 503 if test x$PYTHON3_INTERPRETER != xno; then 504 # We were asked to enable python3 implicitely (auto and 505 # python3 was found) or explicitly. So enable running tests 506 # using python3 then. 507 RUN_TESTS_WITH_PY3=yes 508 else 509 AC_MSG_ERROR([Python 3 was not found]) 510 fi 511fi 512 513if test x$PYTHON3_INTERPRETER = xyes; then 514 MINIMAL_PYTHON_VERSION_FOUND=yes 515fi 516 517if test x$MINIMAL_PYTHON_VERSION_FOUND = xno; then 518 AC_MSG_NOTICE([no minimal version of python found]) 519 if test x$PYTHON = xno; then 520 AC_MSG_NOTICE([python binary wasn't found]) 521 if test x$PYTHON3_INTERPRETER != xno; then 522 AC_MSG_NOTICE([using $PYTHON3_INTERPRETER instead]) 523 PYTHON=$PYTHON3_INTERPRETER 524 MINIMAL_PYTHON_VERSION_FOUND=yes 525 MISSING_FEDABIPKGDIFF_DEP=no 526 fi 527 fi 528else 529 AC_MSG_NOTICE([a minimal version of python was found ...]) 530 if test x$PYTHON3_INTERPRETER != xno; then 531 # We were instructed to use python3 and it's present on the 532 # system. Let's update the PYTHON variable that points to the 533 # actual python interpreter we are going to be using 534 AC_MSG_NOTICE([... and it was $PYTHON3_INTERPRETER]) 535 PYTHON=$PYTHON3_INTERPRETER 536 fi 537fi 538 539dnl if --enable-fedabipkgdiff has the 'auto' value, then check for the required 540dnl python modules. If they are present, then enable the fedabipkgdiff program. 541dnl If they are not then disable the program. 542dnl 543dnl If --enable-fedabipkgdiff has the 'yes' value, then check for the required 544dnl python modules and whatever dependency fedabipkgdiff needs. If they are 545dnl not present then the configure script will error out. 546 547if test x$ENABLE_FEDABIPKGDIFF = xauto -o x$ENABLE_FEDABIPKGDIFF = xyes; then 548 CHECK_DEPS_FOR_FEDABIPKGDIFF=yes 549else 550 CHECK_DEPS_FOR_FEDABIPKGDIFF=no 551fi 552 553if test x$CHECK_DEPS_FOR_FEDABIPKGDIFF = xyes; then 554 MISSING_FEDABIPKGDIFF_DEP=no 555 556 if test x$ENABLE_FEDABIPKGDIFF = xyes; then 557 MISSING_FEDABIPKGDIFF_DEP_FATAL=yes 558 else 559 MISSING_FEDABIPKGDIFF_DEP_FATAL=no 560 fi 561 562 AC_PATH_PROG(WGET, wget, no) 563 564 if test x$WGET = xno; then 565 MISSING_FEDABIPKGDIFF_DEP=yes 566 if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then 567 AC_MSG_ERROR(could not find the wget program) 568 else 569 AC_MSG_NOTICE([could not find the wget program]) 570 AC_MSG_NOTICE([disabling fedabipkgdiff as a result]) 571 fi 572 fi 573 574 if test x$MINIMAL_PYTHON_VERSION_FOUND = xno; then 575 MISSING_FEDABIPKGDIFF_DEP=yes 576 if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then 577 AC_MSG_ERROR([could not find a python program of version at least $MINIMAL_PYTHON2_VERSION]) 578 fi 579 fi 580 581 ################################################################### 582 # Now we are going to check the presence of the required python 583 # modules using either python2 or python3 as required until now. 584 ################################################################### 585 586 # Grrr, the urlparse python2 module got renamed in python3 as 587 # urllib.parse. Oh well. 588 if test x$PYTHON = xpython3; then 589 URLPARSE_MODULE=urllib.parse 590 else 591 URLPARSE_MODULE=urlparse 592 fi 593 594 REQUIRED_PYTHON_MODULES_FOR_FEDABIPKGDIFF="\ 595 argparse logging os re subprocess sys $URLPARSE_MODULE \ 596 xdg koji mock rpm imp tempfile mimetypes shutil six" 597 598 AX_CHECK_PYTHON_MODULES([$REQUIRED_PYTHON_MODULES_FOR_FEDABIPKGDIFF], 599 [$PYTHON], 600 [FOUND_ALL_PYTHON_MODULES=yes], 601 [FOUND_ALL_PYTHON_MODULES=no]) 602 603 if test x$FOUND_ALL_PYTHON_MODULES = xno; then 604 MISSING_FEDABIPKGDIFF_DEP=yes 605 if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then 606 AC_MSG_ERROR([missing python modules: $MISSING_PYTHON_MODULES]); 607 else 608 AC_MSG_NOTICE([missing python modules: $MISSING_PYTHON_MODULES]) 609 AC_MSG_NOTICE([disabling fedabipkgdiff as a result]) 610 fi 611 else 612 # On some old platforms, the koji client object doesn't have 613 # the required .read_config method. Alas, that module doesn't 614 # have any __version__ string either. So we do as well as we 615 # can to try and detect that case and disable fedabipkgdiff if 616 # necessary. 617 AC_MSG_CHECKING([if koji client is recent enough]) 618 $PYTHON 2>&AS_MESSAGE_LOG_FD -c " 619import koji 620try: 621 koji.read_config('koji') 622except koji.ConfigurationError: 623 # See 'tools/fedabipkgdiff'. 624 pass" 625 if test $? -eq 0; then 626 koji_version_check_ok=yes 627 else 628 koji_version_check_ok=no 629 fi 630 AC_MSG_RESULT([$koji_version_check_ok]) 631 if test x$koji_version_check_ok = xno; then 632 MISSING_FEDABIPKGDIFF_DEP=yes 633 if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then 634 AC_MSG_ERROR([unsuitable koji client]) 635 else 636 AC_MSG_WARN([disabling fedabipkgdiff]) 637 fi 638 fi 639 fi 640 641 if test x$MISSING_FEDABIPKGDIFF_DEP = xno; then 642 ENABLE_FEDABIPKGDIFF=yes 643 else 644 ENABLE_FEDABIPKGDIFF=no 645 fi 646fi 647 648AM_CONDITIONAL(ENABLE_FEDABIPKGDIFF, test x$ENABLE_FEDABIPKGDIFF = xyes) 649AM_CONDITIONAL(ENABLE_RUNNING_TESTS_WITH_PY3, test x$RUN_TESTS_WITH_PY3 = xyes) 650AM_CONDITIONAL(ENABLE_PYTHON3_INTERPRETER, test x$PYTHON3_INTERPRETER != xno) 651AC_SUBST(PYTHON) 652 653DEPS_CPPFLAGS="$XML_CFLAGS" 654AC_SUBST(DEPS_CPPFLAGS) 655 656dnl Check for the presence of doxygen program 657 658if test x$ENABLE_APIDOC != xno; then 659 AC_CHECK_PROG(FOUND_DOXYGEN, doxygen, yes, no) 660 if test x$ENABLE_APIDOC = xauto; then 661 if test x$FOUND_DOXYGEN = xyes; then 662 ENABLE_APIDOC=yes 663 else 664 ENABLE_APIDOC=no 665 fi 666 fi 667fi 668AM_CONDITIONAL(ENABLE_APIDOC, test x$ENABLE_APIDOC = xyes) 669 670dnl Check for the presence of the sphinx-build program 671 672if test x$ENABLE_MANUAL != xno; then 673 AC_CHECK_PROG(FOUND_SPHINX_BUILD, sphinx-build, yes, no) 674 if test x$ENABLE_MANUAL = xauto; then 675 if test x$FOUND_SPHINX_BUILD = xyes; then 676 ENABLE_MANUAL=yes 677 else 678 ENABLE_MANUAL=no 679 fi 680 fi 681fi 682AM_CONDITIONAL(ENABLE_MANUAL, test x$ENABLE_MANUAL = xyes) 683 684dnl Check for the presence of Valgrind and do the plumbing to allow 685dnl the running of "make check-valgrind". 686AX_VALGRIND_DFLT(memcheck, on) 687AX_VALGRIND_DFLT(helgrind, on) 688AX_VALGRIND_DFLT(drd, off) 689AX_VALGRIND_DFLT(sgcheck, off) 690 691AX_VALGRIND_CHECK 692 693dnl Handle conditional use of a C++17 compiler 694if test x$ENABLE_CXX17 = xyes; then 695 CXX_STANDARD=c++17 696fi 697AM_CONDITIONAL(ENABLE_CXX17, test x$ENABLE_CXX17 = xyes) 698 699dnl Set the list of libraries libabigail depends on 700 701DEPS_LIBS="$XML_LIBS $ELF_LIBS $DW_LIBS $CTF_LIBS" 702AC_SUBST(DEPS_LIBS) 703 704if test x$ABIGAIL_DEVEL != x; then 705 CFLAGS="-g -Og -Wall -Wextra -Werror -D_FORTIFY_SOURCE=2" 706 CXXFLAGS="-g -Og -Wall -Wextra -Werror -D_FORTIFY_SOURCE=2 -D_GLIBCXX_DEBUG" 707fi 708 709if test x$ABIGAIL_DEBUG != x; then 710 CFLAGS="$CFLAGS -Og -g3 -ggdb" 711 CXXFLAGS="$CXXFLAGS -Og -g3 -ggdb" 712fi 713 714if test x$ABIGAIL_NO_OPTIMIZATION_DEBUG != x; then 715 CFLAGS="-g -O0 -Wall -Wextra -Werror" 716 CXXFLAGS="-g -O0 -Wall -Wextra -Werror" 717fi 718 719if test x$ENABLE_ASAN = xyes; then 720 CFLAGS="$CFLAGS -fsanitize=address" 721 CXXFLAGS="$CXXFLAGS -fsanitize=address" 722fi 723 724if test x$ENABLE_MSAN = xyes; then 725 CFLAGS="$CFLAGS -fsanitize=memory -fsanitize-memory-track-origins" 726 CXXFLAGS="$CXXFLAGS -fsanitize=memory -fsanitize-memory-track-origins" 727fi 728 729if test x$ENABLE_TSAN = xyes; then 730 CFLAGS="$CFLAGS -fsanitize=thread" 731 CXXFLAGS="$CXXFLAGS -fsanitize=thread" 732fi 733 734if test x$ENABLE_UBSAN = xyes; then 735 CFLAGS="$CFLAGS -fsanitize=undefined" 736 CXXFLAGS="$CXXFLAGS -fsanitize=undefined" 737fi 738 739dnl Set a few Automake conditionals 740 741AM_CONDITIONAL([CTF_READER],[test "x$ENABLE_CTF" = "xyes"]) 742 743dnl Set the level of C++ standard we use. 744CXXFLAGS="$CXXFLAGS -std=$CXX_STANDARD" 745 746dnl Check if several decls and constant are defined in dependant 747dnl libraries 748HAS_EM_AARCH64=no 749AC_CHECK_DECL([EM_AARCH64], 750 [HAS_EM_AARCH64=yes], 751 [HAS_EM_AARCH64=no], 752 [[#include <elf.h>]]) 753 754if test x$HAS_EM_AARCH64 = xyes; then 755 AC_DEFINE([HAVE_EM_AARCH64_MACRO], 756 1, 757 [Defined to 1 if elf.h has EM_AARCH64 macro defined]) 758fi 759 760HAS_EM_TILEPRO=no 761AC_CHECK_DECL([EM_TILEPRO], 762 [HAS_EM_TILEPRO=yes], 763 [HAS_EM_TILEPRO=no], 764 [[#include <elf.h>]]) 765 766if test x$HAS_EM_TILEPRO = xyes; then 767 AC_DEFINE([HAVE_EM_TILEPRO_MACRO], 768 1, 769 [Defined to 1 if elf.h has EM_TILEPR0 macro defined]) 770fi 771 772HAS_EM_TILEGX=no 773AC_CHECK_DECL([EM_TILEGX], 774 [HAS_EM_TILEGX=yes], 775 [HAS_EM_TILEGX=no], 776 [[#include <elf.h>]]) 777 778if test x$HAS_EM_TILEGX = xyes; then 779 AC_DEFINE([HAVE_EM_TILEGX_MACRO], 780 1, 781 [Defined to 1 if elf.h has EM_TILEGX macro defined]) 782fi 783 784HAS_R_AARCH64_ABS64=no 785AC_CHECK_DECL([R_AARCH64_ABS64], 786 [HAS_R_AARCH64_ABS64=yes], 787 [HAS_R_AARCH64_ABS64=no], 788 [[#include <elf.h>]]) 789 790if test x$HAS_R_AARCH64_ABS64 = xyes; then 791 AC_DEFINE([HAVE_R_AARCH64_ABS64_MACRO], 792 1, 793 [Defined to 1 if elf.h has R_AARCH64_ABS64 macro defined]) 794fi 795 796HAS_R_AARCH64_PREL32=no 797AC_CHECK_DECL([R_AARCH64_PREL32], 798 [HAS_R_AARCH64_PREL32=yes], 799 [HAS_R_AARCH64_PREL32=no], 800 [[#include <elf.h>]]) 801 802if test x$HAS_R_AARCH64_PREL32 = xyes; then 803 AC_DEFINE([HAVE_R_AARCH64_PREL32_MACRO], 804 1, 805 [Defined to 1 if elf.h has R_AARCH64_PREL32 macro defined]) 806fi 807 808HAS_DW_LANG_UPC=no 809AC_CHECK_DECL([DW_LANG_UPC], 810 [HAS_DW_LANG_UPC=yes], 811 [HAS_DW_LANG_UPC=no], 812 [[#include <dwarf.h>]]) 813if test x$HAS_DW_LANG_UPC = xyes; then 814 AC_DEFINE([HAVE_DW_LANG_UPC_enumerator], 815 1, 816 [Define to 1 if dwarf.h has the DW_LANG_UPC enumerator]) 817fi 818 819HAS_DW_LANG_D=no 820AC_CHECK_DECL([DW_LANG_D], 821 [HAS_DW_LANG_D=yes], 822 [HAS_DW_LANG_D=no], 823 [[#include <dwarf.h>]]) 824if test x$HAS_DW_LANG_D = xyes; then 825 AC_DEFINE([HAVE_DW_LANG_D_enumerator], 826 1, 827 [Define to 1 if dwarf.h has the DW_LANG_D enumerator]) 828fi 829 830HAS_DW_LANG_Python=no 831AC_CHECK_DECL([DW_LANG_Python], 832 [HAS_DW_LANG_Python=yes], 833 [HAS_DW_LANG_Python=no], 834 [[#include <dwarf.h>]]) 835if test x$HAS_DW_LANG_Python = xyes; then 836 AC_DEFINE([HAVE_DW_LANG_Python_enumerator], 837 1, 838 [Define to 1 if dwarf.h has the DW_LANG_Python enumerator]) 839fi 840 841HAS_DW_LANG_Go=no 842AC_CHECK_DECL([DW_LANG_Go], 843 [HAS_DW_LANG_Go=yes], 844 [HAS_DW_LANG_Go=no], 845 [[#include <dwarf.h>]]) 846if test x$HAS_DW_LANG_Go = xyes; then 847 AC_DEFINE([HAVE_DW_LANG_Go_enumerator], 848 1, 849 [Define to 1 if dwarf.h has the DW_LANG_Go enumerator]) 850fi 851 852HAS_DW_LANG_C11=no 853AC_CHECK_DECL([DW_LANG_C11], 854 [HAS_DW_LANG_C11=yes], 855 [HAS_DW_LANG_C11=no], 856 [[#include <dwarf.h>]]) 857if test x$HAS_DW_LANG_C11 = xyes; then 858 AC_DEFINE([HAVE_DW_LANG_C11_enumerator], 859 1, 860 [Define to 1 if dwarf.h has the DW_LANG_C11 enumerator]) 861fi 862 863HAS_DW_LANG_C_plus_plus_03=no 864AC_CHECK_DECL([DW_LANG_C_plus_plus_03], 865 [HAS_DW_LANG_C_plus_plus_03=yes], 866 [HAS_DW_LANG_C_plus_plus_03=no], 867 [[#include <dwarf.h>]]) 868if test x$HAS_DW_LANG_C_plus_plus_03 = xyes; then 869 AC_DEFINE([HAVE_DW_LANG_C_plus_plus_03_enumerator], 870 1, 871 [Define to 1 if dwarf.h has the DW_LANG_C_plus_plus_03 enumerator]) 872fi 873 874HAS_DW_LANG_C_plus_plus_11=no 875AC_CHECK_DECL([DW_LANG_C_plus_plus_11], 876 [HAS_DW_LANG_C_plus_plus_11=yes], 877 [HAS_DW_LANG_C_plus_plus_11=no], 878 [[#include <dwarf.h>]]) 879if test x$HAS_DW_LANG_C_plus_plus_11 = xyes; then 880 AC_DEFINE([HAVE_DW_LANG_C_plus_plus_11_enumerator], 881 1, 882 [Define to 1 if dwarf.h has the DW_LANG_C_plus_plus_11 enumerator]) 883fi 884 885HAS_DW_LANG_C_plus_plus_14=no 886AC_CHECK_DECL([DW_LANG_C_plus_plus_14], 887 [HAS_DW_LANG_C_plus_plus_14=yes], 888 [HAS_DW_LANG_C_plus_plus_14=no], 889 [[#include <dwarf.h>]]) 890if test x$HAS_DW_LANG_C_plus_plus_14 = xyes; then 891 AC_DEFINE([HAVE_DW_LANG_C_plus_plus_14_enumerator], 892 1, 893 [Define to 1 if dwarf.h has the DW_LANG_C_plus_plus_14 enumerator]) 894fi 895 896HAS_DW_LANG_Mips_Assembler=no 897AC_CHECK_DECL([DW_LANG_Mips_Assembler], 898 [HAS_DW_LANG_Mips_Assembler=yes], 899 [HAS_DW_LANG_Mips_Assembler=no], 900 [[#include <dwarf.h>]]) 901if test x$HAS_DW_LANG_Mips_Assembler = xyes; then 902 AC_DEFINE([HAVE_DW_LANG_Mips_Assembler_enumerator], 903 1, 904 [Define to 1 if dwarf.h has the DW_LANG_Mips_Assembler enumerator]) 905fi 906 907HAS_DW_LANG_Rust=no 908AC_CHECK_DECL([DW_LANG_Rust], 909 [HAS_DW_LANG_Rust=yes], 910 [HAS_DW_LANG_Rust=no], 911 [[#include <dwarf.h>]]) 912 913if test x$HAS_DW_LANG_Rust = xyes; then 914 AC_DEFINE([HAVE_DW_LANG_Rust_enumerator], 915 1, 916 [Define to 1 if dwarf.h has the DW_LANG_Rust enumerator]) 917fi 918 919HAS_DW_FORM_strx1=no 920HAS_DW_FORM_strx2=no 921HAS_DW_FORM_strx3=no 922HAS_DW_FORM_strx4=no 923HAS_DW_FORM_line_strp=no 924 925AC_CHECK_DECL([DW_FORM_strx1], 926 [HAS_DW_FORM_strx1=yes], 927 [HAS_DW_FORM_strx1=no], 928 [[#include <dwarf.h>]]) 929 930if test x$HAS_DW_FORM_strx1 = xyes; then 931 AC_DEFINE([HAVE_DW_FORM_strx1], 932 1, 933 [Define to 1 if dwarf.h has the DW_FORM_strx1 enumerator]) 934fi 935 936AC_CHECK_DECL([DW_FORM_strx2], 937 [HAS_DW_FORM_strx2=yes], 938 [HAS_DW_FORM_strx2=no], 939 [[#include <dwarf.h>]]) 940 941if test x$HAS_DW_FORM_strx2 = xyes; then 942 AC_DEFINE([HAVE_DW_FORM_strx2], 943 1, 944 [Define to 1 if dwarf.h has the DW_FORM_strx2 enumerator]) 945fi 946 947AC_CHECK_DECL([DW_FORM_strx3], 948 [HAS_DW_FORM_strx3=yes], 949 [HAS_DW_FORM_strx3=no], 950 [[#include <dwarf.h>]]) 951 952if test x$HAS_DW_FORM_strx3 = xyes; then 953 AC_DEFINE([HAVE_DW_FORM_strx3], 954 1, 955 [Define to 1 if dwarf.h has the DW_FORM_strx3 enumerator]) 956fi 957 958AC_CHECK_DECL([DW_FORM_strx4], 959 [HAS_DW_FORM_strx4=yes], 960 [HAS_DW_FORM_strx4=no], 961 [[#include <dwarf.h>]]) 962 963if test x$HAS_DW_FORM_strx4 = xyes; then 964 AC_DEFINE([HAVE_DW_FORM_strx4], 965 1, 966 [Define to 1 if dwarf.h has the DW_FORM_strx4 enumerator]) 967fi 968 969AC_CHECK_DECL([DW_FORM_line_strp], 970 [HAS_DW_FORM_line_strp=yes], 971 [HAS_DW_FORM_line_strp=no], 972 [[#include <dwarf.h>]]) 973 974if test x$HAS_DW_FORM_line_strp = xyes; then 975 AC_DEFINE([HAVE_DW_FORM_line_strp], 976 1, 977 [Define to 1 if dwarf.h has the DW_FORM_line_strp enumerator]) 978fi 979 980if test x$HAS_DW_FORM_strx1 = xyes -a \ 981 x$HAS_DW_FORM_strx2 = xyes -a \ 982 x$HAS_DW_FORM_strx3 = xyes -a \ 983 x$HAS_DW_FORM_strx4 = xyes ; then 984 AC_DEFINE([HAVE_DW_FORM_strx], 985 1, 986 [Define to 1 if dwarf.h has the DW_FORM_strx enumerators]) 987fi 988 989dnl Set large files support 990AC_SYS_LARGEFILE 991 992AC_CONFIG_FILES([Makefile 993libabigail.pc 994 include/Makefile 995 include/abg-version.h 996 doc/Makefile 997 doc/manuals/Makefile 998 src/Makefile 999 tools/Makefile 1000 tests/Makefile 1001 tests/data/Makefile 1002 bash-completion/Makefile]) 1003 1004dnl Some test scripts are generated by autofoo. 1005AC_CONFIG_FILES([tests/runtestcanonicalizetypes.sh], 1006 [chmod +x tests/runtestcanonicalizetypes.sh]) 1007 AC_CONFIG_FILES([tests/runtestslowselfcompare.sh], 1008 [chmod +x tests/runtestslowselfcompare.sh]) 1009AC_CONFIG_FILES([tests/mockfedabipkgdiff], 1010 [chmod +x tests/mockfedabipkgdiff]) 1011AC_CONFIG_FILES([tests/runtestfedabipkgdiff.py], 1012 [chmod +x tests/runtestfedabipkgdiff.py]) 1013AC_CONFIG_FILES([tests/runtestfedabipkgdiffpy3.sh], 1014 [chmod +x tests/runtestfedabipkgdiffpy3.sh]) 1015AC_CONFIG_FILES([tests/runtestdefaultsupprs.py], 1016 [chmod +x tests/runtestdefaultsupprs.py]) 1017AC_CONFIG_FILES([tests/runtestdefaultsupprspy3.sh], 1018 [chmod +x tests/runtestdefaultsupprspy3.sh]) 1019 1020AC_OUTPUT 1021 1022AC_MSG_NOTICE([ 1023===================================================================== 1024 Libabigail: $VERSION_MAJOR.$VERSION_MINOR.$VERSION_REVISION$VERSION_SUFFIX 1025===================================================================== 1026 1027 Here is the configuration of the package: 1028 1029 Prefix : ${prefix} 1030 Source code location : ${srcdir} 1031 C Compiler : ${CC} 1032 C++ Compiler : ${CXX} 1033 GCC visibility attribute supported : ${SUPPORTS_GCC_VISIBILITY_ATTRIBUTE} 1034 CXXFLAGS : ${CXXFLAGS} 1035 Python : ${PYTHON} 1036 1037 OPTIONAL FEATURES: 1038 C++ standard level : ${CXX_STANDARD} 1039 libdw has the dwarf_getalt function : ${FOUND_DWARF_GETALT_IN_LIBDW} 1040 Enable rpm support in abipkgdiff : ${ENABLE_RPM} 1041 Enable rpm/zstd in abipkgdiff testing : ${ENABLE_RPM_ZSTD} 1042 Enable abilint --show-type-use <type-id> : ${ENABLE_SHOW_TYPE_USE_IN_ABILINT} 1043 Enable self comparison debugging : ${ENABLE_DEBUG_SELF_COMPARISON} 1044 Enable type canonicalization debugging : ${ENABLE_DEBUG_TYPE_CANONICALIZATION} 1045 Enable deb support in abipkgdiff : ${ENABLE_DEB} 1046 Enable GNU tar archive support in abipkgdiff : ${ENABLE_TAR} 1047 Enable bash completion : ${ENABLE_BASH_COMPLETION} 1048 Enable fedabipkgdiff : ${ENABLE_FEDABIPKGDIFF} 1049 Enable python 3 : ${ENABLE_PYTHON3} 1050 Enable CTF front-end : ${ENABLE_CTF} 1051 Enable running tests under Valgrind : ${enable_valgrind} 1052 Enable build with -fsanitize=address : ${ENABLE_ASAN} 1053 Enable build with -fsanitize=memory : ${ENABLE_MSAN} 1054 Enable build with -fsanitize=thread : ${ENABLE_TSAN} 1055 Enable build with -fsanitize=undefined : ${ENABLE_UBSAN} 1056 Generate html apidoc : ${ENABLE_APIDOC} 1057 Generate html manual : ${ENABLE_MANUAL} 1058]) 1059