source: trunk/configure.ac @ 3561

Last change on this file since 3561 was 3561, checked in by Peter, 6 years ago

Merged release 0.13.1 into trunk

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.9 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id: configure.ac 3561 2017-01-04 00:55:10Z peter $
4
5# Copyright (C) 2003 Daniel Dalevi, Jari Häkkinen
6# Copyright (C) 2004 Jari Häkkinen
7# Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson
8# Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson, Markus Ringnér
9# Copyright (C) 2009 Jari Häkkinen, Peter Johansson
10# Copyright (C) 2010, 2011 Peter Johansson
11# Copyright (C) 2012 Jari Häkkinen, Peter Johansson
12# Copyright (C) 2013, 2014, 2015, 2016 Peter Johansson
13#
14# This file is part of the yat library, http://dev.thep.lu.se/yat
15#
16# The yat library is free software; you can redistribute it
17# and/or modify it under the terms of the GNU General Public License as
18# published by the Free Software Foundation; either version 3 of the
19# License, or (at your option) any later version.
20#
21# The yat library is distributed in the hope that it will be useful,
22# but WITHOUT ANY WARRANTY; without even the implied warranty of
23# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24# General Public License for more details.
25#
26# You should have received a copy of the GNU General Public License
27# along with yat. If not, see <http://www.gnu.org/licenses/>.
28#
29# If you grabbed the source from the subversion repository you should,
30# at top-level, execute:
31#     ./bootstrap
32# To push subsequent changes of this file into the build scripts you
33# must issue:
34#     autoreconf
35
36
37m4_include([m4/version.m4])
38AC_INIT([yat],[my_VERSION],[libyat-users@lists.sourceforge.net],,
39        [http://dev.thep.lu.se/yat])
40MY_VERSION
41AC_PREREQ([2.64])
42AC_CONFIG_SRCDIR([yat/utility/Matrix.h])
43AC_CONFIG_AUX_DIR([autotools])
44dnl arg below should be the same as in Makefile.am
45AC_CONFIG_MACRO_DIR([m4])
46AC_PREFIX_DEFAULT([/usr/local])
47
48# Set default htmldir to ${docdir}/html
49AS_IF([test $htmldir = '${docdir}'], [htmldir='${docdir}/html'])
50
51AC_SUBST([YAT_LT_VERSION], [YAT_LT_VERSION_INFO])
52AC_DEFINE([YAT_VERSION], ["my_VERSION"], [version])
53
54AC_CONFIG_HEADERS([config.h])
55AM_INIT_AUTOMAKE([1.11 std-options color-tests parallel-tests
56                  silent-rules subdir-objects])
57
58# Set default programming language
59AC_LANG(C++)
60
61# propagate selected configure variables to DISTCHECK_CONFIGURE_FLAGS
62for var in CPPFLAGS CXX CXXFLAGS CXXCPP LDFLAGS LIBS; do
63  eval isset=\${$var+set}
64  if test "$isset" = 'set' ; then
65    eval val=$`echo $var`
66    DISTCHECK_CONFIGURE_FLAGS="${DISTCHECK_CONFIGURE_FLAGS}'${var}=${val}' "
67  fi
68done
69AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
70
71# record if CXXFLAGS was set by user for further use below
72AS_IF([test "${CXXFLAGS+set}" = set], [
73  CXXFLAGS_set_by_user=yes
74],[
75  AS_IF([test "${INTERNAL_CXXFLAGS+set}" = set], [
76    CXXFLAGS_set_by_user=yes
77  ], [
78    CXXFLAGS_set_by_user=no
79  ])
80  # set CXXFLAGS to avoid expansion in AC_PROG_CXX
81  CXXFLAGS=
82])
83
84# Checks for programs.
85dnl FIXME remove m4_ifdef when we assume Automake 1.12
86m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
87AC_PROG_CXX
88AC_PROG_SED
89AC_PROG_LIBTOOL
90
91# find the compiler vendor: gnu, intel, etc
92AX_COMPILER_VENDOR
93
94have_doxygen=no
95AC_PATH_PROG([DOXYGEN], [doxygen], [no])
96if test "$DOXYGEN" = "no"; then
97   AC_MSG_WARN([unable to find doxygen application])
98else
99   doxygen_min_version=1.5
100   AC_MSG_CHECKING([if doxygen is at least $doxygen_min_version])
101   doxygen_version=`$DOXYGEN --version`
102   AX_COMPARE_VERSION([$doxygen_version], [ge], [$doxygen_min_version],
103                      [have_doxygen=yes], [have_doxygen=old])
104   AC_MSG_RESULT([$doxygen_version])
105fi
106
107AC_SUBST(have_doxygen)
108AM_CONDITIONAL([DX_ENABLE_HTML], [test x$have_doxygen = xyes])
109
110# check for quiet_NaN support in OS
111# Check at run-time, but if we are cross-compiling fall back on a
112# compilation test
113AC_MSG_CHECKING([if std::numeric_limits<>::has_quiet_NaN is true])
114AC_RUN_IFELSE(
115  [AC_LANG_PROGRAM(
116    [@%:@include <limits>],
117    [return !std::numeric_limits<double>::has_quiet_NaN])],
118  [quiet_nan=yes
119   AC_MSG_RESULT($quiet_nan)],
120  [quiet_nan=no
121   AC_MSG_RESULT($quiet_nan)],
122  # if we are cross-compiling fall back on compilation test
123  [AC_MSG_RESULT(cross-compiling)
124   AC_MSG_CHECKING([for std::numeric_limits<>::quiet_NaN()])
125    AC_COMPILE_IFELSE(
126     [AC_LANG_PROGRAM(
127        [@%:@include <limits>
128         extern void f(double);],
129        [f(std::numeric_limits<double>::quiet_NaN())])],
130     [quiet_nan=yes],
131     [quiet_nan=no])
132   AC_MSG_RESULT($quiet_nan)])
133# No support for quiet NAN is fatal -- sub-sequent compilation, or execution
134# of created binary, will fail.
135AS_IF([test x"$quiet_nan" = x"no"], [
136  AC_MSG_FAILURE([dnl
137Support for quiet NAN required. yat will not work on this system!])
138])
139
140# Check for infinity support for doubles in OS
141# Check at run-time, but if we are cross-compiling fall back on a
142# compilation test
143AC_MSG_CHECKING([if std::numeric_limits<>::has_infinity is true])
144AC_RUN_IFELSE(
145  [AC_LANG_PROGRAM(
146    [@%:@include <limits>],
147    [return !std::numeric_limits<double>::has_infinity])],
148  [has_infinity=yes
149   AC_MSG_RESULT($has_infinity)],
150  [has_infinity=no
151   AC_MSG_RESULT($has_infinity)],
152  # if we are cross-compiling fall back on compilation test
153  [AC_MSG_RESULT(cross-compiling)
154   AC_MSG_CHECKING([for std::numeric_limits<>::infinity()])
155    AC_COMPILE_IFELSE(
156     [AC_LANG_PROGRAM(
157        [@%:@include <limits>
158         extern void f(double);],
159        [f(std::numeric_limits<double>::infinity())])],
160     [has_infinity=yes],
161     [has_infinity=no])
162   AC_MSG_RESULT($has_infinity)])
163# No support for infinity is fatal -- sub-sequent compilation, or execution
164# of created binary, will fail.
165AS_IF([test x"${has_infinity}" = x"no"], [
166  AC_MSG_FAILURE([dnl
167Support for infinity required. yat will not work on this system!])
168])
169
170
171AC_MSG_CHECKING([g++ deprecation attribute])
172AC_COMPILE_IFELSE(
173   [AC_LANG_PROGRAM([[void f() __attribute__ ((deprecated));]],)],
174   [AC_DEFINE([YAT_HAVE_GCC_DEPRECATED], [1],
175              [Define if compiler supports deprecated attribute, as in g++ 4.0])
176    AC_MSG_RESULT([yes])],
177   [AC_MSG_RESULT([no])] )
178
179AC_MSG_CHECKING([if std::multiset::iterator is mutable])
180AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <set>
181                                     @%:@include <vector>]],
182                                   [[std::set<std::vector<double> > s;
183                                     std::vector<double> v;
184                                     s.insert(v);
185                                     s.begin()->reserve(100);
186                                   ]])],
187                  [AC_DEFINE([MULTISET_ITERATOR_IS_MUTABLE], [1],
188                             [Define if std::multiset::iterator is mutable])
189                   AC_MSG_RESULT([yes])
190                  ],
191                  [AC_MSG_RESULT([no])] )
192
193# Save user-defined environment settings for later restoration
194APR_SAVE_THE_ENVIRONMENT(CPPFLAGS)
195APR_SAVE_THE_ENVIRONMENT(CXXFLAGS)
196APR_SAVE_THE_ENVIRONMENT(LDFLAGS)
197APR_SAVE_THE_ENVIRONMENT(LIBS)
198user_LIBS=$LIBS
199
200AS_CASE([$host_os], [darwin*], [
201  YAT_LD_ADD_FLAG([LDFLAGS], [-Wl,-flat_namespace])
202])
203
204# prefer using libtool in link tests
205YAT_USE_LIBTOOL_PUSH
206
207# Checks for libraries.
208AC_MSG_NOTICE([checking for libraries])
209AC_CHECK_LIBM
210LIBS="$LIBM $LIBS"
211# we store libs in YAT_STATIC_LIBS that are not suitable to link into
212# libyat but are needed when creating applications linking against
213# libyat. Typically these are static (only) libraries, but see ticket
214# 737 for discussion.
215YAT_STATIC_LIBS=
216YAT_CHECK_LA_LIBS([
217  double cos(double x);
218  double foo(double x) { return cos(x); }
219], [$LIBS], [$LIBM], [YAT_STATIC_LIBS])
220
221# find library implementing BLAS C API, or use gslcblas
222YAT_LIB_CBLAS([YAT_CBLAS_LIB=$CBLAS_LIB], [YAT_CBLAS_LIB=-lgslcblas])
223LIBS="$YAT_CBLAS_LIB $LIBS"
224
225# GNU Scientific Library, GSL http://www.gnu.org/software/gsl/, checks
226# Including AX_PATH_GSL macro from gsl.m4 distributed by GSL
227gsl_version="1.8"
228AC_SUBST(gsl_version)
229YAT_CHECK_GSL([$gsl_version],[LIBS="-lgsl $LIBS"],[AC_MSG_FAILURE([dnl
230GSL $gsl_version (or newer) not found. The GNU Scientific Library
231(GSL) library cannot be found. Please make sure GSL is installed.])
232])
233
234YAT_CHECK_LA_LIBS([
235  double gsl_cdf_hypergeometric_P(const unsigned int k, const unsigned int n1,
236                                  const unsigned int n2, const unsigned int t);
237  double yat_foo(void) { return gsl_cdf_hypergeometric_P(1,2,3,10); }
238], [$LIBS], [-lgsl], [YAT_STATIC_LIBS])
239
240# Boost http://www.boost.org
241min_boost_version=1.35
242AC_SUBST(min_boost_version)
243AX_BOOST_BASE(["$min_boost_version"], [], [AC_MSG_FAILURE([dnl
244Boost ${min_boost_version} (or newer) not found. Please install boost, or provide
245CPPFLAGS=-I/path/to/boost])
246])
247# skip boost link tests if boost is not wanted (--without-boost)
248AS_IF([test x"$want_boost" = x"yes"],[
249  AX_BOOST_SYSTEM
250  LIBS="$BOOST_SYSTEM_LIB $LIBS"
251  AX_BOOST_THREAD
252  YAT_CPP_ADD_FLAG([CPPFLAGS], [$BOOST_CPPFLAGS])
253  YAT_LD_ADD_FLAG([LDFLAGS], [$BOOST_LDFLAGS])
254  LIBS="$BOOST_THREAD_LIB $LIBS"
255  # linking tests in AX_BOOST_SYSTEM occasionaly miss to detect
256  # missing lib (see ticket #719), so link specifically here to catch
257  # that case.
258  AC_MSG_CHECKING([for boost::thread_specific_ptr])
259  AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@include <boost/thread/tss.hpp>],
260                                  [boost::thread_specific_ptr<int> x;
261                                   x.reset(new int(1));])],
262                 [AC_MSG_RESULT([yes])],
263                 [AC_MSG_RESULT([no])
264                  AC_MSG_FAILURE([Boost thread library not found.])
265                 ])
266  # Check if $BOOST_THREAD_LIB is appropriate for libyat.la
267  YAT_CHECK_LA_LIBS([
268    @%:@include <boost/thread.hpp>
269    int my_func(void)
270    { boost::mutex mutex_; return 0; }
271  ], [$BOOST_THREAD_LIB $user_LIBS], [$BOOST_THREAD_LIB], [YAT_STATIC_LIBS])
272  # Check if $BOOST_SYSTEM_LIB is appropriate for libyat.la
273  YAT_CHECK_LA_LIBS([
274    @%:@include <boost/system/error_code.hpp>
275    int my_func(void)
276    { boost::system::system_category; return 0; }
277  ], [$BOOST_SYSTEM_LIB $user_LIBS], [$BOOST_SYSTEM_LIB], [YAT_STATIC_LIBS])
278])
279
280# see tickets #648 #687
281AC_MSG_CHECKING([whether constructor in boost concept is supported])
282AC_COMPILE_IFELSE([
283  AC_LANG_PROGRAM(
284    [
285     @%:@include <boost/concept_check.hpp>
286     template <typename T>
287     class MyConcept
288     {
289     public:
290       MyConcept(void) {}
291       BOOST_CONCEPT_USAGE(MyConcept){}
292     };
293    ],[
294     MyConcept<double> x;
295     x = x;
296    ])
297  ],
298  [AC_MSG_RESULT([yes])
299   AC_DEFINE([YAT_HAVE_BOOST_CONCEPT_WITH_CONSTRUCTOR],[1],
300             [define if compiler supports boost concept with constructor])
301  ],
302  [AC_MSG_RESULT([no])]
303)
304
305# Workaround problem that boost 1.41 does not work with certain versions of GCC
306# see ticket #762
307AC_MSG_CHECKING([if boost::mutex workaround is needed])
308AC_COMPILE_IFELSE(
309  [AC_LANG_PROGRAM([@%:@include <boost/thread.hpp>],
310                   [boost::mutex mutex;]
311   )],
312  [AC_MSG_RESULT([no])
313   AC_DEFINE([YAT_HAVE_WORKING_BOOST_EXCEPTION_PTR], [1],
314             [Define to 1 if boost::exception_ptr works])
315  ],
316  [AC_MSG_RESULT([yes])])
317
318# Check if boost::iterator_facade::operator-> works with a proxy class
319# as reference_type; otherwise workaround is needed in
320# e.g. BamPairIterator. See ticket #790.
321AC_MSG_CHECKING([if boost::iterator_facade::operator-> works])
322AC_COMPILE_IFELSE(
323  [AC_LANG_PROGRAM(
324    [@%:@include <iterator>
325     @%:@include <boost/iterator/iterator_facade.hpp>
326     struct MyClass { void foo(void) const { } };
327     struct MyProxy { void foo(void) const { } };
328     // a nonsense class (only for compiler test purposes)
329     class MyIterator
330       : public boost::iterator_facade<
331        MyIterator, const MyClass, std::input_iterator_tag, MyProxy
332       >
333     {
334       friend class boost::iterator_core_access;
335       const MyProxy dereference(void) const { return MyProxy(); }
336       bool equal(const MyIterator& other) const { return true; }
337       void increment(void) {}
338     };
339    ],
340    [MyIterator iter; iter->foo();]
341    )
342  ],[
343    AC_MSG_RESULT([yes])
344    AC_DEFINE([YAT_HAVE_BOOST_ITERATOR_FACADE_PROXY_PTR], [1],
345              [Define to 1 if boost::iterator_facade::operator-> works])
346  ],[
347    AC_MSG_RESULT([no])
348  ])
349
350
351# check for hts and samtools available from http://www.htslib.org
352YAT_CHECK_HTSLIB
353
354#support for large files
355AC_SYS_LARGEFILE
356if test "$enable_largefile" = "no"; then
357  AC_DEFINE([YAT_LFS_DISABLED], 1,
358            [defined to 1 if large file support is disabled])
359fi
360
361AC_DEFINE([HAVE_INLINE], [1], [Define if inline is available on system])
362# default is same as --disable-debug
363AC_ARG_ENABLE([debug],
364  [AS_HELP_STRING([--enable-debug],[turn on debug options and code])],
365        [], [enable_debug=no])
366
367# If neither --enable-assert nor --disable-assert, set enable_assert
368# to same as enable_debug
369AC_ARG_ENABLE([assert],
370              [AS_HELP_STRING([--enable-assert], [turn on assertions])],
371              [], [enable_assert=$enable_debug])
372
373# we use prefix INTERNAL_ for variables that are solely needed for
374# building yat, i.e., they are not needed for a user of yat and are
375# not propagated to yat-config or yat.m4.
376AC_ARG_VAR([INTERNAL_CPPFLAGS],
377           [Similar to CPPFLAGS but value is not propagated to yat-config])
378AC_ARG_VAR([INTERNAL_CXXFLAGS],
379           [Similar to CXXFLAGS but value is not propagated to yat-config])
380AC_ARG_VAR([INTERNAL_LDFLAGS],
381           [Similar to LDFLAGS but value is not propagated to yat-config])
382
383AS_IF([test "${enable_debug}" = "yes"], [
384  AC_DEFINE([YAT_DEBUG], [1], [Define to activate yat assertioons])
385  YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-Wall -pedantic -g -O])
386], [
387  # avoid defining GSL_RANGE_CHECK_OFF if GSL_RANGE_CHECK is already defined
388  AC_CHECK_DECL([GSL_RANGE_CHECK],[],
389                [AC_DEFINE([GSL_RANGE_CHECK_OFF], [1],
390                           [Define to turn off GSL range checks])])
391  # If CXXFLAGS not set by user, set it to default value
392  AS_IF([test x$CXXFLAGS_set_by_user != xyes], [
393    YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS],[-O3])
394  ])
395])
396
397AS_IF([test x"$enable_assert" = x"no"], [
398  AC_DEFINE([NDEBUG], [1], [Define to turn off assertions])
399])
400
401# turn off compiler warning #654 from intel compiler
402AS_IF([test x"$ax_cv_cxx_compiler_vendor" = x"intel"], [
403  YAT_CXX_ADD_FLAG([CXXFLAGS], ['-diag-disable 654'])
404])
405
406# Turns warnings to errors in compilation tests. Only put tests that
407# should be warning sensitive below this point. Can't find any
408# mechanism to revert AC_LANG_WERROR
409AC_LANG_WERROR
410
411# GCC 4.0.1 on OSX complains about -pthread (issue #713)
412AS_IF([AS_ECHO(["$CPPFLAGS"]) | $GREP '\-pthread' > /dev/null],
413  [AX_CHECK_PREPROC_FLAG([-pthread], [],
414     [CPPFLAGS=`AS_ECHO(["$CPPFLAGS"]) | $SED 's%-pthread%%'`],
415     [$INTERNAL_CPPFLAGS])
416])
417
418# When compiling boost::Mutable_*Iterator some versions of clang complains:
419# warning: unsequenced modification and access to 'i' [-Wunsequenced]
420# Test if compiler gives that warning, and if it does turn it off.
421yat_save_CXXFLAGS=$CXXFLAGS
422AC_MSG_CHECKING([whether 'boost/concept_check.hpp' causes compiler warnings])
423CXXFLAGS="$INTERNAL_CXXFLAGS $CXXFLAGS"
424AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
425  [
426    @%:@include <boost/concept_check.hpp>
427  ],[
428    BOOST_CONCEPT_ASSERT((boost::Mutable_RandomAccessIterator<double* >));
429  ])
430], [ # IF-SUCCESSFUL
431  AC_MSG_RESULT([no])
432  # restore CXXFLAGS
433  CXXFLAGS=$yat_save_CXXFLAGS
434], [ # IF-FAILED
435  AC_MSG_RESULT([yes])
436  CXXFLAGS=$yat_save_CXXFLAGS
437  YAT_CXX_ADD_FLAG([CXXFLAGS], [-Wno-unsequenced])
438])
439
440
441AS_IF([test x$enable_debug = xyes], [
442  suppress_long_long_warnings=no
443  # some versions of boost uses long long - turn off compiler warnings
444  # with -Wno-long-long
445  yat_save_CXXFLAGS=$CXXFLAGS
446  AC_MSG_CHECKING([whether boost causes long long warnings])
447  CXXFLAGS="$INTERNAL_CXXFLAGS $CXXFLAGS"
448  AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
449    [
450      @%:@include <boost/iterator/transform_iterator.hpp>
451      @%:@include <boost/thread.hpp>
452      @%:@include <cmath>
453      @%:@include <functional>
454      @%:@include <vector>
455    ],[
456      using namespace boost;
457      typedef std::pointer_to_unary_function<double, double> F;
458      std::vector<double> vec;
459      transform_iterator<F, std::vector<double>::iterator>
460        i(vec.begin(), std::ptr_fun(fabs));
461      int x = boost::thread::hardware_concurrency();
462      ++x;
463    ])],
464  [AC_MSG_RESULT([no])],
465  [AC_MSG_RESULT([yes])
466   suppress_long_long_warnings=yes
467  ])
468  AS_IF([test x"$suppress_long_long_warnings" = x"no"], [
469    AC_MSG_CHECKING([whether samtools causes long long warnings])
470    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_YAT_BAM_INCLUDES],[])],
471                      [AC_MSG_RESULT([no])],
472                      [AC_MSG_RESULT([yes])
473                       suppress_long_long_warnings=yes])
474  ])
475  AS_IF([test x"$suppress_long_long_warnings" = x"yes"], [
476    YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-Wno-long-long])
477  ])
478  # restore CXXFLAGS
479  CXXFLAGS=$yat_save_CXXFLAGS
480])
481
482#doxygen stuff
483DX_HTML_OUTPUT=html
484AC_SUBST(DX_HTML_OUTPUT)
485
486AC_CONFIG_FILES([build_support/gen_yat_pc.sh],
487                [chmod +x build_support/gen_yat_pc.sh])
488AC_CONFIG_FILES([Makefile
489     doc/doxygen.config
490     doc/first_page.doxygen
491                 test/defs.sh
492])
493
494AC_CONFIG_HEADERS([yat/utility/config_public.h])
495# for the test suite
496yat_abs_top_srcdir=`cd $srcdir && pwd`
497AC_DEFINE_UNQUOTED([YAT_ABS_TOP_SRCDIR], ["$yat_abs_top_srcdir"],
498                   [Define to absolute path to top yat src dir])
499
500# Reset flags
501APR_RESTORE_THE_ENVIRONMENT(CPPFLAGS, YAT_)
502APR_RESTORE_THE_ENVIRONMENT(CXXFLAGS, YAT_)
503APR_RESTORE_THE_ENVIRONMENT(LDFLAGS, YAT_)
504APR_RESTORE_THE_ENVIRONMENT(LIBS, YAT_)
505
506# Set some variables useful when linking
507AC_SUBST([YAT_STATIC_LIBS])
508
509# libs used in libyat.la
510yat_libyat_la_LIBADD="$YAT_LIBS"
511# We avoid linking in cblas in libyat.la, to let users choose
512# favourite cblas library at link time.
513YAT_VAR_REMOVE([yat_libyat_la_LIBADD], [$YAT_CBLAS_LIB])
514# we avoid linking in YAT_STATIC_LIBS as they have been detected to
515# not be suitable libtool archive.
516YAT_VAR_REMOVE([yat_libyat_la_LIBADD], [$YAT_STATIC_LIBS])
517AC_SUBST([yat_libyat_la_LIBADD])
518
519# Primary LIBS are same as linked into libyat.la excluding LIBM
520YAT_PRIMARY_LIBS=$yat_libyat_la_LIBADD
521YAT_VAR_REMOVE([YAT_PRIMARY_LIBS], [$LIBM])
522AC_SUBST(YAT_PRIMARY_LIBS)
523
524# Assign LIBS variables for yat.pc
525YAT_PC_LIBS_PRIVATE=$YAT_LIBS
526
527# Dependency to GSL is noted via 'Requires' field
528YAT_VAR_REMOVE([YAT_PC_LIBS_PRIVATE], [-lgsl $YAT_CBLAS_LIB $LIBM])
529YAT_SET_CONTAINS([$yat_libyat_la_LIBADD], [-lgsl], [
530  YAT_PC_REQUIRES_PRIVATE="gsl > $gsl_version"
531], [
532  YAT_PC_REQUIRES="gsl > $gsl_version"
533])
534
535# ignore this whole bam thing if --without-htslib
536AS_IF([test x$with_htslib != x"no"], [
537  # htslib comes with a pc file, so we can require htslib in yat.pc
538  AS_IF([test x$have_hts = x"yes"], [
539    YAT_VAR_REMOVE([YAT_PC_LIBS_PRIVATE], [$BAM_LIBS -lz])
540    YAT_SET_CONTAINS([$yat_libyat_la_LIBADD], [-lhts], [
541      YAT_PC_REQUIRES_PRIVATE="$YAT_PC_REQUIRES_PRIVATE htslib"
542    ], [
543      YAT_PC_REQUIRES="$YAT_PC_REQUIRES htslib"
544    ])
545  ],[
546    # libbam has no pc file, so has to remain in LIBS and instead we
547    # require zlib
548    YAT_VAR_REMOVE([YAT_PC_LIBS_PRIVATE], [-lz])
549    YAT_SET_CONTAINS([$yat_libyat_la_LIBADD], [-lz], [
550      YAT_PC_REQUIRES_PRIVATE="$YAT_PC_REQUIRES_PRIVATE zlib"
551    ], [
552      YAT_PC_REQUIRES="$YAT_PC_REQUIRES zlib"
553    ])
554  ])
555])
556
557# Having libs declared as LIBS.private in yat.pc assumes that libs
558# have been linked into libyat. Therefore for each lib check if it is
559# mentioned in $yat_libyat_la_LIBADD, and if it's not move
560# lib to LIBS variable.
561for lib in $YAT_PC_LIBS_PRIVATE; do
562  YAT_SET_CONTAINS([$yat_libyat_la_LIBADD], [$lib], [
563  ], [
564    # move lib from $YAT_PC_LIBS_PRIVATE to $YAT_PC_LIBS
565    YAT_VAR_REMOVE([$YAT_PC_LIBS_PRIVATE], [$lib])
566    YAT_PC_LIBS="$YAT_PC_LIBS $lib"
567  ])
568done
569
570AC_SUBST([YAT_PC_LIBS])
571AC_SUBST([YAT_PC_REQUIRES])
572AC_SUBST([YAT_PC_LIBS_PRIVATE])
573AC_SUBST([YAT_PC_REQUIRES_PRIVATE])
574
575AC_SUBST(YAT_LIBS)
576AC_SUBST(YAT_CBLAS_LIB)
577
578# set and AC_SUBST variables that are interpreted by Automake
579AM_CPPFLAGS="$INTERNAL_CPPFLAGS $YAT_CPPFLAGS"
580AM_CXXFLAGS="$INTERNAL_CXXFLAGS $YAT_CXXFLAGS"
581AM_LDFLAGS="$INTERNAL_LDFLAGS $YAT_LDFLAGS"
582
583AC_SUBST(AM_CPPFLAGS)
584AC_SUBST(AM_CXXFLAGS)
585AC_SUBST(AM_LDFLAGS)
586AC_SUBST([enable_shared])
587AC_SUBST([enable_static])
588
589# Name of directory libtool put stuff int - needed for some tests
590AC_SUBST([lt_cv_objdir])
591
592YAT_SVN_RELEASE([am/maintainer.am],
593  [$(YAT_MAJOR_VERSION).$(YAT_MINOR_VERSION)],
594  [libyat@frs.sourceforge.net:/home/frs/project/l/li/libyat],
595  [http://sourceforge.net/projects/libyat/files/$(distdir).tar.gz/files],
596  [http://dev.thep.lu.se/yat/browser/tags/$(VERSION)/NEWS])
597
598# make shell tests work in VPATH builds
599AC_CONFIG_LINKS([test/init.sh:test/init.sh])
600
601# set some variable for final message
602AS_CASE([$have_doxygen],
603        [yes], [doxygen_message=yes],
604        [no], [doxygen_message="no (doxygen not found)"],
605        [old], [doxygen_message="no (\`$DOXYGEN' too old)"],
606        [AC_MSG_WARN([unexpected value \$have_doxygen: '$have_doxygen'])
607         AS_BOX([Report this to ]AC_PACKAGE_BUGREPORT)
608        ])
609
610yat_gslcblas_message=
611AS_IF([test "x$YAT_CBLAS_LIB" = "x-lgslcblas"], [
612yat_gslcblas_message='
613  GSL CBLAS found. This is a reference implementation only.
614  Consider using hardware optimized BLAS.
615  ATLAS (http://math-atlas.sourceforge.net/) provides an
616  optimized BLAS library. It is supported by yat!
617'
618])
619
620yat_libbam_message=
621AS_IF([test x$with_htslib = x"yes" && test x"$have_hts" != x"yes"], [
622yat_libbam_message='
623  LIBBAM found. Support for LIBBAM is deprecated and will be
624  removed in future versions. It is recommended to install HTSLIB
625  available from http://www.htslib.org
626'
627])
628
629# Create output.
630AC_OUTPUT
631
632
633# Some more messages.
634AC_MSG_RESULT([
635yat is configured as follows:
636
637  Build Shared Library: $enable_shared
638  Build Static Library: $enable_static
639  Build Documentation:  $doxygen_message
640  With Bam Support:     $with_htslib
641
642Options used to compile and link:
643  VERSION     = $VERSION
644  CXX         = $CXX
645  CPPFLAGS    = $CPPFLAGS
646  YAT_CPPFLAGS= $AM_CPPFLAGS
647  CXXFLAGS    = $CXXFLAGS
648  YAT_CXXFLAGS= $AM_CXXFLAGS
649  LD          = $LD
650  LDFLAGS     = $LDFLAGS
651  YAT_LDFLAGS = $AM_LDFLAGS
652  LIBS        = $LIBS
653  YAT_LIBS    = $YAT_LIBS
654${yat_gslcblas_message}dnl
655${yat_libbam_message}dnl
656----------------------------------------------------------------
657Now type `make'. dnl
658])
Note: See TracBrowser for help on using the repository browser.