Ignore:
Timestamp:
Apr 30, 2015, 9:36:46 AM (7 years ago)
Author:
Peter
Message:

refs #794

Change logic in configure test looking for libhts/samtools headers and
libraries. Instead of looking whether both headers and libraries are
available, first look for both and <htslib/hts.h> and libhts. If found
use that. If not found, look if both <bam.h> and libbam are
available. If yes, use them. If not abort.

Only test for function bam_calend and global variable
bam_nt16_rev_table when building against libbam as they are irrelevant
in htslib mode.

yat/utility/config_public.h.in: change back to macros
YAT_HAVE_BAM_H
YAT_HAVE_BAM_BAM_H
YAT_HAVE_SAMTOOLS_BAM_H
as they were called in 0.12. Add a new macro YAT_HAVE_HTSLIB_SAM_H,
which is defined when builiding against htslib (just like
YAT_HAVE_HTSLIB).

yat/omic/config_bam.h: use new macro names in
'yat/utility/config_public.h' and avoid having nested if statements
and instead use style:

#if defined YAT_HAVE_HTSLIB_HTS_H
# define YAT_SAM_HEADER "htslib/sam.h"
#elif defined YAT_HAVE_BAM_H
# define YAT_BAM_HEADER "bam.h"
# define YAT_SAM_HEADER "sam.h"
#elif defined YAT_HAVE_BAM_BAM_H
# define YAT_BAM_HEADER "bam/bam.h"
# define YAT_SAM_HEADER "bam/sam.h"
#endif

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/omic/config_bam.h

    r3360 r3415  
    3434#include "yat/utility/config_public.h"
    3535
    36 #ifdef YAT_HAVE_SAM_H
    37 # define YAT_BAM_HEADER "bam.h"
    38 # define YAT_SAM_HEADER "sam.h"
    39 #else
    40 # ifdef YAT_HAVE_HTSLIB_SAM_H
     36#if defined YAT_HAVE_HTSLIB_HTS_H
    4137#  define YAT_SAM_HEADER "htslib/sam.h"
    42 # else
    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
    51 #  endif
    52 # endif
     38#elif defined YAT_HAVE_BAM_H
     39#  define YAT_BAM_HEADER "bam.h"
     40#  define YAT_SAM_HEADER "sam.h"
     41#elif defined YAT_HAVE_BAM_BAM_H
     42#  define YAT_BAM_HEADER "bam/bam.h"
     43#  define YAT_SAM_HEADER "bam/sam.h"
     44#elif defined YAT_HAVE_SAMTOOLS_BAM_H
     45#  define YAT_BAM_HEADER "samtools/bam.h"
     46#  define YAT_SAM_HEADER "samtools/sam.h"
    5347#endif
    5448
Note: See TracChangeset for help on using the changeset viewer.