## Process this file with autoconf to produce a configure script.
##
## $Id$
# Copyright (C) 2003 Daniel Dalevi, Jari Häkkinen
# Copyright (C) 2004 Jari Häkkinen
# Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson
# Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson, Markus Ringnér
# Copyright (C) 2009 Jari Häkkinen, Peter Johansson
# Copyright (C) 2010, 2011 Peter Johansson
# Copyright (C) 2012 Jari Häkkinen, Peter Johansson
# Copyright (C) 2013, 2014, 2015, 2016, 2017 Peter Johansson
#
# This file is part of the yat library, http://dev.thep.lu.se/yat
#
# The yat library is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# The yat library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with yat. If not, see .
#
# If you grabbed the source from the subversion repository you should,
# at top-level, execute:
# ./bootstrap
# To push subsequent changes of this file into the build scripts you
# must issue:
# autoreconf
m4_include([m4/version.m4])
AC_INIT([yat],[my_VERSION],[libyat-users@lists.sourceforge.net],,
[http://dev.thep.lu.se/yat])
MY_VERSION
AC_PREREQ([2.64])
AC_CONFIG_SRCDIR([yat/utility/Matrix.h])
AC_CONFIG_AUX_DIR([autotools])
dnl arg below should be the same as in Makefile.am
AC_CONFIG_MACRO_DIR([m4])
AC_PREFIX_DEFAULT([/usr/local])
# Set default htmldir to ${docdir}/html
AS_IF([test $htmldir = '${docdir}'], [htmldir='${docdir}/html'])
AC_SUBST([YAT_LT_VERSION], [YAT_LT_VERSION_INFO])
AC_DEFINE([YAT_VERSION], ["my_VERSION"], [version])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.11 std-options color-tests parallel-tests
silent-rules subdir-objects])
# Set default programming language
AC_LANG(C++)
# propagate selected configure variables to DISTCHECK_CONFIGURE_FLAGS
for var in CPPFLAGS CXX CXXFLAGS CXXCPP LDFLAGS LIBS; do
eval isset=\${$var+set}
if test "$isset" = 'set' ; then
eval val=$`echo $var`
DISTCHECK_CONFIGURE_FLAGS="${DISTCHECK_CONFIGURE_FLAGS}'${var}=${val}' "
fi
done
AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
# record if CXXFLAGS was set by user for further use below
AS_IF([test "${CXXFLAGS+set}" = set], [
CXXFLAGS_set_by_user=yes
],[
AS_IF([test "${INTERNAL_CXXFLAGS+set}" = set], [
CXXFLAGS_set_by_user=yes
], [
CXXFLAGS_set_by_user=no
])
# set CXXFLAGS to avoid expansion in AC_PROG_CXX
CXXFLAGS=
])
# Checks for programs.
dnl FIXME remove m4_ifdef when we assume Automake 1.12
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_PROG_CXX
AC_ARG_ENABLE([cxx11],
[AS_HELP_STRING([--enable-cxx11],
[search for compiler options to build with C++11 support])
AS_HELP_STRING([--disable-cxx11],
[turn off C++11 support])],
# disallow --enable-cxx11=foo (only yes or no)
[AS_CASE([$enable_cxx11],
[yes|no], [],
[AC_MSG_ERROR([invalid argument for --enable-cxx11: $enable_cxx11])])
],
#default
[enable_cxx11=maybe])
yat_have_rvalue=no
yat_have_atomic=no
yat_have_log2=no
AS_VAR_IF([enable_cxx11], [no], [], [
# if CXX11 is wanted look for rvalue support
YAT_CXX_RVALUE([yat_have_rvalue=yes
AC_DEFINE([YAT_HAVE_RVALUE], [1],
[Define if compiler supports rvalues])],
[], [$enable_cxx11])
YAT_CXX_ATOMIC([yat_have_atomic=yes
AC_DEFINE([YAT_HAVE_ATOMIC], [1],
[Define if compiler supports std::atomic])],
[], [$enable_cxx11])
YAT_CXX_LOG2([yat_have_log2=yes
AC_DEFINE([YAT_HAVE_LOG2], [1],
[Define if std::log2 exists])],
[], [$enable_cxx11])
# Unless --disable-cxx11, #define YAT_WITH_CXX11 in 'config.h'. The
# private 'config.h' is #included first in every source file
# (i.e. before 'config_public.h') and thereby YAT_HAVE_CXX11__ is
# #defined and cxx11 features compiled into libyat (if available).
AC_DEFINE([YAT_WITH_CXX11], [1], [Define if cxx11 is wanted])
])
AC_PROG_SED
AC_PROG_LIBTOOL
# find the compiler vendor: gnu, intel, etc
AX_COMPILER_VENDOR
have_doxygen=no
AC_PATH_PROG([DOXYGEN], [doxygen], [no])
if test "$DOXYGEN" = "no"; then
AC_MSG_WARN([unable to find doxygen application])
else
doxygen_min_version=1.5
AC_MSG_CHECKING([if doxygen is at least $doxygen_min_version])
doxygen_version=`$DOXYGEN --version`
AX_COMPARE_VERSION([$doxygen_version], [ge], [$doxygen_min_version],
[have_doxygen=yes], [have_doxygen=old])
AC_MSG_RESULT([$doxygen_version])
fi
AC_SUBST(have_doxygen)
AM_CONDITIONAL([DX_ENABLE_HTML], [test x$have_doxygen = xyes])
# check for quiet_NaN support in OS
# Check at run-time, but if we are cross-compiling fall back on a
# compilation test
AC_MSG_CHECKING([if std::numeric_limits<>::has_quiet_NaN is true])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[@%:@include ],
[return !std::numeric_limits::has_quiet_NaN])],
[quiet_nan=yes
AC_MSG_RESULT($quiet_nan)],
[quiet_nan=no
AC_MSG_RESULT($quiet_nan)],
# if we are cross-compiling fall back on compilation test
[AC_MSG_RESULT(cross-compiling)
AC_MSG_CHECKING([for std::numeric_limits<>::quiet_NaN()])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[@%:@include
extern void f(double);],
[f(std::numeric_limits::quiet_NaN())])],
[quiet_nan=yes],
[quiet_nan=no])
AC_MSG_RESULT($quiet_nan)])
# No support for quiet NAN is fatal -- sub-sequent compilation, or execution
# of created binary, will fail.
AS_IF([test x"$quiet_nan" = x"no"], [
AC_MSG_FAILURE([dnl
Support for quiet NAN required. yat will not work on this system!])
])
# Check for infinity support for doubles in OS
# Check at run-time, but if we are cross-compiling fall back on a
# compilation test
AC_MSG_CHECKING([if std::numeric_limits<>::has_infinity is true])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[@%:@include ],
[return !std::numeric_limits::has_infinity])],
[has_infinity=yes
AC_MSG_RESULT($has_infinity)],
[has_infinity=no
AC_MSG_RESULT($has_infinity)],
# if we are cross-compiling fall back on compilation test
[AC_MSG_RESULT(cross-compiling)
AC_MSG_CHECKING([for std::numeric_limits<>::infinity()])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[@%:@include
extern void f(double);],
[f(std::numeric_limits::infinity())])],
[has_infinity=yes],
[has_infinity=no])
AC_MSG_RESULT($has_infinity)])
# No support for infinity is fatal -- sub-sequent compilation, or execution
# of created binary, will fail.
AS_IF([test x"${has_infinity}" = x"no"], [
AC_MSG_FAILURE([dnl
Support for infinity required. yat will not work on this system!])
])
AC_MSG_CHECKING([g++ deprecation attribute])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[void f() __attribute__ ((deprecated));]],)],
[AC_DEFINE([YAT_HAVE_GCC_DEPRECATED], [1],
[Define if compiler supports deprecated attribute, as in g++ 4.0])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])] )
AC_MSG_CHECKING([if std::multiset::iterator is mutable])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include
@%:@include ]],
[[std::set > s;
std::vector v;
s.insert(v);
s.begin()->reserve(100);
]])],
[AC_DEFINE([MULTISET_ITERATOR_IS_MUTABLE], [1],
[Define if std::multiset::iterator is mutable])
AC_MSG_RESULT([yes])
],
[AC_MSG_RESULT([no])] )
# Save user-defined environment settings for later restoration
APR_SAVE_THE_ENVIRONMENT(CPPFLAGS)
APR_SAVE_THE_ENVIRONMENT(CXXFLAGS)
APR_SAVE_THE_ENVIRONMENT(LDFLAGS)
APR_SAVE_THE_ENVIRONMENT(LIBS)
user_LIBS=$LIBS
AS_CASE([$host_os], [darwin*], [
YAT_LD_ADD_FLAG([LDFLAGS], [-Wl,-flat_namespace])
])
# prefer using libtool in link tests
YAT_USE_LIBTOOL_PUSH
# Checks for libraries.
AC_MSG_NOTICE([checking for libraries])
AC_CHECK_LIBM
LIBS="$LIBM $LIBS"
# we store libs in YAT_STATIC_LIBS that are not suitable to link into
# libyat but are needed when creating applications linking against
# libyat. Typically these are static (only) libraries, but see ticket
# 737 for discussion.
YAT_STATIC_LIBS=
YAT_CHECK_LA_LIBS([
double cos(double x);
double foo(double x) { return cos(x); }
], [$LIBS], [$LIBM], [YAT_STATIC_LIBS])
# find library implementing BLAS C API, or use gslcblas
YAT_LIB_CBLAS([YAT_CBLAS_LIB=$CBLAS_LIB], [YAT_CBLAS_LIB=-lgslcblas])
LIBS="$YAT_CBLAS_LIB $LIBS"
# GNU Scientific Library, GSL http://www.gnu.org/software/gsl/, checks
# Including AX_PATH_GSL macro from gsl.m4 distributed by GSL
gsl_version="1.8"
AC_SUBST(gsl_version)
YAT_CHECK_GSL([$gsl_version],[LIBS="-lgsl $LIBS"],[AC_MSG_FAILURE([dnl
GSL $gsl_version (or newer) not found. The GNU Scientific Library
(GSL) library cannot be found. Please make sure GSL is installed.])
])
YAT_CHECK_LA_LIBS([
double gsl_cdf_hypergeometric_P(const unsigned int k, const unsigned int n1,
const unsigned int n2, const unsigned int t);
double yat_foo(void) { return gsl_cdf_hypergeometric_P(1,2,3,10); }
], [$LIBS], [-lgsl], [YAT_STATIC_LIBS])
# Boost http://www.boost.org
min_boost_version=1.35
AC_SUBST(min_boost_version)
AX_BOOST_BASE(["$min_boost_version"], [], [AC_MSG_FAILURE([dnl
Boost ${min_boost_version} (or newer) not found. Please install boost, or provide
CPPFLAGS=-I/path/to/boost])
])
# skip boost link tests if boost is not wanted (--without-boost)
AS_IF([test x"$want_boost" = x"yes"],[
AX_BOOST_SYSTEM
LIBS="$BOOST_SYSTEM_LIB $LIBS"
AX_BOOST_THREAD
YAT_CPP_ADD_FLAG([CPPFLAGS], [$BOOST_CPPFLAGS])
YAT_LD_ADD_FLAG([LDFLAGS], [$BOOST_LDFLAGS])
LIBS="$BOOST_THREAD_LIB $LIBS"
# linking tests in AX_BOOST_SYSTEM occasionaly miss to detect
# missing lib (see ticket #719), so link specifically here to catch
# that case.
AC_MSG_CHECKING([for boost::thread_specific_ptr])
AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@include ],
[boost::thread_specific_ptr x;
x.reset(new int(1));])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_FAILURE([Boost thread library not found.])
])
# Check if $BOOST_THREAD_LIB is appropriate for libyat.la
YAT_CHECK_LA_LIBS([
@%:@include
int my_func(void)
{ boost::mutex mutex_; return 0; }
], [$BOOST_THREAD_LIB $user_LIBS], [$BOOST_THREAD_LIB], [YAT_STATIC_LIBS])
# Check if $BOOST_SYSTEM_LIB is appropriate for libyat.la
YAT_CHECK_LA_LIBS([
@%:@include
int my_func(void)
{ boost::system::system_category; return 0; }
], [$BOOST_SYSTEM_LIB $user_LIBS], [$BOOST_SYSTEM_LIB], [YAT_STATIC_LIBS])
])
# see tickets #648 #687
AC_MSG_CHECKING([whether constructor in boost concept is supported])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(
[
@%:@include
template
class MyConcept
{
public:
MyConcept(void) {}
BOOST_CONCEPT_USAGE(MyConcept){}
};
],[
MyConcept x;
x = x;
])
],
[AC_MSG_RESULT([yes])
AC_DEFINE([YAT_HAVE_BOOST_CONCEPT_WITH_CONSTRUCTOR],[1],
[define if compiler supports boost concept with constructor])
],
[AC_MSG_RESULT([no])]
)
# Workaround problem that boost 1.41 does not work with certain versions of GCC
# see ticket #762
AC_MSG_CHECKING([if boost::mutex workaround is needed])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([@%:@include ],
[boost::mutex mutex;]
)],
[AC_MSG_RESULT([no])
AC_DEFINE([YAT_HAVE_WORKING_BOOST_EXCEPTION_PTR], [1],
[Define to 1 if boost::exception_ptr works])
],
[AC_MSG_RESULT([yes])])
# Check if boost::iterator_facade::operator-> works with a proxy class
# as reference_type; otherwise workaround is needed in
# e.g. BamPairIterator. See ticket #790.
AC_MSG_CHECKING([if boost::iterator_facade::operator-> works])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[@%:@include
@%:@include
struct MyClass { void foo(void) const { } };
struct MyProxy { void foo(void) const { } };
// a nonsense class (only for compiler test purposes)
class MyIterator
: public boost::iterator_facade<
MyIterator, const MyClass, std::input_iterator_tag, MyProxy
>
{
friend class boost::iterator_core_access;
const MyProxy dereference(void) const { return MyProxy(); }
bool equal(const MyIterator& other) const { return true; }
void increment(void) {}
};
],
[MyIterator iter; iter->foo();]
)
],[
AC_MSG_RESULT([yes])
AC_DEFINE([YAT_HAVE_BOOST_ITERATOR_FACADE_PROXY_PTR], [1],
[Define to 1 if boost::iterator_facade::operator-> works])
],[
AC_MSG_RESULT([no])
])
# check for hts and samtools available from http://www.htslib.org
YAT_CHECK_HTSLIB
#support for large files
AC_SYS_LARGEFILE
if test "$enable_largefile" = "no"; then
AC_DEFINE([YAT_LFS_DISABLED], 1,
[defined to 1 if large file support is disabled])
fi
AC_DEFINE([HAVE_INLINE], [1], [Define if inline is available on system])
# default is same as --disable-debug
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],[turn on debug options and code])],
[], [enable_debug=no])
# If neither --enable-assert nor --disable-assert, set enable_assert
# to same as enable_debug
AC_ARG_ENABLE([assert],
[AS_HELP_STRING([--enable-assert], [turn on assertions])],
[], [enable_assert=$enable_debug])
# we use prefix INTERNAL_ for variables that are solely needed for
# building yat, i.e., they are not needed for a user of yat and are
# not propagated to yat-config or yat.m4.
AC_ARG_VAR([INTERNAL_CPPFLAGS],
[Similar to CPPFLAGS but value is not propagated to yat-config])
AC_ARG_VAR([INTERNAL_CXXFLAGS],
[Similar to CXXFLAGS but value is not propagated to yat-config])
AC_ARG_VAR([INTERNAL_LDFLAGS],
[Similar to LDFLAGS but value is not propagated to yat-config])
AS_IF([test "${enable_debug}" = "yes"], [
AC_DEFINE([YAT_DEBUG], [1], [Define to activate yat assertioons])
YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-Wall -pedantic -g -O])
], [
# avoid defining GSL_RANGE_CHECK_OFF if GSL_RANGE_CHECK is already defined
AC_CHECK_DECL([GSL_RANGE_CHECK],[],
[AC_DEFINE([GSL_RANGE_CHECK_OFF], [1],
[Define to turn off GSL range checks])])
# If CXXFLAGS not set by user, set it to default value
AS_IF([test x$CXXFLAGS_set_by_user != xyes], [
YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS],[-O3])
])
])
AS_IF([test x"$enable_assert" = x"no"], [
AC_DEFINE([NDEBUG], [1], [Define to turn off assertions])
])
# turn off compiler warning #654 from intel compiler
AS_IF([test x"$ax_cv_cxx_compiler_vendor" = x"intel"], [
YAT_CXX_ADD_FLAG([CXXFLAGS], ['-diag-disable 654'])
])
# Turns warnings to errors in compilation tests. Only put tests that
# should be warning sensitive below this point. Can't find any
# mechanism to revert AC_LANG_WERROR
AC_LANG_WERROR
# GCC 4.0.1 on OSX complains about -pthread (issue #713)
AS_IF([AS_ECHO(["$CPPFLAGS"]) | $GREP '\-pthread' > /dev/null],
[AX_CHECK_PREPROC_FLAG([-pthread], [],
[CPPFLAGS=`AS_ECHO(["$CPPFLAGS"]) | $SED 's%-pthread%%'`],
[$INTERNAL_CPPFLAGS])
])
# When compiling boost::Mutable_*Iterator some versions of clang complains:
# warning: unsequenced modification and access to 'i' [-Wunsequenced]
# Test if compiler gives that warning, and if it does turn it off.
yat_save_CXXFLAGS=$CXXFLAGS
AC_MSG_CHECKING([whether 'boost/concept_check.hpp' causes compiler warnings])
CXXFLAGS="$INTERNAL_CXXFLAGS $CXXFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
@%:@include
],[
BOOST_CONCEPT_ASSERT((boost::Mutable_RandomAccessIterator));
])
], [ # IF-SUCCESSFUL
AC_MSG_RESULT([no])
# restore CXXFLAGS
CXXFLAGS=$yat_save_CXXFLAGS
], [ # IF-FAILED
AC_MSG_RESULT([yes])
CXXFLAGS=$yat_save_CXXFLAGS
YAT_CXX_ADD_FLAG([CXXFLAGS], [-Wno-unsequenced])
])
AS_IF([test x$enable_debug = xyes], [
suppress_long_long_warnings=no
# some versions of boost uses long long - turn off compiler warnings
# with -Wno-long-long
yat_save_CXXFLAGS=$CXXFLAGS
AC_MSG_CHECKING([whether boost causes long long warnings])
CXXFLAGS="$INTERNAL_CXXFLAGS $CXXFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
@%:@include
@%:@include
@%:@include
@%:@include
@%:@include
],[
using namespace boost;
typedef std::pointer_to_unary_function F;
std::vector vec;
transform_iterator::iterator>
i(vec.begin(), std::ptr_fun(fabs));
int x = boost::thread::hardware_concurrency();
++x;
])],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([yes])
suppress_long_long_warnings=yes
])
AS_IF([test x"$suppress_long_long_warnings" = x"no"], [
AC_MSG_CHECKING([whether samtools causes long long warnings])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_YAT_BAM_INCLUDES],[])],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([yes])
suppress_long_long_warnings=yes])
])
AS_IF([test x"$suppress_long_long_warnings" = x"yes"], [
YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-Wno-long-long])
])
# restore CXXFLAGS
CXXFLAGS=$yat_save_CXXFLAGS
])
#doxygen stuff
DX_HTML_OUTPUT=html
AC_SUBST(DX_HTML_OUTPUT)
AC_CONFIG_FILES([build_support/gen_yat_pc.sh],
[chmod +x build_support/gen_yat_pc.sh])
AC_CONFIG_FILES([Makefile
doc/doxygen.config
doc/first_page.doxygen
test/defs.sh
])
AC_CONFIG_HEADERS([yat/utility/config_public.h])
canonical_abs_top_srcdir=`cd $srcdir && pwd -P`
AC_SUBST([canonical_abs_top_srcdir])
canonical_abs_top_builddir=`pwd -P`
AC_SUBST([canonical_abs_top_builddir])
# for the test suite
yat_abs_top_srcdir=`cd $srcdir && pwd`
AC_DEFINE_UNQUOTED([YAT_ABS_TOP_SRCDIR], ["$yat_abs_top_srcdir"],
[Define to absolute path to top yat src dir])
# Reset flags
APR_RESTORE_THE_ENVIRONMENT(CPPFLAGS, YAT_)
APR_RESTORE_THE_ENVIRONMENT(CXXFLAGS, YAT_)
APR_RESTORE_THE_ENVIRONMENT(LDFLAGS, YAT_)
APR_RESTORE_THE_ENVIRONMENT(LIBS, YAT_)
# Set some variables useful when linking
AC_SUBST([YAT_STATIC_LIBS])
# libs used in libyat.la
yat_libyat_la_LIBADD="$YAT_LIBS"
# We avoid linking in cblas in libyat.la, to let users choose
# favourite cblas library at link time.
YAT_VAR_REMOVE([yat_libyat_la_LIBADD], [$YAT_CBLAS_LIB])
# we avoid linking in YAT_STATIC_LIBS as they have been detected to
# not be suitable libtool archive.
YAT_VAR_REMOVE([yat_libyat_la_LIBADD], [$YAT_STATIC_LIBS])
AC_SUBST([yat_libyat_la_LIBADD])
# Primary LIBS are same as linked into libyat.la excluding LIBM
YAT_PRIMARY_LIBS=$yat_libyat_la_LIBADD
YAT_VAR_REMOVE([YAT_PRIMARY_LIBS], [$LIBM])
AC_SUBST(YAT_PRIMARY_LIBS)
# Assign LIBS variables for yat.pc
YAT_PC_LIBS_PRIVATE=$YAT_LIBS
# Dependency to GSL is noted via 'Requires' field
YAT_VAR_REMOVE([YAT_PC_LIBS_PRIVATE], [-lgsl $YAT_CBLAS_LIB $LIBM])
YAT_SET_CONTAINS([$yat_libyat_la_LIBADD], [-lgsl], [
YAT_PC_REQUIRES_PRIVATE="gsl > $gsl_version"
], [
YAT_PC_REQUIRES="gsl > $gsl_version"
])
# ignore this whole bam thing if --without-htslib
AS_IF([test x$with_htslib != x"no"], [
# htslib comes with a pc file, so we can require htslib in yat.pc
AS_IF([test x$have_hts = x"yes"], [
YAT_VAR_REMOVE([YAT_PC_LIBS_PRIVATE], [$BAM_LIBS -lz])
YAT_SET_CONTAINS([$yat_libyat_la_LIBADD], [-lhts], [
YAT_PC_REQUIRES_PRIVATE="$YAT_PC_REQUIRES_PRIVATE htslib"
], [
YAT_PC_REQUIRES="$YAT_PC_REQUIRES htslib"
])
],[
# libbam has no pc file, so has to remain in LIBS and instead we
# require zlib
YAT_VAR_REMOVE([YAT_PC_LIBS_PRIVATE], [-lz])
YAT_SET_CONTAINS([$yat_libyat_la_LIBADD], [-lz], [
YAT_PC_REQUIRES_PRIVATE="$YAT_PC_REQUIRES_PRIVATE zlib"
], [
YAT_PC_REQUIRES="$YAT_PC_REQUIRES zlib"
])
])
])
# Having libs declared as LIBS.private in yat.pc assumes that libs
# have been linked into libyat. Therefore for each lib check if it is
# mentioned in $yat_libyat_la_LIBADD, and if it's not move
# lib to LIBS variable.
for lib in $YAT_PC_LIBS_PRIVATE; do
YAT_SET_CONTAINS([$yat_libyat_la_LIBADD], [$lib], [
], [
# move lib from $YAT_PC_LIBS_PRIVATE to $YAT_PC_LIBS
YAT_VAR_REMOVE([$YAT_PC_LIBS_PRIVATE], [$lib])
YAT_PC_LIBS="$YAT_PC_LIBS $lib"
])
done
AC_SUBST([YAT_PC_LIBS])
AC_SUBST([YAT_PC_REQUIRES])
AC_SUBST([YAT_PC_LIBS_PRIVATE])
AC_SUBST([YAT_PC_REQUIRES_PRIVATE])
AC_SUBST(YAT_LIBS)
AC_SUBST(YAT_CBLAS_LIB)
# set and AC_SUBST variables that are interpreted by Automake
AM_CPPFLAGS="$INTERNAL_CPPFLAGS $YAT_CPPFLAGS"
AM_CXXFLAGS="$INTERNAL_CXXFLAGS $YAT_CXXFLAGS"
AM_LDFLAGS="$INTERNAL_LDFLAGS $YAT_LDFLAGS"
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(AM_CXXFLAGS)
AC_SUBST(AM_LDFLAGS)
AC_SUBST([enable_shared])
AC_SUBST([enable_static])
# Name of directory libtool put stuff int - needed for some tests
AC_SUBST([lt_cv_objdir])
YAT_SVN_RELEASE([am/maintainer.am],
[$(YAT_MAJOR_VERSION).$(YAT_MINOR_VERSION)],
[libyat@frs.sourceforge.net:/home/frs/project/l/li/libyat],
[http://sourceforge.net/projects/libyat/files/$(distdir).tar.gz/files],
[http://dev.thep.lu.se/yat/browser/tags/$(VERSION)/NEWS])
# make shell tests work in VPATH builds
AC_CONFIG_LINKS([test/init.sh:test/init.sh])
# set some variable for final message
AS_CASE([$have_doxygen],
[yes], [doxygen_message=yes],
[no], [doxygen_message="no (doxygen not found)"],
[old], [doxygen_message="no (\`$DOXYGEN' too old)"],
[AC_MSG_WARN([unexpected value \$have_doxygen: '$have_doxygen'])
AS_BOX([Report this to ]AC_PACKAGE_BUGREPORT)
])
yat_gslcblas_message=
AS_IF([test "x$YAT_CBLAS_LIB" = "x-lgslcblas"], [
yat_gslcblas_message='
GSL CBLAS found. This is a reference implementation only.
Consider using hardware optimized BLAS.
ATLAS (http://math-atlas.sourceforge.net/) provides an
optimized BLAS library. It is supported by yat!
'
])
yat_libbam_message=
AS_IF([test x$with_htslib = x"yes" && test x"$have_hts" != x"yes"], [
yat_libbam_message='
LIBBAM found. Support for LIBBAM is deprecated and will be
removed in future versions. It is recommended to install HTSLIB
available from http://www.htslib.org
'
])
# Create output.
AC_OUTPUT
# Some more messages.
AC_MSG_RESULT([
yat is configured as follows:
Build Shared Library: $enable_shared
Build Static Library: $enable_static
Build Documentation: $doxygen_message
With Bam Support: $with_htslib
With Rvalue Support: $yat_have_rvalue
With atomic Support: $yat_have_atomic
Options used to compile and link:
VERSION = $VERSION
CXX = $CXX
CPPFLAGS = $CPPFLAGS
YAT_CPPFLAGS= $AM_CPPFLAGS
CXXFLAGS = $CXXFLAGS
YAT_CXXFLAGS= $AM_CXXFLAGS
LD = $LD
LDFLAGS = $LDFLAGS
YAT_LDFLAGS = $AM_LDFLAGS
LIBS = $LIBS
YAT_LIBS = $YAT_LIBS
${yat_gslcblas_message}dnl
${yat_libbam_message}dnl
----------------------------------------------------------------
Now type `make'. dnl
])