Changeset 3366 for trunk/configure.ac


Ignore:
Timestamp:
Dec 3, 2014, 12:23:07 PM (8 years ago)
Author:
Peter
Message:

prefer private variables in yat.pc. closes #808

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r3365 r3366  
    581581
    582582# Assign LIBS variables for yat.pc
    583 YAT_PC_LIBS=$YAT_LIBS
     583YAT_PC_LIBS_PRIVATE=$YAT_LIBS
     584
    584585# Dependency to GSL is noted via 'Requires' field
    585 YAT_VAR_REMOVE([YAT_PC_LIBS], [-lgsl $YAT_CBLAS_LIB $LIBM])
    586 YAT_PC_REQUIRES="gsl > $gsl_version"
     586YAT_VAR_REMOVE([YAT_PC_LIBS_PRIVATE], [-lgsl $YAT_CBLAS_LIB $LIBM])
     587YAT_SET_CONTAINS([$yat_libyat_la_LIBADD], [-lgsl], [
     588  YAT_PC_REQUIRES_PRIVATE="gsl > $gsl_version"
     589], [
     590  YAT_PC_REQUIRES="gsl > $gsl_version"
     591])
     592
    587593# ignore this whole bam thing if --without-samtools
    588594AS_IF([test x$with_samtools != x"no"], [
    589595  # htslib comes with a pc file, so we can require htslib in yat.pc
    590596  AS_IF([test x$with_hts = x"yes"], [
    591     YAT_VAR_REMOVE([YAT_PC_LIBS], [$BAM_LIBS -lz])
    592     YAT_PC_REQUIRES="$YAT_PC_REQUIRES htslib"
     597    YAT_VAR_REMOVE([YAT_PC_LIBS_PRIVATE], [$BAM_LIBS -lz])
     598    YAT_SET_CONTAINS([$yat_libyat_la_LIBADD], [-lhts], [
     599      YAT_PC_REQUIRES_PRIVATE="$YAT_PC_REQUIRES_PRIVATE htslib"
     600    ], [
     601      YAT_PC_REQUIRES="$YAT_PC_REQUIRES htslib"
     602    ])
    593603  ],[
    594604    # libbam has no pc file, so has to remain in LIBS and instead we
    595605    # require zlib
    596     YAT_VAR_REMOVE([YAT_PC_LIBS], [-lz])
     606    YAT_VAR_REMOVE([YAT_PC_LIBS_PRIVATE], [-lz])
    597607    YAT_PC_REQUIRES="$YAT_PC_REQUIRES zlib"
    598   ])
    599 ])
     608    YAT_SET_CONTAINS([$yat_libyat_la_LIBADD], [-lz], [
     609      YAT_PC_REQUIRES_PRIVATE="$YAT_PC_REQUIRES_PRIVATE zlib"
     610    ], [
     611      YAT_PC_REQUIRES="$YAT_PC_REQUIRES zlib"
     612    ])
     613  ])
     614])
     615
     616# Having libs declared as LIBS.private in yat.pc assumes that libs
     617# have been linked into libyat. Therefore for each lib check if it is
     618# mentioned in $yat_libyat_la_LIBADD, and if it's not move
     619# lib to LIBS variable.
     620for lib in $YAT_PC_LIBS_PRIVATE; do
     621  YAT_SET_CONTAINS([$yat_libyat_la_LIBADD], [$lib], [
     622  ], [
     623    # move lib from $YAT_PC_LIBS_PRIVATE to $YAT_PC_LIBS
     624    YAT_VAR_REMOVE([$YAT_PC_LIBS_PRIVATE], [$lib])
     625    YAT_PC_LIBS="$YAT_PC_LIBS $lib"
     626  ])
     627done
     628
    600629AC_SUBST([YAT_PC_LIBS])
    601630AC_SUBST([YAT_PC_REQUIRES])
     631AC_SUBST([YAT_PC_LIBS_PRIVATE])
     632AC_SUBST([YAT_PC_REQUIRES_PRIVATE])
    602633
    603634AC_SUBST(YAT_LIBS)
Note: See TracChangeset for help on using the changeset viewer.