1412 |
15 Aug 08 |
peter |
## $Id$ |
2776 |
15 Jul 12 |
peter |
2 |
# |
3588 |
19 Jan 17 |
peter |
# serial 10 (yat 0.15) |
2776 |
15 Jul 12 |
peter |
4 |
# |
2776 |
15 Jul 12 |
peter |
# see http://www.gnu.org/software/automake/manual/automake.html#Serials |
2776 |
15 Jul 12 |
peter |
6 |
# |
1412 |
15 Aug 08 |
peter |
# SYNOPSIS |
1412 |
15 Aug 08 |
peter |
8 |
# |
1412 |
15 Aug 08 |
peter |
# YAT_CHECK_YAT([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
1412 |
15 Aug 08 |
peter |
10 |
# |
1412 |
15 Aug 08 |
peter |
# DESCRIPTION |
1412 |
15 Aug 08 |
peter |
12 |
# |
1412 |
15 Aug 08 |
peter |
# Test yat library of a particular version |
1412 |
15 Aug 08 |
peter |
14 |
# |
1412 |
15 Aug 08 |
peter |
# This macro file can be used by applications to find and use the |
1412 |
15 Aug 08 |
peter |
# yat library. |
2690 |
28 Feb 12 |
peter |
17 |
# |
1796 |
12 Feb 09 |
peter |
# Note: macros in this file assume that yat-config has been |
1796 |
12 Feb 09 |
peter |
# installed. yat-config was introduced in yat 0.5 and |
1796 |
12 Feb 09 |
peter |
# consequently these macros do not work with yat 0.4.x (or |
1796 |
12 Feb 09 |
peter |
# older). |
1796 |
12 Feb 09 |
peter |
22 |
# |
1412 |
15 Aug 08 |
peter |
# This macro calls: |
2690 |
28 Feb 12 |
peter |
24 |
# |
1412 |
15 Aug 08 |
peter |
# AC_SUBST(YAT_CPPFLAGS) |
1412 |
15 Aug 08 |
peter |
# AC_SUBST(YAT_CXXFLAGS) |
1412 |
15 Aug 08 |
peter |
# AC_SUBST(YAT_LDFLAGS) |
1412 |
15 Aug 08 |
peter |
# AC_SUBST(YAT_LIBS) |
1412 |
15 Aug 08 |
peter |
# AC_SUBST(YAT_LA_FILE) |
2021 |
04 Aug 09 |
peter |
# AC_SUBST(YAT_LT_ADD) |
1412 |
15 Aug 08 |
peter |
31 |
# |
1412 |
15 Aug 08 |
peter |
# defines: |
1412 |
15 Aug 08 |
peter |
33 |
# |
1412 |
15 Aug 08 |
peter |
# HAVE_YAT |
1412 |
15 Aug 08 |
peter |
35 |
# |
1412 |
15 Aug 08 |
peter |
# and sets the following variable: |
1412 |
15 Aug 08 |
peter |
37 |
# |
1412 |
15 Aug 08 |
peter |
# yat_config: If yat-config exists, $yat_config refers to it, |
1412 |
15 Aug 08 |
peter |
# otherwise $yat_config is set to "no". |
1412 |
15 Aug 08 |
peter |
40 |
# |
1412 |
15 Aug 08 |
peter |
41 |
# |
1412 |
15 Aug 08 |
peter |
# YAT_CHECK_YAT is split into sub-macros: |
1412 |
15 Aug 08 |
peter |
43 |
# |
1412 |
15 Aug 08 |
peter |
# YAT_FIND_YAT() |
1412 |
15 Aug 08 |
peter |
# YAT_CHECK_VERSION([MINIMUM-VERSION]) |
1412 |
15 Aug 08 |
peter |
# YAT_CHECK_HEADER() |
1412 |
15 Aug 08 |
peter |
# YAT_CHECK_LIB() |
1412 |
15 Aug 08 |
peter |
48 |
# |
1412 |
15 Aug 08 |
peter |
# so when preferable, you can call any of these instead. |
1412 |
15 Aug 08 |
peter |
50 |
# |
1412 |
15 Aug 08 |
peter |
51 |
# |
1412 |
15 Aug 08 |
peter |
# YAT_FIND_YAT([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
1412 |
15 Aug 08 |
peter |
53 |
# |
1412 |
15 Aug 08 |
peter |
# Finds the yat-config scripts. If there is no --with-yat |
1412 |
15 Aug 08 |
peter |
# specified, it will look in the PATH. Sets a shell variable |
1412 |
15 Aug 08 |
peter |
# $yat_config. $yat_config is required for the other macros and |
1412 |
15 Aug 08 |
peter |
# therefore if YAT_FIND_YAT has not been called, they will call |
1854 |
07 Mar 09 |
peter |
# YAT_FIND_YAT. If --without-yat (or equivalently --with-yat=no) |
1854 |
07 Mar 09 |
peter |
# is given, all tests and actions are turned off. |
1412 |
15 Aug 08 |
peter |
60 |
# |
1412 |
15 Aug 08 |
peter |
61 |
# |
2574 |
02 Oct 11 |
peter |
# YAT_CHECK_VERSION([MINIMUM-VERSION=0.5], |
2574 |
02 Oct 11 |
peter |
# [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) |
1412 |
15 Aug 08 |
peter |
64 |
# |
1412 |
15 Aug 08 |
peter |
# If the version of yat is at least MINIMUM-VERSION, execute |
1412 |
15 Aug 08 |
peter |
# ACTION-IF-FOUND, otherwise execute ACTION-IF-NOT-FOUND. |
1412 |
15 Aug 08 |
peter |
67 |
# |
1412 |
15 Aug 08 |
peter |
68 |
# |
1412 |
15 Aug 08 |
peter |
# YAT_CHECK_HEADER([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
1412 |
15 Aug 08 |
peter |
70 |
# |
1796 |
12 Feb 09 |
peter |
# If yat headers are found and compilable, call |
1412 |
15 Aug 08 |
peter |
# AC_SUBST(YAT_CPPFLAGS) and AC_SUBST(YAT_CXXFLAGS), define |
1412 |
15 Aug 08 |
peter |
# HAVE_YAT, execute ACTION-IF-FOUND. If test compilation failed |
1412 |
15 Aug 08 |
peter |
# execute ACTION-IF-NOT-FOUND. |
1412 |
15 Aug 08 |
peter |
75 |
# |
1412 |
15 Aug 08 |
peter |
76 |
# |
1412 |
15 Aug 08 |
peter |
# YAT_CHECK_LIB([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
1412 |
15 Aug 08 |
peter |
78 |
# |
1412 |
15 Aug 08 |
peter |
# Compile a small program and link it to yat. On success call |
2021 |
04 Aug 09 |
peter |
# AC_SUBST(YAT_LDFLAGS), AC_SUBST(YAT_LIBS), AC_SUBST(YAT_LT_ADD), |
2021 |
04 Aug 09 |
peter |
# and AC_SUBST(YAT_LA_FILE), and define HAVE_YAT, and execute |
1412 |
15 Aug 08 |
peter |
# ACTION-IF-FOUND. On failure execute ACTION-IF-NOT-FOUND. |
1412 |
15 Aug 08 |
peter |
83 |
# |
3054 |
14 Jun 13 |
peter |
# YAT_CHECK_LIB_WITH_BAM([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
1412 |
15 Aug 08 |
peter |
85 |
# |
3054 |
14 Jun 13 |
peter |
# Test if libyat has bam support. Compile a small program using |
3054 |
14 Jun 13 |
peter |
# class omic::InBamFile and link it to libyat. On success execute |
3054 |
14 Jun 13 |
peter |
# ACTION-IF-FOUND. On failure execute ACTION-IF-NOT-FOUND. Macro |
3054 |
14 Jun 13 |
peter |
# requires that yat-config is available, see YAT_FIND_YAT above. |
1412 |
15 Aug 08 |
peter |
90 |
# |
3054 |
14 Jun 13 |
peter |
91 |
# |
1412 |
15 Aug 08 |
peter |
# LAST MODIFICATION |
1412 |
15 Aug 08 |
peter |
93 |
# |
1412 |
15 Aug 08 |
peter |
# $Date$ |
1412 |
15 Aug 08 |
peter |
95 |
# |
1412 |
15 Aug 08 |
peter |
# COPYLEFT |
1412 |
15 Aug 08 |
peter |
97 |
# |
2119 |
12 Dec 09 |
peter |
# Copyright (C) 2008 Jari Häkkinen, Peter Johansson |
3661 |
14 Jul 17 |
peter |
# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2017 Peter Johansson |
1412 |
15 Aug 08 |
peter |
100 |
# |
1412 |
15 Aug 08 |
peter |
# This file is part of the yat library, http://dev.thep.lu.se/yat |
1412 |
15 Aug 08 |
peter |
102 |
# |
1412 |
15 Aug 08 |
peter |
# The yat library is free software; you can redistribute it and/or |
1412 |
15 Aug 08 |
peter |
# modify it under the terms of the GNU General Public License as |
1486 |
09 Sep 08 |
jari |
# published by the Free Software Foundation; either version 3 of the |
1412 |
15 Aug 08 |
peter |
# License, or (at your option) any later version. |
1412 |
15 Aug 08 |
peter |
107 |
# |
1412 |
15 Aug 08 |
peter |
# The yat library is distributed in the hope that it will be useful, |
1412 |
15 Aug 08 |
peter |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1412 |
15 Aug 08 |
peter |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1412 |
15 Aug 08 |
peter |
# General Public License for more details. |
1412 |
15 Aug 08 |
peter |
112 |
# |
1412 |
15 Aug 08 |
peter |
# You should have received a copy of the GNU General Public License |
1487 |
10 Sep 08 |
jari |
# along with yat. If not, see <http://www.gnu.org/licenses/>. |
1412 |
15 Aug 08 |
peter |
115 |
# |
1412 |
15 Aug 08 |
peter |
116 |
|
1412 |
15 Aug 08 |
peter |
117 |
AC_DEFUN([YAT_CHECK_YAT], |
1412 |
15 Aug 08 |
peter |
118 |
[ |
2295 |
08 Jul 10 |
peter |
119 |
AC_PREREQ([2.60]) dnl we use YAT_FIND_YAT |
1412 |
15 Aug 08 |
peter |
120 |
ac_yat_check_yat_res="yes" |
1412 |
15 Aug 08 |
peter |
121 |
AC_REQUIRE([YAT_FIND_YAT]) dnl |
1412 |
15 Aug 08 |
peter |
122 |
YAT_CHECK_VERSION([$1],,[ac_yat_check_yat_res="no"]) |
1412 |
15 Aug 08 |
peter |
123 |
|
2856 |
26 Sep 12 |
peter |
124 |
AS_IF([test x$ac_yat_check_yat_res = xyes], [ |
2856 |
26 Sep 12 |
peter |
125 |
YAT_CHECK_HEADER(,[ac_yat_check_yat_res="no"]) |
2856 |
26 Sep 12 |
peter |
126 |
]) |
2856 |
26 Sep 12 |
peter |
127 |
|
2856 |
26 Sep 12 |
peter |
128 |
AS_IF([test x$ac_yat_check_yat_res = xyes], [ |
2856 |
26 Sep 12 |
peter |
129 |
YAT_CHECK_LIB(,[ac_yat_check_yat_res="no"]) |
2856 |
26 Sep 12 |
peter |
130 |
]) |
2856 |
26 Sep 12 |
peter |
131 |
|
1854 |
07 Mar 09 |
peter |
132 |
_YAT_ACTION([test "$ac_yat_check_yat_res" != "no"],[$2],[$3]) |
1854 |
07 Mar 09 |
peter |
133 |
|
1412 |
15 Aug 08 |
peter |
134 |
]) # YAT_CHECK_YAT |
1412 |
15 Aug 08 |
peter |
135 |
|
1412 |
15 Aug 08 |
peter |
136 |
|
1412 |
15 Aug 08 |
peter |
137 |
AC_DEFUN([YAT_FIND_YAT], |
1412 |
15 Aug 08 |
peter |
138 |
[ |
2217 |
14 Mar 10 |
peter |
139 |
AC_PREREQ([2.60]) dnl we use multi-arg AS_IF |
2690 |
28 Feb 12 |
peter |
140 |
AC_ARG_WITH([yat], |
2023 |
05 Aug 09 |
peter |
141 |
[AS_HELP_STRING([--with-yat=DIR], |
1854 |
07 Mar 09 |
peter |
142 |
[prefix for installed yat library or full path to yat-config])], |
1854 |
07 Mar 09 |
peter |
143 |
[], |
1854 |
07 Mar 09 |
peter |
144 |
[with_yat=yes]) |
1854 |
07 Mar 09 |
peter |
145 |
|
1854 |
07 Mar 09 |
peter |
146 |
yat_config=no; |
1854 |
07 Mar 09 |
peter |
147 |
yat_ac_want_yat=yes; |
1854 |
07 Mar 09 |
peter |
148 |
AS_IF([test "x$with_yat" = "xno"], |
1854 |
07 Mar 09 |
peter |
149 |
[yat_ac_want_yat=no], |
2690 |
28 Feb 12 |
peter |
150 |
[test "x$with_yat" = "xyes"], |
1854 |
07 Mar 09 |
peter |
151 |
[AC_PATH_PROG([yat_config], [yat-config], [no]) |
1854 |
07 Mar 09 |
peter |
152 |
AS_IF([test "$yat_config" = "no"], |
1854 |
07 Mar 09 |
peter |
153 |
[AC_MSG_WARN([ |
1854 |
07 Mar 09 |
peter |
154 |
the yat-config script installed by yat could not be found. If yat was |
1854 |
07 Mar 09 |
peter |
155 |
installed in PREFIX, make sure PREFIX/bin is in your path, or supply |
2690 |
28 Feb 12 |
peter |
156 |
the appropriate --with-yat option]) |
1854 |
07 Mar 09 |
peter |
157 |
]) |
1854 |
07 Mar 09 |
peter |
158 |
], |
1854 |
07 Mar 09 |
peter |
159 |
[AC_MSG_NOTICE([looking for yat-config]) |
2690 |
28 Feb 12 |
peter |
160 |
for p in $with_yat $with_yat/yat-config $with_yat/bin/yat-config ; do |
1854 |
07 Mar 09 |
peter |
161 |
AS_IF([test "x$yat_config" = "xno"], |
1854 |
07 Mar 09 |
peter |
162 |
[AC_MSG_CHECKING([$p]); |
1854 |
07 Mar 09 |
peter |
163 |
AS_IF([test -f "$p" && $p --help > /dev/null 2>&1], |
1854 |
07 Mar 09 |
peter |
164 |
[yat_config=$p; |
1854 |
07 Mar 09 |
peter |
165 |
AC_MSG_RESULT([yes]);], |
1854 |
07 Mar 09 |
peter |
166 |
[AC_MSG_RESULT([no]);]) |
1854 |
07 Mar 09 |
peter |
167 |
]) |
2690 |
28 Feb 12 |
peter |
168 |
done |
1854 |
07 Mar 09 |
peter |
169 |
AS_IF([test "$yat_config" = "no"], |
1854 |
07 Mar 09 |
peter |
170 |
[AC_MSG_WARN([ |
1781 |
06 Feb 09 |
peter |
171 |
the --with-yat parameter is incorrect. It must |
1781 |
06 Feb 09 |
peter |
172 |
specify an install prefix, or a yat-config file.]) |
1854 |
07 Mar 09 |
peter |
173 |
]) |
1412 |
15 Aug 08 |
peter |
174 |
]) |
2690 |
28 Feb 12 |
peter |
175 |
_YAT_ACTION([test "$yat_config" != "no"],[$1],[$2]) |
1412 |
15 Aug 08 |
peter |
176 |
]) # YAT_FIND_YAT |
1412 |
15 Aug 08 |
peter |
177 |
|
1412 |
15 Aug 08 |
peter |
178 |
|
1412 |
15 Aug 08 |
peter |
179 |
|
1412 |
15 Aug 08 |
peter |
180 |
AC_DEFUN([YAT_CHECK_VERSION], |
1412 |
15 Aug 08 |
peter |
181 |
[ |
2217 |
14 Mar 10 |
peter |
182 |
AC_PREREQ([2.60]) dnl we use YAT_FIND_YAT |
1412 |
15 Aug 08 |
peter |
183 |
AC_REQUIRE([YAT_FIND_YAT]) dnl |
1412 |
15 Aug 08 |
peter |
184 |
if test "$yat_config" != "no"; then |
2574 |
02 Oct 11 |
peter |
185 |
m4_pushdef([yat_min_version], [m4_default([$1], [0.5])]) dnl |
2574 |
02 Oct 11 |
peter |
186 |
AC_MSG_CHECKING([if version of yat is at least yat_min_version]) |
1412 |
15 Aug 08 |
peter |
187 |
|
2574 |
02 Oct 11 |
peter |
188 |
if $yat_config --atleast-version=yat_min_version; then |
1781 |
06 Feb 09 |
peter |
189 |
AC_MSG_RESULT([yes]) |
1412 |
15 Aug 08 |
peter |
190 |
ac_yat_version_ok=yes; |
1412 |
15 Aug 08 |
peter |
191 |
else |
1781 |
06 Feb 09 |
peter |
192 |
AC_MSG_RESULT([no]) |
1412 |
15 Aug 08 |
peter |
193 |
ac_yat_version=`$yat_config --version` |
1781 |
06 Feb 09 |
peter |
194 |
AC_MSG_WARN([ |
2690 |
28 Feb 12 |
peter |
195 |
'$yat_config --version' returned $ac_yat_version, |
2574 |
02 Oct 11 |
peter |
196 |
but the minimum required version is yat_min_version.]) |
1412 |
15 Aug 08 |
peter |
197 |
fi |
2574 |
02 Oct 11 |
peter |
198 |
m4_popdef([yat_min_version]) dnl |
1412 |
15 Aug 08 |
peter |
199 |
fi |
1854 |
07 Mar 09 |
peter |
200 |
_YAT_ACTION([test "$ac_yat_version_ok" = "yes"],[$2],[$3]) |
1412 |
15 Aug 08 |
peter |
201 |
]) # YAT_CHECK_VERSION |
1412 |
15 Aug 08 |
peter |
202 |
|
1412 |
15 Aug 08 |
peter |
203 |
|
1412 |
15 Aug 08 |
peter |
204 |
|
1412 |
15 Aug 08 |
peter |
205 |
AC_DEFUN([YAT_CHECK_HEADER], |
1412 |
15 Aug 08 |
peter |
206 |
[ |
2217 |
14 Mar 10 |
peter |
207 |
AC_PREREQ([2.60]) dnl we use YAT_FIND_YAT |
1412 |
15 Aug 08 |
peter |
208 |
AC_REQUIRE([YAT_FIND_YAT]) dnl |
1412 |
15 Aug 08 |
peter |
209 |
if test "$yat_config" != "no"; then |
1412 |
15 Aug 08 |
peter |
210 |
ac_yat_save_CPPFLAGS=$CPPFLAGS |
1412 |
15 Aug 08 |
peter |
211 |
ac_yat_save_CXXFLAGS=$CXXFLAGS |
1412 |
15 Aug 08 |
peter |
212 |
YAT_CPPFLAGS=`$yat_config --cppflags` |
1412 |
15 Aug 08 |
peter |
213 |
YAT_CXXFLAGS=`$yat_config --cxxflags` |
1412 |
15 Aug 08 |
peter |
214 |
CPPFLAGS="$CPPFLAGS $YAT_CPPFLAGS" |
1412 |
15 Aug 08 |
peter |
215 |
CXXFLAGS="$CXXFLAGS $YAT_CXXFLAGS" |
2022 |
04 Aug 09 |
peter |
216 |
AC_LANG_ASSERT([C++]) |
2396 |
07 Jan 11 |
peter |
# checking for Vector, which uses both GSL and Boost |
3588 |
19 Jan 17 |
peter |
218 |
AC_MSG_CHECKING([for yat/utility/Vector.h]) |
3588 |
19 Jan 17 |
peter |
219 |
_YAT_CHECK_HEADER([yat/utility/Vector.h], [ |
3588 |
19 Jan 17 |
peter |
220 |
AC_MSG_RESULT([yes]) |
3588 |
19 Jan 17 |
peter |
221 |
ac_yat_ok="yes" |
3588 |
19 Jan 17 |
peter |
222 |
], [ |
3588 |
19 Jan 17 |
peter |
223 |
AC_MSG_RESULT([no]) |
3588 |
19 Jan 17 |
peter |
224 |
AC_MSG_CHECKING([for yat/utility/Vector.h with -DYAT_WITHOUT_CXX11]) |
3588 |
19 Jan 17 |
peter |
225 |
CPPFLAGS="$CPPFLAGS -DYAT_WITHOUT_CXX11" |
3588 |
19 Jan 17 |
peter |
226 |
_YAT_CHECK_HEADER([yat/utility/Vector.h], [ |
3588 |
19 Jan 17 |
peter |
227 |
YAT_CPPFLAGS="$YAT_CPPFLAGS -DYAT_WITHOUT_CXX11" |
3588 |
19 Jan 17 |
peter |
228 |
ac_yat_ok="yes" |
3588 |
19 Jan 17 |
peter |
229 |
AC_MSG_RESULT([yes]) |
3588 |
19 Jan 17 |
peter |
230 |
], [ |
3588 |
19 Jan 17 |
peter |
231 |
ac_yat_ok="no" |
3588 |
19 Jan 17 |
peter |
232 |
AC_MSG_RESULT([no]) |
3588 |
19 Jan 17 |
peter |
233 |
]) |
3588 |
19 Jan 17 |
peter |
234 |
]) |
2690 |
28 Feb 12 |
peter |
235 |
|
1412 |
15 Aug 08 |
peter |
# checking that version in yat-config and version.h agree |
1412 |
15 Aug 08 |
peter |
237 |
AC_MSG_CHECKING([version in $yat_config]) |
1412 |
15 Aug 08 |
peter |
238 |
yat_config_version=`$yat_config --version` |
2396 |
07 Jan 11 |
peter |
239 |
AC_MSG_RESULT([$yat_config_version]) |
2691 |
28 Feb 12 |
peter |
240 |
|
2691 |
28 Feb 12 |
peter |
241 |
AC_CACHE_CHECK([version in 'yat/utility/version.h'], |
2691 |
28 Feb 12 |
peter |
242 |
[yat_cv_header_version_equal_yat_config], |
2691 |
28 Feb 12 |
peter |
243 |
[yat_cv_header_version_equal_yat_config=no |
2691 |
28 Feb 12 |
peter |
244 |
AC_COMPILE_IFELSE( |
2691 |
28 Feb 12 |
peter |
245 |
[AC_LANG_PROGRAM([@%:@include <yat/utility/version.h>], |
2776 |
15 Jul 12 |
peter |
246 |
[ @%:@if YAT_VERSION_AT_LEAST(`$yat_config --version-major`,\ |
2691 |
28 Feb 12 |
peter |
247 |
`$yat_config --version-minor`,\ |
2691 |
28 Feb 12 |
peter |
248 |
`$yat_config --version-patch`) |
2691 |
28 Feb 12 |
peter |
249 |
// Versions agree |
2776 |
15 Jul 12 |
peter |
250 |
@%:@else |
2776 |
15 Jul 12 |
peter |
251 |
@%:@ error yat versions disagree |
2776 |
15 Jul 12 |
peter |
252 |
@%:@endif |
2691 |
28 Feb 12 |
peter |
253 |
]) |
2691 |
28 Feb 12 |
peter |
254 |
], |
2691 |
28 Feb 12 |
peter |
255 |
[yat_cv_header_version_equal_yat_config=yes], |
2691 |
28 Feb 12 |
peter |
256 |
[yat_cv_header_version_equal_yat_config=no]) |
2691 |
28 Feb 12 |
peter |
257 |
|
1412 |
15 Aug 08 |
peter |
258 |
]) |
1412 |
15 Aug 08 |
peter |
259 |
|
2691 |
28 Feb 12 |
peter |
260 |
AS_IF([test x$yat_cv_header_version_equal_yat_config = xyes], [ |
2691 |
28 Feb 12 |
peter |
261 |
ac_yat_ok=yes; |
2691 |
28 Feb 12 |
peter |
262 |
AC_SUBST(YAT_CPPFLAGS) |
3054 |
14 Jun 13 |
peter |
263 |
AC_SUBST(YAT_CXXFLAGS) |
3054 |
14 Jun 13 |
peter |
264 |
AC_DEFINE([HAVE_YAT],[1],[define if yat library is available]) |
2691 |
28 Feb 12 |
peter |
265 |
], [ |
2691 |
28 Feb 12 |
peter |
266 |
AC_MSG_WARN([ |
2691 |
28 Feb 12 |
peter |
267 |
version declared in included yat/utility/version.h is not equal to |
2691 |
28 Feb 12 |
peter |
268 |
the one given from yat-config script: $yat_config.]) |
2691 |
28 Feb 12 |
peter |
269 |
ac_yat_ok=no |
2691 |
28 Feb 12 |
peter |
270 |
]) |
2691 |
28 Feb 12 |
peter |
271 |
|
1412 |
15 Aug 08 |
peter |
# restore FLAGS |
1412 |
15 Aug 08 |
peter |
273 |
CPPFLAGS=$ac_yat_save_CPPFLAGS |
1412 |
15 Aug 08 |
peter |
274 |
CXXFLAGS=$ac_yat_save_CXXFLAGS |
1412 |
15 Aug 08 |
peter |
275 |
fi |
1854 |
07 Mar 09 |
peter |
276 |
_YAT_ACTION([test "$ac_yat_ok" = "yes"],[$1],[$2]) |
1412 |
15 Aug 08 |
peter |
277 |
]) # YAT_CHECK_HEADER |
1412 |
15 Aug 08 |
peter |
278 |
|
1412 |
15 Aug 08 |
peter |
279 |
|
1412 |
15 Aug 08 |
peter |
280 |
|
1412 |
15 Aug 08 |
peter |
281 |
AC_DEFUN([YAT_CHECK_LIB], |
1412 |
15 Aug 08 |
peter |
282 |
[ |
2217 |
14 Mar 10 |
peter |
283 |
AC_PREREQ([2.60]) dnl we use YAT_FIND_YAT |
1412 |
15 Aug 08 |
peter |
284 |
AC_REQUIRE([YAT_FIND_YAT]) dnl |
1412 |
15 Aug 08 |
peter |
285 |
if test "$yat_config" != "no"; then |
1412 |
15 Aug 08 |
peter |
286 |
ac_yat_save_LDFLAGS=$LDFLAGS |
1412 |
15 Aug 08 |
peter |
287 |
ac_yat_save_LIBS=$LIBS |
1412 |
15 Aug 08 |
peter |
288 |
YAT_LDFLAGS=`$yat_config --ldflags` |
1412 |
15 Aug 08 |
peter |
289 |
YAT_LIBS=`$yat_config --libs` |
1412 |
15 Aug 08 |
peter |
290 |
LDFLAGS="$LDFLAGS $YAT_LDFLAGS" |
1412 |
15 Aug 08 |
peter |
291 |
LIBS="$LIBS $YAT_LIBS" |
2022 |
04 Aug 09 |
peter |
292 |
AC_LANG_ASSERT([C++]) |
2693 |
28 Feb 12 |
peter |
293 |
AC_CACHE_CHECK([for utility::version(void) in yat], |
2693 |
28 Feb 12 |
peter |
294 |
[yat_cv_lib_yat], |
2693 |
28 Feb 12 |
peter |
295 |
[_YAT_CHECK_LIB_YAT([yat_cv_lib_yat=yes], |
2693 |
28 Feb 12 |
peter |
296 |
[yat_cv_lib_yat=no])]) |
2693 |
28 Feb 12 |
peter |
297 |
|
2693 |
28 Feb 12 |
peter |
298 |
AS_IF([test x$yat_cv_lib_yat = xyes], [ |
2693 |
28 Feb 12 |
peter |
299 |
ac_yat_ok="yes"; |
3054 |
14 Jun 13 |
peter |
300 |
AC_SUBST(YAT_LDFLAGS) |
1412 |
15 Aug 08 |
peter |
301 |
AC_SUBST(YAT_LIBS) |
2021 |
04 Aug 09 |
peter |
# be compatible with yat-config 0.5.x |
2021 |
04 Aug 09 |
peter |
303 |
AS_IF([$yat_config --atleast-version=0.6], |
2109 |
13 Nov 09 |
peter |
304 |
[YAT_LA_FILE=`$yat_config --yat-la-file`;], |
2109 |
13 Nov 09 |
peter |
305 |
[YAT_LA_FILE=`$yat_config --link-libtool`;]) |
2024 |
05 Aug 09 |
peter |
306 |
AC_SUBST(YAT_LA_FILE) |
2022 |
04 Aug 09 |
peter |
307 |
YAT_LT_ADD=`$yat_config --link-libtool`; |
2021 |
04 Aug 09 |
peter |
308 |
AC_SUBST(YAT_LT_ADD)], |
2690 |
28 Feb 12 |
peter |
309 |
[ac_yat_ok="no"; |
1781 |
06 Feb 09 |
peter |
310 |
AC_MSG_RESULT([no]) |
1781 |
06 Feb 09 |
peter |
311 |
AC_MSG_WARN([ |
1781 |
06 Feb 09 |
peter |
312 |
the test program failed to link (or compile). See file config.log for |
1781 |
06 Feb 09 |
peter |
313 |
details on what occured.]) |
1412 |
15 Aug 08 |
peter |
314 |
]) |
1412 |
15 Aug 08 |
peter |
# restore FLAGS |
1412 |
15 Aug 08 |
peter |
316 |
LDFLAGS=$ac_yat_save_LDFLAGS |
1412 |
15 Aug 08 |
peter |
317 |
LIBS=$ac_yat_save_LIBS |
1412 |
15 Aug 08 |
peter |
318 |
fi |
1412 |
15 Aug 08 |
peter |
319 |
|
1854 |
07 Mar 09 |
peter |
320 |
_YAT_ACTION([test "$ac_yat_ok" = "yes"],[$1],[$2]) |
1854 |
07 Mar 09 |
peter |
321 |
|
1412 |
15 Aug 08 |
peter |
322 |
]) # YAT_CHECK_LIB |
1412 |
15 Aug 08 |
peter |
323 |
|
3053 |
13 Jun 13 |
peter |
324 |
|
3053 |
13 Jun 13 |
peter |
# YAT_CHECK_LIB_WITH_BAM |
3053 |
13 Jun 13 |
peter |
326 |
AC_DEFUN([YAT_CHECK_LIB_WITH_BAM], |
3053 |
13 Jun 13 |
peter |
327 |
[ |
3053 |
13 Jun 13 |
peter |
328 |
AC_PREREQ([2.60]) dnl we use YAT_FIND_YAT |
3053 |
13 Jun 13 |
peter |
329 |
AC_REQUIRE([YAT_FIND_YAT]) dnl |
3054 |
14 Jun 13 |
peter |
330 |
AS_IF([test x"$yat_config" = x""], [ |
3054 |
14 Jun 13 |
peter |
331 |
yat_cv_lib_with_bam=no |
3054 |
14 Jun 13 |
peter |
332 |
],[ |
3054 |
14 Jun 13 |
peter |
333 |
ac_yat_save_CPPFLAGS=$CPPFLAGS |
3054 |
14 Jun 13 |
peter |
334 |
ac_yat_save_CXXFLAGS=$CXXFLAGS |
3054 |
14 Jun 13 |
peter |
335 |
ac_yat_save_LDFLAGS=$LDFLAGS |
3054 |
14 Jun 13 |
peter |
336 |
ac_yat_save_LIBS=$LIBS |
3054 |
14 Jun 13 |
peter |
337 |
CPPFLAGS="$CPPFLAGS `$yat_config --cppflags`" |
3054 |
14 Jun 13 |
peter |
338 |
CXXFLAGS="$CXXFLAGS `$yat_config --cxxflags`" |
3054 |
14 Jun 13 |
peter |
339 |
LDFLAGS="$LDFLAGS `$yat_config --ldflags`" |
3054 |
14 Jun 13 |
peter |
340 |
LIBS="$LIBS `$yat_config --libs`" |
3054 |
14 Jun 13 |
peter |
341 |
AC_LANG_ASSERT([C++]) |
3054 |
14 Jun 13 |
peter |
342 |
AC_CACHE_CHECK([for class BamInFile], |
3054 |
14 Jun 13 |
peter |
343 |
[yat_cv_lib_with_bam], |
3054 |
14 Jun 13 |
peter |
344 |
[AC_LINK_IFELSE([ |
3054 |
14 Jun 13 |
peter |
345 |
AC_LANG_PROGRAM([[@%:@include <yat/omic/BamFile.h>]], |
3054 |
14 Jun 13 |
peter |
346 |
[using namespace theplu::yat::omic; |
3054 |
14 Jun 13 |
peter |
347 |
InBamFile is("myfile");]) |
3054 |
14 Jun 13 |
peter |
348 |
],[ |
3054 |
14 Jun 13 |
peter |
349 |
yat_cv_lib_with_bam=yes |
3054 |
14 Jun 13 |
peter |
350 |
],[ |
3054 |
14 Jun 13 |
peter |
351 |
yat_cv_lib_with_bam=no |
3054 |
14 Jun 13 |
peter |
352 |
]) |
3053 |
13 Jun 13 |
peter |
353 |
]) |
3053 |
13 Jun 13 |
peter |
354 |
|
3054 |
14 Jun 13 |
peter |
# restore FLAGS |
3054 |
14 Jun 13 |
peter |
356 |
CPPFLAGS=$ac_yat_save_CPPFLAGS |
3054 |
14 Jun 13 |
peter |
357 |
CXXFLAGS=$ac_yat_save_CXXFLAGS |
3054 |
14 Jun 13 |
peter |
358 |
LDFLAGS=$ac_yat_save_LDFLAGS |
3054 |
14 Jun 13 |
peter |
359 |
LIBS=$ac_yat_save_LIBS |
3054 |
14 Jun 13 |
peter |
360 |
]) |
3054 |
14 Jun 13 |
peter |
361 |
AS_CASE([$yat_cv_lib_with_bam], |
3054 |
14 Jun 13 |
peter |
362 |
[yes], [$1], |
3054 |
14 Jun 13 |
peter |
363 |
[no], [$2]) |
3053 |
13 Jun 13 |
peter |
364 |
]) # YAT_CHECK_LIB_WITH_BAM |
3053 |
13 Jun 13 |
peter |
365 |
|
3053 |
13 Jun 13 |
peter |
366 |
|
2693 |
28 Feb 12 |
peter |
# Private macros |
1854 |
07 Mar 09 |
peter |
368 |
# |
1854 |
07 Mar 09 |
peter |
# if yat_ac_want_yat = no do nothing |
1854 |
07 Mar 09 |
peter |
# if $1 do $2 else do $3 |
1854 |
07 Mar 09 |
peter |
371 |
# |
1854 |
07 Mar 09 |
peter |
372 |
AC_DEFUN([_YAT_ACTION], |
1854 |
07 Mar 09 |
peter |
373 |
[ |
1854 |
07 Mar 09 |
peter |
374 |
AS_IF([test "x$yat_ac_want_yat" = "xno"],[], |
1854 |
07 Mar 09 |
peter |
375 |
[$1],[m4_default([$2], [:])], |
2021 |
04 Aug 09 |
peter |
376 |
[m4_default([$3], [:])]) |
1854 |
07 Mar 09 |
peter |
377 |
]) |
2693 |
28 Feb 12 |
peter |
378 |
|
2693 |
28 Feb 12 |
peter |
379 |
|
3588 |
19 Jan 17 |
peter |
# _YAT_CHECK_HEADER(header, [ACTION-IF_FOUND], [ACTION-IF-NOT-FOUND]) |
3588 |
19 Jan 17 |
peter |
381 |
# |
3588 |
19 Jan 17 |
peter |
382 |
AC_DEFUN([_YAT_CHECK_HEADER], |
3588 |
19 Jan 17 |
peter |
383 |
[ |
3588 |
19 Jan 17 |
peter |
384 |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include <$1>], [])], |
3588 |
19 Jan 17 |
peter |
385 |
[$2], [$3]) |
3588 |
19 Jan 17 |
peter |
386 |
]) |
3588 |
19 Jan 17 |
peter |
387 |
|
3588 |
19 Jan 17 |
peter |
388 |
|
2777 |
15 Jul 12 |
peter |
# _YAT_CHECK_LIB_YAT([ACTION-IF_FOUND], [ACTION-IF-NOT-FOUND]) |
2693 |
28 Feb 12 |
peter |
390 |
# |
2693 |
28 Feb 12 |
peter |
391 |
AC_DEFUN([_YAT_CHECK_LIB_YAT], |
2693 |
28 Feb 12 |
peter |
392 |
[ |
2693 |
28 Feb 12 |
peter |
393 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <string> |
2693 |
28 Feb 12 |
peter |
394 |
namespace theplu{ |
2693 |
28 Feb 12 |
peter |
395 |
namespace yat{ |
2693 |
28 Feb 12 |
peter |
396 |
namespace utility { |
2693 |
28 Feb 12 |
peter |
397 |
std::string version(void); |
2693 |
28 Feb 12 |
peter |
398 |
}}} |
2693 |
28 Feb 12 |
peter |
399 |
]], |
2693 |
28 Feb 12 |
peter |
400 |
[using namespace theplu::yat::utility; |
2693 |
28 Feb 12 |
peter |
401 |
std::string s=version();])], |
2693 |
28 Feb 12 |
peter |
402 |
[$1], [$2]) |
2776 |
15 Jul 12 |
peter |
403 |
]) |