libabigail/configure.ac

223 lines
5.8 KiB
Plaintext
Raw Normal View History

m4_define([version_major], [0])
m4_define([version_minor], [1])
m4_define([version_revision],[0])
AC_INIT([libabigail],
[version_major.version_minor.version_revision],
[http://sourceware.org/bugzilla],
[libabigail],
[http://sourceware.org/libabigail])
AC_PREREQ([2.63])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_SRCDIR([README])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.11.1 foreign subdir-objects tar-ustar])
AM_MAINTAINER_MODE([enable])
AM_SILENT_RULES([yes])
VERSION_MAJOR=version_major
VERSION_MINOR=version_minor
VERSION_REVISION=version_revision
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_REVISION)
AC_ARG_ENABLE(zip-archive,
AS_HELP_STRING([--enable-zip-archive=yes|no|auto],
[enable bundling of TUs in zip archives (default is auto)]),
ENABLE_ZIP_ARCHIVE=$enableval,
ENABLE_ZIP_ARCHIVE=auto)
Make the use of a C++-11 compiler optional * configure.ac: Define a new --enable-cxx11 switch to control the use of the C++-11 compiler. Define a WITH_CXX11 C macro and an automake ENABLE_CXX11 variable. * config.h.in: Initialize the new WITH_CXX11 C macro. * src/Makefile.am: Include the files coded in C++-11 only if the ENABLE_CXX11 automake variable is defined. * tests/Makefile.am: Likewise, build the runtestsvg test program only if C++-11 usage is enabled. * include/abg-diff-utils.h (class d_path_vec): Remove useless usage of the 'typename' keyword. * include/abg-fwd.h (is_enum_type): Renamed is_enum into this, because of a name clash with a tr1 function when not using C++-11. (is_pointer_type): Likewise, renamed is_pointer into this because of a name clash with a tr1 function when not using C++-11. * src/abg-comp-filter.cc (has_harmless_name_change): Adjust for the is_enum -> is_enum_type change. * src/abg-comparison.cc (type_suppression::suppresses_diff): Likewise. (class function_suppression::priv): Add a missing "class" keyword in friend declaration. (diff_context::diff_has_been_traversed) (diff_context::mark_diff_as_traversed): Do not use the C++-11 specific type uintptr_t. * src/abg-dwarf-reader.cc (create_default_dwfl): Do not use designated initializers. Sigh. This is handy though. (expr_result::abs): Cast the argument of std::abs to avoid ambiguous call. (finish_member_function_reading): Adjust for the is_pointer -> is_pointer_type renaming. * src/abg-hash.cc (scope_decl::hash::operator) (class_decl::base_spec::hash::operator) (type_composition::hash::operator): Use std::tr1::hash string, rather than the C++-11 specific std::hash function. * src/abg-ini.cc (read_sections, write_sections): Make std::ifstream constructor take a const char* rather than a string. * src/abg-ir.cc (is_enum_type, is_pointer_type): Renamed is_enum into is_enum_type and is_pointer into is_pointer_type. * src/abg-writer.cc (write_translation_unit): Remove useless typename keyword. Make ofstream take a const char* rather than a string. (write_namespace_decl): Remove useless typename keyword. (write_corpus_to_native_xml_file): Make ofstream take a const char* rather than a string. * tests/test-abidiff.cc (main): Make ofstream take a const char* rather than a string. * tests/test-diff-dwarf.cc (main): Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-11-05 09:08:33 +00:00
AC_ARG_ENABLE(cxx11,
AS_HELP_STRING([--enable-cxx11=yes|no],
[enable features that use the C++11 compiler]),
ENABLE_CXX11=$enableval,
ENABLE_CXX11=no)
AC_ARG_ENABLE(apidoc,
AS_HELP_STRING([--enable-apidoc=yes|no|auto],
[enable generation of the apidoc in html]),
ENABLE_APIDOC=$enableval,
ENABLE_APIDOC=auto)
AC_ARG_ENABLE(manual,
AS_HELP_STRING([--enable-manual=yes|no|auto],
[enable generation of the manual in html]),
ENABLE_MANUAL=$enableval,
ENABLE_MANUAL=auto)
dnl *************************************************
dnl Here is the list of versions of the dependencies
dnl *************************************************
AC_PROG_CXX
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_INSTALL
LT_PREREQ([2.2])
LT_INIT
AC_LANG([C++])
AC_LANG_COMPILER_REQUIRE
dnl Check for dependency: libdw (elfutils)
DW_LIBS=
AC_CHECK_LIB(dw, dwfl_begin, [DW_LIBS=-ldw])
AC_CHECK_HEADER(elfutils/libdwfl.h,
[],
[AC_MSG_ERROR([could not find elfutils/libdwfl.h installed])])
AC_CHECK_LIB([elf], [elf_end], [ELF_LIBS="-lelf"])
AC_CHECK_HEADER([libelf.h],
[],
[AC_MSG_ERROR([could not find libelf.h])])
if test x$DW_LIBS = x; then
AC_MSG_ERROR([could not find elfutils dwarf library installed])
fi
AC_SUBST(DW_LIBS)
AC_SUBST([ELF_LIBS])
dnl Check for dependency: libxml
LIBXML2_VERSION=2.6.22
PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_VERSION)
AC_SUBST(LIBXML2_VERSION)
AC_SUBST(XML_LIBS)
AC_SUBST(XML_CFLAGS)
Initial writing/reading of an ABI corpus to an archive * configure.ac: Support detection of libzip dependency. Define new DEPS_CFLAGS and DEPS_LIBS variables for use in Makefile.am to refer to the dependency headers and libraries. * doc/website/mainpage.txt: Update this to talk about the new libzip dependency. * include/Makefile.am: Add abg-libzip-utils.h to the build system. * include/abg-corpus.h (corps): Hide abigail::corpus's private behind a pimpl idiom. (corpus::{drop_translation_units, get_file_path, set_file_path, write, read}): New methods. * include/abg-libxml-utils.h (new_reader_from_buffer): Declare new function. * include/abg-libzip-utils.h: New file. * src/Makefile.am: Add abg-corpus.cc and abg-libzip-utils.cc to the build system. Refer to the library and headers dependencies via the new DEPS_LIBS and DEPS_CFLAGS variables. * src/abg-corpus.cc: New file. * src/abg-ir.cc (translation::set_path): New method. * src/abg-libxml-utils.cc (new_reader_from_buffer): Define new function. * src/abg-libzip-utils.cc: New file. * src/abg-reader.cc (translation_unit::read): New overload. * src/abg-writer.cc: Inject the names from the std namespace into the abigail namespace, rather than into abigail::writer. (abigail::translation_unit::write): New overload. This can now use ofstream and the other stuff from std that are injected in the abigail:: namespace. * tests/Makefile.am: Add tests/test-write-read-archive.cc to the build system; use that to build runtestwritereadarchive. Also add the input test data from tests/data/test-write-read-archive/test[0-4].xml. * /tests/data/test-write-read-archive/test[0-4].xml: New test input data files. * tests/test-write-read-archive.cc: New test for this archive write/read support. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-27 13:18:59 +00:00
dnl Check for dependency: libzip
LIBZIP_VERSION=0.10
HAS_LIBZIP=no
# The below doesn't seem to work on my box for a reason. Let's write
# the damn thing by hand:
# PKG_CHECK_EXISTS([libzip >= $LIBZIP_VERSION], [HAS_LIBZIP=yes], [HAS_LIBZIP=no])
if $PKG_CONFIG --exists --print-errors "libzip >= $LIBZIP_VERSION"; then
AC_MSG_NOTICE(found libzip version $LIBZIP_VERSION)
HAS_LIBZIP=yes
else
AC_MSG_NOTICE(no libzip >= $LIBZIP_VERSION has been found)
HAS_LIBZIP=no
fi
if test x$ENABLE_ZIP_ARCHIVE = xauto; then
if test x$HAS_LIBZIP = xyes; then
ENABLE_ZIP_ARCHIVE=yes;
else
ENABLE_ZIP_ARCHIVE=no
fi
fi
if test x$ENABLE_ZIP_ARCHIVE = xyes; then
AC_MSG_NOTICE(the zip-archive feature is enabled)
else
AC_MSG_NOTICE(the zip-archive feature is disabled)
fi
FOUND_LIBZIP=no
if test x$ENABLE_ZIP_ARCHIVE = xyes; then
PKG_CHECK_MODULES(LIBZIP, libzip >= $LIBZIP_VERSION)
FOUND_LIBZIP=yes
AC_SUBST(LIBZIP_VERSION)
AC_SUBST(LIBZIP_LIBS)
AC_SUBST(LIBZIP_CFLAGS)
AC_DEFINE([WITH_ZIP_ARCHIVE], 1, [compile the zip archive support])
AC_DEFINE([HAVE_LIBZIP], 1, [Defined to 1 if the libzip library is available])
fi
Initial writing/reading of an ABI corpus to an archive * configure.ac: Support detection of libzip dependency. Define new DEPS_CFLAGS and DEPS_LIBS variables for use in Makefile.am to refer to the dependency headers and libraries. * doc/website/mainpage.txt: Update this to talk about the new libzip dependency. * include/Makefile.am: Add abg-libzip-utils.h to the build system. * include/abg-corpus.h (corps): Hide abigail::corpus's private behind a pimpl idiom. (corpus::{drop_translation_units, get_file_path, set_file_path, write, read}): New methods. * include/abg-libxml-utils.h (new_reader_from_buffer): Declare new function. * include/abg-libzip-utils.h: New file. * src/Makefile.am: Add abg-corpus.cc and abg-libzip-utils.cc to the build system. Refer to the library and headers dependencies via the new DEPS_LIBS and DEPS_CFLAGS variables. * src/abg-corpus.cc: New file. * src/abg-ir.cc (translation::set_path): New method. * src/abg-libxml-utils.cc (new_reader_from_buffer): Define new function. * src/abg-libzip-utils.cc: New file. * src/abg-reader.cc (translation_unit::read): New overload. * src/abg-writer.cc: Inject the names from the std namespace into the abigail namespace, rather than into abigail::writer. (abigail::translation_unit::write): New overload. This can now use ofstream and the other stuff from std that are injected in the abigail:: namespace. * tests/Makefile.am: Add tests/test-write-read-archive.cc to the build system; use that to build runtestwritereadarchive. Also add the input test data from tests/data/test-write-read-archive/test[0-4].xml. * /tests/data/test-write-read-archive/test[0-4].xml: New test input data files. * tests/test-write-read-archive.cc: New test for this archive write/read support. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-27 13:18:59 +00:00
AM_CONDITIONAL(ENABLE_ZIP_ARCHIVE, test x$ENABLE_ZIP_ARCHIVE = xyes)
Initial writing/reading of an ABI corpus to an archive * configure.ac: Support detection of libzip dependency. Define new DEPS_CFLAGS and DEPS_LIBS variables for use in Makefile.am to refer to the dependency headers and libraries. * doc/website/mainpage.txt: Update this to talk about the new libzip dependency. * include/Makefile.am: Add abg-libzip-utils.h to the build system. * include/abg-corpus.h (corps): Hide abigail::corpus's private behind a pimpl idiom. (corpus::{drop_translation_units, get_file_path, set_file_path, write, read}): New methods. * include/abg-libxml-utils.h (new_reader_from_buffer): Declare new function. * include/abg-libzip-utils.h: New file. * src/Makefile.am: Add abg-corpus.cc and abg-libzip-utils.cc to the build system. Refer to the library and headers dependencies via the new DEPS_LIBS and DEPS_CFLAGS variables. * src/abg-corpus.cc: New file. * src/abg-ir.cc (translation::set_path): New method. * src/abg-libxml-utils.cc (new_reader_from_buffer): Define new function. * src/abg-libzip-utils.cc: New file. * src/abg-reader.cc (translation_unit::read): New overload. * src/abg-writer.cc: Inject the names from the std namespace into the abigail namespace, rather than into abigail::writer. (abigail::translation_unit::write): New overload. This can now use ofstream and the other stuff from std that are injected in the abigail:: namespace. * tests/Makefile.am: Add tests/test-write-read-archive.cc to the build system; use that to build runtestwritereadarchive. Also add the input test data from tests/data/test-write-read-archive/test[0-4].xml. * /tests/data/test-write-read-archive/test[0-4].xml: New test input data files. * tests/test-write-read-archive.cc: New test for this archive write/read support. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-27 13:18:59 +00:00
DEPS_CPPFLAGS="$XML_CFLAGS $LIBZIP_CFLAGS"
AC_SUBST(DEPS_CPPFLAGS)
Make the use of a C++-11 compiler optional * configure.ac: Define a new --enable-cxx11 switch to control the use of the C++-11 compiler. Define a WITH_CXX11 C macro and an automake ENABLE_CXX11 variable. * config.h.in: Initialize the new WITH_CXX11 C macro. * src/Makefile.am: Include the files coded in C++-11 only if the ENABLE_CXX11 automake variable is defined. * tests/Makefile.am: Likewise, build the runtestsvg test program only if C++-11 usage is enabled. * include/abg-diff-utils.h (class d_path_vec): Remove useless usage of the 'typename' keyword. * include/abg-fwd.h (is_enum_type): Renamed is_enum into this, because of a name clash with a tr1 function when not using C++-11. (is_pointer_type): Likewise, renamed is_pointer into this because of a name clash with a tr1 function when not using C++-11. * src/abg-comp-filter.cc (has_harmless_name_change): Adjust for the is_enum -> is_enum_type change. * src/abg-comparison.cc (type_suppression::suppresses_diff): Likewise. (class function_suppression::priv): Add a missing "class" keyword in friend declaration. (diff_context::diff_has_been_traversed) (diff_context::mark_diff_as_traversed): Do not use the C++-11 specific type uintptr_t. * src/abg-dwarf-reader.cc (create_default_dwfl): Do not use designated initializers. Sigh. This is handy though. (expr_result::abs): Cast the argument of std::abs to avoid ambiguous call. (finish_member_function_reading): Adjust for the is_pointer -> is_pointer_type renaming. * src/abg-hash.cc (scope_decl::hash::operator) (class_decl::base_spec::hash::operator) (type_composition::hash::operator): Use std::tr1::hash string, rather than the C++-11 specific std::hash function. * src/abg-ini.cc (read_sections, write_sections): Make std::ifstream constructor take a const char* rather than a string. * src/abg-ir.cc (is_enum_type, is_pointer_type): Renamed is_enum into is_enum_type and is_pointer into is_pointer_type. * src/abg-writer.cc (write_translation_unit): Remove useless typename keyword. Make ofstream take a const char* rather than a string. (write_namespace_decl): Remove useless typename keyword. (write_corpus_to_native_xml_file): Make ofstream take a const char* rather than a string. * tests/test-abidiff.cc (main): Make ofstream take a const char* rather than a string. * tests/test-diff-dwarf.cc (main): Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-11-05 09:08:33 +00:00
dnl Handle conditional use of a C++11 compiler
if test x$ENABLE_CXX11 = xyes; then
AC_DEFINE([WITH_CXX11], 1, [Defined to 1 if a C++11 compiler is used])
fi
AM_CONDITIONAL(ENABLE_CXX11, test x$ENABLE_CXX11 = xyes)
ENABLE_ZIP_ARCHIVE_AND_CXX11=no
if test x$ENABLE_CXX11 = xyes -a x$ENABLE_ZIP_ARCHIVE = xyes; then
ENABLE_ZIP_ARCHIVE_AND_CXX11 = yes
fi
AM_CONDITIONAL(ENABLE_ZIP_ARCHIVE_AND_CXX11, test x$ENABLE_ZIP_ARCHIVE_AND_CXX11 = xyes)
dnl Check for the presence of doxygen program
if test x$ENABLE_APIDOC != xno; then
AC_CHECK_PROG(FOUND_DOXYGEN, doxygen, yes, no)
if test x$ENABLE_APIDOC = xauto; then
if test x$FOUND_DOXYGEN = xyes; then
ENABLE_APIDOC=yes
else
ENABLE_APIDOC=no
fi
fi
fi
AM_CONDITIONAL(ENABLE_APIDOC, test x$ENABLE_APIDOC = xyes)
dnl Check for the presence of the sphinx-build program
if test x$ENABLE_MANUAL != xno; then
AC_CHECK_PROG(FOUND_SPHINX_BUILD, sphinx-build, yes, no)
if test x$ENABLE_MANUAL = xauto; then
if test x$FOUND_SPHINX_BUILD = xyes; then
ENABLE_MANUAL=yes
else
ENABLE_MANUAL=no
fi
fi
fi
AM_CONDITIONAL(ENABLE_MANUAL, test x$ENABLE_MANUAL = xyes)
dnl Set the list of libraries libabigail depends on
DEPS_LIBS="$XML_LIBS $LIBZIP_LIBS $DW_LIBS $ELF_LIBS"
Initial writing/reading of an ABI corpus to an archive * configure.ac: Support detection of libzip dependency. Define new DEPS_CFLAGS and DEPS_LIBS variables for use in Makefile.am to refer to the dependency headers and libraries. * doc/website/mainpage.txt: Update this to talk about the new libzip dependency. * include/Makefile.am: Add abg-libzip-utils.h to the build system. * include/abg-corpus.h (corps): Hide abigail::corpus's private behind a pimpl idiom. (corpus::{drop_translation_units, get_file_path, set_file_path, write, read}): New methods. * include/abg-libxml-utils.h (new_reader_from_buffer): Declare new function. * include/abg-libzip-utils.h: New file. * src/Makefile.am: Add abg-corpus.cc and abg-libzip-utils.cc to the build system. Refer to the library and headers dependencies via the new DEPS_LIBS and DEPS_CFLAGS variables. * src/abg-corpus.cc: New file. * src/abg-ir.cc (translation::set_path): New method. * src/abg-libxml-utils.cc (new_reader_from_buffer): Define new function. * src/abg-libzip-utils.cc: New file. * src/abg-reader.cc (translation_unit::read): New overload. * src/abg-writer.cc: Inject the names from the std namespace into the abigail namespace, rather than into abigail::writer. (abigail::translation_unit::write): New overload. This can now use ofstream and the other stuff from std that are injected in the abigail:: namespace. * tests/Makefile.am: Add tests/test-write-read-archive.cc to the build system; use that to build runtestwritereadarchive. Also add the input test data from tests/data/test-write-read-archive/test[0-4].xml. * /tests/data/test-write-read-archive/test[0-4].xml: New test input data files. * tests/test-write-read-archive.cc: New test for this archive write/read support. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-08-27 13:18:59 +00:00
AC_SUBST(DEPS_LIBS)
if test x$ABIGAIL_DEVEL != x; then
CFLAGS="-g -Wall -Wextra -Werror"
CXXFLAGS="-g -Wall -Wextra -Werror"
fi
AC_CONFIG_FILES([Makefile
libabigail.pc
include/Makefile
include/abg-version.h
doc/Makefile
doc/manuals/Makefile
src/Makefile
tools/Makefile
tests/Makefile])
AC_OUTPUT
AC_MSG_NOTICE([
=====================================================================
Libabigail: $VERSION_MAJOR.$VERSION_MINOR.$VERSION_REVISION
=====================================================================
Here is the configuration of the package:
Prefix : ${prefix}
Source code location : ${srcdir}
C Compiler : ${CC}
C++ Compiler : ${CXX}
OPTIONAL FEATURES:
Enable zip archives : ${ENABLE_ZIP_ARCHIVE}
Use a C++-11 compiler : ${ENABLE_CXX11}
Generate html apidoc : ${ENABLE_APIDOC}
Generate html manual : ${ENABLE_MANUAL}
])