Changeset 3068


Ignore:
Timestamp:
Aug 1, 2013, 5:16:44 AM (8 years ago)
Author:
Peter
Message:

Fixes #766

Replace #defines HAVE_BAM_H (and friends) in
yat/utility/config_public.h with #defines YAT_HAVE_BAM_H (and
friends). Update logic in yat/omic/config_bam.h accordingly as well as
test code in libbam detection.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEWS

    r3056 r3068  
    1111  - tTest::score(void) is now declared const (ticket #755)
    1212  - BamReadIterator(4) will now throw if region is invalid (ticket #764)
     13  - #defines HAVE_BAM_H, HAVE_BAM_BAM_H, and HAVE_SAMTOOLS_BAM_H have been
     14    replaced with corresponding macros with prefix 'YAT_' (see ticket #766)
    1315
    1416  A complete list of closed tickets can be found here [[br]]
  • trunk/m4/yat_check_libbam.m4

    r2986 r3068  
    11## $Id$
    22#
    3 # serial 2 (yat 0.10.2)
     3# serial 3 (yat 0.11)
    44#
    55#
     
    2828yat_bam_header=no
    2929# check how to #include <bam.h>
    30 AC_CHECK_HEADERS([bam/bam.h bam.h samtools/bam.h bam.h],
    31                  [yat_bam_header=yes; break])
     30m4_map_args_w([bam/bam.h bam.h samtools/bam.h],
     31              [_YAT_CHECK_HEADER_BAM(], [)
     32])
    3233AS_IF([test x$yat_bam_header = xyes], [$1], [$2])
    3334]) # YAT_CHECK_HEADER_BAM
     35
     36
     37# _YAT_CHECK_HEADER_BAM
     38# =====================
     39# Private macro used in YAT_CHECK_HEADER_BAM
     40AC_DEFUN([_YAT_CHECK_HEADER_BAM],
     41[
     42AS_IF([test x$yat_bam_header = xno], [dnl
     43  AC_CHECK_HEADER([$1], [
     44    AC_DEFINE_UNQUOTED(AS_TR_CPP([YAT_HAVE_$1]), [1],
     45                       [Define to 1 if you have <$1> header file])
     46    yat_bam_header=yes;
     47  ])
     48])
     49]) # _YAT_CHECK_HEADER_BAM
    3450
    3551
     
    3955AC_DEFUN([YAT_CHECK_LIBBAM],
    4056[
    41 AC_REQUIRE([YAT_CHECK_HEADER_BAM])
    4257BAM_LIBS=no
    4358AC_MSG_CHECKING([for library containing bam_header_destroy])
     
    6479save_LIBS=$LIBS
    6580LIBS="$1 $LIBS"
    66 AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@if HAVE_BAM_H
    67                                  @%:@ include <bam.h>
    68                                  @%:@elif HAVE_BAM_BAM_H
    69                                  @%:@ include <bam/bam.h>
    70                                  @%:@elif HAVE_SAMTOOLS_BAM_H
    71                                  @%:@ include <samtools/bam.h>
    72                                  @%:@endif
    73                                 ],[
     81AC_LINK_IFELSE([AC_LANG_PROGRAM([_YAT_BAM_INCLUDES],
     82                                [
    7483                                 bam_header_t* hdr = bam_header_init();
    7584                                 bam_header_destroy(hdr);
     
    8695[
    8796AC_MSG_CHECKING([for bam_nt16_rev_table])
    88 AC_LINK_IFELSE([AC_LANG_PROGRAM(
    89                  [@%:@if HAVE_BAM_H
    90                   @%:@ include <bam.h>
    91                   @%:@elif HAVE_BAM_BAM_H
    92                   @%:@ include <bam/bam.h>
    93                   @%:@elif HAVE_SAMTOOLS_BAM_H
    94                   @%:@ include <samtools/bam.h>
    95                   @%:@endif
    96                  ],[
    97                   char c = bam_nt16_rev_table@<:@7@:>@;
    98                  ])
     97AC_LINK_IFELSE([AC_LANG_PROGRAM([_YAT_BAM_INCLUDES],
     98                  [char c = bam_nt16_rev_table@<:@7@:>@;])
    9999               ],[
    100100                 AC_MSG_RESULT([yes])
     
    105105               ])
    106106]) # YAT_BAM_NT16_REV_TABLE
     107
     108
     109# _YAT_BAM_INCLUDES
     110# =================
     111# Private macro that expand PP magic we see in 'yat/omic/bam_config.h'
     112AC_DEFUN([_YAT_BAM_INCLUDES],
     113[AC_REQUIRE([YAT_CHECK_HEADER_BAM])
     114@%:@if YAT_HAVE_BAM_H
     115@%:@ include <bam.h>
     116@%:@elif YAT_HAVE_BAM_BAM_H
     117@%:@ include <bam/bam.h>
     118@%:@elif YAT_HAVE_SAMTOOLS_BAM_H
     119@%:@ include <samtools/bam.h>
     120@%:@endif
     121]) # _YAT_BAM_HEADER
  • trunk/yat/omic/config_bam.h

    r2990 r3068  
    3434#include "yat/utility/config_public.h"
    3535
    36 #ifdef HAVE_BAM_H
     36#ifdef YAT_HAVE_BAM_H
    3737# define YAT_BAM_HEADER "bam.h"
    3838# define YAT_SAM_HEADER "sam.h"
    3939#else
    40 # ifdef HAVE_BAM_BAM_H
     40# ifdef YAT_HAVE_BAM_BAM_H
    4141#  define YAT_BAM_HEADER "bam/bam.h"
    4242#  define YAT_SAM_HEADER "bam/sam.h"
    4343# else
    44 #  ifdef HAVE_SAMTOOLS_BAM_H
     44#  ifdef YAT_HAVE_SAMTOOLS_BAM_H
    4545#   define YAT_BAM_HEADER "samtools/bam.h"
    4646#   define YAT_SAM_HEADER "samtools/sam.h"
  • trunk/yat/utility/config_public.h.in

    r3045 r3068  
    2929
    3030/// Define to 1 if you have the <bam/bam.h> header file.
    31 #undef HAVE_BAM_BAM_H
     31#undef YAT_HAVE_BAM_BAM_H
    3232
    3333/// Define to 1 if you have the <bam.h> header file.
    34 #undef HAVE_BAM_H
     34#undef YAT_HAVE_BAM_H
    3535
    3636/// Define to 1 if you have the <samtools/bam.h> header file.
    37 #undef HAVE_SAMTOOLS_BAM_H
     37#undef YAT_HAVE_SAMTOOLS_BAM_H
    3838
    3939/// Define if compiler supports deprecated attribute, as in g++ 4.0
Note: See TracChangeset for help on using the changeset viewer.