Changeset 3350
- Timestamp:
- Nov 20, 2014, 2:25:34 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.ac
r3330 r3350 370 370 { z_streamp zs; inflateEnd(zs); return 0; } 371 371 ], [$LIBZ $user_LIBS], [$LIBZ], [YAT_STATIC_LIBS]) 372 YAT_CHECK_HEADER_BAM([],[AC_MSG_FAILURE([header file 'bam.h' was not found])]) 372 373 YAT_CHECK_HEADER_SAM([],[AC_MSG_FAILURE([header file 'sam.h' was not found])]) 374 # check if we have hts 375 YAT_CHECK_HEADER_HTS([AC_DEFINE([YAT_HAVE_HTSLIB], 376 [1], [Define to 1 if HTS is available])]) 373 377 # try link against libbam 374 378 YAT_CHECK_LIBBAM([LIBS="$BAM_LIBS $LIBS" … … 487 491 488 492 AS_IF([test x$enable_debug = xyes], [ 493 suppress_long_long_warnings=no 489 494 # some versions of boost uses long long - turn off compiler warnings 490 495 # with -Wno-long-long 491 496 yat_save_CXXFLAGS=$CXXFLAGS 492 AC_MSG_CHECKING([whether boost uses long long])497 AC_MSG_CHECKING([whether boost causes long long warnings]) 493 498 CXXFLAGS="$INTERNAL_CXXFLAGS $CXXFLAGS" 494 499 AC_COMPILE_IFELSE([AC_LANG_PROGRAM( … … 510 515 [AC_MSG_RESULT([no])], 511 516 [AC_MSG_RESULT([yes]) 512 YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-Wno-long-long]) 517 suppress_long_long_warnings=yes 518 ]) 519 AS_IF([test x"$suppress_long_long_warnings" = x"no"], [ 520 AC_MSG_CHECKING([whether samtools causes long long warnings]) 521 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_YAT_BAM_INCLUDES],[])], 522 [AC_MSG_RESULT([no])], 523 [AC_MSG_RESULT([yes]) 524 suppress_long_long_warnings=yes]) 525 ]) 526 AS_IF([test x"$suppress_long_long_warnings" = x"yes"], [ 527 YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-Wno-long-long]) 513 528 ]) 514 529 # restore CXXFLAGS -
trunk/m4/yat_check_libbam.m4
r3306 r3350 1 1 ## $Id$ 2 2 # 3 # serial 5 (yat 0.12.1)3 # serial 6 (yat 0.13) 4 4 # 5 5 # … … 21 21 # along with yat. If not, see <http://www.gnu.org/licenses/>. 22 22 23 # YAT_CHECK_HEADER_ BAM([action-if-found], [action-if-not-found])23 # YAT_CHECK_HEADER_SAM([action-if-found], [action-if-not-found]) 24 24 # ============================================================== 25 25 # 26 AC_DEFUN([YAT_CHECK_HEADER_ BAM],26 AC_DEFUN([YAT_CHECK_HEADER_SAM], 27 27 [ 28 yat_ bam_header=no29 # check how to #include < bam.h>30 m4_foreach_w([myheader], [ bam.h bam/bam.h samtools/bam.h],31 [_YAT_CHECK_HEADER_ BAM(myheader)28 yat_sam_header=no 29 # check how to #include <sam.h> 30 m4_foreach_w([myheader], [sam.h htslib/sam.h bam/sam.h samtools/sam.h], 31 [_YAT_CHECK_HEADER_SAM(myheader) 32 32 ]) 33 AS_IF([test x$yat_ bam_header = xyes], [$1], [$2])34 ]) # YAT_CHECK_HEADER_ BAM33 AS_IF([test x$yat_sam_header = xyes], [$1], [$2]) 34 ]) # YAT_CHECK_HEADER_SAM 35 35 36 36 37 # _YAT_CHECK_HEADER_ BAM37 # _YAT_CHECK_HEADER_SAM 38 38 # ===================== 39 # Private macro used in YAT_CHECK_HEADER_ BAM40 AC_DEFUN([_YAT_CHECK_HEADER_ BAM],39 # Private macro used in YAT_CHECK_HEADER_SAM 40 AC_DEFUN([_YAT_CHECK_HEADER_SAM], 41 41 [ 42 AS_IF([test x$yat_ bam_header = xno], [dnl42 AS_IF([test x$yat_sam_header = xno], [dnl 43 43 AC_CHECK_HEADER([$1], [ 44 44 AC_DEFINE_UNQUOTED(AS_TR_CPP([YAT_HAVE_$1]), [1], 45 45 [Define to 1 if you have <$1> header file]) 46 yat_ bam_header=yes;46 yat_sam_header=yes; 47 47 ]) 48 48 ]) 49 ]) # _YAT_CHECK_HEADER_BAM 49 ]) # _YAT_CHECK_HEADER_SAM 50 51 52 # YAT_CHECK_HEADER_HTS([action-if-found], [action-if-not-found]) 53 # ===================== 54 # Check if header hts.h is available 55 AC_DEFUN([YAT_CHECK_HEADER_HTS], 56 [ 57 AC_CHECK_HEADER([hts.h], [$1], 58 [AC_CHECK_HEADER([htslib/hts.h], [$1], [$2])]) 59 ]) # YAT_CHECK_HEADER_HTS 50 60 51 61 … … 56 66 [ 57 67 BAM_LIBS=no 58 AC_MSG_CHECKING([for library containing bam_h eader_destroy])59 for libs in "" "-l bam" "-lbam -lpthread"; do68 AC_MSG_CHECKING([for library containing bam_hdr_destroy]) 69 for libs in "" "-lhts" "-lbam" "-lbam -lpthread"; do 60 70 AS_IF([test x"$BAM_LIBS" = x"no"], [ 61 71 YAT_LINK_BAM_IFELSE([$libs], [BAM_LIBS=$libs]) … … 81 91 AC_LINK_IFELSE([AC_LANG_PROGRAM([_YAT_BAM_INCLUDES], 82 92 [ 93 #if YAT_HAVE_HTSLIB 94 bam_hdr_t* hdr = bam_hdr_init(); 95 bam_hdr_destroy(hdr); 96 #else 83 97 bam_header_t* hdr = bam_header_init(); 84 98 bam_header_destroy(hdr); 99 #endif 85 100 ])], 86 101 [$2], [$3]) … … 164 179 # Private macro that expand PP magic we see in 'yat/omic/bam_config.h' 165 180 AC_DEFUN([_YAT_BAM_INCLUDES], 166 [AC_REQUIRE([YAT_CHECK_HEADER_BAM]) 167 @%:@if YAT_HAVE_BAM_H 168 @%:@ include <bam.h> 181 [AC_REQUIRE([YAT_CHECK_HEADER_SAM]) 182 @%:@if YAT_HAVE_SAM_H 169 183 @%:@ include <sam.h> 170 @%:@elif YAT_HAVE_BAM_BAM_H 184 @%:@elif YAT_HAVE_HTSLIB_SAM_H 185 @%:@ include <htslib/sam.h> 186 @%:@elif YAT_HAVE_BAM_SAM_H 171 187 @%:@ include <bam/bam.h> 172 188 @%:@ include <bam/sam.h> 173 @%:@elif YAT_HAVE_SAMTOOLS_ BAM_H189 @%:@elif YAT_HAVE_SAMTOOLS_SAM_H 174 190 @%:@ include <samtools/bam.h> 175 191 @%:@ include <samtools/sam.h> -
trunk/yat/omic/BamFile.cc
r3166 r3350 28 28 #include "yat/utility/Exception.h" 29 29 30 #include YAT_ BAM_HEADER30 #include YAT_SAM_HEADER 31 31 32 32 #include <cassert> -
trunk/yat/omic/BamHeader.h
r3188 r3350 25 25 #include "config_bam.h" 26 26 27 #include YAT_ BAM_HEADER27 #include YAT_SAM_HEADER 28 28 29 29 #include <string> -
trunk/yat/omic/BamRead.h
r3306 r3350 24 24 25 25 #include "config_bam.h" 26 #include YAT_BAM_HEADER27 26 #include YAT_SAM_HEADER 28 27 -
trunk/yat/omic/BamReadFilter.h
r3081 r3350 24 24 25 25 #include "config_bam.h" 26 #include YAT_ BAM_HEADER26 #include YAT_SAM_HEADER 27 27 28 28 #include <functional> -
trunk/yat/omic/config_bam.h
r3068 r3350 34 34 #include "yat/utility/config_public.h" 35 35 36 #ifdef YAT_HAVE_ BAM_H36 #ifdef YAT_HAVE_SAM_H 37 37 # define YAT_BAM_HEADER "bam.h" 38 38 # define YAT_SAM_HEADER "sam.h" 39 39 #else 40 # ifdef YAT_HAVE_BAM_BAM_H 41 # define YAT_BAM_HEADER "bam/bam.h" 42 # define YAT_SAM_HEADER "bam/sam.h" 40 # ifdef YAT_HAVE_HTSLIB_SAM_H 41 # define YAT_SAM_HEADER "htslib/sam.h" 43 42 # else 44 # ifdef YAT_HAVE_SAMTOOLS_BAM_H 45 # define YAT_BAM_HEADER "samtools/bam.h" 46 # define YAT_SAM_HEADER "samtools/sam.h" 43 # ifdef YAT_HAVE_BAM_SAM_H 44 # define YAT_BAM_HEADER "bam/bam.h" 45 # define YAT_SAM_HEADER "bam/sam.h" 46 # else 47 # ifdef YAT_HAVE_SAMTOOLS_SAM_H 48 # define YAT_BAM_HEADER "samtools/bam.h" 49 # define YAT_SAM_HEADER "samtools/sam.h" 50 # endif 47 51 # endif 48 52 # endif 49 53 #endif 50 54 51 #ifndef YAT_ BAM_HEADER55 #ifndef YAT_SAM_HEADER 52 56 #error This file requires samtools header files and cannot be used when \ 53 57 yat was configured with switch '--without-samtools'. -
trunk/yat/utility/Cigar.h
r3306 r3350 31 31 #ifdef YAT_HAVE_LIBBAM 32 32 #include "yat/omic/config_bam.h" 33 #include YAT_ BAM_HEADER33 #include YAT_SAM_HEADER 34 34 #else // if bam.h is not available #define CIGAR 35 35 /// describe how CIGAR operation/length is packed into a 32-bit -
trunk/yat/utility/config_public.h.in
r3258 r3350 28 28 /// 29 29 30 /// Define to 1 if you have the <bam/bam.h> header file.31 #undef YAT_HAVE_BAM_BAM_H32 30 33 /// Define to 1 if you have the <bam .h> header file.34 #undef YAT_HAVE_BAM_ H31 /// Define to 1 if you have the <bam/sam.h> header file. 32 #undef YAT_HAVE_BAM_SAM_H 35 33 36 /// Define to 1 if you have the <samtools/bam.h> header file. 37 #undef YAT_HAVE_SAMTOOLS_BAM_H 34 /// Define to 1 if you have the <htslib/sam.h> header file. 35 #undef YAT_HAVE_HTSLIB_SAM_H 36 37 /// Define to 1 if you have the <sam.h> header file. 38 #undef YAT_HAVE_SAM_H 39 40 /// Define to 1 if you have the <samtools/sam.h> header file. 41 #undef YAT_HAVE_SAMTOOLS_SAM_H 42 43 /// Define to 1 if HTS is available 44 #undef YAT_HAVE_HTSLIB 45 46 /// Define to 1 if you have 'bam_header_t' 47 #undef YAT_HAVE_BAM_HEADER_T 38 48 39 49 /// Define to 1 if libbam is available … … 63 73 #undef YAT_DEV_BUILD 64 74 75 // for backward compatibility 76 77 #ifdef YAT_HAVE_SAM_H 78 /// \deprecated defined for backward compatibility with 0.12 API 79 #define YAT_HAVE_BAM_H YAT_HAVE_SAM_H 65 80 #endif 81 82 #ifdef YAT_HAVE_BAM_SAM_H 83 /// \deprecated defined for backward compatibility with 0.12 API 84 #define YAT_HAVE_BAM_BAM_H YAT_HAVE_BAM_SAM_H 85 #endif 86 87 #ifdef YAT_HAVE_SAMTOOLS_SAM_H 88 /// \deprecated defined for backward compatibility with 0.12 API 89 #define YAT_HAVE_SAMTOOLS_BAM_H YAT_HAVE_SAMTOOLS_SAM_H 90 #endif 91 92 #endif
Note: See TracChangeset
for help on using the changeset viewer.