Merge lp:~noskcaj/ubuntu/trusty/sra-sdk/ftbfs into lp:ubuntu/trusty/sra-sdk

Proposed by Jackson Doak
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~noskcaj/ubuntu/trusty/sra-sdk/ftbfs
Merge into: lp:ubuntu/trusty/sra-sdk
Diff against target: 311195 lines (+253319/-27106)
1118 files modified
.pc/.quilt_patches (+1/-0)
.pc/.quilt_series (+1/-0)
.pc/10_portability.patch/build/Makefile.gcc (+14/-4)
.pc/10_portability.patch/build/Makefile.shell (+81/-37)
.pc/applied-patches (+4/-0)
.pc/build-with-system-libbz2-libz.patch/libs/ncbi-vdb/Makefile (+154/-0)
.pc/do_not_build_external_libs.patch/libs/Makefile (+74/-0)
.pc/hardening-format-security.patch/libs/kdb/database.c (+706/-0)
.pc/hardening-format-security.patch/libs/kdb/index.c (+1006/-0)
.pc/hardening-format-security.patch/libs/kdb/table.c (+706/-0)
.pc/hardening.patch/Makefile (+110/-0)
.pc/hardening.patch/build/Makefile.env (+343/-0)
CHANGES (+0/-30)
Makefile (+20/-42)
README (+2/-20)
README-WINDOWS.txt (+15/-0)
README-build (+0/-237)
README-build.txt (+259/-0)
README-config.txt (+58/-0)
USAGE (+0/-162)
build/BUILD.linux (+1/-1)
build/BUILD.mac (+1/-1)
build/BUILD.win (+1/-1)
build/LNKG.linux (+1/-0)
build/LNKG.mac (+1/-0)
build/LNKG.win (+1/-0)
build/Makefile.clang (+80/-0)
build/Makefile.env (+122/-56)
build/Makefile.gcc (+14/-4)
build/Makefile.linux (+7/-0)
build/Makefile.mac (+7/-0)
build/Makefile.rules (+0/-5)
build/Makefile.shell (+76/-39)
build/Makefile.targets (+114/-0)
build/Makefile.vc++ (+12/-10)
build/Makefile.win (+7/-0)
build/ld.linux.cmn.sh (+6/-1)
build/ld.linux.dlib.sh (+17/-1)
build/ld.linux.exe.sh (+18/-1)
build/ld.linux.ln.sh (+12/-1)
build/ld.linux.slib.sh (+5/-5)
build/ld.mac.cmn.sh (+11/-2)
build/ld.mac.dlib.sh (+159/-18)
build/ld.mac.exe.sh (+125/-13)
build/ld.mac.ln.sh (+2/-0)
build/ld.mac.slib.sh (+6/-6)
build/ld.sh (+247/-67)
build/ld.unix.slib.sh (+3/-3)
build/ld.win.cmn.sh (+64/-1)
build/ld.win.dlib.sh (+31/-31)
build/ld.win.exe.sh (+4/-4)
build/ld.win.slib.sh (+23/-28)
build/mac.arch.sh (+8/-1)
build/sra-dflt-schema.sh (+61/-14)
build/win-cc.sh (+123/-14)
configuration-assistant.perl (+888/-452)
debian/changelog (+43/-0)
debian/compat (+1/-1)
debian/control (+18/-14)
debian/copyright (+5/-2)
debian/docs (+0/-1)
debian/patches/10_portability.patch (+40/-25)
debian/patches/build-with-system-libbz2-libz.patch (+36/-0)
debian/patches/do_not_build_external_libs.patch (+14/-0)
debian/patches/hardening-format-security.patch (+43/-0)
debian/patches/hardening.patch (+39/-0)
debian/patches/series (+4/-0)
debian/rules (+15/-10)
debian/sra-toolkit-libs0.lintian-overrides (+1/-0)
debian/sra-toolkit-libs0.symbols (+6085/-3142)
debian/sra-toolkit.install (+0/-2)
debian/upstream (+12/-0)
debian/watch (+2/-1)
doc/help/html/bam-load-help.html (+29/-0)
doc/help/html/bam-loader-help.html (+0/-31)
doc/help/html/crc32sum-help.html (+1/-1)
interfaces/align/align-access.h (+8/-3)
interfaces/align/align.vschema (+537/-178)
interfaces/align/alignarc.h (+0/-63)
interfaces/align/bam.h (+70/-49)
interfaces/align/dna-reverse-cmpl.h (+43/-0)
interfaces/align/iterator.h (+610/-0)
interfaces/align/manager.h (+69/-0)
interfaces/align/qstat.vschema (+87/-0)
interfaces/align/quality-quantizer.h (+49/-0)
interfaces/align/reader-refseq.h (+3/-3)
interfaces/align/reference.h (+150/-0)
interfaces/align/refseq-mgr.h (+9/-7)
interfaces/align/refseq.vschema (+100/-0)
interfaces/align/seq.vschema (+300/-0)
interfaces/align/writer-alignment.h (+53/-24)
interfaces/align/writer-reference.h (+46/-13)
interfaces/align/writer-refseq.h (+7/-2)
interfaces/align/writer-sequence.h (+12/-5)
interfaces/cc/gcc/i386/atomic.h (+1/-0)
interfaces/cc/gcc/i386/fmtdef.h (+0/-42)
interfaces/cc/gcc/noarch/bitstr.h (+15/-14)
interfaces/cc/gcc/v128.h (+1088/-0)
interfaces/cc/gcc/x86_64/fmtdef.h (+0/-58)
interfaces/cc/vc++/compiler.h (+1/-1)
interfaces/cc/vc++/i386/arch-impl.h (+0/-194)
interfaces/cc/vc++/i386/fmtdef.h (+0/-42)
interfaces/cc/vc++/noarch/arch-impl.h (+194/-0)
interfaces/cc/vc++/noarch/bitstr.h (+4/-4)
interfaces/cc/vc++/stdint.h (+43/-2)
interfaces/cc/vc++/x86_64/arch-impl.h (+0/-133)
interfaces/cc/vc++/x86_64/fmtdef.h (+0/-41)
interfaces/ext/libxml/DOCBparser.h (+96/-0)
interfaces/ext/libxml/HTMLparser.h (+303/-0)
interfaces/ext/libxml/HTMLtree.h (+147/-0)
interfaces/ext/libxml/SAX.h (+173/-0)
interfaces/ext/libxml/SAX2.h (+176/-0)
interfaces/ext/libxml/c14n.h (+115/-0)
interfaces/ext/libxml/catalog.h (+182/-0)
interfaces/ext/libxml/chvalid.h (+230/-0)
interfaces/ext/libxml/debugXML.h (+217/-0)
interfaces/ext/libxml/dict.h (+69/-0)
interfaces/ext/libxml/encoding.h (+226/-0)
interfaces/ext/libxml/entities.h (+150/-0)
interfaces/ext/libxml/globals.h (+491/-0)
interfaces/ext/libxml/hash.h (+233/-0)
interfaces/ext/libxml/list.h (+137/-0)
interfaces/ext/libxml/nanoftp.h (+143/-0)
interfaces/ext/libxml/nanohttp.h (+81/-0)
interfaces/ext/libxml/parser.h (+1226/-0)
interfaces/ext/libxml/parserInternals.h (+611/-0)
interfaces/ext/libxml/pattern.h (+100/-0)
interfaces/ext/libxml/relaxng.h (+213/-0)
interfaces/ext/libxml/schemasInternals.h (+958/-0)
interfaces/ext/libxml/schematron.h (+142/-0)
interfaces/ext/libxml/threads.h (+84/-0)
interfaces/ext/libxml/tree.h (+1252/-0)
interfaces/ext/libxml/uri.h (+94/-0)
interfaces/ext/libxml/valid.h (+458/-0)
interfaces/ext/libxml/xinclude.h (+125/-0)
interfaces/ext/libxml/xlink.h (+189/-0)
interfaces/ext/libxml/xmlIO.h (+360/-0)
interfaces/ext/libxml/xmlautomata.h (+146/-0)
interfaces/ext/libxml/xmlerror.h (+944/-0)
interfaces/ext/libxml/xmlexports.h (+157/-0)
interfaces/ext/libxml/xmlmemory.h (+224/-0)
interfaces/ext/libxml/xmlmodule.h (+57/-0)
interfaces/ext/libxml/xmlreader.h (+424/-0)
interfaces/ext/libxml/xmlregexp.h (+222/-0)
interfaces/ext/libxml/xmlsave.h (+87/-0)
interfaces/ext/libxml/xmlschemas.h (+218/-0)
interfaces/ext/libxml/xmlschemastypes.h (+151/-0)
interfaces/ext/libxml/xmlstring.h (+140/-0)
interfaces/ext/libxml/xmlunicode.h (+202/-0)
interfaces/ext/libxml/xmlversion.h (+458/-0)
interfaces/ext/libxml/xmlwriter.h (+485/-0)
interfaces/ext/libxml/xpath.h (+546/-0)
interfaces/ext/libxml/xpathInternals.h (+630/-0)
interfaces/ext/libxml/xpointer.h (+114/-0)
interfaces/insdc/insdc.h (+35/-0)
interfaces/insdc/sra.h (+14/-13)
interfaces/insdc/sra.vschema (+1/-0)
interfaces/kapp/args.h (+53/-1)
interfaces/kapp/loader-file.h (+15/-2)
interfaces/kapp/loader-meta.h (+1/-1)
interfaces/kapp/log-xml.h (+8/-2)
interfaces/kapp/queue-file.h (+149/-0)
interfaces/kdb/btree.h (+91/-4)
interfaces/kdb/consistency-check.h (+15/-6)
interfaces/kdb/database.h (+16/-2)
interfaces/kdb/kdb-priv.h (+24/-1)
interfaces/kdb/manager.h (+26/-14)
interfaces/kdb/namelist.h (+2/-1)
interfaces/kdb/table.h (+14/-0)
interfaces/kfg/config.h (+168/-7)
interfaces/kfg/kart.h (+87/-0)
interfaces/kfg/keystore-priv.h (+92/-0)
interfaces/kfg/keystore.h (+155/-0)
interfaces/kfg/kfg-priv.h (+4/-0)
interfaces/kfg/repository.h (+290/-0)
interfaces/kfs/arc.h (+14/-0)
interfaces/kfs/arrayfile.h (+18/-0)
interfaces/kfs/buffile.h (+10/-0)
interfaces/kfs/cacheteefile.h (+147/-0)
interfaces/kfs/directory.h (+64/-9)
interfaces/kfs/file.h (+29/-0)
interfaces/kfs/impl.h (+15/-1)
interfaces/kfs/kfs-priv.h (+20/-26)
interfaces/kfs/lockfile.h (+116/-0)
interfaces/kfs/path-priv.h (+0/-101)
interfaces/kfs/path.h (+0/-237)
interfaces/kfs/quickmount.h (+61/-0)
interfaces/kfs/ramfile.h (+75/-0)
interfaces/kfs/readheadfile.h (+86/-0)
interfaces/kfs/sra.h (+16/-4)
interfaces/kfs/tar.h (+5/-0)
interfaces/klib/checksum.h (+1/-1)
interfaces/klib/data-buffer.h (+20/-0)
interfaces/klib/debug.h (+25/-8)
interfaces/klib/defs.h (+35/-5)
interfaces/klib/extern.h (+5/-1)
interfaces/klib/klib-priv.h (+106/-0)
interfaces/klib/ksort-macro.h (+257/-0)
interfaces/klib/log.h (+14/-14)
interfaces/klib/namelist.h (+19/-3)
interfaces/klib/out.h (+5/-1)
interfaces/klib/printf.h (+256/-19)
interfaces/klib/ptrie.h (+1/-1)
interfaces/klib/rc.h (+56/-83)
interfaces/klib/refcount.h (+2/-6)
interfaces/klib/report.h (+98/-0)
interfaces/klib/sort.h (+60/-0)
interfaces/klib/status.h (+1/-1)
interfaces/klib/text.h (+1/-1)
interfaces/klib/vector.h (+155/-0)
interfaces/klib/writer.h (+2/-2)
interfaces/klib/xml.h (+0/-355)
interfaces/klib/xml.hpp (+0/-198)
interfaces/kns/KCurlRequest.h (+65/-0)
interfaces/kns/adapt.h (+89/-0)
interfaces/kns/ascp.h (+87/-0)
interfaces/kns/curl-file.h (+49/-0)
interfaces/kns/endpoint.h (+117/-0)
interfaces/kns/entrez-fetcher.h (+88/-0)
interfaces/kns/extern.h (+41/-0)
interfaces/kns/http.h (+278/-0)
interfaces/kns/impl.h (+104/-0)
interfaces/kns/manager.h (+85/-0)
interfaces/kns/socket.h (+98/-0)
interfaces/kns/stream.h (+126/-0)
interfaces/kns/url-fetcher.h (+66/-0)
interfaces/kproc/impl.h (+104/-0)
interfaces/kproc/procmgr.h (+115/-0)
interfaces/kproc/q-extern.h (+2/-2)
interfaces/kproc/queue.h (+1/-1)
interfaces/kproc/sem.h (+8/-0)
interfaces/kproc/task.h (+83/-0)
interfaces/kproc/timeout.h (+64/-0)
interfaces/krypto/cipher-impl.h (+1/-0)
interfaces/krypto/cipher-priv.h (+1/-0)
interfaces/krypto/cipher-test.h (+49/-0)
interfaces/krypto/cipher.h (+208/-0)
interfaces/krypto/ciphermgr-priv.h (+38/-0)
interfaces/krypto/ciphermgr.h (+98/-0)
interfaces/krypto/encfile-priv.h (+250/-0)
interfaces/krypto/encfile.h (+134/-0)
interfaces/krypto/extern.h (+66/-0)
interfaces/krypto/key.h (+103/-0)
interfaces/krypto/manager-priv.h (+26/-0)
interfaces/krypto/manager.h (+33/-0)
interfaces/krypto/reencfile.h (+91/-0)
interfaces/krypto/rng-impl.h (+86/-0)
interfaces/krypto/rng.h (+68/-0)
interfaces/krypto/testciphermgr.h (+58/-0)
interfaces/krypto/wgaencrypt.h (+128/-0)
interfaces/ktst/test_tools.hpp (+2/-91)
interfaces/ktst/unit_test.hpp (+238/-59)
interfaces/ktst/unit_test_suite.hpp (+304/-240)
interfaces/kxml/xml.h (+382/-0)
interfaces/loader/alignment-writer.h (+109/-0)
interfaces/loader/common-reader-priv.h (+300/-0)
interfaces/loader/common-reader.h (+486/-0)
interfaces/loader/common-writer.h (+192/-0)
interfaces/loader/mmarray.h (+50/-0)
interfaces/loader/reference-writer.h (+78/-0)
interfaces/loader/sequence-writer.h (+91/-0)
interfaces/ncbi/seq.vschema (+13/-14)
interfaces/ncbi/wgs-contig.h (+176/-0)
interfaces/ncbi/wgs-contig.vschema (+660/-0)
interfaces/os/mac/os-native.h (+4/-2)
interfaces/os/unix/unix-native.h (+0/-13)
interfaces/os/win/atomic64.h (+17/-17)
interfaces/os/win/os-native.h (+44/-15)
interfaces/sra/impl.h (+20/-0)
interfaces/sra/pevents.vschema (+1/-1)
interfaces/sra/sradb-priv.h (+164/-29)
interfaces/sra/srapath.h (+5/-4)
interfaces/vdb/blob.h (+147/-0)
interfaces/vdb/built-in.vschema (+19/-7)
interfaces/vdb/cursor.h (+37/-0)
interfaces/vdb/database.h (+17/-1)
interfaces/vdb/dependencies.h (+231/-0)
interfaces/vdb/manager.h (+23/-0)
interfaces/vdb/manager.hpp (+4/-4)
interfaces/vdb/report.h (+92/-0)
interfaces/vdb/vdb-priv.h (+80/-5)
interfaces/vdb/vdb.vschema (+52/-11)
interfaces/vdb/xform.h (+2/-2)
interfaces/vfs/extern.h (+47/-0)
interfaces/vfs/manager-priv.h (+131/-0)
interfaces/vfs/manager.h (+316/-0)
interfaces/vfs/path-priv.h (+266/-0)
interfaces/vfs/path.h (+242/-0)
interfaces/vfs/resolver.h (+267/-0)
libs/Makefile (+14/-55)
libs/align/Makefile (+25/-34)
libs/align/al_iterator.c (+562/-0)
libs/align/align-access.c (+13/-13)
libs/align/align_mgr.c (+108/-0)
libs/align/bam.c (+1936/-1073)
libs/align/debug.h (+35/-1)
libs/align/dna-reverse-cmpl.c (+80/-0)
libs/align/libalign-access.vers (+1/-1)
libs/align/libalign-reader.vers (+1/-1)
libs/align/libalign-writer.vers (+0/-1)
libs/align/pl_iterator.c (+686/-0)
libs/align/quality-quantizer.c (+105/-0)
libs/align/reader-cmn.c (+251/-65)
libs/align/reader-cmn.h (+28/-3)
libs/align/reader-refseq.c (+52/-55)
libs/align/ref_iterator.c (+866/-0)
libs/align/reference-cmn.c (+43/-0)
libs/align/reference-cmn.h (+38/-0)
libs/align/reference.c (+1943/-0)
libs/align/refseq-mgr.c (+449/-187)
libs/align/writer-alignment.c (+157/-60)
libs/align/writer-cmn.c (+104/-13)
libs/align/writer-priv.h (+13/-2)
libs/align/writer-ref.c (+145/-54)
libs/align/writer-ref.h (+13/-9)
libs/align/writer-reference.c (+2277/-892)
libs/align/writer-refseq.c (+16/-6)
libs/align/writer-sequence.c (+228/-22)
libs/ascp/Makefile (+80/-0)
libs/ascp/ascp-priv.h (+74/-0)
libs/ascp/ascp.c (+692/-0)
libs/ascp/linux/ascp-path.c (+61/-0)
libs/ascp/mac/ascp-path.c (+65/-0)
libs/ascp/unix/connect.c (+555/-0)
libs/ascp/win/ascp-path.c (+26/-0)
libs/ascp/win/connect.c (+520/-0)
libs/axf/Makefile (+19/-33)
libs/axf/align-local_ref_id.c (+30/-44)
libs/axf/align-local_ref_start.c (+25/-38)
libs/axf/align-ref-name.c (+22/-30)
libs/axf/align-ref-pos.c (+75/-86)
libs/axf/align-ref-seq-id.c (+30/-30)
libs/axf/align-restore-read.c (+22/-6)
libs/axf/cigar.c (+923/-192)
libs/axf/get-sam-flags.c (+53/-27)
libs/axf/get_mate_align_ids.c (+271/-0)
libs/axf/libaxf.vers (+1/-1)
libs/axf/libaxf.vers.h (+0/-1)
libs/axf/libwaxf.vers (+1/-1)
libs/axf/libwaxf.vers.h (+0/-1)
libs/axf/make-cmp-read_desc.c (+156/-0)
libs/axf/not-my-row.c (+1/-1)
libs/axf/project_read_from_sequence.c (+63/-56)
libs/axf/ref-preserve_qual.c (+2/-0)
libs/axf/ref-restore-read.c (+3/-3)
libs/axf/ref-tbl-sub-select.c (+340/-218)
libs/axf/ref-tbl.c (+85/-0)
libs/axf/ref-tbl.h (+32/-0)
libs/axf/refseq-stats.c (+1/-1)
libs/axf/seq-construct-read.c (+125/-0)
libs/axf/seq-restore-read.c (+43/-49)
libs/axf/template-len.c (+74/-44)
libs/ext/Makefile (+4/-50)
libs/ext/bzip2/Makefile (+48/-71)
libs/ext/curl/Makefile (+103/-0)
libs/ext/zlib/Makefile (+48/-73)
libs/kapp/Makefile (+15/-27)
libs/kapp/args.c (+581/-206)
libs/kapp/args_debug.h (+47/-0)
libs/kapp/libload.vers (+1/-1)
libs/kapp/loader-file.c (+77/-40)
libs/kapp/log-xml.c (+15/-13)
libs/kapp/main.c (+35/-3)
libs/kapp/queue-file.c (+925/-0)
libs/kapp/tokenizer.c (+525/-0)
libs/kapp/unix/sysmain.c (+13/-0)
libs/kapp/win/sysmain.c (+18/-0)
libs/kdb/Makefile (+15/-39)
libs/kdb/btree.c (+48/-23)
libs/kdb/coldata.c (+1/-1)
libs/kdb/colidx0.c (+2/-2)
libs/kdb/colidx1.c (+4/-4)
libs/kdb/colidx2-priv.h (+14/-15)
libs/kdb/colidx2.c (+74/-40)
libs/kdb/column-cc.c (+61/-12)
libs/kdb/column.c (+21/-16)
libs/kdb/database-cc.c (+155/-87)
libs/kdb/database-cmn.c (+4/-5)
libs/kdb/database.c (+182/-20)
libs/kdb/dbcc-cmn.c (+1/-1)
libs/kdb/dbmgr-cmn.c (+69/-38)
libs/kdb/dbmgr-priv.h (+6/-2)
libs/kdb/dbmgr.c (+265/-13)
libs/kdb/idxblk.c (+5/-4)
libs/kdb/index-cmn.h (+4/-3)
libs/kdb/index.c (+12/-8)
libs/kdb/kdb-priv.h (+30/-15)
libs/kdb/kdb.c (+527/-171)
libs/kdb/libkdb.vers (+1/-1)
libs/kdb/libkdb.vers.h (+27/-1)
libs/kdb/libwkdb.vers (+1/-1)
libs/kdb/libwkdb.vers.h (+27/-1)
libs/kdb/meta.c (+60/-26)
libs/kdb/ptrieval-v2.c (+76/-47)
libs/kdb/table-cc.c (+190/-47)
libs/kdb/table.c (+123/-18)
libs/kdb/trieidx-v2.c (+14/-7)
libs/kdb/trieval-v2.c (+2/-2)
libs/kdb/wcolidx0.c (+2/-2)
libs/kdb/wcolidx1.c (+5/-5)
libs/kdb/wcolidx2.c (+3/-3)
libs/kdb/wcolumn.c (+47/-42)
libs/kdb/wdatabase.c (+196/-47)
libs/kdb/wdbmgr.c (+9/-8)
libs/kdb/windex.c (+10/-6)
libs/kdb/wkdb-priv.h (+35/-27)
libs/kdb/wkdb.c (+516/-185)
libs/kdb/wmeta.c (+74/-33)
libs/kdb/wtable.c (+146/-45)
libs/kdb/wtrieidx-v1.c (+1/-1)
libs/kdb/wtrieidx-v2.c (+7/-7)
libs/kfg/Makefile (+29/-27)
libs/kfg/config-grammar.c (+1725/-0)
libs/kfg/config-lex.c (+2511/-0)
libs/kfg/config-tokens.h (+75/-0)
libs/kfg/config.c (+1997/-397)
libs/kfg/config.linux.kfg (+0/-29)
libs/kfg/config.mac.kfg (+0/-29)
libs/kfg/config.win.kfg (+0/-29)
libs/kfg/default.kfg (+45/-0)
libs/kfg/kart.c (+608/-0)
libs/kfg/keystore.c (+836/-0)
libs/kfg/kfg-parse.h (+81/-0)
libs/kfg/libkfg.vers (+1/-1)
libs/kfg/report-kfg.c (+505/-0)
libs/kfg/repository.c (+1186/-0)
libs/kfs/Makefile (+28/-44)
libs/kfs/arc.c (+192/-111)
libs/kfs/arrayfile.c (+41/-0)
libs/kfs/buffile-read.c (+265/-0)
libs/kfs/buffile-write.c (+2/-2)
libs/kfs/buffile.c (+1/-1)
libs/kfs/bzip.c (+25/-9)
libs/kfs/cacheteefile.c (+1689/-0)
libs/kfs/countfile.c (+11/-0)
libs/kfs/crc32.c (+11/-8)
libs/kfs/directory.c (+175/-10)
libs/kfs/ffext.c (+7/-5)
libs/kfs/ffmagic.c (+113/-9)
libs/kfs/file.c (+145/-15)
libs/kfs/fileformat-priv.h (+1/-1)
libs/kfs/gzip.c (+2/-3)
libs/kfs/libkfs.vers (+1/-1)
libs/kfs/lockfile.c (+350/-0)
libs/kfs/md5.c (+28/-14)
libs/kfs/mmap.c (+9/-5)
libs/kfs/nullfile.c (+1/-0)
libs/kfs/pagefile.c (+68/-55)
libs/kfs/path-priv.h (+0/-114)
libs/kfs/path.c (+0/-1669)
libs/kfs/pmem.c (+5/-0)
libs/kfs/quickmount.c (+967/-0)
libs/kfs/ramfile.c (+424/-0)
libs/kfs/readheadfile.c (+294/-0)
libs/kfs/report.c (+169/-0)
libs/kfs/sra.c (+65/-17)
libs/kfs/subfile.c (+9/-9)
libs/kfs/tar.c (+57/-37)
libs/kfs/teefile.c (+1/-0)
libs/kfs/toc.c (+11/-3)
libs/kfs/tocdir.c (+14/-4)
libs/kfs/tocentry.c (+22/-21)
libs/kfs/tocfile.c (+1/-1)
libs/kfs/unix/sysdir-priv.h (+0/-9)
libs/kfs/unix/sysdir.c (+68/-26)
libs/kfs/unix/sysdll.c (+101/-31)
libs/kfs/unix/sysfile-priv.h (+1/-1)
libs/kfs/unix/sysfile.c (+12/-12)
libs/kfs/unix/syslockfile.c (+215/-0)
libs/kfs/unix/syspath.c (+0/-126)
libs/kfs/win/lnk_tools.c (+7/-2)
libs/kfs/win/sysdir-priv.h (+2/-2)
libs/kfs/win/sysdir.c (+336/-94)
libs/kfs/win/sysdll.c (+118/-16)
libs/kfs/win/sysfile-priv.h (+4/-1)
libs/kfs/win/sysfile.c (+320/-29)
libs/kfs/win/syslockfile.c (+67/-0)
libs/kfs/win/sysmmap.c (+2/-0)
libs/kfs/win/syspath.c (+0/-287)
libs/klib/Judy.h (+629/-0)
libs/klib/Makefile (+22/-34)
libs/klib/SHA-32bit.c (+4/-4)
libs/klib/SHA-64bit.c (+4/-4)
libs/klib/data-buffer.c (+150/-94)
libs/klib/judy-vector.c (+892/-0)
libs/klib/judy/Judy1.h (+549/-0)
libs/klib/judy/JudyByCount.c (+952/-0)
libs/klib/judy/JudyByCountWithDefs.c (+4/-0)
libs/klib/judy/JudyCascade.c (+1940/-0)
libs/klib/judy/JudyCount.c (+1193/-0)
libs/klib/judy/JudyCreateBranch.c (+312/-0)
libs/klib/judy/JudyDecascade.c (+1204/-0)
libs/klib/judy/JudyDel.c (+2144/-0)
libs/klib/judy/JudyFirst.c (+211/-0)
libs/klib/judy/JudyFreeArray.c (+361/-0)
libs/klib/judy/JudyGet.c (+1092/-0)
libs/klib/judy/JudyHS.c (+770/-0)
libs/klib/judy/JudyHS.h (+35/-0)
libs/klib/judy/JudyIns.c (+1871/-0)
libs/klib/judy/JudyInsArray.c (+1176/-0)
libs/klib/judy/JudyInsertBranch.c (+133/-0)
libs/klib/judy/JudyL.h (+503/-0)
libs/klib/judy/JudyMalloc.c (+86/-0)
libs/klib/judy/JudyMallocIF.c (+780/-0)
libs/klib/judy/JudyMemActive.c (+257/-0)
libs/klib/judy/JudyMemUsed.c (+59/-0)
libs/klib/judy/JudyNext.c (+2/-0)
libs/klib/judy/JudyNextEmpty.c (+2/-0)
libs/klib/judy/JudyPrev.c (+2/-0)
libs/klib/judy/JudyPrevEmpty.c (+2/-0)
libs/klib/judy/JudyPrevNext.c (+1888/-0)
libs/klib/judy/JudyPrevNextEmpty.c (+1388/-0)
libs/klib/judy/JudyPrintJP.c (+399/-0)
libs/klib/judy/JudyPrivate.h (+1610/-0)
libs/klib/judy/JudyPrivate1L.h (+483/-0)
libs/klib/judy/JudyPrivateBranch.h (+777/-0)
libs/klib/judy/JudySL.c (+1125/-0)
libs/klib/judy/JudyTablesGen.c (+294/-0)
libs/klib/judy/Makefile (+190/-0)
libs/klib/judy/j__udyGet.c (+2/-0)
libs/klib/ksort.c (+97/-0)
libs/klib/libklib.vers (+1/-1)
libs/klib/libklib.vers.h (+0/-1)
libs/klib/log.c (+24/-18)
libs/klib/pbstree-impl.c (+114/-114)
libs/klib/printf.c (+2396/-37)
libs/klib/qsort.c (+33/-1)
libs/klib/refcount.c (+0/-1)
libs/klib/report.c (+816/-0)
libs/klib/status-rc.c (+2/-2)
libs/klib/status.c (+3/-3)
libs/klib/symtab.c (+1/-1)
libs/klib/text.c (+4/-4)
libs/klib/token.c (+4/-5)
libs/klib/unix/systime.c (+3/-1)
libs/klib/unix/syswriter.c (+1/-0)
libs/klib/unpack.c (+175/-1)
libs/klib/vector_namelist.c (+101/-14)
libs/klib/vlen-encode.c (+2/-1)
libs/klib/win/syserrcode.c (+1/-1)
libs/klib/win/syswriter.c (+16/-1)
libs/klib/writer.c (+5/-5)
libs/kns/KCurlFile.c (+716/-0)
libs/kns/KCurlRequest.c (+438/-0)
libs/kns/Makefile (+127/-0)
libs/kns/curlhdr/curl.h (+1600/-0)
libs/kns/curlhdr/curlver.h (+56/-0)
libs/kns/curlhdr/easy.h (+81/-0)
libs/kns/curlhdr/multi.h (+344/-0)
libs/kns/curlhdr/types.h (+1/-0)
libs/kns/endpoint.c (+109/-0)
libs/kns/entrez-fetcher.c (+221/-0)
libs/kns/http-priv.h (+97/-0)
libs/kns/http-test.c (+368/-0)
libs/kns/http.c (+3002/-0)
libs/kns/kns_manager.c (+311/-0)
libs/kns/kns_mgr_priv.h (+67/-0)
libs/kns/libkns.vers (+1/-0)
libs/kns/libkurl.vers (+1/-0)
libs/kns/stream-from-files.c (+168/-0)
libs/kns/stream-from-streams.c (+150/-0)
libs/kns/stream-priv.h (+36/-0)
libs/kns/stream.c (+336/-0)
libs/kns/unix/sysendpoint.c (+169/-0)
libs/kns/unix/sysmgr.c (+35/-0)
libs/kns/unix/syssock.c (+552/-0)
libs/kns/unix/sysstream.c (+251/-0)
libs/kns/url-fetcher-curl.c (+255/-0)
libs/kns/url-fetcher-impl.h (+109/-0)
libs/kns/url-fetcher.c (+129/-0)
libs/kns/win/sysendpoint.c (+185/-0)
libs/kns/win/sysmgr.c (+57/-0)
libs/kns/win/syssock.c (+663/-0)
libs/kns/win/sysstream.c (+232/-0)
libs/kproc/Makefile (+49/-57)
libs/kproc/bsd/syslock.c (+1/-0)
libs/kproc/libkproc.vers (+1/-1)
libs/kproc/libkq.vers (+1/-1)
libs/kproc/libksproc.vers (+1/-1)
libs/kproc/linux/syslock.c (+1/-0)
libs/kproc/procmgr.c (+412/-0)
libs/kproc/queue.c (+90/-3)
libs/kproc/sem.c (+61/-18)
libs/kproc/sttimeout.c (+1/-0)
libs/kproc/task.c (+156/-0)
libs/kproc/unix/syscond.c (+45/-1)
libs/kproc/unix/systimeout.c (+1/-0)
libs/kproc/win/syscond-priv.h (+3/-7)
libs/kproc/win/syscond.c (+243/-19)
libs/kproc/win/syslock.c (+5/-1)
libs/krypto/Makefile (+307/-0)
libs/krypto/aes-byte.c (+236/-0)
libs/krypto/aes-ncbi-priv.h (+227/-0)
libs/krypto/aes-ncbi.c (+2644/-0)
libs/krypto/aes-priv.h (+94/-0)
libs/krypto/aes.c (+1/-0)
libs/krypto/aes_core.c (+1181/-0)
libs/krypto/blockcipher-impl.h (+187/-0)
libs/krypto/blockcipher-priv.h (+90/-0)
libs/krypto/blockcipher.c (+3/-0)
libs/krypto/cipher-byte.c (+522/-0)
libs/krypto/cipher-impl.h (+174/-0)
libs/krypto/cipher-no-vec.c (+41/-0)
libs/krypto/cipher-priv.h (+79/-0)
libs/krypto/cipher-vec.c (+808/-0)
libs/krypto/cipher.c (+538/-0)
libs/krypto/ciphermgr.c (+295/-0)
libs/krypto/compile-test.c (+50/-0)
libs/krypto/csprng.c (+163/-0)
libs/krypto/encfile-priv.h (+163/-0)
libs/krypto/encfile.c (+2122/-0)
libs/krypto/encfilev2.c (+2589/-0)
libs/krypto/key.c (+126/-0)
libs/krypto/libkrypto.vers (+1/-0)
libs/krypto/libkryptotest.vers (+1/-0)
libs/krypto/manager.c (+11/-0)
libs/krypto/ncbi-priv.h (+122/-0)
libs/krypto/no-null-ncbi.c (+59/-0)
libs/krypto/null-ncbi-priv.h (+56/-0)
libs/krypto/null-ncbi.c (+251/-0)
libs/krypto/reencfile.c (+1255/-0)
libs/krypto/rng-impl.h (+91/-0)
libs/krypto/rng.c (+120/-0)
libs/krypto/testcipher.c (+76/-0)
libs/krypto/wgaencrypt.c (+1254/-0)
libs/ktst/Makefile (+81/-0)
libs/ktst/testcase.cpp (+95/-0)
libs/ktst/testenv.cpp (+505/-0)
libs/ktst/testrunner.cpp (+77/-0)
libs/ktst/unix/runprocesstestcase.cpp (+125/-0)
libs/ktst/win/runprocesstestcase.cpp (+152/-0)
libs/kxml/Makefile (+10/-51)
libs/kxml/libkxfs.vers (+1/-1)
libs/kxml/libkxml.vers (+1/-1)
libs/kxml/xml.c (+27/-17)
libs/kxml/xtoc-parsexml.c (+23/-13)
libs/kxml/xtoc.c (+316/-149)
libs/loader/Makefile (+87/-0)
libs/loader/alignment-writer.c (+262/-0)
libs/loader/common-reader.c (+614/-0)
libs/loader/common-writer.c (+2051/-0)
libs/loader/mmarray.c (+131/-0)
libs/loader/reference-writer.c (+462/-0)
libs/loader/sequence-writer.c (+361/-0)
libs/ncbi-vdb/Makefile (+152/-0)
libs/ncbi-vdb/libncbi-vdb.vers (+1/-0)
libs/ncbi-vdb/libncbi-wvdb.vers (+1/-0)
libs/search/Makefile (+8/-31)
libs/search/agrep-myersunltd.c (+3/-3)
libs/search/fgrep-dumb.c (+1/-1)
libs/search/libksrch.vers (+1/-1)
libs/search/libksrch.vers.h (+0/-1)
libs/sra/Makefile (+65/-106)
libs/sra/libsradb.vers (+1/-1)
libs/sra/libsradb.vers.h (+27/-1)
libs/sra/libsrareader.vers (+1/-1)
libs/sra/libsrareader.vers.h (+0/-1)
libs/sra/libsraschema.vers.h (+0/-1)
libs/sra/libwsradb.vers (+1/-1)
libs/sra/libwsradb.vers.h (+0/-1)
libs/sra/libwsraschema.vers.h (+0/-1)
libs/sra/reader-abi.c (+18/-7)
libs/sra/reader-cmn.c (+13/-11)
libs/sra/reader-fastq.c (+11/-5)
libs/sra/reader-illumina.c (+81/-15)
libs/sra/reader-sff.c (+73/-48)
libs/sra/sra-dflt-schema.c (+0/-1)
libs/sra/sra-priv.h (+18/-3)
libs/sra/sra-schema.c (+4083/-0)
libs/sra/sracache.c (+559/-0)
libs/sra/sramgr-cmn.c (+230/-103)
libs/sra/srapath-stub.c (+0/-408)
libs/sra/sraschema-stub.c (+0/-67)
libs/sra/sraschema.c (+0/-1)
libs/sra/sratbl-cmn.c (+349/-81)
libs/sra/wsramgr.c (+1/-0)
libs/sra/wsraschema-stub.c (+0/-67)
libs/sra/wsratbl.c (+13/-6)
libs/sraxf/Makefile (+10/-43)
libs/sraxf/fix_read_seg_impl.h (+169/-0)
libs/sraxf/format-spot-name.c (+9/-2)
libs/sraxf/index_lookup.c (+21/-2)
libs/sraxf/libsraxf.vers (+1/-1)
libs/sraxf/libsraxf.vers.h (+0/-1)
libs/sraxf/libwsraxf.vers (+1/-1)
libs/sraxf/libwsraxf.vers.h (+0/-1)
libs/sraxf/prefix-tree-to-name.c (+0/-2)
libs/sraxf/read-desc.c (+7/-2)
libs/sraxf/read-seg-from-readn.c (+9/-34)
libs/sraxf/stats.c (+130/-65)
libs/sraxf/stats_quality.c (+1/-1)
libs/sraxf/tokenize-spot_name-ion-torrent.c (+48/-23)
libs/sraxf/v0-decompress-local.h (+1/-1)
libs/vdb/Makefile (+18/-41)
libs/vdb/blob-priv.h (+55/-12)
libs/vdb/blob.c (+820/-100)
libs/vdb/blob.h (+0/-7)
libs/vdb/column-cmn.c (+27/-9)
libs/vdb/column-priv.h (+35/-27)
libs/vdb/cursor-cmn.c (+527/-236)
libs/vdb/cursor-priv.h (+32/-4)
libs/vdb/cursor.c (+2/-1)
libs/vdb/database-cmn.c (+27/-2)
libs/vdb/database-depend.c (+1802/-0)
libs/vdb/dbmgr-cmn.c (+249/-107)
libs/vdb/dbmgr-priv.h (+0/-42)
libs/vdb/dbmgr.c (+9/-6)
libs/vdb/delta_average.c (+297/-0)
libs/vdb/libvdb.vers (+1/-1)
libs/vdb/libvdb.vers.h (+27/-1)
libs/vdb/libwvdb.vers (+1/-1)
libs/vdb/libwvdb.vers.h (+27/-1)
libs/vdb/linker-cmn.c (+33/-3)
libs/vdb/linker-int.c (+398/-5)
libs/vdb/linker-priv.h (+10/-0)
libs/vdb/meta-attr-write.c (+12/-9)
libs/vdb/page-map.c (+1028/-383)
libs/vdb/page-map.h (+258/-47)
libs/vdb/phys-cmn.c (+52/-6)
libs/vdb/phys-priv.h (+5/-0)
libs/vdb/prod-cmn.c (+241/-108)
libs/vdb/prod-expr.c (+6/-6)
libs/vdb/prod-func.c (+3/-3)
libs/vdb/prod-priv.h (+47/-8)
libs/vdb/prod.c (+13/-0)
libs/vdb/redimension.c (+1/-0)
libs/vdb/report-vdb.c (+856/-0)
libs/vdb/schema-dump.c (+22/-15)
libs/vdb/schema-expr.c (+9/-2)
libs/vdb/schema-int.c (+1/-0)
libs/vdb/schema-parse.c (+8/-0)
libs/vdb/schema-parse.h (+5/-0)
libs/vdb/schema-priv.h (+3/-0)
libs/vdb/schema-tbl.c (+52/-2)
libs/vdb/schema-type.c (+15/-3)
libs/vdb/schema.c (+19/-11)
libs/vdb/table-cmn.c (+123/-4)
libs/vdb/table-priv.h (+1/-1)
libs/vdb/wcolumn.c (+641/-674)
libs/vdb/wcursor.c (+228/-52)
libs/vdb/wdbmgr.c (+0/-7)
libs/vdb/wlinker.c (+40/-1)
libs/vdb/wphys.c (+68/-33)
libs/vdb/wprod.c (+21/-7)
libs/vdb/wtable.c (+106/-7)
libs/vdb/xform-priv.h (+8/-35)
libs/vfs/Makefile (+101/-0)
libs/vfs/keyring-priv.h (+46/-0)
libs/vfs/keyring.c (+133/-0)
libs/vfs/keyring.h (+110/-0)
libs/vfs/libsrapath.vers (+1/-0)
libs/vfs/libvfs.vers (+1/-0)
libs/vfs/manager.c (+2948/-0)
libs/vfs/path-priv.h (+147/-0)
libs/vfs/path.c (+3349/-0)
libs/vfs/resolver-priv.h (+144/-0)
libs/vfs/resolver.c (+3992/-0)
libs/vfs/srapath-stub.c (+372/-0)
libs/vfs/srapath.c (+1424/-0)
libs/vfs/unix/syskeyring.c (+174/-0)
libs/vfs/unix/syspath.c (+149/-0)
libs/vfs/win/syskeyring.c (+56/-0)
libs/vfs/win/syspath.c (+342/-0)
libs/vxf/Makefile (+19/-44)
libs/vxf/checksum.c (+2/-0)
libs/vxf/integral.c (+5/-1)
libs/vxf/integral_0.c (+115/-0)
libs/vxf/irzip.c (+5/-1)
libs/vxf/irzip.impl.h (+118/-56)
libs/vxf/iunzip.c (+6/-1)
libs/vxf/izip-common.h (+2/-2)
libs/vxf/libvxf.vers (+1/-1)
libs/vxf/libvxf.vers.h (+0/-1)
libs/vxf/libwvxf.vers (+1/-1)
libs/vxf/lower-case-tech-reads.c (+111/-0)
libs/vxf/math-funcs-impl.h (+1/-1)
libs/vxf/rand_4na_2na.c (+1/-2)
libs/vxf/simple-sub-select.c (+57/-22)
libs/vxf/sprintf.c (+1233/-109)
libs/vxf/unzip.c (+16/-10)
libs/vxf/vec-sum.c (+144/-86)
libs/vxf/wgs-tokenize-accession.c (+212/-0)
libs/wgsxf/Makefile (+124/-0)
libs/wgsxf/build_read_type.c (+113/-0)
libs/wgsxf/build_scaffold.c (+435/-0)
libs/wgsxf/libwgsxf.vers (+1/-0)
libs/wgsxf/libwwgsxf.vers (+1/-0)
tools/Makefile (+15/-43)
tools/align-info/Makefile (+13/-31)
tools/align-info/align-info.c (+119/-439)
tools/align-info/align-info.vers (+1/-1)
tools/align-info/align-info.vers.h (+0/-1)
tools/bam-loader/Globals.h (+90/-0)
tools/bam-loader/KFileHelper.c (+142/-0)
tools/bam-loader/KFileHelper.h (+48/-0)
tools/bam-loader/KVPFile.c (+355/-0)
tools/bam-loader/KVPFile.h (+164/-0)
tools/bam-loader/Makefile (+101/-0)
tools/bam-loader/alignment-writer.c (+176/-0)
tools/bam-loader/alignment-writer.h (+95/-0)
tools/bam-loader/analysis.c (+157/-0)
tools/bam-loader/analysis.h (+49/-0)
tools/bam-loader/bam-load.vers (+1/-0)
tools/bam-loader/bam-loader.c (+987/-0)
tools/bam-loader/hashtable.c (+878/-0)
tools/bam-loader/hashtable.h (+55/-0)
tools/bam-loader/loader-imp.c (+2102/-0)
tools/bam-loader/loader-imp.h (+29/-0)
tools/bam-loader/reference-writer.c (+449/-0)
tools/bam-loader/reference-writer.h (+69/-0)
tools/bam-loader/sequence-writer.c (+345/-0)
tools/bam-loader/sequence-writer.h (+84/-0)
tools/cache-mgr/Makefile (+120/-0)
tools/cache-mgr/cache-mgr.c (+1332/-0)
tools/cache-mgr/cache-mgr.vers (+1/-0)
tools/cg-load/Makefile (+106/-0)
tools/cg-load/cg-load.c (+1120/-0)
tools/cg-load/cg-load.vers (+1/-0)
tools/cg-load/debug.h (+34/-0)
tools/cg-load/defs.h (+136/-0)
tools/cg-load/f1_3.c (+76/-0)
tools/cg-load/f1_5.c (+76/-0)
tools/cg-load/f2_0.c (+79/-0)
tools/cg-load/f2_2.c (+95/-0)
tools/cg-load/factory-cmn.h (+61/-0)
tools/cg-load/factory-evidence-dnbs.c (+351/-0)
tools/cg-load/factory-evidence-dnbs.h (+43/-0)
tools/cg-load/factory-evidence-intervals.c (+306/-0)
tools/cg-load/factory-evidence-intervals.h (+43/-0)
tools/cg-load/factory-file.h (+43/-0)
tools/cg-load/factory-mappings.c (+338/-0)
tools/cg-load/factory-mappings.h (+43/-0)
tools/cg-load/factory-reads.c (+261/-0)
tools/cg-load/factory-reads.h (+43/-0)
tools/cg-load/file-version-factory.c (+157/-0)
tools/cg-load/file.c (+403/-0)
tools/cg-load/file.h (+330/-0)
tools/cg-load/writer-algn.c (+775/-0)
tools/cg-load/writer-algn.h (+62/-0)
tools/cg-load/writer-evidence-dnbs.c (+227/-0)
tools/cg-load/writer-evidence-dnbs.h (+88/-0)
tools/cg-load/writer-evidence-intervals.c (+255/-0)
tools/cg-load/writer-evidence-intervals.h (+68/-0)
tools/cg-load/writer-seq.c (+135/-0)
tools/cg-load/writer-seq.h (+58/-0)
tools/fastq-loader/Makefile (+156/-0)
tools/fastq-loader/fastq-grammar.c (+2129/-0)
tools/fastq-loader/fastq-grammar.y (+294/-0)
tools/fastq-loader/fastq-lex.c (+2419/-0)
tools/fastq-loader/fastq-lex.l (+294/-0)
tools/fastq-loader/fastq-loader.c (+543/-0)
tools/fastq-loader/fastq-parse.h (+141/-0)
tools/fastq-loader/fastq-reader.c (+706/-0)
tools/fastq-loader/fastq-reader.h (+50/-0)
tools/fastq-loader/fastq-tokens.h (+64/-0)
tools/fastq-loader/latf-load.vers (+1/-0)
tools/fastq-loader/loader-imp.c (+246/-0)
tools/kar/Makefile (+19/-19)
tools/kar/kar.c (+109/-11)
tools/kar/kar.vers (+1/-1)
tools/kar/kar.vers.h (+0/-1)
tools/kar/sra-kar.c (+36/-1)
tools/kar/sra-kar.vers (+1/-1)
tools/kar/sra-kar.vers.h (+0/-1)
tools/nenctool/Makefile (+123/-0)
tools/nenctool/nenctest.c (+502/-0)
tools/nenctool/nenctest.vers (+1/-0)
tools/nenctool/nenctool.c (+446/-0)
tools/nenctool/nenctool.vers (+1/-0)
tools/nencvalid/Makefile (+111/-0)
tools/nencvalid/nencvalid.c (+607/-0)
tools/nencvalid/nencvalid.vers (+1/-0)
tools/prefetch/Makefile (+100/-0)
tools/prefetch/prefetch.c (+1965/-0)
tools/prefetch/prefetch.vers (+1/-0)
tools/refseq-load/Makefile (+0/-127)
tools/refseq-load/context.c (+0/-284)
tools/refseq-load/context.h (+0/-93)
tools/refseq-load/definitions.h (+0/-59)
tools/refseq-load/refseq-load-includes.h (+0/-115)
tools/refseq-load/refseq-load.c (+0/-623)
tools/refseq-load/refseq-load.vers (+0/-1)
tools/refseq-load/refseq-load.vers.h (+0/-1)
tools/sam-dump/Makefile (+16/-24)
tools/sam-dump/sam-dump.c (+4650/-1331)
tools/sam-dump/sam-dump.vers (+1/-1)
tools/sam-dump/sam-dump.vers.h (+0/-1)
tools/sra-dbcc/Makefile (+20/-22)
tools/sra-dbcc/sra-dbcc.c (+1365/-221)
tools/sra-dbcc/sra-dbcc.vers (+1/-1)
tools/sra-dbcc/sra-dbcc.vers.h (+0/-1)
tools/sra-dump/Makefile (+13/-59)
tools/sra-dump/abi-dump.vers (+1/-1)
tools/sra-dump/abi-dump.vers.h (+0/-1)
tools/sra-dump/abi.c (+69/-49)
tools/sra-dump/core.c (+1224/-536)
tools/sra-dump/core.h (+1/-1)
tools/sra-dump/factory.c (+131/-77)
tools/sra-dump/factory.h (+25/-4)
tools/sra-dump/fasta_dump.c (+752/-0)
tools/sra-dump/fasta_dump.h (+36/-0)
tools/sra-dump/fastq-dump.vers (+1/-1)
tools/sra-dump/fastq-dump.vers.h (+0/-1)
tools/sra-dump/fastq.c (+2731/-1473)
tools/sra-dump/illumina-dump.vers (+1/-1)
tools/sra-dump/illumina-dump.vers.h (+0/-1)
tools/sra-dump/illumina.c (+73/-53)
tools/sra-dump/sff-dump.vers (+1/-1)
tools/sra-dump/sff-dump.vers.h (+0/-1)
tools/sra-dump/sff.c (+14/-9)
tools/sra-dump/sra-dump.c (+30/-30)
tools/sra-dump/sra-dump.vers (+1/-1)
tools/sra-dump/sra-dump.vers.h (+0/-1)
tools/sra-load/Makefile (+12/-25)
tools/sra-load/abi-load.vers (+1/-1)
tools/sra-load/abi-load.vers.h (+0/-1)
tools/sra-load/absolid-fmt.c (+0/-6)
tools/sra-load/common-xml.c (+14/-65)
tools/sra-load/common-xml.h (+1/-29)
tools/sra-load/experiment-xml.c (+30/-140)
tools/sra-load/experiment-xml.h (+0/-1)
tools/sra-load/fastq-fmt.c (+10/-23)
tools/sra-load/fastq-load.vers (+1/-1)
tools/sra-load/fastq-load.vers.h (+0/-1)
tools/sra-load/helicos-fmt.c (+0/-5)
tools/sra-load/helicos-load.vers (+1/-1)
tools/sra-load/helicos-load.vers.h (+0/-1)
tools/sra-load/illumina-fmt.c (+0/-5)
tools/sra-load/illumina-load.vers (+1/-1)
tools/sra-load/illumina-load.vers.h (+0/-1)
tools/sra-load/loader-file.c (+7/-2)
tools/sra-load/loader-file.h (+3/-1)
tools/sra-load/loader-fmt.h (+1/-0)
tools/sra-load/loader.c (+38/-28)
tools/sra-load/run-xml.c (+3/-2)
tools/sra-load/run-xml.h (+2/-1)
tools/sra-load/sff-fmt.c (+0/-5)
tools/sra-load/sff-load.vers (+1/-1)
tools/sra-load/sff-load.vers.h (+0/-1)
tools/sra-load/srf-fmt.c (+0/-5)
tools/sra-load/srf-load.vers (+1/-1)
tools/sra-load/srf-load.vers.h (+0/-1)
tools/sra-load/writer-absolid.c (+8/-2)
tools/sra-load/writer-absolid.h (+4/-1)
tools/sra-pileup/Makefile (+130/-0)
tools/sra-pileup/cg_tools.c (+984/-0)
tools/sra-pileup/cg_tools.h (+124/-0)
tools/sra-pileup/cmdline_cmn.c (+1058/-0)
tools/sra-pileup/cmdline_cmn.h (+134/-0)
tools/sra-pileup/debug.h (+34/-0)
tools/sra-pileup/inputfiles.c (+376/-0)
tools/sra-pileup/inputfiles.h (+99/-0)
tools/sra-pileup/matecache.c (+439/-0)
tools/sra-pileup/matecache.h (+119/-0)
tools/sra-pileup/out_redir.c (+120/-0)
tools/sra-pileup/out_redir.h (+64/-0)
tools/sra-pileup/read_fkt.c (+718/-0)
tools/sra-pileup/read_fkt.h (+82/-0)
tools/sra-pileup/reref.c (+501/-0)
tools/sra-pileup/reref.h (+48/-0)
tools/sra-pileup/sam-aligned.c (+2046/-0)
tools/sra-pileup/sam-aligned.h (+45/-0)
tools/sra-pileup/sam-dump-opts.c (+1502/-0)
tools/sra-pileup/sam-dump-opts.h (+282/-0)
tools/sra-pileup/sam-dump.c (+4896/-0)
tools/sra-pileup/sam-dump.vers (+1/-0)
tools/sra-pileup/sam-dump3.c (+532/-0)
tools/sra-pileup/sam-hdr.c (+425/-0)
tools/sra-pileup/sam-hdr.h (+41/-0)
tools/sra-pileup/sam-unaligned.c (+1482/-0)
tools/sra-pileup/sam-unaligned.h (+43/-0)
tools/sra-pileup/sra-pileup.c (+2611/-0)
tools/sra-pileup/sra-pileup.vers (+1/-0)
tools/sra-sort/Makefile (+130/-0)
tools/sra-sort/Makefile.cc (+24/-0)
tools/sra-sort/Makefile.clang (+27/-0)
tools/sra-sort/Makefile.gcc (+27/-0)
tools/sra-sort/Makefile.vc++ (+24/-0)
tools/sra-sort/buff-writer.c (+785/-0)
tools/sra-sort/buff-writer.h (+64/-0)
tools/sra-sort/caps.c (+125/-0)
tools/sra-sort/caps.h (+70/-0)
tools/sra-sort/capture-first-half-aligned.c (+192/-0)
tools/sra-sort/col-pair.c (+816/-0)
tools/sra-sort/col-pair.h (+323/-0)
tools/sra-sort/csra-pair.c (+216/-0)
tools/sra-sort/csra-pair.h (+84/-0)
tools/sra-sort/csra-tbl.c (+783/-0)
tools/sra-sort/csra-tbl.h (+83/-0)
tools/sra-sort/ctx.h (+109/-0)
tools/sra-sort/db-pair.c (+883/-0)
tools/sra-sort/db-pair.h (+208/-0)
tools/sra-sort/dir-pair.c (+504/-0)
tools/sra-sort/dir-pair.h (+124/-0)
tools/sra-sort/dump-blob-boundaries.c (+203/-0)
tools/sra-sort/except.c (+231/-0)
tools/sra-sort/except.h (+160/-0)
tools/sra-sort/gcc-ped.sh (+39/-0)
tools/sra-sort/glob-poslen.c (+349/-0)
tools/sra-sort/glob-poslen.h (+95/-0)
tools/sra-sort/id-mapper-col.c (+260/-0)
tools/sra-sort/id-mapper-col.h (+55/-0)
tools/sra-sort/idx-mapping.c (+92/-0)
tools/sra-sort/idx-mapping.h (+59/-0)
tools/sra-sort/map-file.c (+1192/-0)
tools/sra-sort/map-file.h (+172/-0)
tools/sra-sort/mapping-row-set.c (+496/-0)
tools/sra-sort/mem.c (+68/-0)
tools/sra-sort/mem.h (+128/-0)
tools/sra-sort/membank-priv.h (+44/-0)
tools/sra-sort/membank.c (+296/-0)
tools/sra-sort/meta-pair.c (+458/-0)
tools/sra-sort/meta-pair.h (+109/-0)
tools/sra-sort/paged-membank.c (+244/-0)
tools/sra-sort/paged-mmapbank.c (+399/-0)
tools/sra-sort/poslen-col-pair.c (+559/-0)
tools/sra-sort/poslen-col-pair.h (+63/-0)
tools/sra-sort/ref-alignid-col.c (+705/-0)
tools/sra-sort/ref-alignid-col.h (+53/-0)
tools/sra-sort/row-set-priv.h (+44/-0)
tools/sra-sort/row-set.c (+208/-0)
tools/sra-sort/row-set.h (+215/-0)
tools/sra-sort/run.c (+388/-0)
tools/sra-sort/simple-row-set.c (+212/-0)
tools/sra-sort/sort-defs.h (+82/-0)
tools/sra-sort/sorting-row-set.c (+405/-0)
tools/sra-sort/sra-sort.c (+754/-0)
tools/sra-sort/sra-sort.h (+171/-0)
tools/sra-sort/sra-sort.vers (+1/-0)
tools/sra-sort/status.h (+48/-0)
tools/sra-sort/tbl-pair.c (+1055/-0)
tools/sra-sort/tbl-pair.h (+209/-0)
tools/sra-sort/xcheck-ref-align.c (+404/-0)
tools/sra-sort/xcheck.h (+49/-0)
tools/sra-stat/Makefile (+14/-35)
tools/sra-stat/sra-stat.c (+2141/-284)
tools/sra-stat/sra-stat.vers (+1/-1)
tools/sra-stat/sra-stat.vers.h (+0/-1)
tools/srapath/Makefile (+96/-0)
tools/srapath/srapath.c (+261/-0)
tools/srapath/srapath.vers (+1/-0)
tools/util/Makefile (+77/-63)
tools/util/kdbmeta.c (+454/-128)
tools/util/kdbmeta.vers (+1/-1)
tools/util/kdbmeta.vers.h (+0/-1)
tools/util/mac/syspass.c (+48/-0)
tools/util/rcexplain.vers (+1/-1)
tools/util/rcexplain.vers.h (+0/-1)
tools/util/rowwritetest.c (+4/-10)
tools/util/rowwritetest.vers (+1/-1)
tools/util/syspass-priv.h (+44/-0)
tools/util/test-sra.c (+1595/-0)
tools/util/test-sra.vers (+1/-0)
tools/util/testld.vers (+1/-1)
tools/util/txt2kdb.vers (+1/-1)
tools/util/unix/syspass.c (+62/-0)
tools/util/vdb-lock.c (+3/-1)
tools/util/vdb-lock.vers (+1/-1)
tools/util/vdb-lock.vers.h (+0/-1)
tools/util/vdb-passwd.c (+276/-0)
tools/util/vdb-passwd.vers (+1/-0)
tools/util/vdb-unlock.c (+3/-1)
tools/util/vdb-unlock.vers (+1/-1)
tools/util/vdb-unlock.vers.h (+0/-1)
tools/util/win/syspass.c (+53/-0)
tools/vdb-config/Makefile (+14/-15)
tools/vdb-config/vdb-config.c (+331/-165)
tools/vdb-config/vdb-config.vers (+1/-1)
tools/vdb-config/vdb-config.vers.h (+0/-1)
tools/vdb-copy/Makefile (+13/-30)
tools/vdb-copy/coldefs.c (+35/-8)
tools/vdb-copy/coldefs.h (+1/-1)
tools/vdb-copy/context.c (+4/-0)
tools/vdb-copy/context.h (+8/-0)
tools/vdb-copy/copy_meta.c (+127/-46)
tools/vdb-copy/definitions.h (+2/-0)
tools/vdb-copy/helper.c (+7/-11)
tools/vdb-copy/helper.h (+1/-2)
tools/vdb-copy/namelist_tools.c (+1/-1)
tools/vdb-copy/num-gen.c (+8/-6)
tools/vdb-copy/progressbar.c (+9/-9)
tools/vdb-copy/redactval.c (+0/-1)
tools/vdb-copy/type_matcher.c (+12/-12)
tools/vdb-copy/vdb-copy-includes.h (+2/-0)
tools/vdb-copy/vdb-copy.c (+70/-57)
tools/vdb-copy/vdb-copy.vers (+1/-1)
tools/vdb-copy/vdb-copy.vers.h (+0/-1)
tools/vdb-decrypt/Makefile (+130/-0)
tools/vdb-decrypt/shared.c (+1270/-0)
tools/vdb-decrypt/shared.h (+93/-0)
tools/vdb-decrypt/vdb-decrypt.c (+283/-0)
tools/vdb-decrypt/vdb-decrypt.vers (+1/-0)
tools/vdb-decrypt/vdb-encrypt.c (+231/-0)
tools/vdb-decrypt/vdb-encrypt.vers (+1/-0)
tools/vdb-dump/Makefile (+12/-30)
tools/vdb-dump/vdb-dump-coldefs.c (+194/-80)
tools/vdb-dump/vdb-dump-coldefs.h (+7/-1)
tools/vdb-dump/vdb-dump-context.c (+16/-65)
tools/vdb-dump/vdb-dump-context.h (+22/-1)
tools/vdb-dump/vdb-dump-filter.c (+2/-2)
tools/vdb-dump/vdb-dump-filter.h (+4/-0)
tools/vdb-dump/vdb-dump-formats.c (+35/-24)
tools/vdb-dump/vdb-dump-formats.h (+4/-0)
tools/vdb-dump/vdb-dump-helper.c (+43/-39)
tools/vdb-dump/vdb-dump-helper.h (+5/-1)
tools/vdb-dump/vdb-dump-num-gen.c (+2/-2)
tools/vdb-dump/vdb-dump-num-gen.h (+6/-1)
tools/vdb-dump/vdb-dump-row-context.h (+6/-0)
tools/vdb-dump/vdb-dump-str.c (+20/-12)
tools/vdb-dump/vdb-dump-str.h (+4/-0)
tools/vdb-dump/vdb-dump-tools.c (+1/-1)
tools/vdb-dump/vdb-dump-tools.h (+4/-0)
tools/vdb-dump/vdb-dump.c (+596/-259)
tools/vdb-dump/vdb-dump.vers (+1/-1)
tools/vdb-dump/vdb-dump.vers.h (+0/-1)
tools/vdb-validate/Makefile (+103/-0)
tools/vdb-validate/vdb-validate.c (+2198/-0)
tools/vdb-validate/vdb-validate.vers (+1/-0)
To merge this branch: bzr merge lp:~noskcaj/ubuntu/trusty/sra-sdk/ftbfs
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+214647@code.launchpad.net

Description of the change

New upstream bugfix release (fixes ftbfs)

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

This was already uploaded as https://launchpad.net/ubuntu/+source/sra-sdk/2.3.3-4~dfsg-1ubuntu1. Note that it still FTBFS on i386.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.pc/.quilt_patches'
2--- .pc/.quilt_patches 1970-01-01 00:00:00 +0000
3+++ .pc/.quilt_patches 2014-04-08 01:47:44 +0000
4@@ -0,0 +1,1 @@
5+debian/patches
6
7=== added file '.pc/.quilt_series'
8--- .pc/.quilt_series 1970-01-01 00:00:00 +0000
9+++ .pc/.quilt_series 2014-04-08 01:47:44 +0000
10@@ -0,0 +1,1 @@
11+series
12
13=== modified file '.pc/10_portability.patch/build/Makefile.gcc'
14--- .pc/10_portability.patch/build/Makefile.gcc 2012-01-10 09:06:14 +0000
15+++ .pc/10_portability.patch/build/Makefile.gcc 2014-04-08 01:47:44 +0000
16@@ -44,7 +44,14 @@
17 -MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
18
19 # tool options
20-WARN = -Wall # -Wconversion
21+WARN = -Wall -Wno-long-long
22+ifneq (sun,$(OS))
23+ WARN += -Wno-variadic-macros
24+endif
25+
26+ifeq (linux,$(OS))
27+ NO_ARRAY_BOUNDS_WARNING = -Wno-array-bounds
28+endif
29
30 ifeq (64,$(BITS))
31 CARCH = -m64
32@@ -60,12 +67,15 @@
33 DBG = -g
34 OPT = $(WARN)
35 NOPT = $(WARN)
36- PED = -std=c99 -ansi -pedantic
37+ # GCC seems unable to use c99 without ansi, which
38+ # basically clobbers features back to c89. the options
39+ # must be specified in the order shown.
40+ PED = -std=c99 -ansi -pedantic # -fdiagnostics-show-option
41 else
42
43 ifeq (x86_64, $(ARCH))
44- OPT = -O3 -fno-strict-aliasing
45+ OPT = -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing
46 else
47- OPT = -O3 -fno-strict-aliasing
48+ OPT = -O3 -Wno-variadic-macros -fno-strict-aliasing
49 endif
50 endif
51
52=== modified file '.pc/10_portability.patch/build/Makefile.shell'
53--- .pc/10_portability.patch/build/Makefile.shell 2012-01-10 09:06:14 +0000
54+++ .pc/10_portability.patch/build/Makefile.shell 2014-04-08 01:47:44 +0000
55@@ -27,80 +27,124 @@
56 UNAME = $(shell uname -s)
57
58 ifeq (Darwin, $(UNAME))
59- OS = mac
60+ HOST_OS = mac
61 endif
62 ifeq (Linux, $(UNAME))
63- OS = linux
64+ HOST_OS = linux
65 endif
66 ifeq (SunOS, $(UNAME))
67- OS = sun
68+ HOST_OS = sun
69+ ARCHITECTURES = x86_64 i386
70 endif
71 ifeq (xCYGWIN, $(findstring xCYGWIN,x$(UNAME)))
72- OS = win
73+ HOST_OS = win
74 endif
75 ifeq (xMINGW, $(findstring xMINGW,x$(UNAME)))
76- OS = win
77+ HOST_OS = win
78 endif
79
80-# OS flavor is normally OS
81-OSFLAV = $(OS)
82+# assume build OS is the same as host OS
83+OS = $(HOST_OS)
84+BUILD_OS = $(OS)
85
86 # determine ARCH
87-ifeq (mac,$(OS))
88- ARCH = $(shell $(TOP)/build/mac.arch.sh)
89+ARCHITECTURES = default
90+ifeq (mac,$(HOST_OS))
91+ HOST_ARCH = $(shell $(TOP)/build/mac.arch.sh)
92 else
93 MARCH = $(shell uname -m)
94
95 ifeq (i386, $(MARCH))
96- ARCH = i386
97+ HOST_ARCH = i386
98 endif
99 ifeq (i486, $(MARCH))
100- ARCH = i386
101+ HOST_ARCH = i386
102 endif
103 ifeq (i586, $(MARCH))
104- ARCH = i386
105+ HOST_ARCH = i386
106 endif
107 ifeq (i686, $(MARCH))
108- ARCH = i386
109+ ifeq (WOW64x, $(findstring WOW64x,$(UNAME)x))
110+ # 64-bit capable Cygwin. Analyze the version of cl to set the corect architecture
111+ CL = $(shell cl.exe 2>&1 >/dev/null)
112+ ifeq (for x64, $(findstring for x64, $(CL)))
113+ HOST_ARCH = x86_64
114+ else
115+ HOST_ARCH = i386
116+ endif
117+ else
118+ HOST_ARCH = i386
119+ endif
120 endif
121 ifeq (x86_64, $(MARCH))
122- ARCH = x86_64
123- endif
124- ifeq (sun4u,$(MARCH))
125- ARCH = sparc32
126+ HOST_ARCH = x86_64
127+ endif
128+ ifeq (i86pc, $(MARCH))
129+ HOST_ARCH = x86_64
130+ ARCHITECTURES = x86_64 i386
131+ endif
132+ ifeq (sun4v,$(MARCH))
133+ HOST_ARCH = sparc64
134+ ARCHITECTURES = sparc64 sparc32
135 endif
136 endif
137
138-# determine BITS
139-ifeq (x86_64, $(ARCH))
140- BITS = 64
141+ARCH = $(HOST_ARCH)
142+REMOTE_ARCH = $(ARCH)
143+
144+# pick up dependencies from object directory
145+ifdef SRCDIR
146+ include $(wildcard *.d)
147 else
148- BITS = 32
149-endif
150-
151-# first pass through defines SRCDIR
152-ifndef SRCDIR
153-
154-# set SRCDIR from MODULE
155+
156+# determine SRCDIR
157 ifdef MODULE
158 SRCDIR=$(TOP)/$(MODULE)
159 else
160 SRCDIR=$(TOP)
161 endif
162
163+# set COMP, LNKG and BUILD
164+COMP = $(shell test -f $(TOP)/build/COMP && mv $(TOP)/build/COMP $(TOP)/build/COMP.$(OS); test -f $(TOP)/build/COMP.$(OS) && cat $(TOP)/build/COMP.$(OS) || echo gcc)
165+LNKG = $(shell test -f $(TOP)/build/STATIC && mv $(TOP)/build/STATIC $(TOP)/build/LNKG.$(OS) && echo stat > $(TOP)/build/LNKG.$(OS); test -f $(TOP)/build/LNKG.$(OS) && cat $(TOP)/build/LNKG.$(OS) || echo stat)
166+BUILD = $(shell test -f $(TOP)/build/BUILD && mv $(TOP)/build/BUILD $(TOP)/build/BUILD.$(OS); test -f $(TOP)/build/BUILD.$(OS) && cat $(TOP)/build/BUILD.$(OS) || echo dbg)
167+TOOLSET := $(COMP)
168+
169+ifdef USE_GCC_IF_ICC
170+ifeq (icc,$(COMP))
171+COMP = gcc
172+endif
173+ifeq (clang,$(COMP))
174+COMP = gcc
175+endif
176+endif
177+
178+endif
179+
180 # set OUTDIR
181 ifndef OUTDIR
182- OUTDIR = $(shell test -f $(TOP)/build/OUTDIR.$(OS) && cat $(TOP)/build/OUTDIR.$(OS) || echo $(TOP))
183+ OUTDIR = $(shell test -f $(TOP)/build/OUTDIR && mv $(TOP)/build/OUTDIR $(TOP)/build/OUTDIR.$(BUILD_OS); test -f $(TOP)/build/OUTDIR.$(BUILD_OS) && cat $(TOP)/build/OUTDIR.$(BUILD_OS) || echo $(TOP))
184 ifeq (,$(OUTDIR))
185 OUTDIR = $(TOP)
186 endif
187- ifeq (.,$(OUTDIR))
188- OUTDIR = $(TOP)
189- endif
190-endif
191-
192-# set COMP and BUILD
193-COMP = $(shell test -f $(TOP)/build/COMP.$(OS) && cat $(TOP)/build/COMP.$(OS) || echo gcc)
194-BUILD = $(shell test -f $(TOP)/build/BUILD.$(OS) && cat $(TOP)/build/BUILD.$(OS) || echo dbg)
195-
196+endif
197+ifeq (,$(ROUTDIR))
198+ ROUTDIR = $(RHOME)
199+endif
200+
201+# OS flavor is normally OS
202+OSFLAV = $(OS)
203+
204+# determine BITS
205+ifeq (x86_64, $(ARCH))
206+ BITS = 64
207+endif
208+ifeq (sparc64, $(ARCH))
209+ BITS = 64
210+endif
211+ifeq (i386, $(ARCH))
212+ BITS = 32
213+endif
214+ifeq (sparc32, $(ARCH))
215+ BITS = 32
216 endif
217
218=== modified file '.pc/applied-patches'
219--- .pc/applied-patches 2012-01-10 09:06:14 +0000
220+++ .pc/applied-patches 2014-04-08 01:47:44 +0000
221@@ -1,1 +1,5 @@
222+do_not_build_external_libs.patch
223 10_portability.patch
224+build-with-system-libbz2-libz.patch
225+hardening.patch
226+hardening-format-security.patch
227
228=== added directory '.pc/build-with-system-libbz2-libz.patch'
229=== added directory '.pc/build-with-system-libbz2-libz.patch/libs'
230=== added directory '.pc/build-with-system-libbz2-libz.patch/libs/ncbi-vdb'
231=== added file '.pc/build-with-system-libbz2-libz.patch/libs/ncbi-vdb/Makefile'
232--- .pc/build-with-system-libbz2-libz.patch/libs/ncbi-vdb/Makefile 1970-01-01 00:00:00 +0000
233+++ .pc/build-with-system-libbz2-libz.patch/libs/ncbi-vdb/Makefile 2014-04-08 01:47:44 +0000
234@@ -0,0 +1,154 @@
235+# ===========================================================================
236+#
237+# PUBLIC DOMAIN NOTICE
238+# National Center for Biotechnology Information
239+#
240+# This software/database is a "United States Government Work" under the
241+# terms of the United States Copyright Act. It was written as part of
242+# the author's official duties as a United States Government employee and
243+# thus cannot be copyrighted. This software/database is freely available
244+# to the public for use. The National Library of Medicine and the U.S.
245+# Government have not placed any restriction on its use or reproduction.
246+#
247+# Although all reasonable efforts have been taken to ensure the accuracy
248+# and reliability of the software and data, the NLM and the U.S.
249+# Government do not and cannot warrant the performance or results that
250+# may be obtained by using this software or data. The NLM and the U.S.
251+# Government disclaim all warranties, express or implied, including
252+# warranties of performance, merchantability or fitness for any particular
253+# purpose.
254+#
255+# Please cite the author in any work or product based on this material.
256+#
257+# ===========================================================================
258+
259+
260+default: std
261+
262+TOP ?= $(shell ../../build/abspath.sh ../..)
263+MODULE = libs/ncbi-vdb
264+
265+EXT_LIBS = \
266+ libncbi-vdb \
267+ libncbi-wvdb
268+
269+ALL_LIBS = \
270+ $(EXT_LIBS)
271+
272+include $(TOP)/build/Makefile.env
273+
274+#-------------------------------------------------------------------------------
275+# outer targets
276+#
277+all std: makedirs
278+ @ $(MAKE_CMD) $(TARGDIR)/std
279+
280+$(EXT_LIBS): makedirs
281+ @ $(MAKE_CMD) $(LIBDIR)/$@
282+
283+.PHONY: all std $(ALL_LIBS)
284+
285+#-------------------------------------------------------------------------------
286+# std
287+#
288+$(TARGDIR)/std: \
289+ $(addprefix $(LIBDIR)/,$(EXT_LIBS))
290+
291+.PHONY: $(TARGDIR)/all $(TARGDIR)/std
292+
293+#-------------------------------------------------------------------------------
294+# clean
295+#
296+clean: stdclean
297+
298+.PHONY: clean
299+
300+#-------------------------------------------------------------------------------
301+# virtual db library
302+#
303+$(LIBDIR)/libncbi-vdb: $(addprefix $(LIBDIR)/libncbi-vdb.,$(LIBEXT))
304+
305+ifeq (linux,$(OS))
306+LIBKFF = kff magic
307+LIBVDB_BLAST = vdb-blast
308+else
309+LIBKFF =
310+LIBVDB_BLAST =
311+endif
312+
313+ifeq (win,$(OS))
314+LIBENTREZ =
315+LIBKQ =
316+LIBKXML =
317+else
318+LIBENTREZ =
319+LIBKQ = kq
320+LIBKXML = kxml kxfs
321+endif
322+
323+VDB_LIB_CMN = \
324+ align-access \
325+ bz2 \
326+ kfg \
327+ kfs \
328+ klib \
329+ kproc \
330+ $(LIBKQ) \
331+ krypto \
332+ ksrch \
333+ $(LIBKXML) \
334+ kurl \
335+ vfs \
336+ z
337+
338+VDB_LIB_RD = \
339+ $(VDB_LIB_CMN) \
340+ align-reader \
341+ ascp \
342+ $(EXT_SCHEMA_MODULES) \
343+ kdb \
344+ sradb \
345+ srareader \
346+ $(LIBVDB-BLAST) \
347+ vdb
348+
349+VDB_OBJ = \
350+ $(addprefix $(ILIBDIR)/lib,$(addsuffix .a,$(VDB_LIB_RD)))
351+
352+VDB_LIB = \
353+ $(addprefix -s,$(VDB_LIB_RD))
354+
355+$(LIBDIR)/libncbi-vdb.$(SHLX): $(VDB_OBJ)
356+ $(LD) --dlib --vers $(SRCDIR) -o $@ $(VDB_LIB)
357+
358+$(LIBDIR)/libncbi-vdb.$(LIBX): $(VDB_OBJ)
359+ $(LD) --slib --vers $(SRCDIR) -o $@ $(VDB_LIB)
360+
361+#-------------------------------------------------------------------------------
362+# update version
363+#
364+$(LIBDIR)/libncbi-wvdb: $(addprefix $(LIBDIR)/libncbi-wvdb.,$(LIBEXT))
365+
366+VDB_LIB_RDWR = \
367+ $(VDB_LIB_CMN) \
368+ align-writer \
369+ waxf \
370+ wkdb \
371+ wsradb \
372+ wsraxf \
373+ wvdb \
374+ $(LIBENTREZ) \
375+ wvxf \
376+ wwgsxf
377+
378+WVDB_OBJ = \
379+ $(addprefix $(ILIBDIR)/lib,$(addsuffix .a,$(VDB_LIB_RDWR)))
380+
381+WVDB_LIB = \
382+ $(addprefix -s,$(VDB_LIB_RDWR))
383+
384+$(LIBDIR)/libncbi-wvdb.$(SHLX): $(WVDB_OBJ)
385+ $(LD) --dlib --vers $(SRCDIR) -o $@ $(WVDB_LIB) -lxml2
386+
387+$(LIBDIR)/libncbi-wvdb.$(LIBX): $(WVDB_OBJ)
388+ $(LD) --slib --vers $(SRCDIR) -o $@ $(WVDB_LIB)
389
390=== added directory '.pc/do_not_build_external_libs.patch'
391=== added directory '.pc/do_not_build_external_libs.patch/libs'
392=== added file '.pc/do_not_build_external_libs.patch/libs/Makefile'
393--- .pc/do_not_build_external_libs.patch/libs/Makefile 1970-01-01 00:00:00 +0000
394+++ .pc/do_not_build_external_libs.patch/libs/Makefile 2014-04-08 01:47:44 +0000
395@@ -0,0 +1,74 @@
396+# ===========================================================================
397+#
398+# PUBLIC DOMAIN NOTICE
399+# National Center for Biotechnology Information
400+#
401+# This software/database is a "United States Government Work" under the
402+# terms of the United States Copyright Act. It was written as part of
403+# the author's official duties as a United States Government employee and
404+# thus cannot be copyrighted. This software/database is freely available
405+# to the public for use. The National Library of Medicine and the U.S.
406+# Government have not placed any restriction on its use or reproduction.
407+#
408+# Although all reasonable efforts have been taken to ensure the accuracy
409+# and reliability of the software and data, the NLM and the U.S.
410+# Government do not and cannot warrant the performance or results that
411+# may be obtained by using this software or data. The NLM and the U.S.
412+# Government disclaim all warranties, express or implied, including
413+# warranties of performance, merchantability or fitness for any particular
414+# purpose.
415+#
416+# Please cite the author in any work or product based on this material.
417+#
418+# ===========================================================================
419+
420+
421+TOP ?= $(shell ../build/abspath.sh ..)
422+MODULE = libs
423+
424+include $(TOP)/build/Makefile.shell
425+
426+#-------------------------------------------------------------------------------
427+# default
428+#
429+SUBDIRS = \
430+ ext \
431+ klib \
432+ kproc \
433+ kfs \
434+ kns \
435+ kxml \
436+ kfg \
437+ krypto \
438+ vfs \
439+ kapp \
440+ kdb \
441+ vdb \
442+ vxf \
443+ search \
444+ sraxf \
445+ align \
446+ axf \
447+ wgsxf \
448+ ktst \
449+ loader \
450+ ascp \
451+ sra \
452+ ncbi-vdb
453+
454+
455+# common targets for non-leaf Makefiles; must follow a definition of SUBDIRS
456+include $(TOP)/build/Makefile.targets
457+
458+$(SUBDIRS):
459+ @ $(MAKE) -C $@
460+
461+.PHONY: default $(SUBDIRS)
462+
463+#-------------------------------------------------------------------------------
464+# pass-through
465+#
466+out debug profile release GCC ICC VC++:
467+ @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env $@
468+
469+.PHONY: out debug profile release GCC ICC VC++
470
471=== added directory '.pc/hardening-format-security.patch'
472=== added directory '.pc/hardening-format-security.patch/libs'
473=== added directory '.pc/hardening-format-security.patch/libs/kdb'
474=== added file '.pc/hardening-format-security.patch/libs/kdb/database.c'
475--- .pc/hardening-format-security.patch/libs/kdb/database.c 1970-01-01 00:00:00 +0000
476+++ .pc/hardening-format-security.patch/libs/kdb/database.c 2014-04-08 01:47:44 +0000
477@@ -0,0 +1,706 @@
478+/*===========================================================================
479+*
480+* PUBLIC DOMAIN NOTICE
481+* National Center for Biotechnology Information
482+*
483+* This software/database is a "United States Government Work" under the
484+* terms of the United States Copyright Act. It was written as part of
485+* the author's official duties as a United States Government employee and
486+* thus cannot be copyrighted. This software/database is freely available
487+* to the public for use. The National Library of Medicine and the U.S.
488+* Government have not placed any restriction on its use or reproduction.
489+*
490+* Although all reasonable efforts have been taken to ensure the accuracy
491+* and reliability of the software and data, the NLM and the U.S.
492+* Government do not and cannot warrant the performance or results that
493+* may be obtained by using this software or data. The NLM and the U.S.
494+* Government disclaim all warranties, express or implied, including
495+* warranties of performance, merchantability or fitness for any particular
496+* purpose.
497+*
498+* Please cite the author in any work or product based on this material.
499+*
500+* ===========================================================================
501+*
502+*/
503+
504+#define KONST const
505+#include <kdb/extern.h>
506+#include "database-priv.h"
507+#include "dbmgr-priv.h"
508+#include "kdb-priv.h"
509+#undef KONST
510+
511+#include <klib/namelist.h>
512+#include <klib/log.h>
513+#include <klib/rc.h>
514+#include <klib/printf.h>
515+#include <os-native.h>
516+#include <sysalloc.h>
517+
518+#include <limits.h>
519+#include <stdlib.h>
520+#include <stdio.h>
521+#include <string.h>
522+#include <assert.h>
523+
524+
525+/*--------------------------------------------------------------------------
526+ * KDatabase
527+ * connection to a database within file system
528+ */
529+
530+/* GetPath
531+ * return the absolute path to DB
532+ */
533+LIB_EXPORT rc_t CC KDatabaseGetPath ( KDatabase const *self,
534+ const char **path )
535+{
536+ if ( self == NULL )
537+ return RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
538+ if ( path == NULL )
539+ return RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
540+
541+ *path = self->path;
542+
543+ return 0;
544+}
545+
546+/* Whack
547+ */
548+static
549+rc_t KDatabaseWhack ( KDatabase *self )
550+{
551+ rc_t rc = 0;
552+
553+ KRefcountWhack ( & self -> refcount, "KDatabase" );
554+
555+ /* release dad */
556+ if ( self -> dad != NULL )
557+ {
558+ rc = KDatabaseSever ( self -> dad );
559+ if ( rc == 0 )
560+ self -> dad = NULL;
561+ }
562+
563+ /* remove from mgr */
564+ if ( rc == 0 )
565+ rc = KDBManagerSever ( self -> mgr );
566+
567+ /* complete */
568+ if ( rc == 0 )
569+ {
570+ KDirectoryRelease ( self -> dir );
571+ free ( self );
572+ return 0;
573+ }
574+
575+ KRefcountInit ( & self -> refcount, 1, "KDatabase", "whack", "kdb" );
576+
577+ return rc;
578+}
579+
580+
581+/* AddRef
582+ * Release
583+ * all objects are reference counted
584+ * NULL references are ignored
585+ */
586+LIB_EXPORT rc_t CC KDatabaseAddRef ( const KDatabase *self )
587+{
588+ if ( self != NULL )
589+ {
590+ switch ( KRefcountAdd ( & self -> refcount, "KDatabase" ) )
591+ {
592+ case krefLimit:
593+ return RC ( rcDB, rcDatabase, rcAttaching, rcRange, rcExcessive );
594+ }
595+ }
596+ return 0;
597+}
598+
599+LIB_EXPORT rc_t CC KDatabaseRelease ( const KDatabase *self )
600+{
601+ if ( self != NULL )
602+ {
603+ switch ( KRefcountDrop ( & self -> refcount, "KDatabase" ) )
604+ {
605+ case krefWhack:
606+ return KDatabaseWhack ( ( KDatabase* ) self );
607+ case krefNegative:
608+ return RC ( rcDB, rcDatabase, rcReleasing, rcRange, rcExcessive );
609+ }
610+ }
611+ return 0;
612+}
613+
614+/* Sever
615+ * like Release, except called internally
616+ * indicates that a child object is letting go...
617+ */
618+KDatabase *KDatabaseAttach ( const KDatabase *self )
619+{
620+ if ( self != NULL )
621+ {
622+ switch ( KRefcountAddDep ( & self -> refcount, "KDatabase" ) )
623+ {
624+ case krefLimit:
625+ return NULL;
626+ }
627+ }
628+ return ( KDatabase* ) self;
629+}
630+
631+rc_t KDatabaseSever ( const KDatabase *self )
632+{
633+ if ( self != NULL )
634+ {
635+ switch ( KRefcountDropDep ( & self -> refcount, "KDatabase" ) )
636+ {
637+ case krefWhack:
638+ return KDatabaseWhack ( ( KDatabase* ) self );
639+ case krefNegative:
640+ return RC ( rcDB, rcDatabase, rcReleasing, rcRange, rcExcessive );
641+ }
642+ }
643+ return 0;
644+}
645+
646+
647+/* Make
648+ * make an initialized structure
649+ */
650+static
651+rc_t KDatabaseMake ( KDatabase **dbp, const KDirectory *dir, const char *path )
652+{
653+ KDatabase *db;
654+
655+ assert ( dbp != NULL );
656+ assert ( path != NULL );
657+
658+ db = malloc ( sizeof * db + strlen ( path ) );
659+ if ( db == NULL )
660+ {
661+ * dbp = NULL;
662+ return RC ( rcDB, rcDatabase, rcConstructing, rcMemory, rcExhausted );
663+ }
664+
665+ db -> mgr = NULL;
666+ db -> dad = NULL;
667+ db -> dir = dir;
668+ KRefcountInit ( & db -> refcount, 1, "KDatabase", "make", path );
669+ strcpy ( db -> path, path );
670+
671+ * dbp = db;
672+ return 0;
673+}
674+
675+
676+/* OpenDBRead
677+ * VOpenDBRead
678+ * open a database for read
679+ *
680+ * "db" [ OUT ] - return parameter for newly opened database
681+ *
682+ * "path" [ IN ] - NUL terminated string in
683+ * wd-native character set giving path to database
684+ */
685+static
686+rc_t KDBManagerVOpenDBReadInt ( const KDBManager *self, const KDatabase **dbp,
687+ const KDirectory *wd, bool try_srapath,
688+ const char *path, va_list args )
689+{
690+ rc_t rc;
691+
692+ /* MUST use vsnprintf because the documented behavior of "path"
693+ is that of stdc library's printf, not vdb printf */
694+ char dbpath [ 4096 ];
695+ int z = ( args == NULL ) ?
696+ snprintf ( dbpath, sizeof dbpath, path ):
697+ vsnprintf ( dbpath, sizeof dbpath, path, args );
698+ if ( z < 0 || ( size_t ) z >= sizeof dbpath )
699+ rc = RC ( rcDB, rcMgr, rcOpening, rcPath, rcExcessive );
700+ else
701+ {
702+ const KDirectory *dir;
703+
704+ /* open the directory if its a database */
705+ rc = KDBOpenPathTypeRead ( self, wd, dbpath, &dir, kptDatabase, NULL, try_srapath );
706+ if ( rc == 0 )
707+ {
708+ KDatabase *db;
709+
710+ /* allocate a new guy */
711+ rc = KDatabaseMake ( & db, dir, dbpath );
712+ if ( rc == 0 )
713+ {
714+ db -> mgr = KDBManagerAttach ( self );
715+ * dbp = db;
716+ return 0;
717+ }
718+
719+ KDirectoryRelease ( dir );
720+ }
721+ }
722+ return rc;
723+}
724+
725+LIB_EXPORT rc_t CC KDBManagerOpenDBRead ( const KDBManager *self,
726+ const KDatabase **db, const char *path, ... )
727+{
728+ rc_t rc;
729+ va_list args;
730+
731+ va_start ( args, path );
732+ rc = KDBManagerVOpenDBRead ( self, db, path, args );
733+ va_end ( args );
734+
735+ return rc;
736+}
737+
738+LIB_EXPORT rc_t CC KDatabaseOpenDBRead ( const KDatabase *self,
739+ const KDatabase **db, const char *name, ... )
740+{
741+ rc_t rc;
742+ va_list args;
743+
744+ va_start ( args, name );
745+ rc = KDatabaseVOpenDBRead ( self, db, name, args );
746+ va_end ( args );
747+
748+ return rc;
749+}
750+
751+LIB_EXPORT rc_t CC KDBManagerVOpenDBRead ( const KDBManager *self,
752+ const KDatabase **db, const char *path, va_list args )
753+{
754+ if ( db == NULL )
755+ return RC ( rcDB, rcMgr, rcOpening, rcParam, rcNull );
756+
757+ * db = NULL;
758+
759+ if ( self == NULL )
760+ return RC ( rcDB, rcMgr, rcOpening, rcSelf, rcNull );
761+
762+ return KDBManagerVOpenDBReadInt ( self, db, self -> wd, true, path, args );
763+}
764+
765+LIB_EXPORT rc_t CC KDatabaseVOpenDBRead ( const KDatabase *self,
766+ const KDatabase **dbp, const char *name, va_list args )
767+{
768+ rc_t rc;
769+ char path [ 256 ];
770+
771+ if ( dbp == NULL )
772+ return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
773+
774+ * dbp = NULL;
775+
776+ if ( self == NULL )
777+ return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
778+
779+ rc = KDBVMakeSubPath ( self -> dir,
780+ path, sizeof path, "db", 2, name, args );
781+ if ( rc == 0 )
782+ {
783+ rc = KDBManagerVOpenDBReadInt ( self -> mgr, dbp,
784+ self -> dir, false, path, NULL );
785+ if ( rc == 0 )
786+ {
787+ KDatabase *db = ( KDatabase* ) * dbp;
788+ db -> dad = KDatabaseAttach ( self );
789+ }
790+ }
791+
792+ return rc;
793+}
794+
795+
796+/* Locked
797+ * returns non-zero if locked
798+ */
799+LIB_EXPORT bool CC KDatabaseLocked ( const KDatabase *self )
800+{
801+ rc_t rc;
802+
803+ if ( self == NULL )
804+ return false;
805+
806+ rc = KDBWritable ( self -> dir, "." );
807+ return GetRCState ( rc ) == rcLocked;
808+}
809+
810+/* Exists
811+ * returns true if requested object exists
812+ *
813+ * "type" [ IN ] - a KDBPathType
814+ * valid values are kptIndex and kptColumn
815+ *
816+ * "path" [ IN ] - NUL terminated path
817+ */
818+LIB_EXPORT bool CC KDatabaseVExists ( const KDatabase *self, uint32_t type, const char *name, va_list args )
819+{
820+ if ( self != NULL && name != NULL && name [ 0 ] != 0 )
821+ {
822+ rc_t rc;
823+ size_t len;
824+ const char *ns;
825+ char path [ 256 ];
826+
827+ switch ( type )
828+ {
829+ case kptDatabase:
830+ ns = "db";
831+ len = 2;
832+ break;
833+
834+ case kptTable:
835+ ns = "tbl";
836+ len = 3;
837+ break;
838+
839+ case kptIndex:
840+ ns = "idx";
841+ len = 3;
842+ break;
843+
844+ default:
845+ return false;
846+ }
847+
848+ rc = KDBVMakeSubPath ( self -> dir, path, sizeof path, ns, len, name, args );
849+ if ( rc == 0 )
850+ {
851+ switch ( KDirectoryPathType ( self -> dir, path ) )
852+ {
853+ case kptFile:
854+ case kptDir:
855+ case kptFile | kptAlias:
856+ case kptDir | kptAlias:
857+ return true;
858+ }
859+ }
860+ }
861+ return false;
862+}
863+
864+LIB_EXPORT bool CC KDatabaseExists ( const KDatabase *self, uint32_t type, const char *name, ... )
865+{
866+ bool exists;
867+
868+ va_list args;
869+ va_start ( args, name );
870+
871+ exists = KDatabaseVExists ( self, type, name, args );
872+
873+ va_end ( args );
874+
875+ return exists;
876+}
877+
878+
879+/* IsAlias
880+ * returns true if object name is an alias
881+ * returns path to fundamental name if it was aliased
882+ *
883+ * "type" [ IN ] - a KDBPathType
884+ * valid values are kptDatabase, kptTable and kptIndex
885+ *
886+ * "resolved" [ OUT ] and "rsize" [ IN ] - optional output buffer
887+ * for fundamenta object name if "alias" is not a fundamental name,
888+ *
889+ * "name" [ IN ] - NUL terminated object name
890+ */
891+LIB_EXPORT bool CC KDatabaseIsAlias ( const KDatabase *self, uint32_t type,
892+ char *resolved, size_t rsize, const char *name )
893+{
894+ if ( self != NULL && name != NULL && name [ 0 ] != 0 )
895+ {
896+ rc_t rc;
897+ size_t len;
898+ const char *ns;
899+ char path [ 256 ];
900+
901+ switch ( type )
902+ {
903+ case kptDatabase:
904+ ns = "db";
905+ len = 2;
906+ break;
907+
908+ case kptTable:
909+ ns = "tbl";
910+ len = 3;
911+ break;
912+
913+ case kptIndex:
914+ ns = "idx";
915+ len = 3;
916+ break;
917+
918+ default:
919+ return false;
920+ }
921+
922+ rc = KDBMakeSubPath ( self -> dir, path, sizeof path, ns, len, name );
923+ if ( rc == 0 )
924+ {
925+ switch ( KDirectoryPathType ( self -> dir, path ) )
926+ {
927+ case kptFile | kptAlias:
928+ case kptDir | kptAlias:
929+ if ( resolved != NULL && rsize != 0 )
930+ {
931+ const KDirectory *sub;
932+ rc = KDirectoryOpenDirRead ( self -> dir, & sub, false, ns );
933+ * resolved = 0;
934+ if ( rc != 0 )
935+ PLOGERR ( klogWarn, ( klogWarn, rc, "failed to open subdirectory '$(sub)'", "sub=%s", ns ) );
936+ else
937+ {
938+ rc = KDirectoryResolveAlias ( sub, false, resolved, rsize, name );
939+ KDirectoryRelease ( sub );
940+ if ( rc != 0 )
941+ PLOGERR ( klogWarn, ( klogWarn, rc, "failed to resolve alias '$(alias)'", "alias=%s", name ) );
942+ }
943+ }
944+ return true;
945+ }
946+ }
947+ }
948+
949+ if ( resolved != NULL && rsize != 0 )
950+ * resolved = 0;
951+
952+ return false;
953+}
954+
955+
956+/* Writable
957+ * returns 0 if object is writable
958+ * or a reason why if not
959+ *
960+ * "type" [ IN ] - a KDBPathType
961+ * valid values are kptDatabase, kptTable and kptIndex
962+ *
963+ * "path" [ IN ] - NUL terminated path
964+ */
965+LIB_EXPORT rc_t CC KDatabaseVWritable ( const KDatabase *self, uint32_t type, const char *name, va_list args )
966+{
967+ /* TBD */
968+ return -1;
969+}
970+
971+LIB_EXPORT rc_t CC KDatabaseWritable ( const KDatabase *self, uint32_t type, const char *name, ... )
972+{
973+ rc_t rc;
974+
975+ va_list args;
976+ va_start ( args, name );
977+
978+ rc = KDatabaseVWritable ( self, type, name, args );
979+
980+ va_end ( args );
981+
982+ return rc;
983+}
984+
985+
986+/* OpenManager
987+ * duplicate reference to manager
988+ * NB - returned reference must be released
989+ */
990+LIB_EXPORT rc_t CC KDatabaseOpenManagerRead ( const KDatabase *self, const KDBManager **mgr )
991+{
992+ rc_t rc;
993+
994+ if ( mgr == NULL )
995+ rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
996+ else
997+ {
998+ if ( self == NULL )
999+ rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
1000+ else
1001+ {
1002+ rc = KDBManagerAddRef ( self -> mgr );
1003+ if ( rc == 0 )
1004+ {
1005+ * mgr = self -> mgr;
1006+ return 0;
1007+ }
1008+ }
1009+
1010+ * mgr = NULL;
1011+ }
1012+
1013+ return rc;
1014+}
1015+
1016+
1017+/* OpenParent
1018+ * duplicate reference to parent database
1019+ * NB - returned reference must be released
1020+ */
1021+LIB_EXPORT rc_t CC KDatabaseOpenParentRead ( const KDatabase *self, const KDatabase **par )
1022+{
1023+ rc_t rc;
1024+
1025+ if ( par == NULL )
1026+ rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
1027+ else
1028+ {
1029+ if ( self == NULL )
1030+ rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
1031+ else
1032+ {
1033+ rc = KDatabaseAddRef ( self -> dad );
1034+ if ( rc == 0 )
1035+ {
1036+ * par = self -> dad;
1037+ return 0;
1038+ }
1039+ }
1040+
1041+ * par = NULL;
1042+ }
1043+
1044+ return rc;
1045+}
1046+
1047+
1048+/* GetDirectory
1049+ * access the directory in use
1050+ */
1051+LIB_EXPORT rc_t CC KDatabaseOpenDirectoryRead ( const KDatabase *self, const KDirectory **dir )
1052+{
1053+ rc_t rc;
1054+
1055+ if ( dir == NULL )
1056+ rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
1057+ else
1058+ {
1059+ if ( self == NULL )
1060+ rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
1061+ else
1062+ {
1063+ * dir = self -> dir;
1064+ return KDirectoryAddRef ( * dir );
1065+ }
1066+
1067+ * dir = NULL;
1068+ }
1069+
1070+ return rc;
1071+}
1072+
1073+
1074+/* ModDate
1075+ * get modification date
1076+ */
1077+LIB_EXPORT rc_t CC KDatabaseModDate ( const KDatabase *self, KTime_t *mtime )
1078+{
1079+ rc_t rc;
1080+
1081+ if ( mtime == NULL )
1082+ rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
1083+ else
1084+ {
1085+ if ( self == NULL )
1086+ rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
1087+ else
1088+ {
1089+ /* HACK ALERT - there needs to be a proper way to record modification times */
1090+ const KDirectory *dir = self -> dir;
1091+
1092+ /* this only tells the last time the table was locked,
1093+ which may be close to the last time it was modified */
1094+ rc = KDirectoryDate ( dir, mtime, "lock" );
1095+ if ( rc == 0 )
1096+ return 0;
1097+
1098+ /* get directory timestamp */
1099+ rc = KDirectoryDate ( dir, mtime, "." );
1100+ if ( rc == 0 )
1101+ return 0;
1102+ }
1103+
1104+ * mtime = 0;
1105+ }
1106+
1107+ return rc;
1108+}
1109+
1110+
1111+/*--------------------------------------------------------------------------
1112+ * KNameList
1113+ */
1114+
1115+/* List
1116+ * create database listings
1117+ */
1118+struct FilterData
1119+{
1120+ const KDBManager * mgr;
1121+ int type;
1122+};
1123+
1124+static
1125+bool CC KDatabaseListFilter ( const KDirectory *dir, const char *name, void *data_ )
1126+{
1127+ struct FilterData * data = data_;
1128+ return ( KDBOpenPathTypeRead ( data->mgr, dir, name, NULL, data->type, NULL, false ) == 0 );
1129+}
1130+
1131+LIB_EXPORT rc_t CC KDatabaseListDB ( const KDatabase *self, KNamelist **names )
1132+{
1133+ if ( self != NULL )
1134+ {
1135+ struct FilterData data;
1136+ data.mgr = self->mgr;
1137+ data.type = kptDatabase;
1138+
1139+ return KDirectoryVList ( self -> dir,
1140+ names, KDatabaseListFilter, &data, "db", NULL );
1141+ }
1142+
1143+ if ( names != NULL )
1144+ * names = NULL;
1145+
1146+ return RC ( rcDB, rcDatabase, rcListing, rcSelf, rcNull );
1147+}
1148+
1149+LIB_EXPORT rc_t CC KDatabaseListTbl ( struct KDatabase const *self, KNamelist **names )
1150+{
1151+ if ( self != NULL )
1152+ {
1153+ struct FilterData data;
1154+ data.mgr = self->mgr;
1155+ data.type = kptTable;
1156+
1157+ return KDirectoryVList ( self -> dir,
1158+ names, KDatabaseListFilter, &data, "tbl", NULL );
1159+ }
1160+
1161+ if ( names != NULL )
1162+ * names = NULL;
1163+
1164+ return RC ( rcDB, rcDatabase, rcListing, rcSelf, rcNull );
1165+}
1166+
1167+LIB_EXPORT rc_t CC KDatabaseListIdx ( struct KDatabase const *self, KNamelist **names )
1168+{
1169+ if ( self != NULL )
1170+ {
1171+ struct FilterData data;
1172+ data.mgr = self->mgr;
1173+ data.type = kptIndex;
1174+
1175+ return KDirectoryVList ( self -> dir,
1176+ names, KDatabaseListFilter, &data, "idx", NULL );
1177+ }
1178+
1179+ if ( names != NULL )
1180+ * names = NULL;
1181+
1182+ return RC ( rcDB, rcDatabase, rcListing, rcSelf, rcNull );
1183+}
1184
1185=== added file '.pc/hardening-format-security.patch/libs/kdb/index.c'
1186--- .pc/hardening-format-security.patch/libs/kdb/index.c 1970-01-01 00:00:00 +0000
1187+++ .pc/hardening-format-security.patch/libs/kdb/index.c 2014-04-08 01:47:44 +0000
1188@@ -0,0 +1,1006 @@
1189+/*===========================================================================
1190+*
1191+* PUBLIC DOMAIN NOTICE
1192+* National Center for Biotechnology Information
1193+*
1194+* This software/database is a "United States Government Work" under the
1195+* terms of the United States Copyright Act. It was written as part of
1196+* the author's official duties as a United States Government employee and
1197+* thus cannot be copyrighted. This software/database is freely available
1198+* to the public for use. The National Library of Medicine and the U.S.
1199+* Government have not placed any restriction on its use or reproduction.
1200+*
1201+* Although all reasonable efforts have been taken to ensure the accuracy
1202+* and reliability of the software and data, the NLM and the U.S.
1203+* Government do not and cannot warrant the performance or results that
1204+* may be obtained by using this software or data. The NLM and the U.S.
1205+* Government disclaim all warranties, express or implied, including
1206+* warranties of performance, merchantability or fitness for any particular
1207+* purpose.
1208+*
1209+* Please cite the author in any work or product based on this material.
1210+*
1211+* ===========================================================================
1212+*
1213+*/
1214+
1215+#include <kdb/extern.h>
1216+
1217+#define KONST const
1218+#include "index-priv.h"
1219+#include "dbmgr-priv.h"
1220+#include "database-priv.h"
1221+#include "table-priv.h"
1222+#include "kdb-priv.h"
1223+#undef KONST
1224+
1225+#include <kdb/index.h>
1226+#include <kfs/file.h>
1227+#include <kfs/mmap.h>
1228+#include <klib/refcount.h>
1229+#include <klib/rc.h>
1230+#include <os-native.h>
1231+#include <sysalloc.h>
1232+
1233+#include <limits.h>
1234+#include <stdlib.h>
1235+#include <stdio.h>
1236+#include <string.h>
1237+#include <byteswap.h>
1238+#include <assert.h>
1239+
1240+/*--------------------------------------------------------------------------
1241+ * KIndex
1242+ * an object capable of mapping an object to integer oid
1243+ */
1244+struct KIndex
1245+{
1246+ const KDBManager *mgr;
1247+ const KDatabase *db;
1248+ const KTable *tbl;
1249+ KRefcount refcount;
1250+ uint32_t vers;
1251+ union
1252+ {
1253+ KTrieIndex_v1 txt1;
1254+ KTrieIndex_v2 txt234;
1255+ KU64Index_v3 u64_3;
1256+ } u;
1257+ bool converted_from_v1;
1258+ uint8_t type;
1259+ char path [ 1 ];
1260+};
1261+
1262+
1263+/* Whack
1264+ */
1265+static
1266+rc_t KIndexWhack ( KIndex *self )
1267+{
1268+ rc_t rc = 0;
1269+
1270+ KRefcountWhack ( & self -> refcount, "KIndex" );
1271+
1272+ /* release owner */
1273+ if ( self -> db != NULL )
1274+ {
1275+ rc = KDatabaseSever ( self -> db );
1276+ if ( rc == 0 )
1277+ self -> db = NULL;
1278+ }
1279+ else if ( self -> tbl != NULL )
1280+ {
1281+ rc = KTableSever ( self -> tbl );
1282+ if ( rc == 0 )
1283+ self -> tbl = NULL;
1284+ }
1285+
1286+ /* remove from mgr */
1287+ if ( rc == 0 )
1288+ rc = KDBManagerSever ( self -> mgr );
1289+ if ( rc == 0 )
1290+ {
1291+ self -> mgr = NULL;
1292+
1293+ /* complete */
1294+ rc = SILENT_RC ( rcDB, rcIndex, rcDestroying, rcIndex, rcBadVersion );
1295+
1296+ switch ( self -> type )
1297+ {
1298+ case kitText:
1299+ case kitText | kitProj:
1300+ switch ( self -> vers )
1301+ {
1302+ case 1:
1303+ KTrieIndexWhack_v1 ( & self -> u . txt1 );
1304+ rc = 0;
1305+ break;
1306+ case 2:
1307+ case 3:
1308+ case 4:
1309+ KTrieIndexWhack_v2 ( & self -> u . txt234 );
1310+ rc = 0;
1311+ break;
1312+ }
1313+ break;
1314+
1315+ case kitU64:
1316+ switch ( self -> vers )
1317+ {
1318+ case 3:
1319+ case 4:
1320+ rc = KU64IndexWhack_v3 ( & self -> u . u64_3 );
1321+ break;
1322+ }
1323+ break;
1324+
1325+ }
1326+
1327+ if ( rc == 0 )
1328+ {
1329+ free ( self );
1330+ return 0;
1331+ }
1332+ }
1333+
1334+ KRefcountInit ( & self -> refcount, 1, "KIndex", "whack", "kidx" );
1335+ return rc;
1336+}
1337+
1338+
1339+/* AddRef
1340+ * Release
1341+ * all objects are reference counted
1342+ * NULL references are ignored
1343+ */
1344+LIB_EXPORT rc_t CC KIndexAddRef ( const KIndex *self )
1345+{
1346+ if ( self != NULL )
1347+ {
1348+ switch ( KRefcountAdd ( & self -> refcount, "KIndex" ) )
1349+ {
1350+ case krefLimit:
1351+ return RC ( rcDB, rcIndex, rcAttaching, rcRange, rcExcessive );
1352+ }
1353+ }
1354+ return 0;
1355+}
1356+
1357+LIB_EXPORT rc_t CC KIndexRelease ( const KIndex *self )
1358+{
1359+ if ( self != NULL )
1360+ {
1361+ switch ( KRefcountDrop ( & self -> refcount, "KIndex" ) )
1362+ {
1363+ case krefWhack:
1364+ return KIndexWhack ( ( KIndex* ) self );
1365+ case krefNegative:
1366+ return RC ( rcDB, rcIndex, rcReleasing, rcRange, rcExcessive );
1367+ }
1368+ }
1369+ return 0;
1370+}
1371+
1372+
1373+/* Make
1374+ */
1375+static
1376+rc_t KIndexMake ( KIndex **idxp, const char *path )
1377+{
1378+ rc_t rc;
1379+
1380+ if ( idxp == NULL )
1381+ rc = RC ( rcDB, rcIndex, rcCreating, rcParam, rcNull );
1382+ else
1383+ {
1384+ if ( path == NULL )
1385+ rc = RC ( rcDB, rcIndex, rcCreating, rcPath, rcNull );
1386+ else if ( path [ 0 ] == 0 )
1387+ rc = RC ( rcDB, rcIndex, rcCreating, rcPath, rcEmpty );
1388+ else
1389+ {
1390+ KIndex* idx = malloc ( sizeof *idx + strlen ( path ) );
1391+ if ( idx == NULL )
1392+ rc = RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
1393+ else
1394+ {
1395+ memset ( idx, 0, sizeof * idx );
1396+ KRefcountInit ( & idx -> refcount, 1, "KIndex", "make", path );
1397+ strcpy ( idx -> path, path );
1398+ * idxp = idx;
1399+ return 0;
1400+ }
1401+ }
1402+ }
1403+
1404+ return rc;
1405+}
1406+
1407+static
1408+rc_t KIndexAttach ( KIndex *self, const KMMap *mm, bool *byteswap )
1409+{
1410+ size_t size;
1411+ rc_t rc = KMMapSize ( mm, & size );
1412+ if ( rc == 0 )
1413+ {
1414+ const void *addr;
1415+ rc = KMMapAddrRead ( mm, & addr );
1416+ if ( rc == 0 )
1417+ {
1418+ union
1419+ {
1420+ KIndexFileHeader_v1 v1;
1421+ KIndexFileHeader_v2 v2;
1422+ KIndexFileHeader_v3 v3;
1423+ } hdrs;
1424+
1425+ const KDBHdr *hdr = addr;
1426+ const KIndexFileHeader_v3 *fh = addr;
1427+
1428+ * byteswap = false;
1429+ rc = KDBHdrValidate ( hdr, size, 1, KDBINDEXVERS );
1430+ if ( GetRCState ( rc ) == rcIncorrect && GetRCObject ( rc ) == rcByteOrder )
1431+ {
1432+ hdrs . v1 . endian = bswap_32 ( hdr -> endian );
1433+ hdrs . v1 . version = bswap_32 ( hdr -> version );
1434+ rc = KDBHdrValidate ( & hdrs . v1, size, 1, KDBINDEXVERS );
1435+ if ( rc == 0 )
1436+ {
1437+ * byteswap = true;
1438+ switch ( hdrs . v1 . version )
1439+ {
1440+ case 1:
1441+ hdr = & hdrs . v1;
1442+ break;
1443+ case 2:
1444+ hdr = & hdrs . v2;
1445+ break;
1446+ case 3:
1447+ case 4:
1448+ hdrs . v3 . index_type = bswap_32 ( fh -> index_type );
1449+ hdrs . v3 . reserved1 = bswap_32 ( fh -> reserved1 );
1450+ hdr = & hdrs . v3 . h;
1451+ fh = & hdrs . v3;
1452+ break;
1453+ }
1454+ }
1455+ }
1456+ if ( rc == 0 )
1457+ {
1458+ self -> vers = hdr -> version;
1459+ switch ( hdr -> version )
1460+ {
1461+ case 1:
1462+#if KDBINDEXVERS != 1
1463+ self -> converted_from_v1 = true;
1464+#endif
1465+ case 2:
1466+ self -> type = kitText;
1467+ break;
1468+ case 3:
1469+ case 4:
1470+ {
1471+ self -> type = fh -> index_type;
1472+ switch ( self -> type )
1473+ {
1474+ case kitText:
1475+ case kitU64:
1476+ break;
1477+ default:
1478+ rc = RC(rcDB, rcIndex, rcConstructing, rcIndex, rcUnrecognized);
1479+ }
1480+ break;
1481+ }
1482+ default:
1483+ rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcBadVersion );
1484+ }
1485+ }
1486+ }
1487+ }
1488+ return rc;
1489+}
1490+
1491+static
1492+rc_t KIndexMakeRead ( KIndex **idxp,
1493+ const KDirectory *dir, const char *path )
1494+{
1495+ const KFile *f;
1496+ rc_t rc = KDirectoryVOpenFileRead ( dir, & f, path, NULL );
1497+ if ( rc == 0 )
1498+ {
1499+ const KMMap *mm;
1500+ rc = KMMapMakeRead ( & mm, f );
1501+ if ( rc == 0 )
1502+ {
1503+ rc = KIndexMake ( idxp, path );
1504+ if ( rc == 0 )
1505+ {
1506+ bool byteswap;
1507+ KIndex *idx = * idxp;
1508+ rc = KIndexAttach ( idx, mm, & byteswap );
1509+ if ( rc == 0 )
1510+ {
1511+ rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcBadVersion );
1512+
1513+ switch ( idx -> vers )
1514+ {
1515+ case 1:
1516+ /* open using v1 code only if KDBINDEXVERS is 1
1517+ if 2 or later, open as a v2 index */
1518+#if KDBINDEXVERS == 1
1519+ rc = KTrieIndexOpen_v1 ( & idx -> u . txt1, mm );
1520+ if ( rc == 0 )
1521+ {
1522+ if ( idx -> u . txt1 . pt . id2node != NULL )
1523+ idx -> type = ( uint8_t ) ( kitText | kitProj );
1524+ else
1525+ idx -> type = ( uint8_t ) kitText;
1526+ }
1527+ break;
1528+#else
1529+ case 2:
1530+ idx -> vers = 3;
1531+ case 3:
1532+ case 4:
1533+ switch ( idx -> type )
1534+ {
1535+ case kitText:
1536+ case kitText | kitProj:
1537+ /* will guess version in open */
1538+ rc = KTrieIndexOpen_v2 ( & idx -> u . txt234, mm, byteswap );
1539+ if( rc == 0 && idx -> u . txt234 . pt . ord2node != NULL )
1540+ idx -> type |= kitProj;
1541+ break;
1542+
1543+ case kitU64:
1544+ rc = KU64IndexOpen_v3 ( & idx -> u . u64_3, mm, byteswap );
1545+ break;
1546+ }
1547+ break;
1548+#endif
1549+ }
1550+ }
1551+
1552+ if ( rc != 0 )
1553+ KIndexWhack ( idx );
1554+ }
1555+
1556+ KMMapRelease ( mm );
1557+ }
1558+
1559+ KFileRelease ( f );
1560+ }
1561+ return rc;
1562+}
1563+
1564+
1565+/* OpenIndexRead
1566+ * VOpenIndexRead
1567+ * open an index for read
1568+ *
1569+ * "idx" [ OUT ] - return parameter for newly opened index
1570+ *
1571+ * "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
1572+ */
1573+static
1574+rc_t KDBManagerOpenIndexReadInt ( const KDBManager *self,
1575+ KIndex **idxp, const KDirectory *wd, const char *path )
1576+{
1577+ char idxpath [ 4096 ];
1578+ rc_t rc = KDirectoryVResolvePath ( wd, true,
1579+ idxpath, sizeof idxpath, path, NULL );
1580+ if ( rc == 0 )
1581+ {
1582+ KIndex *idx;
1583+
1584+ switch ( KDirectoryVPathType ( wd, idxpath, NULL ) )
1585+ {
1586+ case kptNotFound:
1587+ return RC ( rcDB, rcMgr, rcOpening, rcIndex, rcNotFound );
1588+ case kptBadPath:
1589+ return RC ( rcDB, rcMgr, rcOpening, rcPath, rcInvalid );
1590+ case kptFile:
1591+ case kptFile | kptAlias:
1592+ break;
1593+ default:
1594+ return RC ( rcDB, rcMgr, rcOpening, rcPath, rcIncorrect );
1595+ }
1596+
1597+ rc = KIndexMakeRead ( & idx, wd, idxpath );
1598+ if ( rc == 0 )
1599+ {
1600+ idx -> mgr = KDBManagerAttach ( self );
1601+ * idxp = idx;
1602+ return 0;
1603+ }
1604+ }
1605+
1606+ return rc;
1607+}
1608+
1609+LIB_EXPORT rc_t CC KDatabaseOpenIndexRead ( struct KDatabase const *self,
1610+ const KIndex **idx, const char *name, ... )
1611+{
1612+ rc_t rc = 0;
1613+ va_list args;
1614+
1615+ va_start ( args, name );
1616+ rc = KDatabaseVOpenIndexRead ( self, idx, name, args );
1617+ va_end ( args );
1618+
1619+ return rc;
1620+}
1621+
1622+LIB_EXPORT rc_t CC KDatabaseVOpenIndexRead ( const KDatabase *self,
1623+ const KIndex **idxp, const char *name, va_list args )
1624+{
1625+ rc_t rc = 0;
1626+ char path [ 256 ];
1627+
1628+ if ( idxp == NULL )
1629+ return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
1630+
1631+ * idxp = NULL;
1632+
1633+ if ( self == NULL )
1634+ return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
1635+
1636+ rc = KDBVMakeSubPath ( self -> dir,
1637+ path, sizeof path, "idx", 3, name, args );
1638+ if ( rc == 0 )
1639+ {
1640+ KIndex *idx;
1641+ rc = KDBManagerOpenIndexReadInt ( self -> mgr,
1642+ & idx, self -> dir, path );
1643+ if ( rc == 0 )
1644+ {
1645+ idx -> db = KDatabaseAttach ( self );
1646+ * idxp = idx;
1647+ }
1648+ }
1649+ return rc;
1650+}
1651+
1652+LIB_EXPORT rc_t CC KTableOpenIndexRead ( struct KTable const *self,
1653+ const KIndex **idx, const char *name, ... )
1654+{
1655+ rc_t rc = 0;
1656+ va_list args;
1657+
1658+ va_start ( args, name );
1659+ rc = KTableVOpenIndexRead ( self, idx, name, args );
1660+ va_end ( args );
1661+
1662+ return rc;
1663+}
1664+
1665+LIB_EXPORT rc_t CC KTableVOpenIndexRead ( const KTable *self,
1666+ const KIndex **idxp, const char *name, va_list args )
1667+{
1668+ rc_t rc = 0;
1669+ char path [ 256 ];
1670+
1671+ if ( idxp == NULL )
1672+ return RC ( rcDB, rcTable, rcOpening, rcParam, rcNull );
1673+
1674+ * idxp = NULL;
1675+
1676+ if ( self == NULL )
1677+ return RC ( rcDB, rcTable, rcOpening, rcSelf, rcNull );
1678+
1679+ if ( self -> prerelease )
1680+ {
1681+ int len;
1682+ if ( args == 0 )
1683+ len = snprintf ( path, sizeof path, name );
1684+ else
1685+ len = vsnprintf ( path, sizeof path, name, args );
1686+ if ( len < 0 || ( size_t ) len >= sizeof path )
1687+ return RC ( rcDB, rcTable, rcOpening, rcPath, rcExcessive );
1688+ rc = 0;
1689+ }
1690+ else
1691+ {
1692+ rc = KDBVMakeSubPath ( self -> dir,
1693+ path, sizeof path, "idx", 3, name, args );
1694+ }
1695+
1696+ if ( rc == 0 )
1697+ {
1698+ KIndex *idx;
1699+ rc = KDBManagerOpenIndexReadInt ( self -> mgr,
1700+ & idx, self -> dir, path );
1701+ if ( rc == 0 )
1702+ {
1703+ idx -> tbl = KTableAttach ( self );
1704+ * idxp = idx;
1705+ }
1706+ }
1707+ return rc;
1708+}
1709+
1710+
1711+/* Locked
1712+ * returns non-zero if locked
1713+ */
1714+LIB_EXPORT bool CC KIndexLocked ( const KIndex *self )
1715+{
1716+ rc_t rc;
1717+ const KDirectory *dir;
1718+
1719+ if ( self == NULL )
1720+ return false;
1721+
1722+ assert ( self -> db != NULL || self -> tbl != NULL );
1723+ dir = ( self -> db != NULL ) ?
1724+ self -> db -> dir : self -> tbl -> dir;
1725+
1726+ rc = KDBWritable ( dir, self -> path );
1727+ return GetRCState ( rc ) == rcLocked;
1728+}
1729+
1730+
1731+/* Version
1732+ * returns the format version
1733+ */
1734+LIB_EXPORT rc_t CC KIndexVersion ( const KIndex *self, uint32_t *version )
1735+{
1736+ if ( version == NULL )
1737+ return RC ( rcDB, rcIndex, rcAccessing, rcParam, rcNull );
1738+
1739+ if ( self == NULL )
1740+ {
1741+ * version = 0;
1742+ return RC ( rcDB, rcIndex, rcAccessing, rcSelf, rcNull );
1743+ }
1744+
1745+ * version = self -> vers;
1746+ return 0;
1747+}
1748+
1749+
1750+/* Type
1751+ * returns the type of index
1752+ */
1753+LIB_EXPORT rc_t CC KIndexType ( const KIndex *self, KIdxType *type )
1754+{
1755+ if ( type == NULL )
1756+ return RC ( rcDB, rcIndex, rcAccessing, rcParam, rcNull );
1757+
1758+ if ( self == NULL )
1759+ {
1760+ * type = ( KIdxType ) 0;
1761+ return RC ( rcDB, rcIndex, rcAccessing, rcSelf, rcNull );
1762+ }
1763+
1764+ * type = ( KIdxType ) self -> type;
1765+ return 0;
1766+}
1767+
1768+
1769+/* CheckConsistency
1770+ * run a consistency check on the open index
1771+ *
1772+ * "level" [ IN ] - a measure of rigor of the exercise:
1773+ * 0 is the lightest
1774+ * 1 will test all id mappings
1775+ * 2 will perform key->id retrievals
1776+ * 3 will perform id->key retrievals if a projection index exists
1777+ *
1778+ * "start_id" [ OUT, NULL OKAY ] - returns the first id in index
1779+ *
1780+ * "id_range" [ OUT, NULL OKAY ] - returns the range of ids from first to last
1781+ *
1782+ * "num_keys" [ OUT, NULL OKAY ] - returns the number of key entries
1783+ *
1784+ * "num_rows" [ OUT, NULL OKAY ] - returns the number of key->id mappings
1785+ *
1786+ * "num_holes" [ OUT, NULL OKAY ] - returns the number of holes in the mapped id range
1787+ */
1788+LIB_EXPORT rc_t CC KIndexConsistencyCheck ( const KIndex *self, uint32_t level,
1789+ int64_t *start_id, uint64_t *id_range, uint64_t *num_keys,
1790+ uint64_t *num_rows, uint64_t *num_holes )
1791+{
1792+ rc_t rc;
1793+
1794+ if ( self == NULL )
1795+ rc = RC ( rcDB, rcIndex, rcValidating, rcSelf, rcNull );
1796+ else
1797+ {
1798+ bool key2id, id2key, all_ids;
1799+ switch ( level )
1800+ {
1801+ case 0:
1802+ key2id = id2key = all_ids = false;
1803+ break;
1804+ case 1:
1805+ key2id = id2key = false;
1806+ all_ids = true;
1807+ break;
1808+ case 2:
1809+ key2id = id2key = true;
1810+ all_ids = false;
1811+ break;
1812+ default:
1813+ key2id = id2key = all_ids = true;
1814+ }
1815+
1816+ switch ( self -> type )
1817+ {
1818+ case kitText:
1819+ id2key = false;
1820+ case kitText | kitProj:
1821+ switch ( self -> vers )
1822+ {
1823+ case 1:
1824+ rc = KTrieIndexCheckConsistency_v1 ( & self -> u . txt1,
1825+ start_id, id_range, num_keys, num_rows, num_holes,
1826+ self, key2id, id2key );
1827+ break;
1828+ case 2:
1829+ case 3:
1830+ case 4:
1831+ rc = KTrieIndexCheckConsistency_v2 ( & self -> u . txt234,
1832+ start_id, id_range, num_keys, num_rows, num_holes,
1833+ self, key2id, id2key, all_ids, self -> converted_from_v1 );
1834+ break;
1835+ default:
1836+ return RC ( rcDB, rcIndex, rcValidating, rcIndex, rcBadVersion );
1837+ }
1838+ break;
1839+
1840+ default:
1841+ rc = RC ( rcDB, rcIndex, rcValidating, rcFunction, rcUnsupported );
1842+ }
1843+ }
1844+
1845+ return rc;
1846+}
1847+
1848+
1849+/* Find
1850+ * finds a single mapping from key
1851+ */
1852+LIB_EXPORT rc_t CC KIndexFindText ( const KIndex *self, const char *key, int64_t *start_id, uint64_t *id_count,
1853+ int ( CC * custom_cmp ) ( const void *item, struct PBSTNode const *n, void *data ),
1854+ void *data )
1855+{
1856+ rc_t rc = 0;
1857+ uint32_t id32, span;
1858+
1859+ if ( id_count != NULL )
1860+ * id_count = 0;
1861+
1862+ if ( start_id == NULL )
1863+ return RC ( rcDB, rcIndex, rcSelecting, rcParam, rcNull );
1864+
1865+ * start_id = 0;
1866+
1867+ if ( self == NULL )
1868+ return RC ( rcDB, rcIndex, rcSelecting, rcSelf, rcNull );
1869+
1870+ if ( key == NULL )
1871+ return RC ( rcDB, rcIndex, rcSelecting, rcString, rcNull );
1872+ if ( key [ 0 ] == 0 )
1873+ return RC ( rcDB, rcIndex, rcSelecting, rcString, rcEmpty );
1874+
1875+ span = 1;
1876+
1877+ switch ( self -> type )
1878+ {
1879+ case kitText:
1880+ case kitText | kitProj:
1881+ switch ( self -> vers )
1882+ {
1883+ case 1:
1884+ rc = KTrieIndexFind_v1 ( & self -> u . txt1, key, & id32, custom_cmp, data );
1885+ if ( rc == 0 )
1886+ * start_id = id32;
1887+ break;
1888+ case 2:
1889+ case 3:
1890+ case 4:
1891+#if V2FIND_RETURNS_SPAN
1892+ rc = KTrieIndexFind_v2 ( & self -> u . txt234, key, start_id, & span, custom_cmp, data, self -> converted_from_v1 );
1893+#else
1894+ rc = KTrieIndexFind_v2 ( & self -> u . txt234, key, start_id, custom_cmp, data, self -> converted_from_v1 );
1895+#endif
1896+ break;
1897+ default:
1898+ return RC ( rcDB, rcIndex, rcSelecting, rcIndex, rcBadVersion );
1899+ }
1900+ break;
1901+ default:
1902+ return RC ( rcDB, rcIndex, rcSelecting, rcNoObj, rcUnknown );
1903+ }
1904+
1905+ if ( id_count != NULL )
1906+ * id_count = span;
1907+
1908+ return rc;
1909+}
1910+
1911+
1912+/* FindAll
1913+ * finds all mappings from key
1914+ */
1915+LIB_EXPORT rc_t CC KIndexFindAllText ( const KIndex *self, const char *key,
1916+ rc_t ( CC * f ) ( int64_t id, uint64_t id_count, void *data ), void *data )
1917+{
1918+ rc_t rc = 0;
1919+ int64_t id64;
1920+ uint32_t id32, span;
1921+
1922+ if ( self == NULL )
1923+ return RC ( rcDB, rcIndex, rcSelecting, rcSelf, rcNull );
1924+
1925+ if ( f == NULL )
1926+ return RC ( rcDB, rcIndex, rcSelecting, rcFunction, rcNull );
1927+
1928+ if ( key == NULL )
1929+ return RC ( rcDB, rcIndex, rcSelecting, rcString, rcNull );
1930+ if ( key [ 0 ] == 0 )
1931+ return RC ( rcDB, rcIndex, rcSelecting, rcString, rcEmpty );
1932+
1933+ span = 1;
1934+
1935+ switch ( self -> type )
1936+ {
1937+ case kitText:
1938+ case kitText | kitProj:
1939+ switch ( self -> vers )
1940+ {
1941+ case 1:
1942+ rc = KTrieIndexFind_v1 ( & self -> u . txt1, key, & id32, NULL, NULL );
1943+ if ( rc == 0 )
1944+ rc = ( * f ) ( id32, 1, data );
1945+ break;
1946+ case 2:
1947+ case 3:
1948+ case 4:
1949+#if V2FIND_RETURNS_SPAN
1950+ rc = KTrieIndexFind_v2 ( & self -> u . txt234, key, & id64, & span, NULL, NULL, self -> converted_from_v1 );
1951+#else
1952+ rc = KTrieIndexFind_v2 ( & self -> u . txt234, key, & id64, NULL, NULL, self -> converted_from_v1 );
1953+#endif
1954+ if ( rc == 0 )
1955+ rc = ( * f ) ( id64, span, data );
1956+ break;
1957+ default:
1958+ return RC ( rcDB, rcIndex, rcSelecting, rcIndex, rcBadVersion );
1959+ }
1960+ break;
1961+ default:
1962+ return RC ( rcDB, rcIndex, rcSelecting, rcNoObj, rcUnknown );
1963+ }
1964+
1965+ return rc;
1966+}
1967+
1968+
1969+/* Project
1970+ * finds key(s) mapping to value/id if supported
1971+ */
1972+LIB_EXPORT rc_t CC KIndexProjectText ( const KIndex *self,
1973+ int64_t id, int64_t *start_id, uint64_t *id_count,
1974+ char *key, size_t kmax, size_t *actsize )
1975+{
1976+ rc_t rc = 0;
1977+ int64_t dummy;
1978+ uint32_t span;
1979+
1980+ if ( start_id == NULL )
1981+ start_id = & dummy;
1982+
1983+ * start_id = 0;
1984+
1985+ if ( id_count != NULL )
1986+ * id_count = 0;
1987+
1988+ if ( key == NULL && kmax != 0 )
1989+ return RC ( rcDB, rcIndex, rcProjecting, rcBuffer, rcNull );
1990+
1991+ if ( kmax != 0 )
1992+ key [ 0 ] = 0;
1993+
1994+ if ( self == NULL )
1995+ return RC ( rcDB, rcIndex, rcProjecting, rcSelf, rcNull );
1996+
1997+ if ( ( ( KIdxType ) self -> type & kitProj ) == 0 )
1998+ return RC ( rcDB, rcIndex, rcProjecting, rcIndex, rcIncorrect );
1999+
2000+ if ( key == NULL )
2001+ return RC ( rcDB, rcIndex, rcProjecting, rcBuffer, rcNull );
2002+
2003+ span = 1;
2004+
2005+ switch ( self -> type )
2006+ {
2007+ case kitText | kitProj:
2008+ switch ( self -> vers )
2009+ {
2010+ case 1:
2011+ /* there is a limit on ids in v1 */
2012+ if ( id <= 0 || ( id >> 32 ) != 0 )
2013+ return RC ( rcDB, rcIndex, rcProjecting, rcId, rcNotFound );
2014+
2015+ rc = KTrieIndexProject_v1 ( & self -> u . txt1,
2016+ ( uint32_t ) id, key, kmax, actsize );
2017+ if ( rc == 0 )
2018+ * start_id = id;
2019+ break;
2020+ case 2:
2021+ case 3:
2022+ case 4:
2023+#if V2FIND_RETURNS_SPAN
2024+ rc = KTrieIndexProject_v2 ( & self -> u . txt234, id, start_id, & span, key, kmax, actsize );
2025+#else
2026+ rc = KTrieIndexProject_v2 ( & self -> u . txt234, id, key, kmax, actsize );
2027+ if ( rc == 0 )
2028+ * start_id = id;
2029+#endif
2030+ break;
2031+ default:
2032+ return RC ( rcDB, rcIndex, rcProjecting, rcIndex, rcBadVersion );
2033+ }
2034+ break;
2035+ default:
2036+ return RC ( rcDB, rcIndex, rcProjecting, rcNoObj, rcUnknown );
2037+ }
2038+
2039+ if ( id_count != NULL )
2040+ * id_count = span;
2041+
2042+ return rc;
2043+}
2044+
2045+
2046+/* ProjectAll
2047+ * finds key(s) mapping to value/id if supported
2048+ */
2049+LIB_EXPORT rc_t CC KIndexProjectAllText ( const KIndex *self, int64_t id,
2050+ rc_t ( CC * f ) ( int64_t start_id, uint64_t id_count, const char *key, void *data ),
2051+ void *data )
2052+{
2053+ rc_t rc = 0;
2054+ char key [ 256 ];
2055+
2056+ uint32_t span;
2057+ int64_t start_id;
2058+
2059+ if ( self == NULL )
2060+ return RC ( rcDB, rcIndex, rcProjecting, rcSelf, rcNull );
2061+
2062+ if ( ( ( KIdxType ) self -> type & kitProj ) == 0 )
2063+ return RC ( rcDB, rcIndex, rcProjecting, rcIndex, rcIncorrect );
2064+
2065+ if ( f == NULL )
2066+ return RC ( rcDB, rcIndex, rcProjecting, rcFunction, rcNull );
2067+
2068+ span = 1;
2069+
2070+ switch ( self -> type )
2071+ {
2072+ case kitText | kitProj:
2073+ switch ( self -> vers )
2074+ {
2075+ case 1:
2076+ /* there is a limit on ids in v1 */
2077+ if ( id <= 0 || ( id >> 32 ) != 0 )
2078+ return RC ( rcDB, rcIndex, rcProjecting, rcId, rcNotFound );
2079+
2080+ rc = KTrieIndexProject_v1 ( & self -> u . txt1,
2081+ ( uint32_t ) id, key, sizeof key, NULL );
2082+ if ( rc == 0 )
2083+ rc = ( * f ) ( id, 1, key, data );
2084+ break;
2085+
2086+ case 2:
2087+ case 3:
2088+ case 4:
2089+#if V2FIND_RETURNS_SPAN
2090+ rc = KTrieIndexProject_v2 ( & self -> u . txt234, id, & start_id, & span, key, sizeof key, NULL );
2091+#else
2092+ rc = KTrieIndexProject_v2 ( & self -> u . txt234, start_id = id, key, sizeof key );
2093+#endif
2094+ if ( rc == 0 )
2095+ rc = ( * f ) ( start_id, span, key, data );
2096+ break;
2097+
2098+ default:
2099+ return RC ( rcDB, rcIndex, rcProjecting, rcIndex, rcBadVersion );
2100+ }
2101+ break;
2102+ default:
2103+ return RC ( rcDB, rcIndex, rcProjecting, rcNoObj, rcUnknown );
2104+ }
2105+
2106+ return rc;
2107+}
2108+
2109+LIB_EXPORT rc_t CC KIndexFindU64( const KIndex* self, uint64_t offset, uint64_t* key, uint64_t* key_size, int64_t* id, uint64_t* id_qty )
2110+{
2111+ rc_t rc = 0;
2112+
2113+ if( key == NULL || key_size == NULL || id == NULL || id_qty == NULL ) {
2114+ return RC(rcDB, rcIndex, rcSelecting, rcParam, rcNull);
2115+ }
2116+ *key = *key_size = *id = *id_qty = 0;
2117+ if( self == NULL ) {
2118+ return RC(rcDB, rcIndex, rcSelecting, rcSelf, rcNull);
2119+ }
2120+
2121+ switch( self->type )
2122+ {
2123+ case kitU64:
2124+ switch( self->vers )
2125+ {
2126+ case 3:
2127+ case 4:
2128+ rc = KU64IndexFind_v3(&self->u.u64_3, offset, key, key_size, id, id_qty);
2129+ break;
2130+ default:
2131+ return RC(rcDB, rcIndex, rcSelecting, rcIndex, rcBadVersion);
2132+ }
2133+ break;
2134+ default:
2135+ return RC(rcDB, rcIndex, rcSelecting, rcNoObj, rcUnknown);
2136+ }
2137+ return rc;
2138+}
2139+
2140+LIB_EXPORT rc_t CC KIndexFindAllU64( const KIndex* self, uint64_t offset,
2141+ rc_t ( CC * f )(uint64_t key, uint64_t key_size, int64_t id, uint64_t id_qty, void* data ), void* data)
2142+{
2143+ rc_t rc = 0;
2144+
2145+ if ( self == NULL )
2146+ return RC(rcDB, rcIndex, rcSelecting, rcSelf, rcNull);
2147+ if ( f == NULL )
2148+ return RC(rcDB, rcIndex, rcSelecting, rcFunction, rcNull);
2149+
2150+ switch ( self->type )
2151+ {
2152+ case kitU64:
2153+ switch ( self->vers )
2154+ {
2155+ case 3:
2156+ case 4:
2157+ rc = KU64IndexFindAll_v3(&self->u.u64_3, offset, f, data);
2158+ break;
2159+ default:
2160+ return RC(rcDB, rcIndex, rcSelecting, rcIndex, rcBadVersion);
2161+ }
2162+ break;
2163+ default:
2164+ return RC(rcDB, rcIndex, rcSelecting, rcNoObj, rcUnknown);
2165+ }
2166+
2167+ return rc;
2168+}
2169+
2170+
2171+/* SetMaxId
2172+ * certain legacy versions of skey were built to know only the starting id
2173+ * of the NAME_FMT column, but were never given a maximum id. allow them
2174+ * to be corrected here.
2175+ */
2176+LIB_EXPORT void CC KIndexSetMaxRowId ( const KIndex *cself, int64_t max_row_id )
2177+{
2178+ if ( cself != NULL ) switch ( cself -> type )
2179+ {
2180+ case kitText:
2181+ case kitText | kitProj:
2182+ switch ( cself -> vers )
2183+ {
2184+ case 2:
2185+ case 3:
2186+ case 4:
2187+ /* here we can repair the max row id */
2188+ if ( cself -> u . txt234 . pt . maxid < max_row_id )
2189+ ( ( KIndex* ) cself ) -> u . txt234 . pt . maxid = max_row_id;
2190+ break;
2191+ }
2192+ break;
2193+ }
2194+}
2195
2196=== added file '.pc/hardening-format-security.patch/libs/kdb/table.c'
2197--- .pc/hardening-format-security.patch/libs/kdb/table.c 1970-01-01 00:00:00 +0000
2198+++ .pc/hardening-format-security.patch/libs/kdb/table.c 2014-04-08 01:47:44 +0000
2199@@ -0,0 +1,706 @@
2200+/*===========================================================================
2201+*
2202+* PUBLIC DOMAIN NOTICE
2203+* National Center for Biotechnology Information
2204+*
2205+* This software/database is a "United States Government Work" under the
2206+* terms of the United States Copyright Act. It was written as part of
2207+* the author's official duties as a United States Government employee and
2208+* thus cannot be copyrighted. This software/database is freely available
2209+* to the public for use. The National Library of Medicine and the U.S.
2210+* Government have not placed any restriction on its use or reproduction.
2211+*
2212+* Although all reasonable efforts have been taken to ensure the accuracy
2213+* and reliability of the software and data, the NLM and the U.S.
2214+* Government do not and cannot warrant the performance or results that
2215+* may be obtained by using this software or data. The NLM and the U.S.
2216+* Government disclaim all warranties, express or implied, including
2217+* warranties of performance, merchantability or fitness for any particular
2218+* purpose.
2219+*
2220+* Please cite the author in any work or product based on this material.
2221+*
2222+* ===========================================================================
2223+*
2224+*/
2225+
2226+#define TRACK_REFERENCES 0
2227+
2228+#define KONST const
2229+#include "table-priv.h"
2230+#include "dbmgr-priv.h"
2231+#include "database-priv.h"
2232+#include "kdb-priv.h"
2233+#undef KONST
2234+
2235+#include <kdb/extern.h>
2236+#include <klib/namelist.h>
2237+#include <klib/log.h>
2238+#include <klib/rc.h>
2239+#include <klib/printf.h>
2240+#include <os-native.h>
2241+#include <sysalloc.h>
2242+
2243+#include <limits.h>
2244+#include <stdlib.h>
2245+#include <stdio.h>
2246+#include <string.h>
2247+#include <assert.h>
2248+
2249+
2250+/*--------------------------------------------------------------------------
2251+ * KTable
2252+ * a collection of columns indexed by row id, metadata, indices
2253+ */
2254+
2255+/* GetPath
2256+ * return the absolute path to table
2257+ */
2258+LIB_EXPORT rc_t CC KTableGetPath ( const KTable *self,
2259+ const char **path )
2260+{
2261+ if ( self == NULL )
2262+ return RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
2263+ if ( path == NULL )
2264+ return RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
2265+
2266+ *path = self->path;
2267+
2268+ return 0;
2269+}
2270+
2271+/* Whack
2272+ */
2273+static
2274+rc_t KTableWhack ( KTable *self )
2275+{
2276+ rc_t rc = 0;
2277+
2278+ KRefcountWhack ( & self -> refcount, "KTable" );
2279+
2280+ if ( self -> db != NULL )
2281+ {
2282+ rc = KDatabaseSever ( self -> db );
2283+ if ( rc == 0 )
2284+ self -> db = NULL;
2285+ }
2286+
2287+ if ( rc == 0 )
2288+ rc = KDBManagerSever ( self -> mgr );
2289+
2290+ if ( rc == 0 )
2291+ {
2292+ KDirectoryRelease ( self -> dir );
2293+ free ( self );
2294+ return 0;
2295+ }
2296+
2297+ KRefcountInit ( & self -> refcount, 1, "KTable", "whack", "ktbl" );
2298+
2299+ return rc;
2300+}
2301+
2302+
2303+/* AddRef
2304+ * Release
2305+ * all objects are reference counted
2306+ * NULL references are ignored
2307+ */
2308+LIB_EXPORT rc_t CC KTableAddRef ( const KTable *self )
2309+{
2310+ if ( self != NULL )
2311+ {
2312+ switch ( KRefcountAdd ( & self -> refcount, "KTable" ) )
2313+ {
2314+ case krefLimit:
2315+ return RC ( rcDB, rcTable, rcAttaching, rcRange, rcExcessive );
2316+ }
2317+ }
2318+ return 0;
2319+}
2320+
2321+LIB_EXPORT rc_t CC KTableRelease ( const KTable *self )
2322+{
2323+ if ( self != NULL )
2324+ {
2325+ switch ( KRefcountDrop ( & self -> refcount, "KTable" ) )
2326+ {
2327+ case krefWhack:
2328+ return KTableWhack ( ( KTable* ) self );
2329+ case krefNegative:
2330+ return RC ( rcDB, rcTable, rcReleasing, rcRange, rcExcessive );
2331+ }
2332+ }
2333+ return 0;
2334+}
2335+
2336+/* Attach
2337+ * Sever
2338+ */
2339+KTable *KTableAttach ( const KTable *self )
2340+{
2341+ if ( self != NULL )
2342+ {
2343+ switch ( KRefcountAddDep ( & self -> refcount, "KTable" ) )
2344+ {
2345+ case krefLimit:
2346+ return NULL;
2347+ }
2348+ }
2349+ return ( KTable* ) self;
2350+}
2351+
2352+/* Sever
2353+ * like KTableRelease, except called internally
2354+ * indicates that a child object is letting go...
2355+ */
2356+rc_t KTableSever ( const KTable *self )
2357+{
2358+ if ( self != NULL )
2359+ {
2360+ switch ( KRefcountDropDep ( & self -> refcount, "KTable" ) )
2361+ {
2362+ case krefWhack:
2363+ return KTableWhack ( ( KTable* ) self );
2364+ case krefNegative:
2365+ return RC ( rcDB, rcTable, rcReleasing, rcRange, rcExcessive );
2366+ }
2367+ }
2368+ return 0;
2369+}
2370+
2371+/* Make
2372+ * make an initialized structure
2373+ * NB - does NOT attach reference to dir, but steals it
2374+ */
2375+static
2376+rc_t KTableMake ( KTable **tblp, const KDirectory *dir, const char *path )
2377+{
2378+ KTable *tbl;
2379+
2380+ assert ( tblp != NULL );
2381+ assert ( path != NULL );
2382+
2383+ tbl = malloc ( sizeof * tbl + strlen ( path ) );
2384+ if ( tbl == NULL )
2385+ {
2386+ * tblp = NULL;
2387+ return RC ( rcDB, rcTable, rcConstructing, rcMemory, rcExhausted );
2388+ }
2389+
2390+ memset ( tbl, 0, sizeof * tbl );
2391+ tbl -> dir = dir;
2392+ KRefcountInit ( & tbl -> refcount, 1, "KTable", "make", path );
2393+ strcpy ( tbl -> path, path );
2394+
2395+ * tblp = tbl;
2396+ return 0;
2397+}
2398+
2399+
2400+/* OpenTableRead
2401+ * VOpenTableRead
2402+ * open a table for read
2403+ *
2404+ * "tbl" [ OUT ] - return parameter for newly opened table
2405+ *
2406+ * "path" [ IN ] - NUL terminated string in
2407+ * wd-native character set giving path to table
2408+ */
2409+static
2410+rc_t KDBManagerVOpenTableReadInt ( const KDBManager *self,
2411+ const KTable **tblp, const KDirectory *wd, bool try_srapath,
2412+ const char *path, va_list args )
2413+{
2414+ rc_t rc;
2415+
2416+ char tblpath [ 4096 ];
2417+ int z = ( args == NULL ) ?
2418+ snprintf ( tblpath, sizeof tblpath, path ):
2419+ vsnprintf ( tblpath, sizeof tblpath, path, args );
2420+ if ( z < 0 || ( size_t ) z >= sizeof tblpath )
2421+ rc = RC ( rcDB, rcMgr, rcOpening, rcPath, rcExcessive );
2422+ else
2423+ {
2424+ KTable *tbl;
2425+ const KDirectory *dir;
2426+ bool prerelease = false;
2427+
2428+ rc = KDBOpenPathTypeRead ( self, wd, tblpath, &dir, kptTable, NULL, try_srapath );
2429+ if ( rc != 0 )
2430+ {
2431+ prerelease = true;
2432+ rc = KDBOpenPathTypeRead ( self, wd, tblpath, &dir, kptPrereleaseTbl, NULL, try_srapath );
2433+ }
2434+
2435+ if ( rc == 0 )
2436+ {
2437+ rc = KTableMake ( & tbl, dir, tblpath );
2438+ if ( rc == 0 )
2439+ {
2440+ tbl -> mgr = KDBManagerAttach ( self );
2441+ tbl -> prerelease = prerelease;
2442+ * tblp = tbl;
2443+ return 0;
2444+ }
2445+ KDirectoryRelease ( dir );
2446+ }
2447+ }
2448+ return rc;
2449+}
2450+
2451+
2452+LIB_EXPORT rc_t CC KDBManagerOpenTableRead ( const KDBManager *self,
2453+ const KTable **tbl, const char *path, ... )
2454+{
2455+ rc_t rc;
2456+ va_list args;
2457+
2458+ va_start ( args, path );
2459+ rc = KDBManagerVOpenTableRead ( self, tbl, path, args );
2460+ va_end ( args );
2461+
2462+ return rc;
2463+}
2464+
2465+
2466+LIB_EXPORT rc_t CC KDBManagerVOpenTableRead ( const KDBManager *self,
2467+ const KTable **tbl, const char *path, va_list args )
2468+{
2469+ if ( tbl == NULL )
2470+ return RC ( rcDB, rcMgr, rcOpening, rcParam, rcNull );
2471+
2472+ * tbl = NULL;
2473+
2474+ if ( self == NULL )
2475+ return RC ( rcDB, rcMgr, rcOpening, rcSelf, rcNull );
2476+
2477+ return KDBManagerVOpenTableReadInt ( self, tbl, self -> wd, true, path, args);
2478+}
2479+
2480+LIB_EXPORT rc_t CC KDatabaseOpenTableRead ( const KDatabase *self,
2481+ const KTable **tbl, const char *name, ... )
2482+{
2483+ rc_t rc;
2484+ va_list args;
2485+
2486+ va_start ( args, name );
2487+ rc = KDatabaseVOpenTableRead ( self, tbl, name, args );
2488+ va_end ( args );
2489+
2490+ return rc;
2491+}
2492+
2493+LIB_EXPORT rc_t CC KDatabaseVOpenTableRead ( const KDatabase *self,
2494+ const KTable **tblp, const char *name, va_list args )
2495+{
2496+ rc_t rc;
2497+ char path [ 256 ];
2498+
2499+ if ( tblp == NULL )
2500+ return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
2501+
2502+ * tblp = NULL;
2503+
2504+ if ( self == NULL )
2505+ return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
2506+
2507+ rc = KDBVMakeSubPath ( self -> dir,
2508+ path, sizeof path, "tbl", 3, name, args );
2509+ if ( rc == 0 )
2510+ {
2511+ rc = KDBManagerVOpenTableReadInt ( self -> mgr, tblp,
2512+ self -> dir, false, path, NULL );
2513+ if ( rc == 0 )
2514+ {
2515+ KTable *tbl = ( KTable* ) * tblp;
2516+ tbl -> db = KDatabaseAttach ( self );
2517+ }
2518+ }
2519+
2520+ return rc;
2521+}
2522+
2523+
2524+/* Locked
2525+ * returns non-zero if locked
2526+ */
2527+LIB_EXPORT bool CC KTableLocked ( const KTable *self )
2528+{
2529+ rc_t rc;
2530+
2531+ if ( self == NULL )
2532+ return false;
2533+
2534+ rc = KDBWritable ( self -> dir, "." );
2535+ return GetRCState ( rc ) == rcLocked;
2536+}
2537+
2538+
2539+/* Exists
2540+ * returns true if requested object exists
2541+ *
2542+ * "type" [ IN ] - a KDBPathType
2543+ *
2544+ * "path" [ IN ] - NUL terminated path
2545+ */
2546+LIB_EXPORT bool CC KTableVExists ( const KTable *self, uint32_t type, const char *name, va_list args )
2547+{
2548+ if ( self != NULL && name != NULL && name [ 0 ] != 0 )
2549+ {
2550+ rc_t rc;
2551+ const char *ns;
2552+ char path [ 256 ];
2553+
2554+ switch ( type )
2555+ {
2556+ case kptIndex:
2557+ ns = "idx";
2558+ break;
2559+
2560+ case kptColumn:
2561+ ns = "col";
2562+ break;
2563+
2564+ default:
2565+ return false;
2566+ }
2567+
2568+ rc = KDBVMakeSubPath ( self -> dir, path, sizeof path, ns, 3, name, args );
2569+ if ( rc == 0 )
2570+ {
2571+ switch ( KDirectoryPathType ( self -> dir, path ) )
2572+ {
2573+ case kptFile:
2574+ case kptDir:
2575+ case kptFile | kptAlias:
2576+ case kptDir | kptAlias:
2577+ return true;
2578+ }
2579+ }
2580+ }
2581+ return false;
2582+}
2583+
2584+LIB_EXPORT bool CC KTableExists ( const KTable *self, uint32_t type, const char *name, ... )
2585+{
2586+ bool exists;
2587+
2588+ va_list args;
2589+ va_start ( args, name );
2590+
2591+ exists = KTableVExists ( self, type, name, args );
2592+
2593+ va_end ( args );
2594+
2595+ return exists;
2596+}
2597+
2598+
2599+/* IsAlias
2600+ * returns true if object name is an alias
2601+ * returns path to fundamental name if it was aliased
2602+ *
2603+ * "type" [ IN ] - a KDBPathType
2604+ * valid values are kptIndex and kptColumn
2605+ *
2606+ * "resolved" [ OUT ] and "rsize" [ IN ] - optional output buffer
2607+ * for fundamenta object name if "alias" is not a fundamental name,
2608+ *
2609+ * "name" [ IN ] - NUL terminated object name
2610+ */
2611+LIB_EXPORT bool CC KTableIsAlias ( const KTable *self, uint32_t type,
2612+ char *resolved, size_t rsize, const char *name )
2613+{
2614+ if ( self != NULL && name != NULL && name [ 0 ] != 0 )
2615+ {
2616+ rc_t rc;
2617+ const char *ns;
2618+ char path [ 256 ];
2619+
2620+ switch ( type )
2621+ {
2622+ case kptIndex:
2623+ ns = "idx";
2624+ break;
2625+
2626+ case kptColumn:
2627+ ns = "col";
2628+ break;
2629+
2630+ default:
2631+ return false;
2632+ }
2633+
2634+ rc = KDBMakeSubPath ( self -> dir, path, sizeof path, ns, 3, name );
2635+ if ( rc == 0 )
2636+ {
2637+ switch ( KDirectoryPathType ( self -> dir, path ) )
2638+ {
2639+ case kptFile | kptAlias:
2640+ case kptDir | kptAlias:
2641+ if ( resolved != NULL && rsize != 0 )
2642+ {
2643+ const KDirectory *sub;
2644+ rc = KDirectoryOpenDirRead ( self -> dir, & sub, false, ns );
2645+ * resolved = 0;
2646+ if ( rc != 0 )
2647+ PLOGERR ( klogWarn, ( klogWarn, rc, "failed to open subdirectory '$(sub)'", "sub=%s", ns ) );
2648+ else
2649+ {
2650+ rc = KDirectoryResolveAlias ( sub, false, resolved, rsize, name );
2651+ KDirectoryRelease ( sub );
2652+ if ( rc != 0 )
2653+ PLOGERR ( klogWarn, ( klogWarn, rc, "failed to resolve alias '$(alias)'", "alias=%s", name ) );
2654+ }
2655+ }
2656+ return true;
2657+ }
2658+ }
2659+ }
2660+
2661+ if ( resolved != NULL && rsize != 0 )
2662+ * resolved = 0;
2663+
2664+ return false;
2665+}
2666+
2667+
2668+/* Writable
2669+ * returns 0 if object is writable
2670+ * or a reason why if not
2671+ *
2672+ * "type" [ IN ] - a KDBPathType
2673+ * valid values are kptIndex and kptColumn
2674+ *
2675+ * "path" [ IN ] - NUL terminated path
2676+ */
2677+LIB_EXPORT rc_t CC KTableVWritable ( const KTable *self, uint32_t type, const char *name, va_list args )
2678+{
2679+ /* TBD */
2680+ return -1;
2681+}
2682+
2683+LIB_EXPORT rc_t CC KTableWritable ( const KTable *self, uint32_t type, const char *name, ... )
2684+{
2685+ rc_t rc;
2686+
2687+ va_list args;
2688+ va_start ( args, name );
2689+
2690+ rc = KTableVWritable ( self, type, name, args );
2691+
2692+ va_end ( args );
2693+
2694+ return rc;
2695+}
2696+
2697+
2698+/* OpenManager
2699+ * duplicate reference to manager
2700+ * NB - returned reference must be released
2701+ */
2702+LIB_EXPORT rc_t CC KTableOpenManagerRead ( const KTable *self, const KDBManager **mgr )
2703+{
2704+ rc_t rc;
2705+
2706+ if ( mgr == NULL )
2707+ rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
2708+ else
2709+ {
2710+ if ( self == NULL )
2711+ rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
2712+ else
2713+ {
2714+ rc = KDBManagerAddRef ( self -> mgr );
2715+ if ( rc == 0 )
2716+ {
2717+ * mgr = self -> mgr;
2718+ return 0;
2719+ }
2720+ }
2721+
2722+ * mgr = NULL;
2723+ }
2724+
2725+ return rc;
2726+}
2727+
2728+
2729+/* OpenParent
2730+ * duplicate reference to parent database
2731+ * NB - returned reference must be released
2732+ */
2733+LIB_EXPORT rc_t CC KTableOpenParentRead ( const KTable *self, const KDatabase **db )
2734+{
2735+ rc_t rc;
2736+
2737+ if ( db == NULL )
2738+ rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
2739+ else
2740+ {
2741+ if ( self == NULL )
2742+ rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
2743+ else
2744+ {
2745+ rc = KDatabaseAddRef ( self -> db );
2746+ if ( rc == 0 )
2747+ {
2748+ * db = self -> db;
2749+ return 0;
2750+ }
2751+ }
2752+
2753+ * db = NULL;
2754+ }
2755+
2756+ return rc;
2757+}
2758+
2759+
2760+/* GetDirectory
2761+ * access the directory in use
2762+ */
2763+LIB_EXPORT rc_t CC KTableOpenDirectoryRead ( const KTable *self, const KDirectory **dir )
2764+{
2765+ rc_t rc;
2766+
2767+ if ( dir == NULL )
2768+ rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
2769+ else
2770+ {
2771+ if ( self == NULL )
2772+ rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
2773+ else
2774+ {
2775+ * dir = self -> dir;
2776+ return KDirectoryAddRef ( * dir );
2777+ }
2778+
2779+ * dir = NULL;
2780+ }
2781+
2782+ return rc;
2783+}
2784+
2785+
2786+/* ModDate
2787+ * get modification date
2788+ */
2789+LIB_EXPORT rc_t CC KTableModDate ( const KTable *self, KTime_t *mtime )
2790+{
2791+ rc_t rc;
2792+
2793+ if ( mtime == NULL )
2794+ rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
2795+ else
2796+ {
2797+ if ( self == NULL )
2798+ rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
2799+ else
2800+ {
2801+ /* HACK ALERT - there needs to be a proper way to record modification times */
2802+ const KDirectory *dir = self -> dir;
2803+
2804+ /* this only tells the last time the table was locked,
2805+ which may be close to the last time it was modified */
2806+ rc = KDirectoryDate ( dir, mtime, "lock" );
2807+ if ( rc == 0 )
2808+ return 0;
2809+
2810+ if ( GetRCState ( rc ) == rcNotFound )
2811+ {
2812+ rc = KDirectoryDate ( dir, mtime, "sealed" );
2813+ if ( rc == 0 )
2814+ return 0;
2815+ }
2816+
2817+ /* get directory timestamp */
2818+ rc = KDirectoryDate ( dir, mtime, "." );
2819+ if ( rc == 0 )
2820+ return 0;
2821+ }
2822+
2823+ * mtime = 0;
2824+ }
2825+
2826+ return rc;
2827+}
2828+
2829+
2830+/*--------------------------------------------------------------------------
2831+ * KNamelist
2832+ */
2833+
2834+/* List
2835+ * create table listings
2836+ */
2837+struct FilterData
2838+{
2839+ const KDBManager * mgr;
2840+ int type;
2841+};
2842+
2843+static
2844+bool CC KDatabaseListFilter ( const KDirectory *dir, const char *name, void *data_ )
2845+{
2846+ struct FilterData * data = data_;
2847+ return ( KDBOpenPathTypeRead ( data->mgr, dir, name, NULL, data->type, NULL, false ) == 0 );
2848+}
2849+
2850+LIB_EXPORT rc_t CC KTableListCol ( const KTable *self, KNamelist **names )
2851+{
2852+ if ( self != NULL )
2853+ {
2854+ struct FilterData data;
2855+
2856+ data.mgr = self->mgr;
2857+ data.type = kptColumn;
2858+
2859+ return KDirectoryVList ( self -> dir,
2860+ names, KDatabaseListFilter, &data, "col", NULL );
2861+ }
2862+
2863+ if ( names != NULL )
2864+ * names = NULL;
2865+
2866+ return RC ( rcDB, rcTable, rcListing, rcSelf, rcNull );
2867+}
2868+
2869+static
2870+bool CC KTableListIdxFilter ( const KDirectory *dir, const char *name, void *data )
2871+{
2872+ const size_t sz = strlen(name);
2873+
2874+ if (sz > 4 && strcmp(&name[sz - 4], ".md5") == 0)
2875+ return false;
2876+ return true;
2877+}
2878+
2879+static
2880+bool CC KTableListSkeyFilter ( const KDirectory *dir, const char *name, void *data )
2881+{
2882+ if ( strcmp ( name, "skey" ) == 0 )
2883+ return true;
2884+ return false;
2885+}
2886+
2887+LIB_EXPORT rc_t CC KTableListIdx ( const KTable *self, KNamelist **names )
2888+{
2889+ if ( self != NULL )
2890+ {
2891+ if ( ! self -> prerelease )
2892+ {
2893+ return KDirectoryVList ( self -> dir,
2894+ names, KTableListIdxFilter, NULL, "idx", NULL );
2895+ }
2896+
2897+ return KDirectoryVList ( self -> dir,
2898+ names, KTableListSkeyFilter, NULL, ".", NULL );
2899+ }
2900+
2901+ if ( names != NULL )
2902+ * names = NULL;
2903+
2904+ return RC ( rcDB, rcTable, rcListing, rcSelf, rcNull );
2905+}
2906
2907=== added directory '.pc/hardening.patch'
2908=== added file '.pc/hardening.patch/Makefile'
2909--- .pc/hardening.patch/Makefile 1970-01-01 00:00:00 +0000
2910+++ .pc/hardening.patch/Makefile 2014-04-08 01:47:44 +0000
2911@@ -0,0 +1,110 @@
2912+# ===========================================================================
2913+#
2914+# PUBLIC DOMAIN NOTICE
2915+# National Center for Biotechnology Information
2916+#
2917+# This software/database is a "United States Government Work" under the
2918+# terms of the United States Copyright Act. It was written as part of
2919+# the author's official duties as a United States Government employee and
2920+# thus cannot be copyrighted. This software/database is freely available
2921+# to the public for use. The National Library of Medicine and the U.S.
2922+# Government have not placed any restriction on its use or reproduction.
2923+#
2924+# Although all reasonable efforts have been taken to ensure the accuracy
2925+# and reliability of the software and data, the NLM and the U.S.
2926+# Government do not and cannot warrant the performance or results that
2927+# may be obtained by using this software or data. The NLM and the U.S.
2928+# Government disclaim all warranties, express or implied, including
2929+# warranties of performance, merchantability or fitness for any particular
2930+# purpose.
2931+#
2932+# Please cite the author in any work or product based on this material.
2933+#
2934+# ===========================================================================
2935+
2936+
2937+#-------------------------------------------------------------------------------
2938+# environment
2939+#
2940+TOP ?= $(CURDIR)
2941+include $(TOP)/build/Makefile.shell
2942+
2943+
2944+#-------------------------------------------------------------------------------
2945+# default
2946+#
2947+SUBDIRS = \
2948+ libs \
2949+ tools
2950+
2951+# common targets for non-leaf Makefiles; must follow a definition of SUBDIRS
2952+include $(TOP)/build/Makefile.targets
2953+
2954+default: $(SUBDIRS)
2955+
2956+test: $(SUBDIRS)
2957+
2958+$(SUBDIRS) test:
2959+ @ $(MAKE) -C $@
2960+
2961+.PHONY: default $(SUBDIRS) test
2962+
2963+#-------------------------------------------------------------------------------
2964+# all
2965+#
2966+$(SUBDIRS_ALL):
2967+
2968+#-------------------------------------------------------------------------------
2969+# std
2970+#
2971+$(SUBDIRS_STD):
2972+
2973+#-------------------------------------------------------------------------------
2974+# clean
2975+#
2976+clean: clean_test
2977+
2978+clean_test:
2979+
2980+#-------------------------------------------------------------------------------
2981+# pass-through targets
2982+#
2983+COMPILERS = GCC VC++ CLANG
2984+ARCHITECTURES = i386 x86_64 sparc32 sparc64
2985+CONFIG = debug profile release static dynamic
2986+PUBLISH = scm pubtools
2987+REPORTS = bindir targdir osdir config compilers architecture architectures
2988+PASSTHRUS = \
2989+ out \
2990+ CC $(COMPILERS) \
2991+ $(ARCHITECTURES) \
2992+ $(CONFIG) $(PUBLISH)
2993+
2994+$(PASSTHRUS):
2995+ @ $(MAKE) -s TOP=$(CURDIR) -f build/Makefile.env $@
2996+ @ $(MAKE) -s TOP=$(CURDIR) -f build/Makefile.env rebuild-dirlinks config
2997+
2998+$(REPORTS):
2999+ @ $(MAKE) -s TOP=$(CURDIR) -f build/Makefile.env $@
3000+
3001+.PHONY: $(PASSTHRUS) $(REPORTS)
3002+
3003+
3004+#-------------------------------------------------------------------------------
3005+# configuration help
3006+#
3007+help configure:
3008+ @ echo "Before initial build, run 'make OUTDIR=<dir> out' from"
3009+ @ echo "the project root to set the output directory of your builds."
3010+ @ echo
3011+ @ echo "To select a compiler, run 'make <comp>' where"
3012+ @ echo "comp = { "$(COMPILERS)" }."
3013+ @ echo
3014+ @ echo "For hosts that support cross-compilation ( only Macintosh today ),"
3015+ @ echo "you can run 'make <arch>' where arch = { "$(ARCHITECTURES)" }."
3016+ @ echo
3017+ @ echo "To set a build configuration, run 'make <config>' where"
3018+ @ echo "config = { "$(CONFIG)" }."
3019+ @ echo
3020+
3021+.PHONY: help configure
3022
3023=== added directory '.pc/hardening.patch/build'
3024=== added file '.pc/hardening.patch/build/Makefile.env'
3025--- .pc/hardening.patch/build/Makefile.env 1970-01-01 00:00:00 +0000
3026+++ .pc/hardening.patch/build/Makefile.env 2014-04-08 01:47:44 +0000
3027@@ -0,0 +1,343 @@
3028+# ===========================================================================
3029+#
3030+# PUBLIC DOMAIN NOTICE
3031+# National Center for Biotechnology Information
3032+#
3033+# This software/database is a "United States Government Work" under the
3034+# terms of the United States Copyright Act. It was written as part of
3035+# the author's official duties as a United States Government employee and
3036+# thus cannot be copyrighted. This software/database is freely available
3037+# to the public for use. The National Library of Medicine and the U.S.
3038+# Government have not placed any restriction on its use or reproduction.
3039+#
3040+# Although all reasonable efforts have been taken to ensure the accuracy
3041+# and reliability of the software and data, the NLM and the U.S.
3042+# Government do not and cannot warrant the performance or results that
3043+# may be obtained by using this software or data. The NLM and the U.S.
3044+# Government disclaim all warranties, express or implied, including
3045+# warranties of performance, merchantability or fitness for any particular
3046+# purpose.
3047+#
3048+# Please cite the author in any work or product based on this material.
3049+#
3050+# ===========================================================================
3051+
3052+
3053+# pick up dependencies from object directory
3054+ifdef SRCDIR
3055+ include $(wildcard *.d)
3056+endif
3057+
3058+# determine shell environment
3059+include $(TOP)/build/Makefile.shell
3060+
3061+# normally build shared and static external libs
3062+LIBEXT = $(LIBX) $(SHLX)
3063+
3064+# normally build static intermediate libs
3065+ILIBEXT = $(LIBX)
3066+
3067+# would normally only build dynamic library modules,
3068+# but some tools are expecting to be able to static link
3069+MODEXT = $(LIBX) $(SHLX)
3070+
3071+# determine BUILD
3072+ifeq (,$(BUILD))
3073+ BUILD = dbg
3074+endif
3075+
3076+# some rules are sensitive to the type of build
3077+BUILDTYPE = $(BUILD)
3078+
3079+# adjust settings for build
3080+ifeq (dbg,$(BUILD))
3081+ DEBUG := -D_DEBUGGING
3082+# ILIBEXT = $(LIBX) $(SHLX)
3083+ MODEXT = $(LIBX) $(SHLX)
3084+endif
3085+ifeq (rel,$(BUILD))
3086+ DEBUG := -DNDEBUG
3087+endif
3088+ifeq (prof,$(BUILD))
3089+ DEBUG := -DNDEBUG -D_PROFILING
3090+endif
3091+
3092+# allow for an all-static build
3093+ifeq (stat,$(LNKG))
3094+ STATIC = --static
3095+ LINKAGE := -D_STATIC
3096+ LIBEXT = $(LIBX)
3097+ ILIBEXT = $(LIBX)
3098+ MODEXT = $(LIBX)
3099+ STAT_OR_DYN = static
3100+ STATICSYSLIBS := --static-system-libs
3101+
3102+else
3103+ STAT_OR_DYN = dynamic
3104+endif
3105+
3106+LOCAL_OR_REMOTE = local
3107+
3108+
3109+# drop all suffix rules
3110+.SUFFIXES:
3111+
3112+# load OS and COMP specific files
3113+include $(TOP)/build/Makefile.$(OS)
3114+include $(TOP)/build/Makefile.$(COMP)
3115+include $(TOP)/build/Makefile.rules
3116+
3117+# external schema modules
3118+EXT_SCHEMA_MODULES = axf sraxf wgsxf vxf
3119+READONLY_SCHEMA_LIBS = $(addprefix -d,$(EXT_SCHEMA_MODULES))
3120+UPDATE_SCHEMA_LIBS = $(addprefix -dw,$(EXT_SCHEMA_MODULES))
3121+ALWAYS_STATIC_SCHEMA_LIBS = $(addprefix -s,$(EXT_SCHEMA_MODULES))
3122+
3123+# full directory paths
3124+OLD_TARGDIR = $(OUTDIR)/$(OSFLAV)/$(BUILD)/$(TOOLSET)/$(ARCH)
3125+TARGDIR = $(OUTDIR)/$(OSFLAV)/$(TOOLSET)/$(LNKG)/$(ARCH)/$(BUILD)
3126+BINDIR = $(TARGDIR)/bin
3127+ifeq (win,$(OS))
3128+ # on Windows, place test executables next to .dlls
3129+ TEST_BINDIR = $(BINDIR)
3130+else
3131+ TEST_BINDIR = $(TARGDIR)/test-bin
3132+endif
3133+ILIBDIR = $(TARGDIR)/ilib
3134+LIBDIR = $(TARGDIR)/lib
3135+MODDIR = $(TARGDIR)/mod
3136+WMODDIR = $(TARGDIR)/wmod
3137+OBJDIR = $(TARGDIR)/obj/$(MODULE)
3138+
3139+# path to the ncbi sub-directory
3140+# this is where modules and installed schema files are kept
3141+ifeq (win,$(OS))
3142+ # under Windows, we are always relative to binary path
3143+ NCBIDIR = $(BINDIR)/ncbi
3144+else
3145+ifeq (--static,$(STATIC))
3146+ # in static builds, we are relative to binary path
3147+ # because the configuration library will be part of tool
3148+ NCBIDIR = $(BINDIR)/ncbi
3149+else
3150+ # in dynamic builds, we are relative to library path
3151+ # because the configuration library will live there
3152+ NCBIDIR = $(LIBDIR)/ncbi
3153+endif
3154+endif
3155+
3156+# make reissue command
3157+MAKE_CMD = $(MAKE) BUILD=$(BUILD) TOOLSET=$(TOOLSET) COMP=$(COMP) LNKG=$(LNKG) \
3158+ TOP=$(TOP) SRCDIR=$(SRCDIR) OUTDIR=$(OUTDIR) -C $(OBJDIR) -f $(SRCDIR)/Makefile
3159+
3160+# directory and link creation
3161+SUBDIRS = bin test-bin ilib lib
3162+OUTDIRS = schema
3163+
3164+# clean rules
3165+stdclean:
3166+ @ -rm -rf $(OBJDIR)
3167+ @ rm -rf $(addsuffix .*,$(addprefix $(ILIBDIR)/,$(ALL_LIBS))) \
3168+ $(addsuffix .*,$(addprefix $(LIBDIR)/,$(ALL_LIBS))) \
3169+ $(addsuffix .*,$(addprefix $(MODDIR)/,$(ALL_LIBS))) \
3170+ $(addsuffix .*,$(addprefix $(WMODDIR)/,$(ALL_LIBS))) \
3171+ $(addsuffix *,$(addprefix $(BINDIR)/,$(ALL_TOOLS) $(ALL_LIBS))) \
3172+ $(addsuffix *,$(addprefix $(TEST_BINDIR)/,$(ALL_TOOLS) $(TEST_TOOLS)))
3173+
3174+# removing symbolic links that point to specific builds
3175+removelinks:
3176+ @ test ! -h $(OUTDIR)/schema && rm -rf $(OUTDIR)/schema || true
3177+ @ rm -f $(addprefix $(OUTDIR)/,$(addsuffix $(BITS),$(SUBDIRS)))
3178+ @ rm -f $(addprefix $(OUTDIR)/,$(OUTDIRS))
3179+
3180+# create all required output directories
3181+makedirs:
3182+ @ mkdir -p $(addprefix $(TARGDIR)/,$(SUBDIRS) obj/$(MODULE)) $(NCBIDIR)
3183+
3184+# build version include files
3185+vers-includes: makedirs
3186+ @ $(MAKE_CMD) -s $(TARGDIR)/$@
3187+
3188+ifeq (win,$(OS))
3189+
3190+# Windows doesn't really support symbolic links
3191+# we may add them back in when our toolkit is able to create them
3192+rebuild-dirlinks: makedirs
3193+ @ true
3194+else
3195+
3196+LNDIRS = $(addprefix ln_,$(SUBDIRS))
3197+$(LNDIRS):
3198+ @ ln -s $(TARGDIR)/$(subst ln_,,$@) $(OUTDIR)/$(subst ln_,,$@)$(BITS)
3199+
3200+ifdef NOREBUILD_LINKS
3201+rebuild-dirlinks:
3202+ @ true
3203+else
3204+rebuild-dirlinks: removelinks makedirs $(LNDIRS)
3205+ @ ln -s $(TOP)/interfaces $(OUTDIR)/schema
3206+endif
3207+
3208+endif
3209+
3210+.PHONY: stdclean removelinks makedirs vers-includes rebuild-dirlinks
3211+
3212+# configuration targets
3213+out:
3214+ @ echo $(OUTDIR) > $(TOP)/build/OUTDIR.$(BUILD_OS)
3215+ @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
3216+
3217+CC:
3218+ @ echo cc > $(TOP)/build/COMP.$(OS)
3219+
3220+GCC:
3221+ @ echo gcc > $(TOP)/build/COMP.$(OS)
3222+
3223+ICC:
3224+ @ echo icc > $(TOP)/build/COMP.$(OS)
3225+
3226+VC++:
3227+ @ echo vc++ > $(TOP)/build/COMP.$(OS)
3228+
3229+CLANG:
3230+ @ echo clang > $(TOP)/build/COMP.$(OS)
3231+
3232+static:
3233+ @ echo stat > $(TOP)/build/LNKG.$(OS)
3234+
3235+dynamic:
3236+ @ echo dyn > $(TOP)/build/LNKG.$(OS)
3237+
3238+debug:
3239+ @ echo dbg > $(TOP)/build/BUILD.$(OS)
3240+
3241+profile: static
3242+ @ echo prof > $(TOP)/build/BUILD.$(OS)
3243+
3244+release:
3245+ @ echo rel > $(TOP)/build/BUILD.$(OS)
3246+
3247+pubtools: release static
3248+
3249+bindir:
3250+ @ echo "$(BINDIR)"
3251+
3252+targdir:
3253+ @ echo "$(TARGDIR)"
3254+
3255+osdir:
3256+ @ echo "$(OUTDIR)/$(OSFLAV)"
3257+
3258+compilers:
3259+ @ echo "$(COMPILERS)"
3260+
3261+architectures:
3262+ @ echo "$(ARCHITECTURES)"
3263+
3264+architecture:
3265+ @ echo "$(ARCH)"
3266+
3267+config:
3268+ @ echo " current build is $(BUILD_OS) $(STAT_OR_DYN) $(BUILD) $(ARCH) build using $(TOOLSET) tools"
3269+ @ echo " output target directory is '$(TARGDIR)'"
3270+ @ echo
3271+
3272+.PHONY: out CC GCC ICC debug profile release bindir report_config
3273+
3274+# includes based upon build
3275+ITF = $(TOP)/interfaces
3276+OSINC = $(TOP)/interfaces/os
3277+CCINC = $(TOP)/interfaces/cc
3278+XTINC = $(TOP)/interfaces/ext
3279+
3280+# OS specific source and include dirs
3281+SRCDIRS_OS = $(SRCDIR)/$(OS)
3282+INCDIRS_OS = $(OSINC)/$(OS)
3283+
3284+# most OS' have a parent type
3285+ifdef OS_DAD
3286+
3287+SRCDIRS_OS += $(SRCDIR)/$(OS_DAD)
3288+INCDIRS_OS += $(OSINC)/$(OS_DAD)
3289+
3290+# some OS' have a grandparent
3291+ifdef OS_GDAD
3292+SRCDIRS_OS += $(SRCDIR)/$(OS_GDAD)
3293+INCDIRS_OS += $(OSINC)/$(OS_GDAD)
3294+endif
3295+
3296+endif
3297+
3298+# compiler specific includes
3299+INCDIRS_COMP = \
3300+ $(CCINC)/$(COMP)/$(ARCH) \
3301+ $(CCINC)/$(COMP)
3302+
3303+# some compilers have a parent type
3304+ifdef COMP_DAD
3305+
3306+INCDIRS_COMP += \
3307+ $(CCINC)/$(COMP_DAD)/$(ARCH) \
3308+ $(CCINC)/$(COMP_DAD)
3309+
3310+endif
3311+
3312+VPATH = \
3313+ $(SRCDIR)/$(COMP)/$(ARCH) \
3314+ $(SRCDIR)/$(COMP) \
3315+ $(SRCDIRS_OS) \
3316+ $(SRCDIR)
3317+
3318+INCDIRS = \
3319+ $(addprefix -I,$(SRCDIRS_OS)) \
3320+ $(addprefix -I,$(SRCDIR) $(ITF)) \
3321+ $(addprefix -I,$(INCDIRS_COMP)) \
3322+ $(addprefix -I,$(INCDIRS_OS) $(XTINC)) \
3323+ -I.
3324+
3325+
3326+# defines that describe os & architecture
3327+DLLX ?= $(SHLX)
3328+ARCHDEFS = -D_ARCH_BITS=$(BITS) -DLIBPREFIX=$(LPFX) -DSHLIBEXT=$(DLLX)
3329+
3330+# default tool parameters
3331+CFLAGS = $(DEBUG) $(DBG) $(CARCH) $(PROF) $(PED) $(LINKAGE) $(DEFINES) $(ARCHDEFS) $(INCDIRS)
3332+CPFLAGS = $(DEBUG) $(DBG) $(CARCH) $(PROF) $(LINKAGE) $(DEFINES) $(ARCHDEFS) $(INCDIRS)
3333+LDFLAGS = $(DBG) $(PROF) $(CARCH)
3334+
3335+#-------------------------------------------------------------------------------
3336+# runtests
3337+#
3338+# MallocScribble=1 is for catching allocation problems on Mac
3339+#
3340+ifeq ($(RUNTESTS_OVERRIDE),)
3341+runtests: std $(TEST_TOOLS)
3342+ @ echo "$0 $*"; export LD_LIBRARY_PATH=$(LIBDIR);export MallocScribble=1;\
3343+ for i in $(TEST_TOOLS);\
3344+ do\
3345+ echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++;\
3346+ echo Run $(TEST_BINDIR)/$$i;eval $(RUN_REMOTELY) $(TEST_BINDIR)/$$i;r=$$?; \
3347+ if [ "$$r" != "0" ] ; then exit $$r; fi; \
3348+ done
3349+
3350+.PHONY: runtests
3351+endif
3352+
3353+#-------------------------------------------------------------------------------
3354+# buildtests
3355+#
3356+buildtests: std $(TEST_TOOLS) $(SLOW_TEST_TOOLS)
3357+
3358+#-------------------------------------------------------------------------------
3359+# slowtests
3360+#
3361+slowtests: std $(SLOW_TEST_TOOLS)
3362+ @ echo "$0 $*"; export LD_LIBRARY_PATH=$(LIBDIR);\
3363+ for i in $(SLOW_TEST_TOOLS);\
3364+ do\
3365+ echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++;\
3366+ echo Run $(TEST_BINDIR)/$$i;eval $(TEST_BINDIR)/$$i;r=$$?; \
3367+ if [ "$$r" != "0" ] ; then exit $$r; fi; \
3368+ done
3369+
3370+.PHONY: slowtests buildtests
3371
3372=== removed file 'CHANGES'
3373--- CHANGES 2012-01-10 09:06:14 +0000
3374+++ CHANGES 1970-01-01 00:00:00 +0000
3375@@ -1,30 +0,0 @@
3376-# ===========================================================================
3377-#
3378-# PUBLIC DOMAIN NOTICE
3379-# National Center for Biotechnology Information
3380-#
3381-# This software/database is a "United States Government Work" under the
3382-# terms of the United States Copyright Act. It was written as part of
3383-# the author's official duties as a United States Government employee and
3384-# thus cannot be copyrighted. This software/database is freely available
3385-# to the public for use. The National Library of Medicine and the U.S.
3386-# Government have not placed any restriction on its use or reproduction.
3387-#
3388-# Although all reasonable efforts have been taken to ensure the accuracy
3389-# and reliability of the software and data, the NLM and the U.S.
3390-# Government do not and cannot warrant the performance or results that
3391-# may be obtained by using this software or data. The NLM and the U.S.
3392-# Government disclaim all warranties, express or implied, including
3393-# warranties of performance, merchantability or fitness for any particular
3394-# purpose.
3395-#
3396-# Please cite the author in any work or product based on this material.
3397-#
3398-# ===========================================================================
3399-
3400-
3401-The NCBI SRA Software Development Kit
3402-Contact: sra-tools@ncbi.nlm.nih.gov
3403-
3404-Release documentation is now being delivered at
3405-http://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software
3406
3407=== modified file 'Makefile'
3408--- Makefile 2012-01-10 09:06:14 +0000
3409+++ Makefile 2014-04-08 01:47:44 +0000
3410@@ -37,6 +37,9 @@
3411 libs \
3412 tools
3413
3414+# common targets for non-leaf Makefiles; must follow a definition of SUBDIRS
3415+include $(TOP)/build/Makefile.targets
3416+
3417 default: $(SUBDIRS)
3418
3419 test: $(SUBDIRS)
3420@@ -47,69 +50,44 @@
3421 .PHONY: default $(SUBDIRS) test
3422
3423 #-------------------------------------------------------------------------------
3424-# static vs. dynamic
3425-#
3426-static:
3427- @ touch "$(CURDIR)/build/STATIC"
3428-
3429-dynamic:
3430- @ rm -f "$(CURDIR)/build/STATIC"
3431-
3432-.PHONY: static dynamic
3433-
3434-#-------------------------------------------------------------------------------
3435 # all
3436 #
3437-SUBDIRS_ALL = $(addsuffix _all,$(SUBDIRS))
3438-
3439-all: $(SUBDIRS_ALL)
3440-
3441 $(SUBDIRS_ALL):
3442- @ $(MAKE) -C $(subst _all,,$@) all
3443-
3444-.PHONY: all $(SUBDIRS_ALL)
3445
3446 #-------------------------------------------------------------------------------
3447 # std
3448 #
3449-SUBDIRS_STD = $(addsuffix _std,$(SUBDIRS))
3450-
3451-std: $(SUBDIRS_STD)
3452-
3453 $(SUBDIRS_STD):
3454- @ $(MAKE) -C $(subst _std,,$@) std
3455-
3456-.PHONY: std $(SUBDIRS_STD)
3457
3458 #-------------------------------------------------------------------------------
3459 # clean
3460 #
3461-SUBDIRS_CLEAN = $(addsuffix _clean,$(SUBDIRS_ALL))
3462-
3463-clean: $(SUBDIRS_CLEAN)
3464-
3465-$(SUBDIRS_CLEAN):
3466- @ $(MAKE) -C $(subst _all_clean,,$@) clean
3467-
3468-.PHONY: clean $(SUBDIRS_CLEAN)
3469-
3470+clean: clean_test
3471+
3472+clean_test:
3473
3474 #-------------------------------------------------------------------------------
3475 # pass-through targets
3476 #
3477-COMPILERS = GCC ICC VC++
3478-ARCHITECTURES = i386 x86_64
3479-CONFIG = debug profile release
3480+COMPILERS = GCC VC++ CLANG
3481+ARCHITECTURES = i386 x86_64 sparc32 sparc64
3482+CONFIG = debug profile release static dynamic
3483+PUBLISH = scm pubtools
3484+REPORTS = bindir targdir osdir config compilers architecture architectures
3485 PASSTHRUS = \
3486- out bindir \
3487+ out \
3488 CC $(COMPILERS) \
3489 $(ARCHITECTURES) \
3490- $(CONFIG)
3491+ $(CONFIG) $(PUBLISH)
3492
3493 $(PASSTHRUS):
3494- @ $(MAKE) TOP=$(CURDIR) -f build/Makefile.env $@
3495-
3496-.PHONY: $(PASSTHRUS)
3497+ @ $(MAKE) -s TOP=$(CURDIR) DEB_CFLAGS="$(DEB_CFLAGS)" DEB_LDFLAGS="$(DEB_LDFLAGS)" -f build/Makefile.env $@
3498+ @ $(MAKE) -s TOP=$(CURDIR) DEB_CFLAGS="$(DEB_CFLAGS)" DEB_LDFLAGS="$(DEB_LDFLAGS)" -f build/Makefile.env rebuild-dirlinks config
3499+
3500+$(REPORTS):
3501+ @ $(MAKE) -s TOP=$(CURDIR) DEB_CFLAGS="$(DEB_CFLAGS)" DEB_LDFLAGS="$(DEB_LDFLAGS)" -f build/Makefile.env $@
3502+
3503+.PHONY: $(PASSTHRUS) $(REPORTS)
3504
3505
3506 #-------------------------------------------------------------------------------
3507
3508=== modified file 'README'
3509--- README 2012-01-10 09:06:14 +0000
3510+++ README 2014-04-08 01:47:44 +0000
3511@@ -32,26 +32,8 @@
3512 The SRA Toolkit and SDK from NCBI is a collection of tools and
3513 libraries for using data in the INSDC Sequence Read Archives.
3514
3515-With this release, NCBI has implemented Compression by Reference, a
3516-sequence alignment compression process for storing sequence data.
3517-Currently BAM, Complete Genomics and Illumina export.txt formats
3518-contain alignment information. Compression by Reference only stores
3519-the difference in base pairs between sequence data and the segments it
3520-aligns to. The decompression process to restore original data such as
3521-fastq-dump would require fast access to the actual sequences of the
3522-references. NCBI recommends that SRA users dedicate local disk space
3523-to store local references downloaded from the NCBI SRA site. Linked
3524-references should be in a location accessible by the SRA Reader
3525-software.
3526-
3527-Older files in the NCBI system may not have been compressed using
3528-Compression by Reference. For more information on how to use
3529-Reference-based compressed files, download local references, and use
3530-related tools please refer to Compression by Reference file on the
3531-NCBI SRA website:
3532-
3533- "http://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=softwareReadme"
3534-
3535+With this release, NCBI has implemented Automatic Remote Access by accession,
3536+making it possible to access data using NCBI servers without prior download.
3537
3538 For additional information on using and building the toolkit,
3539 please visit our web site at:
3540
3541=== modified file 'README-WINDOWS.txt'
3542--- README-WINDOWS.txt 2012-01-10 09:06:14 +0000
3543+++ README-WINDOWS.txt 2014-04-08 01:47:44 +0000
3544@@ -29,6 +29,21 @@
3545 Contact: sra-tools@ncbi.nlm.nih.gov
3546
3547
3548+NOTICE:
3549+
3550+ Effective as of release 2.1.8, NCBI is no longer supporting public sources for
3551+ Windows builds. The sources will still contain everything that we use to build
3552+ the binaries, but may not build in your environment.
3553+
3554+ The reason for this change has to do with dependencies upon third party
3555+ libraries, which are commonly installed on other platforms, but could be
3556+ described as "hit and miss" on Windows. When the libraries DO exist, it is
3557+ difficult to know if they have a correct or compatible calling convention.
3558+
3559+ We will continue to distribute pre-built binaries for Windows. You are welcome
3560+ to try your luck at compiling the sources yourself under Cygwin.
3561+
3562+
3563 ENVIRONMENT:
3564
3565 The Windows build uses the same makefiles as Linux and Mac, and has
3566
3567=== removed file 'README-build'
3568--- README-build 2012-01-10 09:06:14 +0000
3569+++ README-build 1970-01-01 00:00:00 +0000
3570@@ -1,237 +0,0 @@
3571-# ===========================================================================
3572-#
3573-# PUBLIC DOMAIN NOTICE
3574-# National Center for Biotechnology Information
3575-#
3576-# This software/database is a "United States Government Work" under the
3577-# terms of the United States Copyright Act. It was written as part of
3578-# the author's official duties as a United States Government employee and
3579-# thus cannot be copyrighted. This software/database is freely available
3580-# to the public for use. The National Library of Medicine and the U.S.
3581-# Government have not placed any restriction on its use or reproduction.
3582-#
3583-# Although all reasonable efforts have been taken to ensure the accuracy
3584-# and reliability of the software and data, the NLM and the U.S.
3585-# Government do not and cannot warrant the performance or results that
3586-# may be obtained by using this software or data. The NLM and the U.S.
3587-# Government disclaim all warranties, express or implied, including
3588-# warranties of performance, merchantability or fitness for any particular
3589-# purpose.
3590-#
3591-# Please cite the author in any work or product based on this material.
3592-#
3593-# ===========================================================================
3594-
3595-
3596-The NCBI SRA ( Sequence Read Archive ) SDK ( Software Development Kit )
3597-
3598-
3599-Contact: sra-tools@ncbi.nlm.nih.gov
3600-http://trace.ncbi.nlm.nih.gov/Traces/sra/std
3601-
3602-
3603-This version of the NCBI SRA SDK generates loading and dumping tools with
3604-their respective libraries for building new and accessing existing runs.
3605-It may be built with GCC, ICC or Microsoft VC++.
3606-
3607-
3608-REQUIREMENTS:
3609-
3610-This software release was designed to run under Linux, MacOSX and Windows
3611-operating systems on Intel x86-compatible 32 and 64 bit architectures.
3612-
3613- ar # tested with version 2.15.90
3614- bash # certain scripts require bash
3615- make # GNU make version 3.80 or later
3616- gcc, g++ # tested with 4.1.2, but should work with others
3617- libz # version 1
3618- libbz2 # version 1
3619- libxml2 # tested with version 2.6.7 [Linux and Mac only]
3620-
3621-If your system does NOT have libz or libbz2, or if the build fails due to
3622-missing one of the expected libraries, try running "make all" which will
3623-attempt to download the sources to libz and libbz2 and build them.
3624-
3625-OPTIONS:
3626-
3627-Specific versions of ICC are supported as an alternate compiler.
3628-
3629- icc, icpc # tested with 11.0 (64-bit) and 10.1 (32-bit)
3630- # 32-bit 11.0 does not work
3631-
3632-WINDOWS BUILD:
3633-
3634-The Windows build uses the same makefiles as Linux and Mac, and has been tested
3635-under Cygwin. You need to execute Cygwin AFTER sourcing the Microsoft batch file
3636-from Visual Studio.
3637-
3638-
3639-CONTENTS:
3640-
3641- CHANGES # describes changes at pertinent levels
3642- Makefile # drives configuration and sub-target builds
3643- README
3644- README-WINDOWS.txt
3645- USAGE
3646- build # holds special makefiles and configuration
3647- interfaces # contains module interfaces, schema, plus
3648- compiler and platform specific includes
3649- libs # sdk library code
3650- tools # toolkit code
3651- test # testing code
3652-
3653-
3654-CONFIGURATION:
3655-
3656-There are three configurable parameters:
3657- 1) BUILD = 'debug', 'release' etc.
3658- 2) COMP = 'GCC' etc.
3659- 3) OUTDIR = <path-to-binaries-libs-objfiles>
3660-
3661-The target architecture is chosen to match your build host. At this
3662-time, only the Macintosh build will support cross-compilation. In the
3663-instructions below, x86_64 is the assumed architecture. If your host
3664-is i386 (32-bit), then you would substitute 32 for paths that contain
3665-64.
3666-
3667-
3668-BUILD INSTRUCTIONS:
3669-
3670-## create output directories and symlinks for first time
3671-
3672- $ OUTDIR=<path-to-output>
3673- $ make OUTDIR="$OUTDIR" out
3674-
3675-The path in OUTDIR MUST be a full path - relative paths may fail.
3676-
3677-## decide upon STATIC or DYNAMIC builds
3678-# VDB.2 was designed to make use of dynamic libraries, but
3679-# in many environments static builds are more convenient or may even be
3680-# required, due to installation restrictions.
3681-#
3682-# THE BUILD DOES NOT CURRENTLY SUPPORT PARALLEL DYNAMIC AND STATIC MODES
3683-# if you switch between them, you should perform a "make clean" first.
3684-
3685- $ make static
3686--OR_
3687- $ make dynamic
3688-
3689-## if you are using a dynamic build, update LD_LIBRARY_PATH - probably want to put
3690-# in shell startup ( ensure that libz, libbz2 and libxml2 can be found in your path )
3691-
3692- $ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$OUTDIR/lib64"
3693-
3694-## the build uses "TOP" as an internal variable
3695-# if you have it defined in your shell environment, unset it before making
3696-
3697-## build the libraries and binaries
3698-
3699- $ make GCC debug # optionally set compiler and/or build
3700- $ make # builds libraries and binary executables
3701-
3702-The standard make will cause default libraries and tools to be built. Binary
3703-executables and both shared and static libraries can be found in their
3704-respective output directories.
3705-
3706-If the build fails due to not finding libz or libbz2, try:
3707-
3708- $ make all # see note above on libraries
3709-
3710-
3711-STATIC BUILD RESULTS:
3712-
3713-<OUTDIR>/bin64/ # (bin32 for 32-bit builds)
3714- abi-dump # dump to ABI-native format
3715- abi-load # load from ABI-native format
3716- align-info # retrieve information from cSRA object
3717- fastq-dump # dump to FASTQ format
3718- fastq-load # load from FASTQ format
3719- helicos-load # load from Helicos native format
3720- illumina-dump # dump to Illumina-native format
3721- illumina-load # load from Illumina-native format
3722- kar # single file archive utility
3723- kdbmeta # access db, table or column metadata
3724- rcexplain # return code display utility
3725- sam-dump # dump to SAM format from cSRA
3726- sff-dump # dumps 454 runs in SFF format
3727- sff-load # load from SFF format
3728- sra-dbcc # consistency checker
3729- sra-kar # sra-specific kar tool
3730- sra-stat # gather run statistics and print to stdout
3731- srf-load # load from SRF format
3732- vdb-copy # tool to copy tables
3733- vdb-dump # dump rows in a textual format
3734- vdb-lock # locks an object against modification
3735- vdb-unlock # unlocks an object
3736-
3737-<OUTDIR>/bin64/ncbi # (bin32 for 32-bit builds)
3738- config.kfg # simple text file for configuring file system
3739-
3740-<OUTDIR>/lib64/ # (lib32 for 32-bit builds)
3741- libkdb # static physical layer reading library
3742- libkfg # static configuration library
3743- libkfs # static file system library
3744- libklib # static support library
3745- libkproc # static process synchronization library
3746- libkq # static cross-thread queue library
3747- libksproc # static single-threaded emulation library
3748- libksrch # static search algorithm library
3749- libkxfs # static XML to filesystem library
3750- libkxml # static XML container support library
3751- libload # static loader tool utility library
3752- libsradb # static API for accessing sra
3753- libsrareader # static reader library
3754- libsraschema # static version of SRA schema
3755- libvdb # static virtual layer reading library
3756- libwkdb # static physical layer update library
3757- libwsradb # static update API for SRA
3758- libwvdb # static virtual layer update library
3759-
3760-<OUTDIR>/mod64/ # (mod32 for 32-bit builds)
3761- -- empty --
3762-
3763-<OUTDIR>/wmod64/ # (wmod32 for 32-bit builds)
3764- -- empty --
3765-
3766-
3767-
3768-DYNAMIC BUILD RESULTS:
3769-
3770-<OUTDIR>/bin64/ # (bin32 for 32-bit builds)
3771- -- same as static --
3772-
3773-<OUTDIR>/bin64/ncbi # (bin32 for 32-bit builds)
3774- -- empty --
3775-
3776-<OUTDIR>/lib64/ # (lib32 for 32-bit builds)
3777- libkdb # physical layer reading library
3778- libkfg # configuration library
3779- libkfs # file system library
3780- libklib # support library
3781- libkproc # process synchronization library
3782- libkq # cross-thread queue library
3783- libksproc # single-threaded emulation library
3784- libksrch # search algorithm library
3785- libkxfs # XML to filesystem library
3786- libkxml # XML container support library
3787- libload # loader tool utility library
3788- libsra-schema # weak-linked sra schema
3789- libsradb # API for accessing sra
3790- libsrapath # weak-link stubs for srapath
3791- libsrareader # reader library
3792- libvdb # virtual layer reading library
3793- libwkdb # physical layer update library
3794- libwsradb # update API for SRA
3795- libwvdb # virtual layer update library
3796-
3797-<OUTDIR>/lib64/ncbi # (lib32 for 32-bit builds)
3798- config.kfg # simple text file for configuring file system
3799-
3800-<OUTDIR>/mod64/ # (mod32 for 32-bit builds)
3801- libaxf # cSRA-specific VDB external functions
3802- libsraxf # sra-specific VDB external functions
3803- libvxf # generic VDB external functions
3804-
3805-<OUTDIR>/wmod64/ # (wmod32 for 32-bit builds)
3806- libwsraxf # sra-specific VDB external functions for update
3807- libwvxf # update VDB external functions
3808
3809=== added file 'README-build.txt'
3810--- README-build.txt 1970-01-01 00:00:00 +0000
3811+++ README-build.txt 2014-04-08 01:47:44 +0000
3812@@ -0,0 +1,259 @@
3813+# ===========================================================================
3814+#
3815+# PUBLIC DOMAIN NOTICE
3816+# National Center for Biotechnology Information
3817+#
3818+# This software/database is a "United States Government Work" under the
3819+# terms of the United States Copyright Act. It was written as part of
3820+# the author's official duties as a United States Government employee and
3821+# thus cannot be copyrighted. This software/database is freely available
3822+# to the public for use. The National Library of Medicine and the U.S.
3823+# Government have not placed any restriction on its use or reproduction.
3824+#
3825+# Although all reasonable efforts have been taken to ensure the accuracy
3826+# and reliability of the software and data, the NLM and the U.S.
3827+# Government do not and cannot warrant the performance or results that
3828+# may be obtained by using this software or data. The NLM and the U.S.
3829+# Government disclaim all warranties, express or implied, including
3830+# warranties of performance, merchantability or fitness for any particular
3831+# purpose.
3832+#
3833+# Please cite the author in any work or product based on this material.
3834+#
3835+# ===========================================================================
3836+
3837+
3838+The NCBI SRA ( Sequence Read Archive ) SDK ( Software Development Kit )
3839+
3840+
3841+Contact: sra-tools@ncbi.nlm.nih.gov
3842+http://trace.ncbi.nlm.nih.gov/Traces/sra/std
3843+
3844+
3845+This version of the NCBI SRA SDK generates tools with their respective libraries
3846+for building new and accessing existing runs. It may be built with GCC.
3847+
3848+
3849+REQUIREMENTS:
3850+
3851+This software release was designed to run under Linux, MacOSX and Windows
3852+operating systems on Intel x86-compatible 32 and 64 bit architectures.
3853+
3854+ ar # tested with version 2.22
3855+ bash # certain scripts require bash
3856+ make # GNU make version 3.81 or later
3857+ gcc, g++ # tested with 4.4.2, but should work with others
3858+ libxml2 # tested with version 2.7.6
3859+ libcurl # tested with version 7.27
3860+
3861+WINDOWS BUILD:
3862+
3863+The Windows build uses the same make files as Linux and Mac, and has been tested
3864+under Cygwin. You need to execute Cygwin AFTER sourcing the Microsoft batch file
3865+from Visual Studio.
3866+
3867+
3868+CONTENTS:
3869+
3870+ Makefile # drives configuration and sub-target builds
3871+ README
3872+ README-WINDOWS.txt
3873+ build # holds special makefiles and configuration
3874+ interfaces # contains module interfaces, schema, plus
3875+ compiler and platform specific includes
3876+ libs # sdk library code
3877+ tools # toolkit code
3878+
3879+
3880+CONFIGURATION:
3881+
3882+There are three configurable parameters:
3883+ 1) BUILD = 'debug', 'release' etc.
3884+ 2) COMP = 'GCC' etc.
3885+ 3) OUTDIR = <path-to-binaries-libs-objfiles>
3886+
3887+The target architecture is chosen to match your build host. At this
3888+time, only the Macintosh build will support cross-compilation. In the
3889+instructions below, x86_64 is the assumed architecture. If your host
3890+is i386 (32-bit), then you would substitute 32 for paths that contain
3891+64.
3892+
3893+Running "make help" will list more details of how your build may
3894+be configured:
3895+
3896+ Before initial build, run 'make OUTDIR=<dir> out' from
3897+ the project root to set the output directory of your builds.
3898+
3899+ To select a compiler, run 'make <comp>' where
3900+ comp = { GCC VC++ CLANG }.
3901+
3902+ For hosts that support cross-compilation ( only Macintosh today ),
3903+ you can run 'make <arch>' where arch = { i386 x86_64 sparc32 sparc64 }.
3904+
3905+ To set a build configuration, run 'make <config>' where
3906+ config = { debug profile release static dynamic }.
3907+
3908+Running "make config" will show the current configuration, e.g.:
3909+
3910+ current build is linux static rel x86_64 build using gcc tools
3911+ output target directory is '$PATH_TO_OUTPUT/linux/gcc/stat/x86_64/rel'
3912+
3913+where "$PATH_TO_OUTPUT" is local to your system, of course.
3914+
3915+
3916+BUILD INSTRUCTIONS:
3917+
3918+## create output directories and symlinks for first time
3919+
3920+ $ OUTDIR=<path-to-output>
3921+ $ make OUTDIR="$OUTDIR" out
3922+
3923+The path in OUTDIR MUST be a full path - relative paths may fail.
3924+
3925+## decide upon STATIC or DYNAMIC builds
3926+# VDB.2 was designed to make use of dynamic libraries, but
3927+# in many environments static builds are more convenient or may even be
3928+# required, due to installation restrictions.
3929+#
3930+# THE BUILD DOES NOT CURRENTLY SUPPORT PARALLEL DYNAMIC AND STATIC MODES
3931+# if you switch between them, you should perform a "make clean" first.
3932+
3933+ $ make static
3934+-OR_
3935+ $ make dynamic
3936+
3937+## if you are using a dynamic build, update LD_LIBRARY_PATH - probably want to put
3938+# in shell startup ( ensure that libz, libbz2 and libxml2 can be found in your path )
3939+
3940+ $ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$OUTDIR/lib64"
3941+
3942+## the build uses "TOP" as an internal variable
3943+# if you have it defined in your shell environment, unset it before making
3944+
3945+## build the libraries and binaries
3946+
3947+ $ make GCC debug # optionally set compiler and/or build
3948+ $ make # builds libraries and binary executables
3949+
3950+The standard make will cause default libraries and tools to be built. Binary
3951+executables and both shared and static libraries can be found in their
3952+respective output directories.
3953+
3954+
3955+STATIC BUILD RESULTS:
3956+
3957+<OUTDIR>/bin64/ # (bin32 for 32-bit builds)
3958+ abi-dump # dump to ABI-native format
3959+ abi-load # load from ABI-native format
3960+ align-info # retrieve information from SRA alignment object (cSRA)
3961+ bam-load # load from BAM format into SRA (cSRA)
3962+ cg-load # load from Complete Genomics native format
3963+ fastq-dump # dump to FASTQ format
3964+ fastq-load # load from FASTQ format
3965+ helicos-load # load from Helicos native format
3966+ illumina-dump # dump to Illumina-native format
3967+ illumina-load # load from Illumina-native format
3968+ kar # single file archive utility
3969+ kdbmeta # access db, table or column metadata
3970+ latf-load # generic FASTQ loader
3971+ prefetch # tool to download runs from NCBI by accession
3972+ rcexplain # return code display utility
3973+ sam-dump # dump to SAM format from cSRA
3974+ sff-dump # dumps 454 runs in SFF format
3975+ sff-load # load from SFF format
3976+ sra-kar # sra-specific kar tool
3977+ sra-pileup # produces SAM-style pileup information from SRA (cSRA)
3978+ sra-sort # canonically orders SRA (cSRA) data for improved access
3979+ sra-stat # gather run statistics and print to stdout
3980+ srapath # returns the full location of an object by accession
3981+ srf-load # load from SRF format
3982+ test-sra # test user's environment for configuration and libraries
3983+ vdb-config # display and/or modify user configuration
3984+ vdb-copy # tool to copy tables
3985+ vdb-decrypt # tool to decrypt files from dbGap
3986+ vdb-dump # dump rows in a textual format
3987+ vdb-encrypt # to to (re)encrypt files using dbGap encryption key
3988+ vdb-lock # locks an object against modification
3989+ vdb-unlock # unlocks an object
3990+
3991+<OUTDIR>/lib64/ # (lib32 for 32-bit builds)
3992+ libalign-access # BAM format reading API
3993+ libalign-reader # SRA (cSRA) alignment reading API
3994+ libbz2 # bzip2 library
3995+ libkdb # physical layer reading library
3996+ libkfg # configuration library
3997+ libkfs # physical file system library
3998+ libklib # support library
3999+ libkproc # process synchronization library
4000+ libkq # cross-thread queue library
4001+ libkrypto # cryptographic library
4002+ libsproc # single-threaded stub library
4003+ libksrch # search algorithm library
4004+ libkurl # interface to libcurl
4005+ libkxfs # XML to filesystem library
4006+ libkxml # XML container support library
4007+ libload # loader tool utility library
4008+ libsradb # API for accessing sra
4009+ libsrareader # reader library
4010+ libsraschema # version of SRA schema for reading
4011+ libvdb # virtual layer reading library
4012+ libvfs # virtual file system library
4013+ libwkdb # physical layer update library
4014+ libwsradb # update API for SRA
4015+ libwsraschema # version of SRA schema for update
4016+ libwvdb # virtual layer update library
4017+ libz # gzip library
4018+
4019+<OUTDIR>/mod64/ # (mod32 for 32-bit builds)
4020+ -- empty --
4021+
4022+<OUTDIR>/wmod64/ # (wmod32 for 32-bit builds)
4023+ -- empty --
4024+
4025+
4026+
4027+DYNAMIC BUILD RESULTS:
4028+
4029+<OUTDIR>/bin64/ # (bin32 for 32-bit builds)
4030+ -- same as static --
4031+
4032+<OUTDIR>/lib64/ # (lib32 for 32-bit builds)
4033+ libalign-access # BAM format reading API
4034+ libalign-reader # SRA (cSRA) alignment reading API
4035+ libbz2 # static bzip2 library
4036+ libkdb # physical layer reading library
4037+ libkfg # configuration library
4038+ libkfs # physical file system library
4039+ libklib # support library
4040+ libkproc # process synchronization library
4041+ libkq # cross-thread queue library
4042+ libkrypto # cryptographic library
4043+ libsproc # single-threaded stub library
4044+ libksrch # search algorithm library
4045+ libkurl # interface to libcurl
4046+ libkxfs # XML to filesystem library
4047+ libkxml # XML container support library
4048+ libload # loader tool utility library
4049+ libsradb # API for accessing sra
4050+ libsrareader # reader library
4051+ libsraschema # static version of SRA schema for reading
4052+ libvdb # virtual layer reading library
4053+ libvfs # virtual file system library
4054+ libwkdb # physical layer update library
4055+ libwsradb # update API for SRA
4056+ libwsraschema # static version of SRA schema for update
4057+ libwvdb # virtual layer update library
4058+ libz # static gzip library
4059+
4060+<OUTDIR>/mod64/ # (mod32 for 32-bit builds)
4061+ libaxf # cSRA-specific VDB external functions
4062+ libsraxf # SRA-specific VDB external functions
4063+ libvxf # generic VDB external functions
4064+ libwgsxf # WGS-specific VDB external functions
4065+
4066+<OUTDIR>/wmod64/ # (wmod32 for 32-bit builds)
4067+ libwaxf # cSRA-specific VDB external functions for update
4068+ libwsraxf # SRA-specific VDB external functions for update
4069+ libwvxf # update VDB external functions
4070+ libwwgsxf # WGS-specific VDB external functions for update
4071+
4072
4073=== added file 'README-config.txt'
4074--- README-config.txt 1970-01-01 00:00:00 +0000
4075+++ README-config.txt 2014-04-08 01:47:44 +0000
4076@@ -0,0 +1,58 @@
4077+# ===========================================================================
4078+#
4079+# PUBLIC DOMAIN NOTICE
4080+# National Center for Biotechnology Information
4081+#
4082+# This software/database is a "United States Government Work" under the
4083+# terms of the United States Copyright Act. It was written as part of
4084+# the author's official duties as a United States Government employee and
4085+# thus cannot be copyrighted. This software/database is freely available
4086+# to the public for use. The National Library of Medicine and the U.S.
4087+# Government have not placed any restriction on its use or reproduction.
4088+#
4089+# Although all reasonable efforts have been taken to ensure the accuracy
4090+# and reliability of the software and data, the NLM and the U.S.
4091+# Government do not and cannot warrant the performance or results that
4092+# may be obtained by using this software or data. The NLM and the U.S.
4093+# Government disclaim all warranties, express or implied, including
4094+# warranties of performance, merchantability or fitness for any particular
4095+# purpose.
4096+#
4097+# Please cite the author in any work or product based on this material.
4098+#
4099+# ===========================================================================
4100+
4101+
4102+The NCBI SRA ( Sequence Read Archive )
4103+
4104+
4105+Contact: sra-tools@ncbi.nlm.nih.gov
4106+http://trace.ncbi.nlm.nih.gov/Traces/sra/std
4107+
4108+About configuration-assistant:
4109+
4110+ configuration-assistant.perl will help you to configure the SRA tools to be able
4111+ to access the local reference repository and to download the correct references
4112+ for a given cSRA file.
4113+
4114+To run configuration-assistant on Linux or Mac:
4115+ - open a shell
4116+ - change directory to the folder where you extracted the toolkit (cd .../sratoolkit...),
4117+ - type 'perl configuration-assistant.perl' (without the quotation marks).
4118+
4119+
4120+To run configuration-assistant on Windows:
4121+
4122+ - open Command Prompt (Start->Run->cmd.exe),
4123+ - change directory to the folder where you extracted the toolkit (cd ...\sratoolkit.x.x.x-win64),
4124+ - type 'perl configuration-assistant.perl' (without the quotation marks).
4125+
4126+
4127+If the following message shows up:
4128+
4129+ "'perl' is not recognized as an internal or external command,
4130+ operable program or batch file."
4131+
4132+that means perl is not installed or not installed properly.
4133+
4134+Download Perl at ActiveState.com (http://www.activestate.com/activeperl/downloads)
4135
4136=== removed file 'USAGE'
4137--- USAGE 2012-01-10 09:06:14 +0000
4138+++ USAGE 1970-01-01 00:00:00 +0000
4139@@ -1,162 +0,0 @@
4140-# ===========================================================================
4141-#
4142-# PUBLIC DOMAIN NOTICE
4143-# National Center for Biotechnology Information
4144-#
4145-# This software/database is a "United States Government Work" under the
4146-# terms of the United States Copyright Act. It was written as part of
4147-# the author's official duties as a United States Government employee and
4148-# thus cannot be copyrighted. This software/database is freely available
4149-# to the public for use. The National Library of Medicine and the U.S.
4150-# Government have not placed any restriction on its use or reproduction.
4151-#
4152-# Although all reasonable efforts have been taken to ensure the accuracy
4153-# and reliability of the software and data, the NLM and the U.S.
4154-# Government do not and cannot warrant the performance or results that
4155-# may be obtained by using this software or data. The NLM and the U.S.
4156-# Government disclaim all warranties, express or implied, including
4157-# warranties of performance, merchantability or fitness for any particular
4158-# purpose.
4159-#
4160-# Please cite the author in any work or product based on this material.
4161-#
4162-# ===========================================================================
4163-
4164-
4165-The NCBI SRA ( Sequence Read Archive ) Toolkit
4166-
4167-
4168-Contact: sra-tools@ncbi.nlm.nih.gov
4169-http://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software
4170-
4171-
4172-For preliminary documentation on tool usage, consult the files within
4173-the "help" directory.
4174-
4175-
4176-CHANGES:
4177-
4178-SRA Toolkit includes new features in sam-dump tool and vdb-dump tools.
4179-
4180-Sam-dump now supports slicing across multiple sequences, and dumping cSRA files to fasta and fastq formats. In addition, sam-dump has three new parameters
4181--=|--hide-identical Output '=' if base is identical to reference
4182---gzip Compress output using gzip
4183---bzip2 Compress output using bzip2
4184-
4185-vdb-dump has two new parameters
4186--o|--column_enum_short enumerates columns in short form
4187--b|--boolean defines how boolean's are printed (1,T)
4188-
4189-We have combined the functionality of two scripts, config-assistant.perl and reference-assistant.perl into a single script, configuration-assistant.perl that helps users download the correct references for a given cSRA file and configure the user environment for the SRA Toolkit.
4190-
4191-DESCRIPTION:
4192-
4193- This release includes tools for reading the SRA archive, generally
4194- by converting individual runs into some commonly used format such as
4195- fastq. Support for NCBI's Compression by Reference is also included.
4196-
4197- "Linux" binaries have been created on CentOS and SuSE Linux
4198- distributions. They are not guaranteed to work on other
4199- distributions. In particular, the version of libc.so should be
4200- compatible. They are specific to the x86-family architectures.
4201-
4202- "Windows" binaries have been created using MSVC's (not Cygwin)
4203- tools. This release includes Win32 binaries. The "*-load" tools
4204- are not released for "Windows".
4205-
4206- "Mac OS X" binaries are available for the x86-family
4207- architectures. They will NOT run on PPC Macs. The 64-bit binaries
4208- will run only on OS 10.6. The 32-bit binaries should run on either
4209- 10.5 or later.
4210-
4211-
4212-CONTENTS:
4213-
4214- "abi-dump" - dump ABI color-space runs into their native format
4215- "abi-load" - load ABI color-space runs
4216- "fastq-dump" - dump any run of any platform in FASTQ format
4217- "fastq-load" - load FASTQ runs
4218- "helicos-load" - load HELICOS runs
4219- "illumina-dump" - dump Illumina runs into their native format
4220- "illumina-load" - load Illumina native runs
4221- "kar" - an archive extraction tool for .sra files
4222- "kdbmeta" - display the contents of one or more metadata stores
4223- "rcexplain" - print out error string for return codes (RC)
4224- "refseq-load" - ( NEW for Linux and Mac ) download a reference
4225- sequence object
4226- "sff-dump" - dump 454 runs into SFF format
4227- "sff-load" - load 454 SFF runs
4228- "sra-dbcc" - check SRA runs
4229- "sra-dump" - dump any run in a textual format [see note below]
4230- "sra-kar" - creates a single file archive from an SRA run
4231- "sra-stat" - display run column statistics
4232- "srf-load" - load SRF runs
4233- "sam-dump" - dump a cSRA into the SAM-format
4234- "vdb-copy" - copy SRA objects
4235- "vdb-dump" - display SRA objects in a textual format [see note below]
4236- "vdb-lock" - lock an object against modification
4237- "vdb-unlock" - unlock an object
4238- "align-info" - displays which references a csra-archive uses
4239- "vdb-config" - displays the configuration
4240-
4241-
4242-NOTES:
4243-
4244- The "sam-dump" tool only works on cSRA's. ( See README-csra )
4245- The textual dumpers "sra-dump" and "vdb-dump" are provided in this
4246- release as an aid in visual inspection. It is likely that their
4247- actual output formatting will be changed in the near future to a
4248- stricter, more formalized representation[s].
4249-
4250- The "help" information will be improved in near future releases, and
4251- the tool options will become standardized across the set. We will
4252- also be providing documentation on our web site.
4253-
4254- Tool options may change in the next release. Version 1 tool options
4255- will remain supported wherever possible in order to preserve
4256- operation of any existing scripts.
4257-
4258-
4259-CAVEATS:
4260-
4261- SRA tools are designed to handle very large amounts of data, and are
4262- not currently oriented toward desktop use. They work well within any
4263- Unix-like environment, such as Linux or MacOS's BSD shell.
4264-
4265- Windows operation presents a few challenges. We have tested our
4266- binaries under the MS "cmd.exe" shell and Cygwin's bash. Our tools
4267- know how to accept paths in Windows, Cygwin, POSIX and MinGW
4268- formats. Internally, all paths are treated as MinGW-style POSIX
4269- paths, so any information appearing in output will reflect this
4270- conversion:
4271-
4272- # simple file names
4273- SRR012345.sra => [NO CHANGE]
4274-
4275- # relative paths
4276- win\SRR012345.sra => win/SRR012345.sra
4277-
4278- # full or drive-relative paths
4279- C:\sra\win\SRR012345.sra => /C/sra/win/SRR012345.sra
4280-
4281- # network paths
4282- \\server\sra\SRR012345.sra => //server/sra/SRR012345.sra
4283-
4284- # POSIX paths
4285- /sra/posix/SRR012345.sra => [NO CHANGE]
4286-
4287- # Cygwin full paths
4288- /cygdrive/C/sra/SRR012345.sra => /C/sra/SRR012345.sra
4289-
4290- There are some situations where the software may behave unexpectedly
4291- due to path conversions. In particular, since Windows does not
4292- conform to POSIX path conventions, there may be difficulties
4293- combining network paths with non-network paths, explicitly or
4294- implicitly. IF YOU HAVE PROBLEMS, we recommend mounting file servers
4295- as network drives.
4296-
4297- If you run the software under Cygwin, you should take care to use
4298- either relative paths (those that do not begin with '/') or full
4299- paths that start with "/cygdrive/". The reason is that Cygwin
4300- provides its own path manipulation, but our tools are not aware of
4301- which shell they are running under.
4302
4303=== modified file 'build/BUILD.linux'
4304--- build/BUILD.linux 2012-01-10 09:06:14 +0000
4305+++ build/BUILD.linux 2014-04-08 01:47:44 +0000
4306@@ -1,1 +1,1 @@
4307-pub
4308+rel
4309
4310=== modified file 'build/BUILD.mac'
4311--- build/BUILD.mac 2012-01-10 09:06:14 +0000
4312+++ build/BUILD.mac 2014-04-08 01:47:44 +0000
4313@@ -1,1 +1,1 @@
4314-pub
4315+rel
4316
4317=== modified file 'build/BUILD.win'
4318--- build/BUILD.win 2012-01-10 09:06:14 +0000
4319+++ build/BUILD.win 2014-04-08 01:47:44 +0000
4320@@ -1,1 +1,1 @@
4321-pub
4322+rel
4323
4324=== added file 'build/LNKG.linux'
4325--- build/LNKG.linux 1970-01-01 00:00:00 +0000
4326+++ build/LNKG.linux 2014-04-08 01:47:44 +0000
4327@@ -0,0 +1,1 @@
4328+stat
4329
4330=== added file 'build/LNKG.mac'
4331--- build/LNKG.mac 1970-01-01 00:00:00 +0000
4332+++ build/LNKG.mac 2014-04-08 01:47:44 +0000
4333@@ -0,0 +1,1 @@
4334+stat
4335
4336=== added file 'build/LNKG.win'
4337--- build/LNKG.win 1970-01-01 00:00:00 +0000
4338+++ build/LNKG.win 2014-04-08 01:47:44 +0000
4339@@ -0,0 +1,1 @@
4340+stat
4341
4342=== added file 'build/Makefile.clang'
4343--- build/Makefile.clang 1970-01-01 00:00:00 +0000
4344+++ build/Makefile.clang 2014-04-08 01:47:44 +0000
4345@@ -0,0 +1,80 @@
4346+# ===========================================================================
4347+#
4348+# PUBLIC DOMAIN NOTICE
4349+# National Center for Biotechnology Information
4350+#
4351+# This software/database is a "United States Government Work" under the
4352+# terms of the United States Copyright Act. It was written as part of
4353+# the author's official duties as a United States Government employee and
4354+# thus cannot be copyrighted. This software/database is freely available
4355+# to the public for use. The National Library of Medicine and the U.S.
4356+# Government have not placed any restriction on its use or reproduction.
4357+#
4358+# Although all reasonable efforts have been taken to ensure the accuracy
4359+# and reliability of the software and data, the NLM and the U.S.
4360+# Government do not and cannot warrant the performance or results that
4361+# may be obtained by using this software or data. The NLM and the U.S.
4362+# Government disclaim all warranties, express or implied, including
4363+# warranties of performance, merchantability or fitness for any particular
4364+# purpose.
4365+#
4366+# Please cite the author in any work or product based on this material.
4367+#
4368+# ===========================================================================
4369+
4370+
4371+# compilers
4372+CC = @ $(TOP)/build/cc.sh $(OS) 'clang -c' \
4373+ $(CHECKSUM) --objx $(OBJX) --cflags "$(CFLAGS)" -MD
4374+CP = @ $(TOP)/build/cc.sh $(OS) 'clang -xc++ -c' \
4375+ $(CHECKSUM) --objx $(OBJX) --cflags "$(CPFLAGS)" -MD
4376+
4377+# C preprocessor
4378+PP = gcc -E $(CFLAGS)
4379+
4380+# linkers
4381+LD = @ $(TOP)/build/ld.sh $(OS) $(ARCH) gcc \
4382+ --build $(BUILD) --ldflags "$(LDFLAGS)" $(STATIC) \
4383+ $(STATICSYSLIBS) $(CHECKSUM) --objx $(OBJX) --shlx $(SHLX) --libx $(LIBX) \
4384+ -MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
4385+
4386+LP = @ $(TOP)/build/ld.sh $(OS) $(ARCH) g++ \
4387+ --build $(BUILD) --ldflags "$(LDFLAGS)" $(STATIC) \
4388+ $(STATICSYSLIBS) $(CHECKSUM) --objx $(OBJX) --shlx $(SHLX) --libx $(LIBX) \
4389+ -MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
4390+
4391+# tool options
4392+WARN = -Wall -Wno-variadic-macros -Wno-long-long # -Wconversion
4393+ifeq (linux,$(OS))
4394+ NO_ARRAY_BOUNDS_WARNING = -Wno-array-bounds
4395+endif
4396+
4397+ifeq (64,$(BITS))
4398+ CARCH = -m64
4399+else
4400+ CARCH = -m32
4401+endif
4402+
4403+ifeq (prof, $(BUILD))
4404+ PROF = -pg
4405+endif
4406+
4407+ifeq (dbg, $(BUILD))
4408+ DBG = -g
4409+ OPT = $(WARN)
4410+ NOPT = $(WARN)
4411+ # GCC seems unable to use c99 without ansi, which
4412+ # basically clobbers features back to c89. the options
4413+ # must be specified in the order shown.
4414+ PED = -std=c99 -ansi -pedantic # -fdiagnostics-show-option
4415+else
4416+
4417+ifeq (x86_64, $(ARCH))
4418+ OPT = -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing
4419+else
4420+ OPT = -O3 -Wno-variadic-macros -fno-strict-aliasing
4421+endif
4422+endif
4423+
4424+# clang is designed to be a GCC substitute
4425+COMP_DAD = gcc
4426
4427=== modified file 'build/Makefile.env'
4428--- build/Makefile.env 2012-01-10 09:06:14 +0000
4429+++ build/Makefile.env 2014-04-08 01:47:44 +0000
4430@@ -37,8 +37,9 @@
4431 # normally build static intermediate libs
4432 ILIBEXT = $(LIBX)
4433
4434-# only build dynamic library modules
4435-MODEXT = $(SHLX)
4436+# would normally only build dynamic library modules,
4437+# but some tools are expecting to be able to static link
4438+MODEXT = $(LIBX) $(SHLX)
4439
4440 # determine BUILD
4441 ifeq (,$(BUILD))
4442@@ -59,27 +60,24 @@
4443 endif
4444 ifeq (prof,$(BUILD))
4445 DEBUG := -DNDEBUG -D_PROFILING
4446- STATIC = --static
4447-endif
4448-ifeq (pub,$(BUILD))
4449- DEBUG := -DNDEBUG
4450- BUILDTYPE = rel
4451- STATIC = --static
4452- STATICSYSLIBS := --static-system-libs
4453-endif
4454-
4455+endif
4456
4457 # allow for an all-static build
4458-ifndef STATIC
4459- STATIC = $(shell test -f $(TOP)/build/STATIC && echo "--static")
4460-endif
4461-ifeq (--static,$(STATIC))
4462+ifeq (stat,$(LNKG))
4463+ STATIC = --static
4464 LINKAGE := -D_STATIC
4465 LIBEXT = $(LIBX)
4466 ILIBEXT = $(LIBX)
4467 MODEXT = $(LIBX)
4468+ STAT_OR_DYN = static
4469+ STATICSYSLIBS := --static-system-libs
4470+
4471+else
4472+ STAT_OR_DYN = dynamic
4473 endif
4474
4475+LOCAL_OR_REMOTE = local
4476+
4477
4478 # drop all suffix rules
4479 .SUFFIXES:
4480@@ -89,9 +87,22 @@
4481 include $(TOP)/build/Makefile.$(COMP)
4482 include $(TOP)/build/Makefile.rules
4483
4484+# external schema modules
4485+EXT_SCHEMA_MODULES = axf sraxf wgsxf vxf
4486+READONLY_SCHEMA_LIBS = $(addprefix -d,$(EXT_SCHEMA_MODULES))
4487+UPDATE_SCHEMA_LIBS = $(addprefix -dw,$(EXT_SCHEMA_MODULES))
4488+ALWAYS_STATIC_SCHEMA_LIBS = $(addprefix -s,$(EXT_SCHEMA_MODULES))
4489+
4490 # full directory paths
4491-TARGDIR = $(OUTDIR)/$(OSFLAV)/$(BUILD)/$(COMP)/$(ARCH)
4492+OLD_TARGDIR = $(OUTDIR)/$(OSFLAV)/$(BUILD)/$(TOOLSET)/$(ARCH)
4493+TARGDIR = $(OUTDIR)/$(OSFLAV)/$(TOOLSET)/$(LNKG)/$(ARCH)/$(BUILD)
4494 BINDIR = $(TARGDIR)/bin
4495+ifeq (win,$(OS))
4496+ # on Windows, place test executables next to .dlls
4497+ TEST_BINDIR = $(BINDIR)
4498+else
4499+ TEST_BINDIR = $(TARGDIR)/test-bin
4500+endif
4501 ILIBDIR = $(TARGDIR)/ilib
4502 LIBDIR = $(TARGDIR)/lib
4503 MODDIR = $(TARGDIR)/mod
4504@@ -116,22 +127,22 @@
4505 endif
4506
4507 # make reissue command
4508-MAKE_CMD = $(MAKE) BUILD=$(BUILD) COMP=$(COMP) TOP=$(TOP) \
4509- SRCDIR=$(SRCDIR) OUTDIR=$(OUTDIR) -C $(OBJDIR) -f $(SRCDIR)/Makefile
4510+MAKE_CMD = $(MAKE) BUILD=$(BUILD) TOOLSET=$(TOOLSET) COMP=$(COMP) LNKG=$(LNKG) \
4511+ TOP=$(TOP) SRCDIR=$(SRCDIR) OUTDIR=$(OUTDIR) -C $(OBJDIR) -f $(SRCDIR)/Makefile
4512
4513 # directory and link creation
4514-SUBDIRS = bin ilib lib mod wmod
4515+SUBDIRS = bin test-bin ilib lib
4516 OUTDIRS = schema
4517
4518 # clean rules
4519 stdclean:
4520- @ rm -rf $(OBJDIR)
4521- @ rm -f $(addsuffix .vers.h,$(ALL_TOOLS) $(ALL_LIBS)) \
4522- $(addsuffix .*,$(addprefix $(ILIBDIR)/,$(ALL_LIBS))) \
4523+ @ -rm -rf $(OBJDIR)
4524+ @ rm -rf $(addsuffix .*,$(addprefix $(ILIBDIR)/,$(ALL_LIBS))) \
4525 $(addsuffix .*,$(addprefix $(LIBDIR)/,$(ALL_LIBS))) \
4526 $(addsuffix .*,$(addprefix $(MODDIR)/,$(ALL_LIBS))) \
4527 $(addsuffix .*,$(addprefix $(WMODDIR)/,$(ALL_LIBS))) \
4528- $(addsuffix *,$(addprefix $(BINDIR)/,$(ALL_TOOLS) $(ALL_LIBS)))
4529+ $(addsuffix *,$(addprefix $(BINDIR)/,$(ALL_TOOLS) $(ALL_LIBS))) \
4530+ $(addsuffix *,$(addprefix $(TEST_BINDIR)/,$(ALL_TOOLS) $(TEST_TOOLS)))
4531
4532 # removing symbolic links that point to specific builds
4533 removelinks:
4534@@ -143,6 +154,10 @@
4535 makedirs:
4536 @ mkdir -p $(addprefix $(TARGDIR)/,$(SUBDIRS) obj/$(MODULE)) $(NCBIDIR)
4537
4538+# build version include files
4539+vers-includes: makedirs
4540+ @ $(MAKE_CMD) -s $(TARGDIR)/$@
4541+
4542 ifeq (win,$(OS))
4543
4544 # Windows doesn't really support symbolic links
4545@@ -155,66 +170,79 @@
4546 $(LNDIRS):
4547 @ ln -s $(TARGDIR)/$(subst ln_,,$@) $(OUTDIR)/$(subst ln_,,$@)$(BITS)
4548
4549+ifdef NOREBUILD_LINKS
4550+rebuild-dirlinks:
4551+ @ true
4552+else
4553 rebuild-dirlinks: removelinks makedirs $(LNDIRS)
4554 @ ln -s $(TOP)/interfaces $(OUTDIR)/schema
4555-
4556-endif
4557-
4558-.PHONY: stdclean removelinks makedirs rebuild-dirlinks
4559+endif
4560+
4561+endif
4562+
4563+.PHONY: stdclean removelinks makedirs vers-includes rebuild-dirlinks
4564
4565 # configuration targets
4566 out:
4567- echo $(OUTDIR) > $(TOP)/build/OUTDIR.$(OS)
4568+ @ echo $(OUTDIR) > $(TOP)/build/OUTDIR.$(BUILD_OS)
4569 @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
4570
4571 CC:
4572 @ echo cc > $(TOP)/build/COMP.$(OS)
4573- @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
4574
4575 GCC:
4576 @ echo gcc > $(TOP)/build/COMP.$(OS)
4577- @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
4578
4579 ICC:
4580 @ echo icc > $(TOP)/build/COMP.$(OS)
4581- @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
4582
4583 VC++:
4584 @ echo vc++ > $(TOP)/build/COMP.$(OS)
4585- @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
4586+
4587+CLANG:
4588+ @ echo clang > $(TOP)/build/COMP.$(OS)
4589+
4590+static:
4591+ @ echo stat > $(TOP)/build/LNKG.$(OS)
4592+
4593+dynamic:
4594+ @ echo dyn > $(TOP)/build/LNKG.$(OS)
4595
4596 debug:
4597 @ echo dbg > $(TOP)/build/BUILD.$(OS)
4598- @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
4599
4600-profile:
4601+profile: static
4602 @ echo prof > $(TOP)/build/BUILD.$(OS)
4603- @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
4604
4605 release:
4606 @ echo rel > $(TOP)/build/BUILD.$(OS)
4607- @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
4608-
4609-scm:
4610- @ echo scm > $(TOP)/build/BUILD.$(OS)
4611- @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
4612-
4613-pubtools:
4614- @ echo pub > $(TOP)/build/BUILD.$(OS)
4615- @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
4616+
4617+pubtools: release static
4618
4619 bindir:
4620 @ echo "$(BINDIR)"
4621
4622-purify:
4623- @ echo pur > $(TOP)/build/BUILD.$(OS)
4624- @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
4625-
4626-purecov:
4627- @ echo pcov > $(TOP)/build/BUILD.$(OS)
4628- @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
4629-
4630-.PHONY: out CC GCC ICC debug profile release scm purify purecov
4631+targdir:
4632+ @ echo "$(TARGDIR)"
4633+
4634+osdir:
4635+ @ echo "$(OUTDIR)/$(OSFLAV)"
4636+
4637+compilers:
4638+ @ echo "$(COMPILERS)"
4639+
4640+architectures:
4641+ @ echo "$(ARCHITECTURES)"
4642+
4643+architecture:
4644+ @ echo "$(ARCH)"
4645+
4646+config:
4647+ @ echo " current build is $(BUILD_OS) $(STAT_OR_DYN) $(BUILD) $(ARCH) build using $(TOOLSET) tools"
4648+ @ echo " output target directory is '$(TARGDIR)'"
4649+ @ echo
4650+
4651+.PHONY: out CC GCC ICC debug profile release bindir report_config
4652
4653 # includes based upon build
4654 ITF = $(TOP)/interfaces
4655@@ -264,7 +292,8 @@
4656 $(addprefix -I,$(SRCDIRS_OS)) \
4657 $(addprefix -I,$(SRCDIR) $(ITF)) \
4658 $(addprefix -I,$(INCDIRS_COMP)) \
4659- $(addprefix -I,$(INCDIRS_OS) $(XTINC))
4660+ $(addprefix -I,$(INCDIRS_OS) $(XTINC)) \
4661+ -I.
4662
4663
4664 # defines that describe os & architecture
4665@@ -272,6 +301,43 @@
4666 ARCHDEFS = -D_ARCH_BITS=$(BITS) -DLIBPREFIX=$(LPFX) -DSHLIBEXT=$(DLLX)
4667
4668 # default tool parameters
4669-CFLAGS = $(DEBUG) $(DBG) $(CARCH) $(PROF) $(PED) $(LINKAGE) $(DEFINES) $(ARCHDEFS) $(INCDIRS)
4670+CFLAGS = $(DEBUG) $(DBG) $(CARCH) $(PROF) $(PED) $(LINKAGE) $(DEFINES) $(ARCHDEFS) $(INCDIRS) $(DEB_CFLAGS)
4671 CPFLAGS = $(DEBUG) $(DBG) $(CARCH) $(PROF) $(LINKAGE) $(DEFINES) $(ARCHDEFS) $(INCDIRS)
4672-LDFLAGS = $(DBG) $(PROF)
4673+LDFLAGS = $(DBG) $(PROF) $(CARCH) $(DEB_LDFLAGS)
4674+
4675+#-------------------------------------------------------------------------------
4676+# runtests
4677+#
4678+# MallocScribble=1 is for catching allocation problems on Mac
4679+#
4680+ifeq ($(RUNTESTS_OVERRIDE),)
4681+runtests: std $(TEST_TOOLS)
4682+ @ echo "$0 $*"; export LD_LIBRARY_PATH=$(LIBDIR);export MallocScribble=1;\
4683+ for i in $(TEST_TOOLS);\
4684+ do\
4685+ echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++;\
4686+ echo Run $(TEST_BINDIR)/$$i;eval $(RUN_REMOTELY) $(TEST_BINDIR)/$$i;r=$$?; \
4687+ if [ "$$r" != "0" ] ; then exit $$r; fi; \
4688+ done
4689+
4690+.PHONY: runtests
4691+endif
4692+
4693+#-------------------------------------------------------------------------------
4694+# buildtests
4695+#
4696+buildtests: std $(TEST_TOOLS) $(SLOW_TEST_TOOLS)
4697+
4698+#-------------------------------------------------------------------------------
4699+# slowtests
4700+#
4701+slowtests: std $(SLOW_TEST_TOOLS)
4702+ @ echo "$0 $*"; export LD_LIBRARY_PATH=$(LIBDIR);\
4703+ for i in $(SLOW_TEST_TOOLS);\
4704+ do\
4705+ echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++;\
4706+ echo Run $(TEST_BINDIR)/$$i;eval $(TEST_BINDIR)/$$i;r=$$?; \
4707+ if [ "$$r" != "0" ] ; then exit $$r; fi; \
4708+ done
4709+
4710+.PHONY: slowtests buildtests
4711
4712=== modified file 'build/Makefile.gcc'
4713--- build/Makefile.gcc 2012-01-10 09:06:14 +0000
4714+++ build/Makefile.gcc 2014-04-08 01:47:44 +0000
4715@@ -44,7 +44,14 @@
4716 -MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
4717
4718 # tool options
4719-WARN = -Wall # -Wconversion
4720+WARN = -Wall -Wno-long-long
4721+ifneq (sun,$(OS))
4722+ WARN += -Wno-variadic-macros
4723+endif
4724+
4725+ifeq (linux,$(OS))
4726+ NO_ARRAY_BOUNDS_WARNING = -Wno-array-bounds
4727+endif
4728
4729 ifeq (prof, $(BUILD))
4730 PROF = -pg
4731@@ -54,12 +61,15 @@
4732 DBG = -g
4733 OPT = $(WARN)
4734 NOPT = $(WARN)
4735- PED = -std=c99 -ansi -pedantic
4736+ # GCC seems unable to use c99 without ansi, which
4737+ # basically clobbers features back to c89. the options
4738+ # must be specified in the order shown.
4739+ PED = -std=c99 -ansi -pedantic # -fdiagnostics-show-option
4740 else
4741
4742 ifeq (x86_64, $(ARCH))
4743- OPT = -O3 -fno-strict-aliasing
4744+ OPT = -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing
4745 else
4746- OPT = -O3 -fno-strict-aliasing
4747+ OPT = -O3 -Wno-variadic-macros -fno-strict-aliasing
4748 endif
4749 endif
4750
4751=== modified file 'build/Makefile.linux'
4752--- build/Makefile.linux 2011-05-24 14:48:10 +0000
4753+++ build/Makefile.linux 2014-04-08 01:47:44 +0000
4754@@ -73,3 +73,10 @@
4755 endif
4756 DFLT_LIBXML_INCLUDES = $(NCBI)/libxml/include/libxml2
4757 endif
4758+
4759+# flex+bison
4760+LEX = @ true
4761+YACC = @ true
4762+
4763+# build matrix
4764+COMPILERS = GCC # ICC
4765
4766=== modified file 'build/Makefile.mac'
4767--- build/Makefile.mac 2011-05-24 14:48:10 +0000
4768+++ build/Makefile.mac 2014-04-08 01:47:44 +0000
4769@@ -68,3 +68,10 @@
4770 OS_GDAD = unix
4771
4772 LIBXML_LPATH = /usr/lib
4773+
4774+# flex+bison: on Mac, use source-controlled generated .c/.h files
4775+YACC = @ true
4776+LEX = @ true
4777+
4778+# build matrix
4779+COMPILERS = GCC CLANG
4780
4781=== modified file 'build/Makefile.rules'
4782--- build/Makefile.rules 2011-05-24 14:48:10 +0000
4783+++ build/Makefile.rules 2014-04-08 01:47:44 +0000
4784@@ -99,11 +99,6 @@
4785 $(CP) -S -o $@ -fPIC $(NOPT) $<
4786
4787
4788-######################################################################
4789-## TBD: *.vers.h will no longer be generated or used for executables #
4790-# instead, we will update the linker to produce a *.vers.o #
4791-# with a stub for KAppVersion to return a constant #
4792-######################################################################
4793 # version include generation
4794 %.vers.h: %.vers
4795 $(TOP)/build/make-vers-inc.sh $^ > $@
4796
4797=== modified file 'build/Makefile.shell'
4798--- build/Makefile.shell 2012-01-10 09:06:14 +0000
4799+++ build/Makefile.shell 2014-04-08 01:47:44 +0000
4800@@ -26,54 +26,72 @@
4801 # determine OS
4802 UNAME = $(shell uname -s)
4803
4804-OS = ''
4805+HOST_OS = ''
4806 ifeq (Darwin, $(UNAME))
4807- OS = mac
4808+ HOST_OS = mac
4809 endif
4810 ifeq (Linux, $(UNAME))
4811- OS = linux
4812+ HOST_OS = linux
4813 endif
4814 ifeq (SunOS, $(UNAME))
4815- OS = sun
4816+ HOST_OS = sun
4817+ ARCHITECTURES = x86_64 i386
4818 endif
4819 ifeq (xCYGWIN, $(findstring xCYGWIN,x$(UNAME)))
4820- OS = win
4821+ HOST_OS = win
4822 endif
4823 ifeq (xMINGW, $(findstring xMINGW,x$(UNAME)))
4824- OS = win
4825+ HOST_OS = win
4826 endif
4827 # handle all other OSes (like BSD or Hurd) as if they were linux (see bug #627861)
4828-ifeq ($(OS), '')
4829- OS = linux
4830+ifeq ($(HOST_OS), '')
4831+ HOST_OS = linux
4832 endif
4833
4834-# OS flavor is normally OS
4835-OSFLAV = $(OS)
4836+# assume build OS is the same as host OS
4837+OS = $(HOST_OS)
4838+BUILD_OS = $(OS)
4839
4840 # determine ARCH
4841-ARCH=''
4842-ifeq (mac,$(OS))
4843- ARCH = $(shell $(TOP)/build/mac.arch.sh)
4844+HOST_ARCH=''
4845+ARCHITECTURES = default
4846+ifeq (mac,$(HOST_OS))
4847+ HOST_ARCH = $(shell $(TOP)/build/mac.arch.sh)
4848 else
4849 MARCH = $(shell uname -m)
4850
4851 ifeq (i386, $(MARCH))
4852- ARCH = i386
4853+ HOST_ARCH = i386
4854 endif
4855 ifeq (i486, $(MARCH))
4856- ARCH = i386
4857+ HOST_ARCH = i386
4858 endif
4859 ifeq (i586, $(MARCH))
4860- ARCH = i386
4861+ HOST_ARCH = i386
4862 endif
4863 ifeq (i686, $(MARCH))
4864- ARCH = i386
4865+ ifeq (WOW64x, $(findstring WOW64x,$(UNAME)x))
4866+ # 64-bit capable Cygwin. Analyze the version of cl to set the corect architecture
4867+ CL = $(shell cl.exe 2>&1 >/dev/null)
4868+ ifeq (for x64, $(findstring for x64, $(CL)))
4869+ HOST_ARCH = x86_64
4870+ else
4871+ HOST_ARCH = i386
4872+ endif
4873+ else
4874+ HOST_ARCH = i386
4875+ endif
4876 endif
4877 ifeq (x86_64, $(MARCH))
4878- ARCH = x86_64
4879- endif
4880- ifeq (sun4u,$(MARCH))
4881- ARCH = sparc32
4882+ HOST_ARCH = x86_64
4883+ endif
4884+ ifeq (i86pc, $(MARCH))
4885+ HOST_ARCH = x86_64
4886+ ARCHITECTURES = x86_64 i386
4887+ endif
4888+ ifeq (sun4v,$(MARCH))
4889+ HOST_ARCH = sparc64
4890+ ARCHITECTURES = sparc64 sparc32
4891 endif
4892 endif
4893 # Handle all other architectures equivalent as i386 (see bug #627861)
4894@@ -81,32 +99,51 @@
4895 ARCH = i386
4896 endif
4897
4898-# determine BITS
4899-BITS = $(shell dpkg-architecture -qDEB_BUILD_ARCH_BITS)
4900-
4901-# first pass through defines SRCDIR
4902-ifndef SRCDIR
4903-
4904-# set SRCDIR from MODULE
4905+ARCH = $(HOST_ARCH)
4906+REMOTE_ARCH = $(ARCH)
4907+
4908+# pick up dependencies from object directory
4909+ifdef SRCDIR
4910+ include $(wildcard *.d)
4911+else
4912+
4913+# determine SRCDIR
4914 ifdef MODULE
4915 SRCDIR=$(TOP)/$(MODULE)
4916 else
4917 SRCDIR=$(TOP)
4918 endif
4919
4920+# set COMP, LNKG and BUILD
4921+COMP = $(shell test -f $(TOP)/build/COMP && mv $(TOP)/build/COMP $(TOP)/build/COMP.$(OS); test -f $(TOP)/build/COMP.$(OS) && cat $(TOP)/build/COMP.$(OS) || echo gcc)
4922+LNKG = $(shell test -f $(TOP)/build/STATIC && mv $(TOP)/build/STATIC $(TOP)/build/LNKG.$(OS) && echo stat > $(TOP)/build/LNKG.$(OS); test -f $(TOP)/build/LNKG.$(OS) && cat $(TOP)/build/LNKG.$(OS) || echo stat)
4923+BUILD = $(shell test -f $(TOP)/build/BUILD && mv $(TOP)/build/BUILD $(TOP)/build/BUILD.$(OS); test -f $(TOP)/build/BUILD.$(OS) && cat $(TOP)/build/BUILD.$(OS) || echo dbg)
4924+TOOLSET := $(COMP)
4925+
4926+ifdef USE_GCC_IF_ICC
4927+ifeq (icc,$(COMP))
4928+COMP = gcc
4929+endif
4930+ifeq (clang,$(COMP))
4931+COMP = gcc
4932+endif
4933+endif
4934+
4935+endif
4936+
4937 # set OUTDIR
4938 ifndef OUTDIR
4939- OUTDIR = $(shell test -f $(TOP)/build/OUTDIR.$(OS) && cat $(TOP)/build/OUTDIR.$(OS) || echo $(TOP))
4940+ OUTDIR = $(shell test -f $(TOP)/build/OUTDIR && mv $(TOP)/build/OUTDIR $(TOP)/build/OUTDIR.$(BUILD_OS); test -f $(TOP)/build/OUTDIR.$(BUILD_OS) && cat $(TOP)/build/OUTDIR.$(BUILD_OS) || echo $(TOP))
4941 ifeq (,$(OUTDIR))
4942 OUTDIR = $(TOP)
4943 endif
4944- ifeq (.,$(OUTDIR))
4945- OUTDIR = $(TOP)
4946- endif
4947-endif
4948-
4949-# set COMP and BUILD
4950-COMP = $(shell test -f $(TOP)/build/COMP.$(OS) && cat $(TOP)/build/COMP.$(OS) || echo gcc)
4951-BUILD = $(shell test -f $(TOP)/build/BUILD.$(OS) && cat $(TOP)/build/BUILD.$(OS) || echo dbg)
4952-
4953-endif
4954+endif
4955+ifeq (,$(ROUTDIR))
4956+ ROUTDIR = $(RHOME)
4957+endif
4958+
4959+# OS flavor is normally OS
4960+OSFLAV = $(OS)
4961+
4962+# determine BITS
4963+BITS = $(shell dpkg-architecture -qDEB_BUILD_ARCH_BITS)
4964
4965=== added file 'build/Makefile.targets'
4966--- build/Makefile.targets 1970-01-01 00:00:00 +0000
4967+++ build/Makefile.targets 2014-04-08 01:47:44 +0000
4968@@ -0,0 +1,114 @@
4969+# ===========================================================================
4970+#
4971+# PUBLIC DOMAIN NOTICE
4972+# National Center for Biotechnology Information
4973+#
4974+# This software/database is a "United States Government Work" under the
4975+# terms of the United States Copyright Act. It was written as part of
4976+# the author's official duties as a United States Government employee and
4977+# thus cannot be copyrighted. This software/database is freely available
4978+# to the public for use. The National Library of Medicine and the U.S.
4979+# Government have not placed any restriction on its use or reproduction.
4980+#
4981+# Although all reasonable efforts have been taken to ensure the accuracy
4982+# and reliability of the software and data, the NLM and the U.S.
4983+# Government do not and cannot warrant the performance or results that
4984+# may be obtained by using this software or data. The NLM and the U.S.
4985+# Government disclaim all warranties, express or implied, including
4986+# warranties of performance, merchantability or fitness for any particular
4987+# purpose.
4988+#
4989+# Please cite the author in any work or product based on this material.
4990+#
4991+# ===========================================================================
4992+
4993+# defines make targets commonly used in non-leaf directories:
4994+# default
4995+# all
4996+# std
4997+# clean
4998+# buildtests
4999+# runtests
5000+# slowtests
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: