source: branches/0.12-stable/configure.ac @ 3293

Last change on this file since 3293 was 3293, checked in by Peter, 9 years ago

update copyright years

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