@@ -55,6 +55,11 @@ AC_ARG_WITH([libdeflate],
5555 [ AS_HELP_STRING ( [ --with-libdeflate] , [ use libdeflate for BAM output] ) ] ,
5656 [ with_libdeflate=yes] , [ with_libdeflate=no] )
5757
58+ dnl arg for building with mods support in 'counts'
59+ AC_ARG_WITH ( [ htsmods] ,
60+ [ AS_HELP_STRING ( [ --with-htsmods] , [ use HTSLib 'mods' to support Nanopore] ) ] ,
61+ [ with_htsmods=yes] , [ with_htsmods=no] )
62+
5863dnl check for required libraries
5964AC_SEARCH_LIBS ( [ pthread_create] , [ pthread] , [ ] , [ AC_MSG_FAILURE ( [ "pthread library not found"] ) ] )
6065AC_SEARCH_LIBS ( [ gzopen] , [ z] , [ ] , [ AC_MSG_FAILURE ( [ "Zlib library not found"] ) ] )
@@ -66,18 +71,22 @@ AS_IF([test "x$with_libdeflate" = "xyes"],
6671AC_SEARCH_LIBS ( [ hts_version] , [ hts] , [ ] , [ AC_MSG_FAILURE ( [ $hts_fail_msg] ) ] )
6772AC_CHECK_HEADERS ( [ htslib/hts.h] , [ ] , [ AC_MSG_ERROR ( [ hts.h not found] ) ] )
6873# Require HTS_VERSION >= 102000
69- AC_COMPILE_IFELSE (
70- [ AC_LANG_PROGRAM ( [ [
71- #include <htslib/hts.h>
72- #if !defined(HTS_VERSION)
73- # error HTS_VERSION not defined
74- #endif
75- #if HTS_VERSION < 102000
76- # error htslib library too old
77- #endif
78- ] ] , [ [ ] ] ) ] ,
79- [ have_hts=yes] ,
80- [ have_hts=no]
74+ AS_IF ( [ test "x$with_htsmods" = "xyes"] ,
75+ [
76+ AC_COMPILE_IFELSE (
77+ [
78+ AC_LANG_PROGRAM ( [ [
79+ #include <htslib/hts.h>
80+ #if !defined(HTS_VERSION)
81+ # error HTS_VERSION not defined
82+ #endif
83+ #if HTS_VERSION < 102000
84+ # error htslib library too old
85+ #endif
86+ ] ] , [ [ ] ] )
87+ ] , [ have_htsmods_version=yes] , [ have_htsmods_version=no] )
88+ ] ,
89+ [ have_htsmods_version=yes]
8190)
8291
8392AC_COMPUTE_INT (
@@ -87,8 +96,13 @@ AC_COMPUTE_INT(
8796 [ AC_MSG_ERROR ( [ Could not compute HTS_VERSION] ) ]
8897)
8998AC_MSG_NOTICE ( [ Detected htslib version: $hts_version_macro] )
90- AS_IF ( [ test "x$have_hts" != "xyes"] ,
91- [ AC_MSG_ERROR ( [ Required htslib version must be at least 102000 (v1.20)] ) ] )
99+
100+ AS_IF ( [ test "x$have_htsmods_version" != "xyes"] , [
101+ AC_MSG_ERROR ( [
102+ HTSLib version must be at least 102000 (v1.20) for mods support
103+ ] )
104+ ] )
105+ AM_CONDITIONAL([ BUILD_NANOPORE] , [ test "x$with_htsmods" = "xyes"] )
92106
93107AC_SEARCH_LIBS ( [ cblas_dgemm] , [ gslcblas] , [ ] , [ AC_MSG_FAILURE ( [ $gsl_fail_msg] ) ] )
94108AC_SEARCH_LIBS ( [ gsl_blas_dgemm] , [ gsl] , [ ] , [ AC_MSG_FAILURE ( [ $gsl_fail_msg] ) ] )
0 commit comments