@@ -158,8 +158,8 @@ LIBHTS_SOVERSION = 3
158
158
# is not strictly necessary and should be removed the next time
159
159
# LIBHTS_SOVERSION is bumped (see #1144 and
160
160
# https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html#//apple_ref/doc/uid/TP40002013-SW23)
161
- MACH_O_COMPATIBILITY_VERSION = 3.1.21
162
- MACH_O_CURRENT_VERSION = 3.1.21
161
+ MACH_O_COMPATIBILITY_VERSION = 3.1.22
162
+ MACH_O_CURRENT_VERSION = 3.1.22
163
163
164
164
# Force version.h to be remade if $(PACKAGE_VERSION) has changed.
165
165
version.h : $(if $(wildcard version.h) ,$(if $(findstring "$(PACKAGE_VERSION ) ",$(shell cat version.h) ) ,,force) )
@@ -196,6 +196,8 @@ config_vars.h:
196
196
.c.pico :
197
197
$(CC ) $(CFLAGS ) $(TARGET_CFLAGS ) $(ALL_CPPFLAGS ) $(EXTRA_CFLAGS_PIC ) -c -o $@ $<
198
198
199
+ ref_cache/% .o : ref_cache/% .c
200
+ $(CC ) $(CFLAGS ) $(REF_CACHE_EXTRA_C_FLAGS ) $(TARGET_CFLAGS ) $(ALL_CPPFLAGS ) -c -o $@ $<
199
201
200
202
LIBHTS_OBJS = \
201
203
kfunc.o \
@@ -239,6 +241,24 @@ LIBHTS_OBJS = \
239
241
$(HTSCODECS_OBJS ) \
240
242
$(NONCONFIGURE_OBJS )
241
243
244
+ REF_CACHE_OBJS = ref_cache/cmsg_wrap.o \
245
+ ref_cache/http_parser.o \
246
+ ref_cache/listener.o \
247
+ ref_cache/log_files.o \
248
+ ref_cache/main.o \
249
+ ref_cache/misc.o \
250
+ ref_cache/ping.o \
251
+ ref_cache/poll_wrap_epoll.o \
252
+ ref_cache/poll_wrap_poll.o \
253
+ ref_cache/ref_files.o \
254
+ ref_cache/request_handler.o \
255
+ ref_cache/sendfile_wrap.o \
256
+ ref_cache/server.o \
257
+ ref_cache/transaction.o \
258
+ ref_cache/upstream.o \
259
+ cram/pooled_alloc.o \
260
+ md5.o
261
+
242
262
# Without configure we wish to have a rich set of default figures,
243
263
# but we still need conditional inclusion as we wish to still
244
264
# support ./configure --disable-blah.
@@ -273,6 +293,9 @@ thread_pool_internal_h = thread_pool_internal.h $(htslib_thread_pool_h)
273
293
# using the configure script or just comment the line out if you are not.
274
294
-include config.mk
275
295
296
+ # Add optional built programs here
297
+ all : $(REF_CACHE_PROGRAMS )
298
+
276
299
# Usually config.h is generated by running configure or config.status,
277
300
# but if those aren't used create a default config.h here.
278
301
config.h :
@@ -309,9 +332,17 @@ config.h:
309
332
echo ' #define HAVE_ATTRIBUTE_CONSTRUCTOR 1' >> $@
310
333
echo ' #endif' >> $@
311
334
echo ' #if (defined(__x86_64__) || defined(_M_X64))' >> $@
312
- echo ' #define HAVE_ATTRIBUTE_TARGET 1' >> $@
335
+ echo ' #define HAVE_ATTRIBUTE_TARGET_SSSE3 1' >> $@
313
336
echo ' #define HAVE_BUILTIN_CPU_SUPPORT_SSSE3 1' >> $@
314
337
echo ' #endif' >> $@
338
+ echo ' #if defined __linux__' >> $@
339
+ echo ' #define HAVE_GETAUXVAL' >> $@
340
+ echo ' #elif defined __FreeBSD__' >> $@
341
+ echo ' #define HAVE_ELF_AUX_INFO' >> $@
342
+ echo ' #elif defined __OpenBSD__' >> $@
343
+ echo ' // Enable extra OpenBSD checks (see simd.c)' >> $@
344
+ echo ' #define HAVE_OPENBSD' >> $@
345
+ echo ' #endif' >> $@
315
346
316
347
# And similarly for htslib.pc.tmp ("pkg-config template"). No dependency
317
348
# on htslib.pc.in listed, as if that file is newer the usual way to regenerate
@@ -493,13 +524,13 @@ cram/cram_decode.o cram/cram_decode.pico: cram/cram_decode.c config.h $(cram_h)
493
524
cram/cram_encode.o cram/cram_encode.pico : cram/cram_encode.c config.h $(cram_h ) $(cram_os_h ) $(sam_internal_h ) $(htslib_hts_h ) $(htslib_hts_endian_h ) $(textutils_internal_h )
494
525
cram/cram_external.o cram/cram_external.pico : cram/cram_external.c config.h $(htscodecs_rANS_static4x16_h ) $(htslib_hfile_h ) $(cram_h )
495
526
cram/cram_index.o cram/cram_index.pico : cram/cram_index.c config.h $(htslib_bgzf_h ) $(htslib_hfile_h ) $(hts_internal_h ) $(cram_h ) $(cram_os_h )
496
- cram/cram_io.o cram/cram_io.pico : cram/cram_io.c config.h os/lzma_stub.h $(fuzz_settings_h ) $(cram_h ) $(cram_os_h ) $(htslib_hts_h ) $(cram_open_trace_file_h ) $(htscodecs_rANS_static_h ) $(htscodecs_rANS_static4x16_h ) $(htscodecs_arith_dynamic_h ) $(htscodecs_tokenise_name3_h ) $(htscodecs_fqzcomp_qual_h ) $(htscodecs_varint_h ) $(htslib_hfile_h ) $(htslib_bgzf_h ) $(htslib_faidx_h ) $(hts_internal_h )
527
+ cram/cram_io.o cram/cram_io.pico : cram/cram_io.c config.h os/lzma_stub.h $(fuzz_settings_h ) $(cram_h ) $(cram_os_h ) $(htslib_hts_h ) $(hts_internal_h ) $( cram_open_trace_file_h ) $(htscodecs_rANS_static_h ) $(htscodecs_rANS_static4x16_h ) $(htscodecs_arith_dynamic_h ) $(htscodecs_tokenise_name3_h ) $(htscodecs_fqzcomp_qual_h ) $(htscodecs_varint_h ) $(htslib_hfile_h ) $(htslib_bgzf_h ) $(htslib_faidx_h ) $(hts_internal_h )
497
528
cram/cram_stats.o cram/cram_stats.pico : cram/cram_stats.c config.h $(cram_h ) $(cram_os_h )
498
529
cram/mFILE.o cram/mFILE.pico : cram/mFILE.c config.h $(htslib_hts_log_h ) $(cram_os_h ) cram/mFILE.h
499
530
cram/open_trace_file.o cram/open_trace_file.pico : cram/open_trace_file.c config.h $(cram_os_h ) $(cram_open_trace_file_h ) $(cram_misc_h ) $(htslib_hfile_h ) $(htslib_hts_log_h ) $(htslib_hts_h )
500
531
cram/pooled_alloc.o cram/pooled_alloc.pico : cram/pooled_alloc.c config.h cram/pooled_alloc.h $(cram_misc_h )
501
532
cram/string_alloc.o cram/string_alloc.pico : cram/string_alloc.c config.h cram/string_alloc.h
502
- thread_pool.o thread_pool.pico : thread_pool.c config.h $(thread_pool_internal_h ) $(htslib_hts_log_h )
533
+ thread_pool.o thread_pool.pico : thread_pool.c config.h $(thread_pool_internal_h ) $(htslib_hts_log_h ) $( hts_internal_h )
503
534
504
535
htscodecs/htscodecs/arith_dynamic.o htscodecs/htscodecs/arith_dynamic.pico : htscodecs/htscodecs/arith_dynamic.c config.h $(htscodecs_arith_dynamic_h ) $(htscodecs_varint_h ) $(htscodecs_pack_h ) $(htscodecs_utils_h ) $(htscodecs_c_simple_model_h )
505
536
htscodecs/htscodecs/fqzcomp_qual.o htscodecs/htscodecs/fqzcomp_qual.pico : htscodecs/htscodecs/fqzcomp_qual.c config.h $(htscodecs_fqzcomp_qual_h ) $(htscodecs_varint_h ) $(htscodecs_utils_h ) $(htscodecs_c_simple_model_h )
@@ -533,11 +564,46 @@ htsfile: htsfile.o libhts.a
533
564
tabix : tabix.o libhts.a
534
565
$(CC ) $(LDFLAGS ) -o $@ tabix.o libhts.a $(LIBS ) -lpthread
535
566
567
+ ref_cache/ref-cache : $(REF_CACHE_OBJS )
568
+ $(CC ) $(LDFLAGS ) $(REF_CACHE_EXTRA_LD_FLAGS ) -o $@ $(REF_CACHE_OBJS ) -lcurl
569
+
536
570
annot-tsv.o : annot-tsv.c config.h $(htslib_hts_h ) $(htslib_hts_defs_h ) $(htslib_khash_str2int_h ) $(htslib_kstring_h ) $(htslib_kseq_h ) $(htslib_bgzf_h ) $(htslib_regidx_h ) $(textutils_internal_h )
537
571
bgzip.o : bgzip.c config.h $(htslib_bgzf_h ) $(htslib_hts_h ) $(htslib_hfile_h )
538
572
htsfile.o : htsfile.c config.h $(htslib_hfile_h ) $(htslib_hts_h ) $(htslib_sam_h ) $(htslib_vcf_h )
539
573
tabix.o : tabix.c config.h $(htslib_tbx_h ) $(htslib_sam_h ) $(htslib_vcf_h ) $(htslib_kseq_h ) $(htslib_bgzf_h ) $(htslib_hts_h ) $(htslib_regidx_h ) $(htslib_hts_defs_h ) $(htslib_hts_log_h ) $(htslib_thread_pool_h )
540
574
575
+ # ref_cache dependencies
576
+ ref_cache_cmsg_wrap_h = ref_cache/cmsg_wrap.h
577
+ ref_cache_http_parser_h = ref_cache/http_parser.h $(htslib_hts_defs_h ) $(ref_cache_types_h )
578
+ ref_cache_listener_h = ref_cache/listener.h $(ref_cache_types_h )
579
+ ref_cache_log_files_h = ref_cache/log_files.h $(htslib_hts_defs_h ) $(ref_types_h )
580
+ ref_cache_misc_h = ref_cache/misc.h $(htslib_hts_defs_h )
581
+ ref_cache_options_h = ref_cache/options.h $(ref_cache_types_h )
582
+ ref_cache_ping_h = ref_cache/ping.h
583
+ ref_cache_poll_wrap_h = ref_cache/poll_wrap.h $(ref_cache_types_h )
584
+ ref_cache_ref_files_h = ref_cache/ref_files.h $(htslib_hts_defs_h ) $(ref_cache_types_h )
585
+ ref_cache_request_handler_h = ref_cache/request_handler.h $(htslib_hts_defs_h ) $(ref_cache_types_h )
586
+ ref_cache_sendfile_wrap_h = ref_cache/sendfile_wrap.h
587
+ ref_cache_server_h = ref_cache/server.h $(htslib_hts_defs_h ) $(ref_cache_types_h )
588
+ ref_cache_transaction_h = ref_cache/transaction.h $(htslib_hts_defs_h ) $(ref_cache_types_h )
589
+ ref_cache_types_h = ref_cache/types.h
590
+ ref_cache_upstream_h = ref_cache/upstream.h $(ref_cache_types_h )
591
+
592
+ ref_cache/cmsg_wrap.o : ref_cache/cmsg_wrap.c config.h $(ref_cache_cmsg_wrap_h )
593
+ ref_cache/http_parser.o : ref_cache/http_parser.c config.h $(ref_cache_http_parser_h ) $(ref_cache_misc_h ) $(ref_cache_options_h ) $(ref_cache_request_handler_h ) $(ref_cache_server_h ) cram/pooled_alloc.h
594
+ ref_cache/listener.o : ref_cache/listener.c config.h $(ref_cache_listener_h ) $(ref_cache_misc_h ) $(ref_cache_options_h ) $(ref_cache_poll_wrap_h )
595
+ ref_cache/log_files.o : ref_cache/log_files.c config.h $(ref_cache_log_files_h ) $(ref_cache_options_h )
596
+ ref_cache/main.o : ref_cache/main.c config.h $(ref_cache_listener_h ) $(ref_cache_log_files_h ) $(ref_cache_misc_h ) $(ref_cache_options_h ) $(ref_cache_ping_h ) $(ref_cache_poll_wrap_h ) $(ref_cache_server_h ) $(ref_cache_upstream_h )
597
+ ref_cache/ping.o : ref_cache/ping.c config.h $(ref_cache_ping_h ) $(ref_cache_misc_h ) $(ref_cache_options_h )
598
+ ref_cache/poll_wrap_epoll.o : ref_cache/poll_wrap_epoll.c config.h $(ref_cache_poll_wrap_h ) cram/pooled_alloc.h
599
+ ref_cache/poll_wrap_poll.o : ref_cache/poll_wrap_poll.c config.h $(ref_cache_poll_wrap_h ) cram/pooled_alloc.h
600
+ ref_cache/ref_files.o : ref_cache/ref_files.c config.h $(ref_cache_ref_files_h ) $(ref_cache_misc_h ) $(ref_cache_options_h ) $(ref_cache_upstream_h )
601
+ ref_cache/request_handler.o : ref_cache/request_handler.c config.h $(ref_cache_request_handler_h ) $(ref_cache_http_parser_h ) $(ref_cache_misc_h ) $(ref_cache_options_h ) $(ref_cache_ref_files_h ) $(ref_cache_transaction_h ) $(ref_cache_upstream_h )
602
+ ref_cache/sendfile_wrap.o : ref_cache/sendfile_wrap.c config.h $(ref_cache_sendfile_wrap_h )
603
+ ref_cache/server.o : ref_cache/server.c config.h $(ref_cache_server_h ) $(ref_cache_http_parser_h ) $(ref_cache_listener_h ) $(ref_cache_misc_h ) $(ref_cache_options_h ) $(ref_cache_poll_wrap_h ) $(ref_cache_ref_files_h ) $(ref_cache_request_handler_h ) $(ref_cache_transaction_h ) $(ref_cache_upstream_h ) cram/pooled_alloc.h
604
+ ref_cache/transaction.o : ref_cache/transaction.c config.h $(ref_cache_transaction_h ) $(ref_cache_http_parser_h ) $(ref_cache_options_h ) $(ref_cache_poll_wrap_h ) $(ref_cache_ref_files_h ) $(ref_cache_sendfile_wrap_h ) $(ref_cache_server_h ) cram/pooled_alloc.h
605
+ ref_cache/upstream.o : ref_cache/upstream.c config.h $(ref_cache_upstream_h ) $(ref_cache_cmsg_wrap_h ) $(ref_cache_misc_h ) $(ref_cache_options_h ) $(ref_cache_poll_wrap_h ) $(htslib_hts_defs_h )
606
+
541
607
# Runes to check that the htscodecs submodule is present
542
608
ifdef HTSCODECS_SOURCES
543
609
htscodecs/htscodecs/% .c : | htscodecs/htscodecs
@@ -568,7 +634,7 @@ htscodecs/htscodecs:
568
634
@false
569
635
570
636
# Build the htscodecs/htscodecs/version.h file if necessary
571
- htscodecs/htscodecs/version.h : force
637
+ htscodecs/htscodecs/version.h : force | htscodecs/htscodecs
572
638
@if test -e $(srcdir ) /htscodecs/.git && test -e $(srcdir ) /htscodecs/configure.ac ; then \
573
639
vers=` cd $( srcdir) /htscodecs && git describe --always --dirty --match ' v[0-9]\.[0-9]*' ` && \
574
640
case " $$ vers" in \
@@ -635,7 +701,12 @@ check test: all $(HTSCODECS_TEST_TARGETS)
635
701
cd test/base_mods && ./base-mods.sh base-mods.tst
636
702
REF_PATH=: test/sam test/ce.fa test/faidx/faidx.fa test/faidx/fastqs.fq
637
703
test/test-regidx
638
- cd test && REF_PATH=: ./test.pl $$ {TEST_OPTS:-}
704
+ cd test && \
705
+ if test " x$( BUILT_PLUGINS) " ! = " x" ; then \
706
+ REF_PATH=: HTS_PATH=.. ./with-shlib.sh ./test.pl $(REF_CACHE_TEST_OPTS ) $$ {TEST_OPTS:-} ; \
707
+ else \
708
+ REF_PATH=: ./test.pl $(REF_CACHE_TEST_OPTS ) $$ {TEST_OPTS:-} ; \
709
+ fi
639
710
640
711
test/hts_endian : test/hts_endian.o
641
712
$(CC ) $(LDFLAGS ) -o $@ test/hts_endian.o $(LIBS )
@@ -803,7 +874,7 @@ test/test_faidx.o: test/test_faidx.c config.h $(htslib_faidx_h)
803
874
test/test_index.o : test/test_index.c config.h $(htslib_sam_h ) $(htslib_vcf_h )
804
875
test/test-vcf-api.o : test/test-vcf-api.c config.h $(htslib_hts_h ) $(htslib_vcf_h ) $(htslib_kstring_h ) $(htslib_kseq_h )
805
876
test/test-vcf-sweep.o : test/test-vcf-sweep.c config.h $(htslib_vcf_sweep_h )
806
- test/test-bcf-sr.o : test/test-bcf-sr.c config.h $(htslib_synced_bcf_reader_h ) $(htslib_hts_h ) $(htslib_vcf_h )
877
+ test/test-bcf-sr.o : test/test-bcf-sr.c config.h $(htslib_hts_defs_h ) $( htslib_synced_bcf_reader_h ) $(htslib_hts_h ) $(htslib_vcf_h )
807
878
test/test-bcf-translate.o : test/test-bcf-translate.c config.h $(htslib_vcf_h )
808
879
test/test_introspection.o : test/test_introspection.c config.h $(htslib_hts_h ) $(htslib_hfile_h )
809
880
test/test-bcf_set_variant_type.o : test/test-bcf_set_variant_type.c config.h $(htslib_hts_h ) vcf.c
@@ -881,19 +952,21 @@ $(srcprefix)htslib.map: libhts.so
881
952
printf ' \n%s {\n' " HTSLIB_$$ curr_vers" >> $@ .new.tmp && \
882
953
cat $@ .tmp >> $@ .new.tmp && \
883
954
printf ' } %s;\n' " $$ last_vers" >> $@ .new.tmp && \
884
- rm -f $@ .tmp && \
885
- mv $@ .new.tmp $@ ; \
886
- fi ; \
955
+ rm -f $@ .tmp && \
956
+ mv $@ .new.tmp $@ ; \
887
957
else \
888
958
rm -f $@ .tmp ; \
889
959
fi
890
960
891
- install : libhts.a $(BUILT_PROGRAMS ) $(BUILT_PLUGINS ) installdirs install-$(SHLIB_FLAVOUR ) install-pkgconfig
892
- $(INSTALL_PROGRAM ) $(BUILT_PROGRAMS ) $(DESTDIR )$(bindir )
961
+ install : libhts.a $(BUILT_PROGRAMS ) $(BUILT_PLUGINS ) $( REF_CACHE_PROGRAMS ) installdirs install-$(SHLIB_FLAVOUR ) install-pkgconfig
962
+ $(INSTALL_PROGRAM ) $(BUILT_PROGRAMS ) $(REF_CACHE_PROGRAMS ) $( DESTDIR )$(bindir )
893
963
if test -n " $( BUILT_PLUGINS) " ; then $( INSTALL_PROGRAM) $( BUILT_PLUGINS) $( DESTDIR) $( plugindir) ; fi
894
964
$(INSTALL_DATA ) $(SRC ) htslib/* .h $(DESTDIR )$(includedir ) /htslib
895
965
$(INSTALL_DATA ) libhts.a $(DESTDIR )$(libdir ) /libhts.a
896
966
$(INSTALL_MAN ) $(SRC ) annot-tsv.1 $(SRC ) bgzip.1 $(SRC ) htsfile.1 $(SRC ) tabix.1 $(DESTDIR )$(man1dir )
967
+ if test " x$( REF_CACHE_PROGRAMS) " ! = " x" ; then \
968
+ $(INSTALL_MAN ) $(SRC ) ref_cache/ref-cache.1 $(DESTDIR )$(man1dir ) ; \
969
+ fi
897
970
$(INSTALL_MAN ) $(SRC ) faidx.5 $(SRC ) sam.5 $(SRC ) vcf.5 $(DESTDIR )$(man5dir )
898
971
$(INSTALL_MAN ) $(SRC ) htslib-s3-plugin.7 $(DESTDIR )$(man7dir )
899
972
@@ -932,12 +1005,12 @@ install-pkgconfig: htslib.pc.tmp installdirs
932
1005
# A pkg-config file (suitable for copying to $PKG_CONFIG_PATH) that provides
933
1006
# flags for building against the uninstalled library in this build directory.
934
1007
htslib-uninstalled.pc : htslib.pc.tmp
935
- sed -e ' s#@-includedir@#' ` pwd` ' #g;s#@-libdir@#' ` pwd` ' #g ' htslib.pc.tmp > $@
1008
+ sed -e " s#@-includedir@#` pwd` #g;s#@-libdir@#` pwd` #g " htslib.pc.tmp > $@
936
1009
937
1010
938
1011
testclean :
939
1012
-rm -f test/* .tmp test/* .tmp.* test/faidx/* .tmp* \
940
- test/longrefs/*.tmp.* test/tabix/*.tmp.* \
1013
+ test/longrefs/*.tmp.* test/ref_cache/*.tmp.* test/ tabix/*.tmp.* \
941
1014
test/bgzf_boundaries/*.tmp.* test/*/FAIL* \
942
1015
header-exports.txt shlib-exports-$(SHLIB_FLAVOUR).txt
943
1016
-rm -rf htscodecs/tests/test.out
@@ -950,9 +1023,10 @@ mostlyclean: testclean
950
1023
-rm -f htscodecs/htscodecs/* .o htscodecs/htscodecs/* .pico $(DEL_HTSCODECS_VERSION )
951
1024
-rm -f hts-object-files
952
1025
-rm -f htscodecs/tests/* .o
1026
+ -rm -f ref_cache/* .o
953
1027
954
1028
clean : mostlyclean clean-$(SHLIB_FLAVOUR )
955
- -rm -f libhts.a $(BUILT_PROGRAMS ) $(BUILT_PLUGINS ) $(BUILT_TEST_PROGRAMS ) $(BUILT_THRASH_PROGRAMS )
1029
+ -rm -f libhts.a $(BUILT_PROGRAMS ) $(BUILT_PLUGINS ) $(BUILT_TEST_PROGRAMS ) $(BUILT_THRASH_PROGRAMS ) $( REF_CACHE_PROGRAMS )
956
1030
-rm -f htscodecs/tests/rans4x8 htscodecs/tests/rans4x16pr htscodecs/tests/arith_dynamic htscodecs/tests/tokenise_name3 htscodecs/tests/fqzcomp_qual htscodecs/tests/varint
957
1031
958
1032
distclean maintainer-clean : clean
@@ -981,11 +1055,11 @@ tags TAGS:
981
1055
# code with your program, this hook enables Automake-style "make dist"
982
1056
# for this subdirectory. If you do bundle an htslib snapshot, please
983
1057
# add identifying information to $(PACKAGE_VERSION) as appropriate.
984
- # (The wildcards attempt to omit non-exported files (.git*, README.md ,
1058
+ # (The wildcards attempt to omit non-exported files (.git, .gitignore ,
985
1059
# etc) and other detritus that might be in the top-level directory.)
986
- distdir :
1060
+ distdir : htscodecs/htscodecs/version.h
987
1061
@if [ -z " $( distdir) " ]; then echo " Please supply a distdir=DIR argument." ; false ; fi
988
- tar -c * .[ch15 ] [ILMNRchtv ]* [ELSbcekmnth ] | (cd $( distdir) && tar -x)
1062
+ tar -c * .[ch157 ] [I-R ]* [ELSde] [cmors] * [bcemns4] [bhtv] * [bhknpt] htscodecs/ * .md htscodecs/[ht] * / * [chp-t0-9 ] | (cd $( distdir) && tar -x)
989
1063
+cd $(distdir ) && $(MAKE ) distclean
990
1064
991
1065
force :
0 commit comments