Changeset 3728


Ignore:
Timestamp:
Mar 16, 2018, 5:12:53 AM (5 years ago)
Author:
Peter
Message:

New macro YAT_SEARCH_LIBS, similar to AC_SEARCH_LIBS but does not
modify variable LIBS.

Use macro in macros: YAT_LIB_CBLAS, YAT_LIB_HTS, and _YAT_CHECK_ZLIB
to simplify code.

Location:
trunk/m4
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/m4/yat_cblas.m4

    r3453 r3728  
    22
    33#
    4 # serial 2 (yat 0.14)
     4# serial 3 (yat 0.16)
    55#
    66
     
    2020# COPYLEFT
    2121#
    22 #   Copyright (C) 2009, 2012, 2013, 2015 Peter Johansson
     22#   Copyright (C) 2009, 2012, 2013, 2015, 2018 Peter Johansson
    2323#
    2424#   This file is part of the yat library, http://dev.thep.lu.se/yat
     
    7575# - CBLAS in SCSL library (SGI/Cray Scientific Library)
    7676AS_IF([test $yat_cblas_ok = no], [
    77   AC_SEARCH_LIBS([cblas_sgemm],
     77  YAT_SEARCH_LIBS([cblas_sgemm],
    7878                 [tatlas satlas cblas opencblas mkl_core scs],
    7979                 [yat_cblas_ok=yes;
    80                   AS_IF([test "$ac_cv_search_cblas_sgemm" != "none required"],[
    81                     CBLAS_LIB=$ac_cv_search_cblas_sgemm
    82                   ])
     80                  CBLAS_LIB=$yat_cv_search_cblas_sgemm
    8381                 ])
    84   LIBS=$save_LIBS
    8582])
    8683
  • trunk/m4/yat_check_htslib.m4

    r3497 r3728  
    11## $Id$
    22#
    3 # serial 1 (yat 0.14)
     3# serial 2 (yat 0.16)
    44#
    5 #   Copyright (C) 2016 Peter Johansson
     5#   Copyright (C) 2016, 2018 Peter Johansson
    66#
    77#   This file is part of the yat library, http://dev.thep.lu.se/yat
     
    6161])
    6262
    63 ]) # YAT_CHECK_HTS
     63]) # YAT_CHECK_HTSLIB
    6464
    6565
     
    116116  AC_CHECK_HEADER([zlib.h], [],
    117117    [AC_MSG_FAILURE([header file 'zlib.h' was not found])])
    118   AC_SEARCH_LIBS([inflateEnd], [z], [],
     118  YAT_SEARCH_LIBS([inflateEnd], [z],
     119    [LIBZ=$yat_cv_search_inflateEnd
     120     LIBS="$LIBZ $LIBS"],
    119121    [AC_MSG_FAILURE([library 'libz' was not found])])
    120   LIBZ=$ac_cv_search_inflateEnd
    121   AS_IF([test x"$LIBZ" = x"none required"], [LIBZ=])
    122122
    123123  YAT_CHECK_LA_LIBS([
  • trunk/m4/yat_check_libbam.m4

    r3417 r3728  
    11## $Id$
    22#
    3 # serial 7 (yat 0.13)
    4 #
    5 #
    6 #   Copyright (C) 2012, 2013, 2014, 2015 Peter Johansson
     3# serial 8 (yat 0.16)
     4#
     5#
     6#   Copyright (C) 2012, 2013, 2014, 2015, 2018 Peter Johansson
    77#
    88#   This file is part of the yat library, http://dev.thep.lu.se/yat
     
    4949[
    5050BAM_LIBS=no
    51 AC_SEARCH_LIBS([bam_hdr_destroy], [hts],
    52                [AS_IF([test "$ac_cv_search_bam_hdr_destroy" != "none required"],
    53                       [BAM_LIBS=$ac_cv_search_bam_hdr_destroy])
     51YAT_SEARCH_LIBS([bam_hdr_destroy], [hts],
     52               [BAM_LIBS=$yat_cv_search_bam_hdr_destroy
    5453                $1],
    5554               [$2])
  • trunk/m4/yat_common.m4

    r3417 r3728  
    11## $Id$
    22#
    3 # Copyright (C) 2009, 2010, 2012, 2013, 2014 Peter Johansson
     3# Copyright (C) 2009, 2010, 2012, 2013, 2014, 2018 Peter Johansson
    44#
    55# This file is part of the yat library, http://dev.thep.lu.se/yat
     
    2222# This file contains some small useful macros.
    2323#
    24 # serial 3 (yat 0.11)
     24# serial 4 (yat 0.16)
    2525#
    2626
     
    9292LIBS=$save_LIBS
    9393])
     94
     95# YAT_SEARCH_LIBS(function, libraries, [action-if-found],
     96#                 [action-if-not-found], [other-libraries])
     97# =================================================================
     98# Same as AC_SEARCH_LIBS, but do not append LIBS with found library
     99# (if-found). Found library is stored in $yat_cv_search_<function>, set
     100# to empty string if no library required, and set to no if no library
     101# found.
     102AC_DEFUN([YAT_SEARCH_LIBS],
     103[
     104AS_VAR_PUSHDEF([yat_Search], [yat_cv_search_$1])
     105dnl cache variable used in autoconf code (AC_SEARCH_LIBS)
     106AS_VAR_PUSHDEF([yat_ac_Search], [ac_cv_search_$1])
     107yat_func_search_save_LIBS=$LIBS
     108
     109AC_SEARCH_LIBS([$1], [$2], [
     110    LIBS=$yat_func_search_save_LIBS
     111    AS_VAR_IF([yat_ac_Search], ["none required"], [], [
     112      AS_VAR_COPY([yat_Search], [yat_ac_Search])
     113    ])
     114    $3
     115  ], [
     116    AS_VAR_COPY([yat_ac_Search], [yat_Search])
     117    $4
     118  ], [$5])
     119
     120AS_VAR_POPDEF([yat_ac_Search])
     121AS_VAR_POPDEF([yat_Search])
     122]) # YAT_SEARCH_LIBS
Note: See TracChangeset for help on using the changeset viewer.