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