[med-svn] [ngs-sdk] 01/03: Imported Upstream version 1.2.5
Olivier Sallou
osallou at debian.org
Thu Aug 18 08:56:07 UTC 2016
This is an automated email from the git hooks/post-receive script.
osallou pushed a commit to branch master
in repository ngs-sdk.
commit 62d125bb75d5dacf9256ff34b2d3a3deb65d5757
Author: Olivier Sallou <olivier.sallou at debian.org>
Date: Thu Aug 18 10:51:13 2016 +0200
Imported Upstream version 1.2.5
---
CHANGES | 15 ++
CHANGES.md | 37 ++--
ngs-bam/.gitignore | 1 +
ngs-bam/Makefile | 2 +-
ngs-bam/Makefile.install | 121 ++++++++++++
ngs-bam/{Makefile => Makefile.vers} | 23 +--
ngs-bam/setup/konfigure.perl | 206 +++++++++++++--------
ngs-bam/setup/package.prl | 1 -
ngs-bam/Makefile => ngs-java/Makefile.vers | 23 +--
ngs-java/gov/nih/nlm/ncbi/ngs/LibDependencies.java | 4 +-
ngs-java/setup/konfigure.perl | 204 ++++++++++++--------
ngs-java/setup/package.prl | 1 -
ngs-python/.gitignore | 1 +
ngs-bam/Makefile => ngs-python/Makefile.vers | 23 +--
ngs-python/setup/konfigure.perl | 204 ++++++++++++--------
ngs-python/setup/package.prl | 1 -
ngs-sdk/.gitignore | 1 +
ngs-sdk/Makefile | 2 +-
ngs-bam/Makefile => ngs-sdk/Makefile.vers | 23 +--
ngs-sdk/dispatch/version.h | 2 +-
ngs-sdk/language/java/jni_String.cpp | 10 +-
ngs-sdk/setup/konfigure.perl | 203 ++++++++++++--------
ngs-sdk/setup/package.prl | 1 -
23 files changed, 679 insertions(+), 430 deletions(-)
diff --git a/CHANGES b/CHANGES
index 72dafdf..08121e6 100644
--- a/CHANGES
+++ b/CHANGES
@@ -26,6 +26,21 @@
The NCBI NGS Software Development Kit
Contact: sra-tools at ncbi.nlm.nih.gov
+NCBI External Developer Release: NGS SDK 1.2.5
+July 11, 2016
+
+ blast, kfg, ncbi-vdb, sra-tools, vfs: restored possibility to disable local caching
+ htsjdk: Several JVM crashes related to a number of open files were fixed. New property to disable auto-download was integrated into HTSJDK
+ kfg: When loading configuration files on Windows USERPROFILE environment variable is used before HOME
+ ngs, search, sra-search: sra-search was modified to support multiple threads.
+ ngs-engine, ngs-tools, sra-tools, vfs: The "auxiliary" nodes in configuration are now ignored
+ ngs-engine: Added support for blob-by-blob access to SEQUENCE table
+ ngs-engine: removed a potential memory leak in NGS_CursorMake()
+ ngs: Fixed a bug in ngs::Alignment::getMateReferenceSpec() affecting pre-March 2015 runs
+ ngs: now supports parallel compilation with "make -j N"
+ vfs: environment variable VDB_PWFILE is no longer used
+
+
NCBI External Developer Release: NGS SDK 1.2.4
May 25, 2016
diff --git a/CHANGES.md b/CHANGES.md
index e33438f..8c5a9bf 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,16 +1,31 @@
# NCBI External Developer Release:
+## NGS SDK 1.2.5
+**July 12, 2016**
+
+ **blast, kfg, ncbi-vdb, sra-tools, vfs**: restored possibility to disable local caching
+ **htsjdk**: Several JVM crashes related to a number of open files were fixed. New property to disable auto-download was integrated into HTSJDK
+ **kfg**: When loading configuration files on Windows USERPROFILE environment variable is used before HOME
+ **ngs, search, sra-search**: sra-search was modified to support multiple threads.
+ **ngs-engine, ngs-tools, sra-tools, vfs**: The "auxiliary" nodes in configuration are now ignored
+ **ngs-engine**: Added support for blob-by-blob access to SEQUENCE table
+ **ngs-engine**: removed a potential memory leak in NGS_CursorMake()
+ **ngs**: Fixed a bug in ngs::Alignment::getMateReferenceSpec() affecting pre-March 2015 runs
+ **ngs**: now supports parallel compilation with "make -j N"
+ **vfs**: environment variable VDB_PWFILE is no longer used
+
+
## NGS SDK 1.2.4
**May 25, 2016**
- **build**: MSVS 2013 toolset (12.0) is now supported across all repositories
- **doc, ngs**: updated javadoc to include throws and other missing tags
- **examples, ngs**: added DumpReferenceFASTA.py example
- **htsjdk**: added code to HTS-JDK to avoid involving NGS unless we are sure that it is being requested
- **ngs, ngs-engine**: Added filtering to NGS of secondary alignments that do not have primary alignments
- **ngs, test**: ngs-python: fixed bug in String processing for Python 3.*
- **ngs-engine**: ncbi-ngs engine was updated: fixed a bug that made NGS read iterator return 0 reads on WGS accessions.
- **ngs**: Improved native library load in ngs-java, enhanced its error reporting and added a mode to disable auto-download of native libraries
- **ngs**: Python code will check for the latest version of the libraries and update if newer ones are available
- **ngs**: check for the latest version of the libraries and update if newer ones are available
- **ngs**: simplified ngs-python bindings
+ **build**: MSVS 2013 toolset (12.0) is now supported across all repositories
+ **doc, ngs**: updated javadoc to include throws and other missing tags
+ **examples, ngs**: added DumpReferenceFASTA.py example
+ **htsjdk**: added code to HTS-JDK to avoid involving NGS unless we are sure that it is being requested
+ **ngs, ngs-engine**: Added filtering to NGS of secondary alignments that do not have primary alignments
+ **ngs, test, ngs-python**: fixed bug in String processing for Python 3.x
+ **ngs-engine**: ncbi-ngs engine was updated - fixed a bug that made NGS read iterator return 0 reads on WGS accessions.
+ **ngs**: Improved native library load in ngs-java, enhanced its error reporting and added a mode to disable auto-download of native libraries
+ **ngs**: Python code will check for the latest version of the libraries and update if newer ones are available
+ **ngs**: check for the latest version of the libraries and update if newer ones are available
+ **ngs**: simplified ngs-python bindings
diff --git a/ngs-bam/.gitignore b/ngs-bam/.gitignore
index df15e2d..f3d79aa 100644
--- a/ngs-bam/.gitignore
+++ b/ngs-bam/.gitignore
@@ -1,2 +1,3 @@
+/ld.linux.exe_cmd.sh
/Makefile.config*
/reconfigure
diff --git a/ngs-bam/Makefile b/ngs-bam/Makefile
index 210fbbf..c1fb2d7 100644
--- a/ngs-bam/Makefile
+++ b/ngs-bam/Makefile
@@ -40,6 +40,6 @@ clean: Makefile.config
install: Makefile.config
@ $(MAKE) -f Makefile.libs
- @ perl $(TOP)/setup/install
+ @ $(MAKE) -s --no-print-directory -f Makefile.install install
.PHONY: std clean install
diff --git a/ngs-bam/Makefile.install b/ngs-bam/Makefile.install
new file mode 100644
index 0000000..220bab9
--- /dev/null
+++ b/ngs-bam/Makefile.install
@@ -0,0 +1,121 @@
+# ===========================================================================
+#
+# PUBLIC DOMAIN NOTICE
+# National Center for Biotechnology Information
+#
+# This software/database is a "United States Government Work" under the
+# terms of the United States Copyright Act. It was written as part of
+# the author's official duties as a United States Government employee and
+# thus cannot be copyrighted. This software/database is freely available
+# to the public for use. The National Library of Medicine and the U.S.
+# Government have not placed any restriction on its use or reproduction.
+#
+# Although all reasonable efforts have been taken to ensure the accuracy
+# and reliability of the software and data, the NLM and the U.S.
+# Government do not and cannot warrant the performance or results that
+# may be obtained by using this software or data. The NLM and the U.S.
+# Government disclaim all warranties, express or implied, including
+# warranties of performance, merchantability or fitness for any particular
+# purpose.
+#
+# Please cite the author in any work or product based on this material.
+#
+# ===========================================================================
+
+default: install
+
+TOP ?= $(CURDIR)
+MODPATH =
+
+include $(TOP)/Makefile.config
+
+#-------------------------------------------------------------------------------
+# install
+#
+LIBRARIES_TO_INSTALL = \
+ ngs-bam.$(VERSION_SHLX) \
+ ngs-bam-c++.$(VERSION_LIBX) \
+
+LIB_TARGET = $(INST_LIBDIR)$(BITS)
+
+LIBRARIES_WITH_PREFIX = \
+ $(addprefix $(LIB_TARGET)/$(LPFX),$(LIBRARIES_TO_INSTALL))
+
+copylibs: $(LIB_TARGET)
+ @ echo "Installing libraries to $(LIB_TARGET)"
+ @ $(MAKE) -f Makefile.install $(LIBRARIES_WITH_PREFIX)
+
+copyincludes:
+ @ echo "Installing includes to $(INST_INCDIR)"
+ @ mkdir -p $(INST_INCDIR)/
+ @ cp -r $(TOP)/ngs-bam $(INST_INCDIR)/
+
+copyexamples:
+ifneq ($(INST_SHAREDIR),)
+ @ echo "Installing examples to $(INST_SHAREDIR)"
+ @ mkdir -p $(INST_SHAREDIR)/examples
+ @ $(MAKE) -C $(TOP)/examples install INST_TARGET=$(INST_SHAREDIR)/examples
+endif
+
+#fake root for debugging
+#uncomment this line and change the test for root ( see under install: ) to succeed:
+#ROOT = ~/root
+
+INCLUDE_SYMLINK = $(ROOT)/usr/include/ngs-bam
+PROFILE_FILE = $(ROOT)/etc/profile.d/ngs-bam
+
+ifeq (linux, $(OS))
+ ifeq (0, $(shell id -u))
+ LINUX_ROOT = true
+ endif
+endif
+
+install: copylibs copyincludes copyexamples
+ifeq (true, $(LINUX_ROOT))
+ @ # install symlink to includes
+ @ echo "Updating $(INCLUDE_SYMLINK)"
+ @ rm -f $(INCLUDE_SYMLINK)
+ @ ln -s $(INST_INCDIR)/ngs-bam $(INCLUDE_SYMLINK)
+ @ #
+ @ echo "Updating $(PROFILE_FILE).[c]sh"
+ @ printf \
+"#version $(VERSION)\n"\
+"if ! echo \$$LD_LIBRARY_PATH | /bin/grep -q $(LIB_TARGET)\n"\
+"then export LD_LIBRARY_PATH=$(LIB_TARGET):\$$LD_LIBRARY_PATH\n"\
+"fi\n"\
+"export NGS_LIBDIR=$(LIB_TARGET)\n" \
+ >$(PROFILE_FILE).sh && chmod 644 $(PROFILE_FILE).sh || true;
+ @ printf \
+"#version $(VERSION)\n"\
+"echo \$$LD_LIBRARY_PATH | /bin/grep -q $(LIB_TARGET)\n"\
+"if ( \$$status ) setenv LD_LIBRARY_PATH $(LIB_TARGET):\$$LD_LIBRARY_PATH\n"\
+"setenv NGS_LIBDIR $(LIB_TARGET)\n" \
+ >$(PROFILE_FILE).csh && chmod 644 $(PROFILE_FILE).csh || true;
+ @ #TODO: check version of the files above
+ @ #
+ @ echo "Use \$$NGS_LIBDIR in your link commands, e.g.:"
+ @ echo " ld -L\$$NGS_LIBDIR -lngs-bam ..."
+else
+ @ #
+ @ echo "Please add $(LIB_TARGET) to your LD_LIBRARY_PATH, e.g.:"
+ @ echo " export LD_LIBRARY_PATH=$(LIB_TARGET):\$$LD_LIBRARY_PATH"
+ @ #
+ @ echo "Use $(LIB_TARGET) in your link commands, e.g.:"
+ @ echo " export NGS_LIBDIR=$(LIB_TARGET)"
+ @ echo " ld -L\$$NGS_LIBDIR -lngs-bam ..."
+endif
+
+TO_UNINSTALL = $(LIB_TARGET)/libngs-bam* $(INST_INCDIR)/ngs-bam $(INST_SHAREDIR)/examples
+TO_UNINSTALL_AS_ROOT = $(INST_INCDIR)/ngs-bam $(INCLUDE_SYMLINK) $(PROFILE_FILE).*
+
+uninstall:
+ @ echo "Uninstalling $(TO_UNINSTALL) ..."
+ @ rm -rf $(TO_UNINSTALL)
+ifeq (true, $(LINUX_ROOT))
+ @ echo "Uninstalling $(TO_UNINSTALL_AS_ROOT) ..."
+ @ rm -rf $(TO_UNINSTALL_AS_ROOT)
+endif
+ @ echo "done."
+
+.PHONY: install copylibs copyincludes copyexamples uninstall
+
diff --git a/ngs-bam/Makefile b/ngs-bam/Makefile.vers
similarity index 77%
copy from ngs-bam/Makefile
copy to ngs-bam/Makefile.vers
index 210fbbf..2063d78 100644
--- a/ngs-bam/Makefile
+++ b/ngs-bam/Makefile.vers
@@ -22,24 +22,5 @@
#
# ===========================================================================
-# default response to "make"
-default: std
-
-# the sub-targets
-SUBDIRS = \
-
-SUBTARGS = \
-
-include $(CURDIR)/Makefile.rules
-
-std: Makefile.config
- @ $(MAKE) -f Makefile.libs std
-
-clean: Makefile.config
- @ $(MAKE) -f Makefile.libs clean
-
-install: Makefile.config
- @ $(MAKE) -f Makefile.libs
- @ perl $(TOP)/setup/install
-
-.PHONY: std clean install
+# NGS-BAM and library version
+VERSION = 1.2.5
diff --git a/ngs-bam/setup/konfigure.perl b/ngs-bam/setup/konfigure.perl
index fe8d17c..63ecf76 100644
--- a/ngs-bam/setup/konfigure.perl
+++ b/ngs-bam/setup/konfigure.perl
@@ -203,6 +203,14 @@ unless ($OSTYPE =~ /linux/i || $OSTYPE =~ /darwin/i || $OSTYPE eq 'win') {
exit 1;
}
+my $OS_DISTRIBUTOR = '';
+if ($OS eq 'linux') {
+ print "checking OS distributor... " unless ($AUTORUN);
+ $OS_DISTRIBUTOR = `lsb_release -si 2> /dev/null`;
+ chomp $OS_DISTRIBUTOR;
+ println $OS_DISTRIBUTOR unless ($AUTORUN);
+}
+
print "checking machine architecture... " unless ($AUTORUN);
println $MARCH unless ($AUTORUN);
unless ($MARCH =~ /x86_64/i || $MARCH =~ /i?86/i) {
@@ -284,10 +292,6 @@ $INS_MAKEFILE = File::Spec->catdir(CONFIG_OUT(), "$INS_MAKEFILE.$OS.$ARCH.prl");
my $TOOLS = "";
$TOOLS = "jdk" if ($PKG{LNG} eq 'JAVA');
-print "checking $PACKAGE_NAME version... " unless ($AUTORUN);
-my $FULL_VERSION = VERSION();
-println $FULL_VERSION unless ($AUTORUN);
-
# determine architecture
print "checking for supported architecture... " unless ($AUTORUN);
@@ -424,6 +428,11 @@ if ($TOOLS =~ /gcc$/ && check_no_array_bounds()) {
$NO_ARRAY_BOUNDS_WARNING = '-Wno-array-bounds';
}
+my $STATIC_LIBSTDCPP = '';
+if ($TOOLS =~ /gcc$/) {
+ $STATIC_LIBSTDCPP = check_static_libstdcpp();
+}
+
my @dependencies;
my %DEPEND_OPTIONS;
@@ -464,7 +473,8 @@ foreach my $href (@REQ) {
$href->{locbldpath} = expand($href->{locbldpath}) if ($href->{locbldpath});
# found directories
- my ($found_itf, $found_bin, $found_lib, $found_ilib, $found_jar);
+ my
+ ($found_itf, $found_bin, $found_lib, $found_ilib, $found_jar, $found_src);
my %a = %$href;
next if ($a{option} && $DEPEND_OPTIONS{$a{option}});
@@ -477,8 +487,8 @@ foreach my $href (@REQ) {
my $need_itf = ! ($a{type} =~ /D/ || $a{type} =~ /E/ || $a{type} =~ /J/);
my $need_jar = $a{type} =~ /J/;
- my ($bin, $inc, $lib, $ilib)
- = ($a{bin}, $a{include}, $a{lib}); # file names to check
+ my ($bin, $inc, $lib, $ilib, $src)
+ = ($a{bin}, $a{include}, $a{lib}, undef, $a{src}); # file names to check
$lib = '' unless ($lib);
$lib = expand($lib);
@@ -520,7 +530,8 @@ foreach my $href (@REQ) {
undef $il;
++$has_option{sources};
}
- my ($fi, $fl, $fil) = find_in_dir($try, $i, $l, $il);
+ my ($fi, $fl, $fil)
+ = find_in_dir($try, $i, $l, $il, undef, undef, $src);
if ($fi || $fl || $fil) {
$found_itf = $fi if (! $found_itf && $fi);
$found_lib = $fl if (! $found_lib && $fl);
@@ -541,7 +552,8 @@ foreach my $href (@REQ) {
}
if (! $found_itf && ! $has_option{sources} && $a{srcpath}) {
my $try = $a{srcpath};
- ($found_itf) = find_in_dir($try, $inc);
+ ($found_itf, undef, undef, $found_src)
+ = find_in_dir($try, $inc, undef, undef, undef, undef, $src);
}
if (! $has_option{prefix}) {
my $try = $a{pkgpath};
@@ -668,6 +680,11 @@ foreach my $href (@REQ) {
push(@dependencies, "$a{aname}_INCDIR = $found_itf");
println "includes: $found_itf";
}
+ if ($found_src) {
+ $found_src = abs_path($found_src);
+ push(@dependencies, "$a{aname}_SRCDIR = $found_src");
+ println "sources: $found_src";
+ }
if ($found_lib) {
$found_lib = abs_path($found_lib);
if ($a{aname} eq 'NGS' || $a{aname} eq 'VDB') {
@@ -699,8 +716,8 @@ foreach my $href (@REQ) {
}
}
-my ($E_BINDIR, $E_LIBDIR, $VERSION, $MAJVERS, $E_VERSION_LIBX, $E_MAJVERS_LIBX,
- $E_VERSION_EXEX, $E_MAJVERS_EXEX)
+my ($E_BINDIR, $E_LIBDIR, $E_VERSION_LIBX, $E_MAJVERS_LIBX,
+ $E_VERSION_EXEX, $E_MAJVERS_EXEX)
= ('' , '');
println unless ($AUTORUN);
@@ -714,6 +731,14 @@ if ($OS ne 'win' && ! $OPT{'status'}) {
close F;
}
+ if ($TOOLS =~ /gcc$/) {
+ my $EXECMDF = File::Spec->catdir(CONFIG_OUT(), 'ld.linux.exe_cmd.sh');
+ println "configure: creating '$EXECMDF'" unless ($AUTORUN);
+ open F, ">$EXECMDF" or die "cannot open $EXECMDF to write";
+ print F "EXE_CMD=\"\$LD $STATIC_LIBSTDCPP -static-libgcc\"\n";
+ close F;
+ }
+
# create Makefile.config
println "configure: creating '$OUT_MAKEFILE'" unless ($AUTORUN);
open my $F, ">$OUT_MAKEFILE" or die "cannot open $OUT_MAKEFILE to write";
@@ -773,6 +798,7 @@ BUILD = $BUILD
# target OS
OS = $OS
OSINC = $OSINC
+OS_DISTRIBUTOR = $OS_DISTRIBUTOR
# prefix string for system libraries
LPFX = $LPFX
@@ -866,23 +892,14 @@ EndText
L($F, "NO_ARRAY_BOUNDS_WARNING = $NO_ARRAY_BOUNDS_WARNING");
L($F);
- # version information
-
- my $MAJMIN;
-
- if ($FULL_VERSION =~ /(\d+)\.(\d+)\.(\d+)-?\w*\d*/) {
- $VERSION = "$1.$2.$3";
- $MAJMIN = "$1.$2";
- $MAJVERS = $1;
- } else {
- die $VERSION;
- }
-
print $F <<EndText;
-# $PACKAGE_NAME and library version
-VERSION = $VERSION
-MAJMIN = $MAJMIN
-MAJVERS = $MAJVERS
+# \$(VERSION) is defined in a separate file which is updated every release
+include \$(TOP)/Makefile.vers
+
+empty :=
+space := \$(empty) \$(empty)
+MAJMIN = \$(subst \$(space),.,\$(wordlist 1,2,\$(subst .,\$(space),\$(VERSION))))
+MAJVERS = \$(firstword \$(subst .,\$(space),\$(VERSION)))
# output path
BUILD_PREFIX = $BUILD_PREFIX
@@ -974,6 +991,14 @@ EndText
L($F, $_) foreach (@dependencies);
L($F);
+ # pass HAVE_XML2 to build scripts
+ L($F, 'ifeq (,$(HAVE_XML2))');
+ L($F, ' HAVE_XML2=0');
+ L($F, 'endif');
+ L($F, 'CONFIGURE_FOUND_XML2=$(HAVE_XML2)');
+ L($F, 'export CONFIGURE_FOUND_XML2');
+ L($F);
+
if ($OS eq 'linux' || $OS eq 'mac') {
L($F, '# installation rules');
L($F,
@@ -1039,51 +1064,55 @@ EndText
T($F, ' fi');
}
close $F;
-
- # create Makefile.config.install
- println "configure: creating '$INS_MAKEFILE'" unless ($AUTORUN);
- open $F, ">$INS_MAKEFILE" or die "cannot open $INS_MAKEFILE to write";
-
- $OPT{'javadir' } = '' unless ($OPT{'javadir' });
- $OPT{'sharedir'} = '' unless ($OPT{'sharedir'});
-
- print $F "sub CONFIGURE {\n";
- print $F " \$_{PACKAGE_NAME } = '$PACKAGE_NAME';\n";
- print $F " \$_{VERSION } = '$VERSION';\n";
- print $F " \$_{LNG } = '$PKG{LNG}';\n";
- print $F " \$_{OS } = '$OS';\n";
- print $F " \$_{BITS } = $BITS;\n";
- print $F " \$_{MAJVERS } = $MAJVERS;\n";
- print $F " \$_{LPFX } = '$LPFX';\n";
- print $F " \$_{LIBX } = '$LIBX';\n";
- print $F " \$_{MAJVERS_LIBX } = '" . expand($E_MAJVERS_LIBX) . "';\n";
- print $F " \$_{VERSION_LIBX } = '" . expand($E_VERSION_LIBX) . "';\n";
- print $F " \$_{SHLX } = '$SHLX';\n";
- print $F " \$_{MAJVERS_SHLX } = '" . expand($E_MAJVERS_SHLX) . "';\n";
- print $F " \$_{VERSION_SHLX } = '" . expand($E_VERSION_SHLX) . "';\n";
- print $F " \$_{VERSION_EXEX } = '" . expand($E_VERSION_EXEX) . "';\n";
- print $F " \$_{MAJVERS_EXEX } = '" . expand($E_MAJVERS_EXEX) . "';\n";
- print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n";
- if ($PKG{LNG} ne 'PYTHON') {
- print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n";
- print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n";
- } elsif ($OPT{PYTHON_LIB_PATH}) {
- print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n";
- }
- print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n";
- print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n";
- print $F " \$_{INST_INCDIR } = '$OPT{'includedir'}';\n";
- print $F " \$_{INST_BINDIR } = '$OPT{'bindir'}';\n";
- print $F " \$_{INST_LIBDIR } = '$OPT{'libdir'}';\n";
- print $F " \$_{INST_JARDIR } = '$OPT{'javadir'}';\n";
- print $F " \$_{INST_SHAREDIR} = '$OPT{'sharedir'}';\n";
- print $F "\n";
- print $F " \@_\n";
- print $F "}\n";
- print $F "\n";
- print $F "1\n";
-
- close $F;
+
+ # creation of Makefile.config.install is disabled, since nobody uses it now
+ # and I need to remove versions from prl scripts
+ if (0) {
+ # create Makefile.config.install
+ println "configure: creating '$INS_MAKEFILE'" unless ($AUTORUN);
+ open $F, ">$INS_MAKEFILE" or die "cannot open $INS_MAKEFILE to write";
+
+ $OPT{'javadir' } = '' unless ($OPT{'javadir' });
+ $OPT{'sharedir'} = '' unless ($OPT{'sharedir'});
+
+ print $F "sub CONFIGURE {\n";
+ print $F " \$_{PACKAGE_NAME } = '$PACKAGE_NAME';\n";
+ print $F " \$_{VERSION } = '\$VERSION';\n";
+ print $F " \$_{LNG } = '$PKG{LNG}';\n";
+ print $F " \$_{OS } = '$OS';\n";
+ print $F " \$_{BITS } = $BITS;\n";
+ print $F " \$_{MAJVERS } = \$MAJVERS;\n";
+ print $F " \$_{LPFX } = '$LPFX';\n";
+ print $F " \$_{LIBX } = '$LIBX';\n";
+ print $F " \$_{MAJVERS_LIBX } = '" . expand($E_MAJVERS_LIBX) . "';\n";
+ print $F " \$_{VERSION_LIBX } = '" . expand($E_VERSION_LIBX) . "';\n";
+ print $F " \$_{SHLX } = '$SHLX';\n";
+ print $F " \$_{MAJVERS_SHLX } = '" . expand($E_MAJVERS_SHLX) . "';\n";
+ print $F " \$_{VERSION_SHLX } = '" . expand($E_VERSION_SHLX) . "';\n";
+ print $F " \$_{VERSION_EXEX } = '" . expand($E_VERSION_EXEX) . "';\n";
+ print $F " \$_{MAJVERS_EXEX } = '" . expand($E_MAJVERS_EXEX) . "';\n";
+ print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n";
+ if ($PKG{LNG} ne 'PYTHON') {
+ print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n";
+ print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n";
+ } elsif ($OPT{PYTHON_LIB_PATH}) {
+ print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n";
+ }
+ print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n";
+ print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n";
+ print $F " \$_{INST_INCDIR } = '$OPT{'includedir'}';\n";
+ print $F " \$_{INST_BINDIR } = '$OPT{'bindir'}';\n";
+ print $F " \$_{INST_LIBDIR } = '$OPT{'libdir'}';\n";
+ print $F " \$_{INST_JARDIR } = '$OPT{'javadir'}';\n";
+ print $F " \$_{INST_SHAREDIR} = '$OPT{'sharedir'}';\n";
+ print $F "\n";
+ print $F " \@_\n";
+ print $F "}\n";
+ print $F "\n";
+ print $F "1\n";
+
+ close $F;
+ }
}
if (! $OPT{'status'} ) {
@@ -1254,15 +1283,12 @@ sub expand_path {
}
sub find_in_dir {
- my ($dir, $include, $lib, $ilib, $jar, $bin) = @_;
+ my ($dir, $include, $lib, $ilib, $jar, $bin, $src) = @_;
unless (-d $dir) {
-# println "no" unless ($AUTORUN);
println "\t\tnot found $dir" if ($OPT{'debug'});
return;
}
-# print "\t$dir... " unless ($AUTORUN);
-# print "[found] " if ($OPT{'debug'});
- my ($found_inc, $found_lib, $found_ilib);
+ my ($found_inc, $found_lib, $found_ilib, $found_src);
if ($include) {
print "\tincludes... " unless ($AUTORUN);
if (-e "$dir/$include") {
@@ -1280,7 +1306,6 @@ sub find_in_dir {
}
}
if ($lib || $ilib) {
-# print "\n\t" if ($nl && !$AUTORUN);
print "\tlibraries... " unless ($AUTORUN);
if ($lib) {
my $builddir = File::Spec->catdir($dir, $OS, $TOOLS, $ARCH, $BUILD);
@@ -1372,7 +1397,15 @@ sub find_in_dir {
$found_lib = $try;
}
}
- return ($found_inc, $found_lib, $found_ilib);
+ if ($src) {
+ print "\tsrc... " unless ($AUTORUN);
+ my $try = "$dir/$src";
+ if (-e "$try") {
+ println $dir unless ($AUTORUN);
+ $found_src = $dir;
+ }
+ }
+ return ($found_inc, $found_lib, $found_ilib, $found_src);
}
sub reverse_build {
@@ -1410,6 +1443,15 @@ sub check_no_array_bounds {
check_compiler('O', '-Wno-array-bounds');
}
+sub check_static_libstdcpp {
+ my $option = '-static-libstdc++';
+ my $save = $TOOLS;
+ $TOOLS = $CPP;
+ $_ = check_compiler('O', $option);
+ $TOOLS = $save;
+ $_ ? $option : ''
+}
+
sub find_lib {
check_compiler('L', @_);
}
@@ -1421,7 +1463,7 @@ sub check_compiler {
if ($t eq 'L') {
print "checking for $n library... ";
} elsif ($t eq 'O') {
- if ($tool && $tool =~ /gcc$/) {
+ if ($tool && ($tool =~ /gcc$/ || $tool =~ /g\+\+$/)) {
print "checking whether $tool accepts $n... ";
} else {
return;
@@ -1452,7 +1494,8 @@ sub check_compiler {
$library = '-lmagic';
$log = '#include <magic.h> \n int main() { magic_open (0); }\n'
} elsif ($n eq 'xml2') {
- $library = '-lxml2';
+ $library = '-lxml2';
+ $library .= ' -liconv' if ($OS eq 'mac');
$log = '#include <libxml/xmlreader.h>\n' .
'int main() { xmlInitParser ( ); }\n'
} else {
@@ -1504,7 +1547,6 @@ sub check {
die "No PACKAGE_NAME" unless PACKAGE_NAME();
die "No PACKAGE_NAMW" unless PACKAGE_NAMW();
die "No PACKAGE_TYPE" unless PACKAGE_TYPE();
- die "No VERSION" unless VERSION();
my %PKG = PKG();
diff --git a/ngs-bam/setup/package.prl b/ngs-bam/setup/package.prl
index 30b6f30..32b8020 100644
--- a/ngs-bam/setup/package.prl
+++ b/ngs-bam/setup/package.prl
@@ -1,6 +1,5 @@
################################################################################
sub PACKAGE { 'ngs-bam' }
-sub VERSION { '1.2.4' }
sub PACKAGE_TYPE { 'L' }
sub PACKAGE_NAME { 'NGS-BAM' }
sub PACKAGE_NAMW { 'NGS_BAM' }
diff --git a/ngs-bam/Makefile b/ngs-java/Makefile.vers
similarity index 77%
copy from ngs-bam/Makefile
copy to ngs-java/Makefile.vers
index 210fbbf..3cad8bd 100644
--- a/ngs-bam/Makefile
+++ b/ngs-java/Makefile.vers
@@ -22,24 +22,5 @@
#
# ===========================================================================
-# default response to "make"
-default: std
-
-# the sub-targets
-SUBDIRS = \
-
-SUBTARGS = \
-
-include $(CURDIR)/Makefile.rules
-
-std: Makefile.config
- @ $(MAKE) -f Makefile.libs std
-
-clean: Makefile.config
- @ $(MAKE) -f Makefile.libs clean
-
-install: Makefile.config
- @ $(MAKE) -f Makefile.libs
- @ perl $(TOP)/setup/install
-
-.PHONY: std clean install
+# NGS-JAVA and library version
+VERSION = 1.2.5
diff --git a/ngs-java/gov/nih/nlm/ncbi/ngs/LibDependencies.java b/ngs-java/gov/nih/nlm/ncbi/ngs/LibDependencies.java
index b11b91e..cc90250 100644
--- a/ngs-java/gov/nih/nlm/ncbi/ngs/LibDependencies.java
+++ b/ngs-java/gov/nih/nlm/ncbi/ngs/LibDependencies.java
@@ -29,6 +29,6 @@ package gov.nih.nlm.ncbi.ngs;
class LibDependencies {
final static String NGS_SDK = "ngs-sdk";
final static String NCBI_VDB = "ncbi-vdb";
- final static String NGS_SDK_VERSION = "1.2.4";
- final static String NCBI_VDB_VERSION = "2.6.2";
+ final static String NGS_SDK_VERSION = "1.2.5";
+ final static String NCBI_VDB_VERSION = "2.7.0";
}
diff --git a/ngs-java/setup/konfigure.perl b/ngs-java/setup/konfigure.perl
index fe8d17c..a05ab22 100644
--- a/ngs-java/setup/konfigure.perl
+++ b/ngs-java/setup/konfigure.perl
@@ -203,6 +203,14 @@ unless ($OSTYPE =~ /linux/i || $OSTYPE =~ /darwin/i || $OSTYPE eq 'win') {
exit 1;
}
+my $OS_DISTRIBUTOR = '';
+if ($OS eq 'linux') {
+ print "checking OS distributor... " unless ($AUTORUN);
+ $OS_DISTRIBUTOR = `lsb_release -si 2> /dev/null`;
+ chomp $OS_DISTRIBUTOR;
+ println $OS_DISTRIBUTOR unless ($AUTORUN);
+}
+
print "checking machine architecture... " unless ($AUTORUN);
println $MARCH unless ($AUTORUN);
unless ($MARCH =~ /x86_64/i || $MARCH =~ /i?86/i) {
@@ -284,10 +292,6 @@ $INS_MAKEFILE = File::Spec->catdir(CONFIG_OUT(), "$INS_MAKEFILE.$OS.$ARCH.prl");
my $TOOLS = "";
$TOOLS = "jdk" if ($PKG{LNG} eq 'JAVA');
-print "checking $PACKAGE_NAME version... " unless ($AUTORUN);
-my $FULL_VERSION = VERSION();
-println $FULL_VERSION unless ($AUTORUN);
-
# determine architecture
print "checking for supported architecture... " unless ($AUTORUN);
@@ -424,6 +428,11 @@ if ($TOOLS =~ /gcc$/ && check_no_array_bounds()) {
$NO_ARRAY_BOUNDS_WARNING = '-Wno-array-bounds';
}
+my $STATIC_LIBSTDCPP = '';
+if ($TOOLS =~ /gcc$/) {
+ $STATIC_LIBSTDCPP = check_static_libstdcpp();
+}
+
my @dependencies;
my %DEPEND_OPTIONS;
@@ -464,7 +473,8 @@ foreach my $href (@REQ) {
$href->{locbldpath} = expand($href->{locbldpath}) if ($href->{locbldpath});
# found directories
- my ($found_itf, $found_bin, $found_lib, $found_ilib, $found_jar);
+ my
+ ($found_itf, $found_bin, $found_lib, $found_ilib, $found_jar, $found_src);
my %a = %$href;
next if ($a{option} && $DEPEND_OPTIONS{$a{option}});
@@ -477,8 +487,8 @@ foreach my $href (@REQ) {
my $need_itf = ! ($a{type} =~ /D/ || $a{type} =~ /E/ || $a{type} =~ /J/);
my $need_jar = $a{type} =~ /J/;
- my ($bin, $inc, $lib, $ilib)
- = ($a{bin}, $a{include}, $a{lib}); # file names to check
+ my ($bin, $inc, $lib, $ilib, $src)
+ = ($a{bin}, $a{include}, $a{lib}, undef, $a{src}); # file names to check
$lib = '' unless ($lib);
$lib = expand($lib);
@@ -520,7 +530,8 @@ foreach my $href (@REQ) {
undef $il;
++$has_option{sources};
}
- my ($fi, $fl, $fil) = find_in_dir($try, $i, $l, $il);
+ my ($fi, $fl, $fil)
+ = find_in_dir($try, $i, $l, $il, undef, undef, $src);
if ($fi || $fl || $fil) {
$found_itf = $fi if (! $found_itf && $fi);
$found_lib = $fl if (! $found_lib && $fl);
@@ -541,7 +552,8 @@ foreach my $href (@REQ) {
}
if (! $found_itf && ! $has_option{sources} && $a{srcpath}) {
my $try = $a{srcpath};
- ($found_itf) = find_in_dir($try, $inc);
+ ($found_itf, undef, undef, $found_src)
+ = find_in_dir($try, $inc, undef, undef, undef, undef, $src);
}
if (! $has_option{prefix}) {
my $try = $a{pkgpath};
@@ -668,6 +680,11 @@ foreach my $href (@REQ) {
push(@dependencies, "$a{aname}_INCDIR = $found_itf");
println "includes: $found_itf";
}
+ if ($found_src) {
+ $found_src = abs_path($found_src);
+ push(@dependencies, "$a{aname}_SRCDIR = $found_src");
+ println "sources: $found_src";
+ }
if ($found_lib) {
$found_lib = abs_path($found_lib);
if ($a{aname} eq 'NGS' || $a{aname} eq 'VDB') {
@@ -699,8 +716,8 @@ foreach my $href (@REQ) {
}
}
-my ($E_BINDIR, $E_LIBDIR, $VERSION, $MAJVERS, $E_VERSION_LIBX, $E_MAJVERS_LIBX,
- $E_VERSION_EXEX, $E_MAJVERS_EXEX)
+my ($E_BINDIR, $E_LIBDIR, $E_VERSION_LIBX, $E_MAJVERS_LIBX,
+ $E_VERSION_EXEX, $E_MAJVERS_EXEX)
= ('' , '');
println unless ($AUTORUN);
@@ -714,6 +731,14 @@ if ($OS ne 'win' && ! $OPT{'status'}) {
close F;
}
+ if ($TOOLS =~ /gcc$/) {
+ my $EXECMDF = File::Spec->catdir(CONFIG_OUT(), 'ld.linux.exe_cmd.sh');
+ println "configure: creating '$EXECMDF'" unless ($AUTORUN);
+ open F, ">$EXECMDF" or die "cannot open $EXECMDF to write";
+ print F "EXE_CMD=\"\$LD $STATIC_LIBSTDCPP -static-libgcc\"\n";
+ close F;
+ }
+
# create Makefile.config
println "configure: creating '$OUT_MAKEFILE'" unless ($AUTORUN);
open my $F, ">$OUT_MAKEFILE" or die "cannot open $OUT_MAKEFILE to write";
@@ -773,6 +798,7 @@ BUILD = $BUILD
# target OS
OS = $OS
OSINC = $OSINC
+OS_DISTRIBUTOR = $OS_DISTRIBUTOR
# prefix string for system libraries
LPFX = $LPFX
@@ -866,23 +892,14 @@ EndText
L($F, "NO_ARRAY_BOUNDS_WARNING = $NO_ARRAY_BOUNDS_WARNING");
L($F);
- # version information
-
- my $MAJMIN;
-
- if ($FULL_VERSION =~ /(\d+)\.(\d+)\.(\d+)-?\w*\d*/) {
- $VERSION = "$1.$2.$3";
- $MAJMIN = "$1.$2";
- $MAJVERS = $1;
- } else {
- die $VERSION;
- }
-
print $F <<EndText;
-# $PACKAGE_NAME and library version
-VERSION = $VERSION
-MAJMIN = $MAJMIN
-MAJVERS = $MAJVERS
+# \$(VERSION) is defined in a separate file which is updated every release
+include \$(TOP)/Makefile.vers
+
+empty :=
+space := \$(empty) \$(empty)
+MAJMIN = \$(subst \$(space),.,\$(wordlist 1,2,\$(subst .,\$(space),\$(VERSION))))
+MAJVERS = \$(firstword \$(subst .,\$(space),\$(VERSION)))
# output path
BUILD_PREFIX = $BUILD_PREFIX
@@ -974,6 +991,14 @@ EndText
L($F, $_) foreach (@dependencies);
L($F);
+ # pass HAVE_XML2 to build scripts
+ L($F, 'ifeq (,$(HAVE_XML2))');
+ L($F, ' HAVE_XML2=0');
+ L($F, 'endif');
+ L($F, 'CONFIGURE_FOUND_XML2=$(HAVE_XML2)');
+ L($F, 'export CONFIGURE_FOUND_XML2');
+ L($F);
+
if ($OS eq 'linux' || $OS eq 'mac') {
L($F, '# installation rules');
L($F,
@@ -1040,50 +1065,54 @@ EndText
}
close $F;
- # create Makefile.config.install
- println "configure: creating '$INS_MAKEFILE'" unless ($AUTORUN);
- open $F, ">$INS_MAKEFILE" or die "cannot open $INS_MAKEFILE to write";
-
- $OPT{'javadir' } = '' unless ($OPT{'javadir' });
- $OPT{'sharedir'} = '' unless ($OPT{'sharedir'});
-
- print $F "sub CONFIGURE {\n";
- print $F " \$_{PACKAGE_NAME } = '$PACKAGE_NAME';\n";
- print $F " \$_{VERSION } = '$VERSION';\n";
- print $F " \$_{LNG } = '$PKG{LNG}';\n";
- print $F " \$_{OS } = '$OS';\n";
- print $F " \$_{BITS } = $BITS;\n";
- print $F " \$_{MAJVERS } = $MAJVERS;\n";
- print $F " \$_{LPFX } = '$LPFX';\n";
- print $F " \$_{LIBX } = '$LIBX';\n";
- print $F " \$_{MAJVERS_LIBX } = '" . expand($E_MAJVERS_LIBX) . "';\n";
- print $F " \$_{VERSION_LIBX } = '" . expand($E_VERSION_LIBX) . "';\n";
- print $F " \$_{SHLX } = '$SHLX';\n";
- print $F " \$_{MAJVERS_SHLX } = '" . expand($E_MAJVERS_SHLX) . "';\n";
- print $F " \$_{VERSION_SHLX } = '" . expand($E_VERSION_SHLX) . "';\n";
- print $F " \$_{VERSION_EXEX } = '" . expand($E_VERSION_EXEX) . "';\n";
- print $F " \$_{MAJVERS_EXEX } = '" . expand($E_MAJVERS_EXEX) . "';\n";
- print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n";
- if ($PKG{LNG} ne 'PYTHON') {
- print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n";
- print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n";
- } elsif ($OPT{PYTHON_LIB_PATH}) {
- print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n";
- }
- print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n";
- print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n";
- print $F " \$_{INST_INCDIR } = '$OPT{'includedir'}';\n";
- print $F " \$_{INST_BINDIR } = '$OPT{'bindir'}';\n";
- print $F " \$_{INST_LIBDIR } = '$OPT{'libdir'}';\n";
- print $F " \$_{INST_JARDIR } = '$OPT{'javadir'}';\n";
- print $F " \$_{INST_SHAREDIR} = '$OPT{'sharedir'}';\n";
- print $F "\n";
- print $F " \@_\n";
- print $F "}\n";
- print $F "\n";
- print $F "1\n";
-
- close $F;
+ # creation of Makefile.config.install is disabled, since nobody uses it now
+ # and I need to remove versions from prl scripts
+ if (0) {
+ # create Makefile.config.install
+ println "configure: creating '$INS_MAKEFILE'" unless ($AUTORUN);
+ open $F, ">$INS_MAKEFILE" or die "cannot open $INS_MAKEFILE to write";
+
+ $OPT{'javadir' } = '' unless ($OPT{'javadir' });
+ $OPT{'sharedir'} = '' unless ($OPT{'sharedir'});
+
+ print $F "sub CONFIGURE {\n";
+ print $F " \$_{PACKAGE_NAME } = '$PACKAGE_NAME';\n";
+ print $F " \$_{VERSION } = '\$VERSION';\n";
+ print $F " \$_{LNG } = '$PKG{LNG}';\n";
+ print $F " \$_{OS } = '$OS';\n";
+ print $F " \$_{BITS } = $BITS;\n";
+ print $F " \$_{MAJVERS } = \$MAJVERS;\n";
+ print $F " \$_{LPFX } = '$LPFX';\n";
+ print $F " \$_{LIBX } = '$LIBX';\n";
+ print $F " \$_{MAJVERS_LIBX } = '" . expand($E_MAJVERS_LIBX) . "';\n";
+ print $F " \$_{VERSION_LIBX } = '" . expand($E_VERSION_LIBX) . "';\n";
+ print $F " \$_{SHLX } = '$SHLX';\n";
+ print $F " \$_{MAJVERS_SHLX } = '" . expand($E_MAJVERS_SHLX) . "';\n";
+ print $F " \$_{VERSION_SHLX } = '" . expand($E_VERSION_SHLX) . "';\n";
+ print $F " \$_{VERSION_EXEX } = '" . expand($E_VERSION_EXEX) . "';\n";
+ print $F " \$_{MAJVERS_EXEX } = '" . expand($E_MAJVERS_EXEX) . "';\n";
+ print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n";
+ if ($PKG{LNG} ne 'PYTHON') {
+ print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n";
+ print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n";
+ } elsif ($OPT{PYTHON_LIB_PATH}) {
+ print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n";
+ }
+ print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n";
+ print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n";
+ print $F " \$_{INST_INCDIR } = '$OPT{'includedir'}';\n";
+ print $F " \$_{INST_BINDIR } = '$OPT{'bindir'}';\n";
+ print $F " \$_{INST_LIBDIR } = '$OPT{'libdir'}';\n";
+ print $F " \$_{INST_JARDIR } = '$OPT{'javadir'}';\n";
+ print $F " \$_{INST_SHAREDIR} = '$OPT{'sharedir'}';\n";
+ print $F "\n";
+ print $F " \@_\n";
+ print $F "}\n";
+ print $F "\n";
+ print $F "1\n";
+
+ close $F;
+ }
}
if (! $OPT{'status'} ) {
@@ -1254,15 +1283,12 @@ sub expand_path {
}
sub find_in_dir {
- my ($dir, $include, $lib, $ilib, $jar, $bin) = @_;
+ my ($dir, $include, $lib, $ilib, $jar, $bin, $src) = @_;
unless (-d $dir) {
-# println "no" unless ($AUTORUN);
println "\t\tnot found $dir" if ($OPT{'debug'});
return;
}
-# print "\t$dir... " unless ($AUTORUN);
-# print "[found] " if ($OPT{'debug'});
- my ($found_inc, $found_lib, $found_ilib);
+ my ($found_inc, $found_lib, $found_ilib, $found_src);
if ($include) {
print "\tincludes... " unless ($AUTORUN);
if (-e "$dir/$include") {
@@ -1280,7 +1306,6 @@ sub find_in_dir {
}
}
if ($lib || $ilib) {
-# print "\n\t" if ($nl && !$AUTORUN);
print "\tlibraries... " unless ($AUTORUN);
if ($lib) {
my $builddir = File::Spec->catdir($dir, $OS, $TOOLS, $ARCH, $BUILD);
@@ -1372,7 +1397,15 @@ sub find_in_dir {
$found_lib = $try;
}
}
- return ($found_inc, $found_lib, $found_ilib);
+ if ($src) {
+ print "\tsrc... " unless ($AUTORUN);
+ my $try = "$dir/$src";
+ if (-e "$try") {
+ println $dir unless ($AUTORUN);
+ $found_src = $dir;
+ }
+ }
+ return ($found_inc, $found_lib, $found_ilib, $found_src);
}
sub reverse_build {
@@ -1410,6 +1443,15 @@ sub check_no_array_bounds {
check_compiler('O', '-Wno-array-bounds');
}
+sub check_static_libstdcpp {
+ my $option = '-static-libstdc++';
+ my $save = $TOOLS;
+ $TOOLS = $CPP;
+ $_ = check_compiler('O', $option);
+ $TOOLS = $save;
+ $_ ? $option : ''
+}
+
sub find_lib {
check_compiler('L', @_);
}
@@ -1421,7 +1463,7 @@ sub check_compiler {
if ($t eq 'L') {
print "checking for $n library... ";
} elsif ($t eq 'O') {
- if ($tool && $tool =~ /gcc$/) {
+ if ($tool && ($tool =~ /gcc$/ || $tool =~ /g\+\+$/)) {
print "checking whether $tool accepts $n... ";
} else {
return;
@@ -1452,7 +1494,8 @@ sub check_compiler {
$library = '-lmagic';
$log = '#include <magic.h> \n int main() { magic_open (0); }\n'
} elsif ($n eq 'xml2') {
- $library = '-lxml2';
+ $library = '-lxml2';
+ $library .= ' -liconv' if ($OS eq 'mac');
$log = '#include <libxml/xmlreader.h>\n' .
'int main() { xmlInitParser ( ); }\n'
} else {
@@ -1504,7 +1547,6 @@ sub check {
die "No PACKAGE_NAME" unless PACKAGE_NAME();
die "No PACKAGE_NAMW" unless PACKAGE_NAMW();
die "No PACKAGE_TYPE" unless PACKAGE_TYPE();
- die "No VERSION" unless VERSION();
my %PKG = PKG();
diff --git a/ngs-java/setup/package.prl b/ngs-java/setup/package.prl
index e19caa3..82f92a8 100644
--- a/ngs-java/setup/package.prl
+++ b/ngs-java/setup/package.prl
@@ -1,6 +1,5 @@
################################################################################
sub PACKAGE { 'ngs-java' }
-sub VERSION { '1.2.4' }
sub PACKAGE_TYPE { 'J' }
sub PACKAGE_NAME { 'NGS-JAVA' }
sub PACKAGE_NAMW { 'NGS_JAVA' }
diff --git a/ngs-python/.gitignore b/ngs-python/.gitignore
index 70d522b..9ec2861 100644
--- a/ngs-python/.gitignore
+++ b/ngs-python/.gitignore
@@ -1,5 +1,6 @@
*.pyc
/build
+/ld.linux.exe_cmd.sh
/Makefile.userconfig
/Makefile.config*
/reconfigure
diff --git a/ngs-bam/Makefile b/ngs-python/Makefile.vers
similarity index 77%
copy from ngs-bam/Makefile
copy to ngs-python/Makefile.vers
index 210fbbf..4fc7e20 100644
--- a/ngs-bam/Makefile
+++ b/ngs-python/Makefile.vers
@@ -22,24 +22,5 @@
#
# ===========================================================================
-# default response to "make"
-default: std
-
-# the sub-targets
-SUBDIRS = \
-
-SUBTARGS = \
-
-include $(CURDIR)/Makefile.rules
-
-std: Makefile.config
- @ $(MAKE) -f Makefile.libs std
-
-clean: Makefile.config
- @ $(MAKE) -f Makefile.libs clean
-
-install: Makefile.config
- @ $(MAKE) -f Makefile.libs
- @ perl $(TOP)/setup/install
-
-.PHONY: std clean install
+# NGS-PYTHON and library version
+VERSION = 1.2.5
diff --git a/ngs-python/setup/konfigure.perl b/ngs-python/setup/konfigure.perl
index fe8d17c..a05ab22 100644
--- a/ngs-python/setup/konfigure.perl
+++ b/ngs-python/setup/konfigure.perl
@@ -203,6 +203,14 @@ unless ($OSTYPE =~ /linux/i || $OSTYPE =~ /darwin/i || $OSTYPE eq 'win') {
exit 1;
}
+my $OS_DISTRIBUTOR = '';
+if ($OS eq 'linux') {
+ print "checking OS distributor... " unless ($AUTORUN);
+ $OS_DISTRIBUTOR = `lsb_release -si 2> /dev/null`;
+ chomp $OS_DISTRIBUTOR;
+ println $OS_DISTRIBUTOR unless ($AUTORUN);
+}
+
print "checking machine architecture... " unless ($AUTORUN);
println $MARCH unless ($AUTORUN);
unless ($MARCH =~ /x86_64/i || $MARCH =~ /i?86/i) {
@@ -284,10 +292,6 @@ $INS_MAKEFILE = File::Spec->catdir(CONFIG_OUT(), "$INS_MAKEFILE.$OS.$ARCH.prl");
my $TOOLS = "";
$TOOLS = "jdk" if ($PKG{LNG} eq 'JAVA');
-print "checking $PACKAGE_NAME version... " unless ($AUTORUN);
-my $FULL_VERSION = VERSION();
-println $FULL_VERSION unless ($AUTORUN);
-
# determine architecture
print "checking for supported architecture... " unless ($AUTORUN);
@@ -424,6 +428,11 @@ if ($TOOLS =~ /gcc$/ && check_no_array_bounds()) {
$NO_ARRAY_BOUNDS_WARNING = '-Wno-array-bounds';
}
+my $STATIC_LIBSTDCPP = '';
+if ($TOOLS =~ /gcc$/) {
+ $STATIC_LIBSTDCPP = check_static_libstdcpp();
+}
+
my @dependencies;
my %DEPEND_OPTIONS;
@@ -464,7 +473,8 @@ foreach my $href (@REQ) {
$href->{locbldpath} = expand($href->{locbldpath}) if ($href->{locbldpath});
# found directories
- my ($found_itf, $found_bin, $found_lib, $found_ilib, $found_jar);
+ my
+ ($found_itf, $found_bin, $found_lib, $found_ilib, $found_jar, $found_src);
my %a = %$href;
next if ($a{option} && $DEPEND_OPTIONS{$a{option}});
@@ -477,8 +487,8 @@ foreach my $href (@REQ) {
my $need_itf = ! ($a{type} =~ /D/ || $a{type} =~ /E/ || $a{type} =~ /J/);
my $need_jar = $a{type} =~ /J/;
- my ($bin, $inc, $lib, $ilib)
- = ($a{bin}, $a{include}, $a{lib}); # file names to check
+ my ($bin, $inc, $lib, $ilib, $src)
+ = ($a{bin}, $a{include}, $a{lib}, undef, $a{src}); # file names to check
$lib = '' unless ($lib);
$lib = expand($lib);
@@ -520,7 +530,8 @@ foreach my $href (@REQ) {
undef $il;
++$has_option{sources};
}
- my ($fi, $fl, $fil) = find_in_dir($try, $i, $l, $il);
+ my ($fi, $fl, $fil)
+ = find_in_dir($try, $i, $l, $il, undef, undef, $src);
if ($fi || $fl || $fil) {
$found_itf = $fi if (! $found_itf && $fi);
$found_lib = $fl if (! $found_lib && $fl);
@@ -541,7 +552,8 @@ foreach my $href (@REQ) {
}
if (! $found_itf && ! $has_option{sources} && $a{srcpath}) {
my $try = $a{srcpath};
- ($found_itf) = find_in_dir($try, $inc);
+ ($found_itf, undef, undef, $found_src)
+ = find_in_dir($try, $inc, undef, undef, undef, undef, $src);
}
if (! $has_option{prefix}) {
my $try = $a{pkgpath};
@@ -668,6 +680,11 @@ foreach my $href (@REQ) {
push(@dependencies, "$a{aname}_INCDIR = $found_itf");
println "includes: $found_itf";
}
+ if ($found_src) {
+ $found_src = abs_path($found_src);
+ push(@dependencies, "$a{aname}_SRCDIR = $found_src");
+ println "sources: $found_src";
+ }
if ($found_lib) {
$found_lib = abs_path($found_lib);
if ($a{aname} eq 'NGS' || $a{aname} eq 'VDB') {
@@ -699,8 +716,8 @@ foreach my $href (@REQ) {
}
}
-my ($E_BINDIR, $E_LIBDIR, $VERSION, $MAJVERS, $E_VERSION_LIBX, $E_MAJVERS_LIBX,
- $E_VERSION_EXEX, $E_MAJVERS_EXEX)
+my ($E_BINDIR, $E_LIBDIR, $E_VERSION_LIBX, $E_MAJVERS_LIBX,
+ $E_VERSION_EXEX, $E_MAJVERS_EXEX)
= ('' , '');
println unless ($AUTORUN);
@@ -714,6 +731,14 @@ if ($OS ne 'win' && ! $OPT{'status'}) {
close F;
}
+ if ($TOOLS =~ /gcc$/) {
+ my $EXECMDF = File::Spec->catdir(CONFIG_OUT(), 'ld.linux.exe_cmd.sh');
+ println "configure: creating '$EXECMDF'" unless ($AUTORUN);
+ open F, ">$EXECMDF" or die "cannot open $EXECMDF to write";
+ print F "EXE_CMD=\"\$LD $STATIC_LIBSTDCPP -static-libgcc\"\n";
+ close F;
+ }
+
# create Makefile.config
println "configure: creating '$OUT_MAKEFILE'" unless ($AUTORUN);
open my $F, ">$OUT_MAKEFILE" or die "cannot open $OUT_MAKEFILE to write";
@@ -773,6 +798,7 @@ BUILD = $BUILD
# target OS
OS = $OS
OSINC = $OSINC
+OS_DISTRIBUTOR = $OS_DISTRIBUTOR
# prefix string for system libraries
LPFX = $LPFX
@@ -866,23 +892,14 @@ EndText
L($F, "NO_ARRAY_BOUNDS_WARNING = $NO_ARRAY_BOUNDS_WARNING");
L($F);
- # version information
-
- my $MAJMIN;
-
- if ($FULL_VERSION =~ /(\d+)\.(\d+)\.(\d+)-?\w*\d*/) {
- $VERSION = "$1.$2.$3";
- $MAJMIN = "$1.$2";
- $MAJVERS = $1;
- } else {
- die $VERSION;
- }
-
print $F <<EndText;
-# $PACKAGE_NAME and library version
-VERSION = $VERSION
-MAJMIN = $MAJMIN
-MAJVERS = $MAJVERS
+# \$(VERSION) is defined in a separate file which is updated every release
+include \$(TOP)/Makefile.vers
+
+empty :=
+space := \$(empty) \$(empty)
+MAJMIN = \$(subst \$(space),.,\$(wordlist 1,2,\$(subst .,\$(space),\$(VERSION))))
+MAJVERS = \$(firstword \$(subst .,\$(space),\$(VERSION)))
# output path
BUILD_PREFIX = $BUILD_PREFIX
@@ -974,6 +991,14 @@ EndText
L($F, $_) foreach (@dependencies);
L($F);
+ # pass HAVE_XML2 to build scripts
+ L($F, 'ifeq (,$(HAVE_XML2))');
+ L($F, ' HAVE_XML2=0');
+ L($F, 'endif');
+ L($F, 'CONFIGURE_FOUND_XML2=$(HAVE_XML2)');
+ L($F, 'export CONFIGURE_FOUND_XML2');
+ L($F);
+
if ($OS eq 'linux' || $OS eq 'mac') {
L($F, '# installation rules');
L($F,
@@ -1040,50 +1065,54 @@ EndText
}
close $F;
- # create Makefile.config.install
- println "configure: creating '$INS_MAKEFILE'" unless ($AUTORUN);
- open $F, ">$INS_MAKEFILE" or die "cannot open $INS_MAKEFILE to write";
-
- $OPT{'javadir' } = '' unless ($OPT{'javadir' });
- $OPT{'sharedir'} = '' unless ($OPT{'sharedir'});
-
- print $F "sub CONFIGURE {\n";
- print $F " \$_{PACKAGE_NAME } = '$PACKAGE_NAME';\n";
- print $F " \$_{VERSION } = '$VERSION';\n";
- print $F " \$_{LNG } = '$PKG{LNG}';\n";
- print $F " \$_{OS } = '$OS';\n";
- print $F " \$_{BITS } = $BITS;\n";
- print $F " \$_{MAJVERS } = $MAJVERS;\n";
- print $F " \$_{LPFX } = '$LPFX';\n";
- print $F " \$_{LIBX } = '$LIBX';\n";
- print $F " \$_{MAJVERS_LIBX } = '" . expand($E_MAJVERS_LIBX) . "';\n";
- print $F " \$_{VERSION_LIBX } = '" . expand($E_VERSION_LIBX) . "';\n";
- print $F " \$_{SHLX } = '$SHLX';\n";
- print $F " \$_{MAJVERS_SHLX } = '" . expand($E_MAJVERS_SHLX) . "';\n";
- print $F " \$_{VERSION_SHLX } = '" . expand($E_VERSION_SHLX) . "';\n";
- print $F " \$_{VERSION_EXEX } = '" . expand($E_VERSION_EXEX) . "';\n";
- print $F " \$_{MAJVERS_EXEX } = '" . expand($E_MAJVERS_EXEX) . "';\n";
- print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n";
- if ($PKG{LNG} ne 'PYTHON') {
- print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n";
- print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n";
- } elsif ($OPT{PYTHON_LIB_PATH}) {
- print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n";
- }
- print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n";
- print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n";
- print $F " \$_{INST_INCDIR } = '$OPT{'includedir'}';\n";
- print $F " \$_{INST_BINDIR } = '$OPT{'bindir'}';\n";
- print $F " \$_{INST_LIBDIR } = '$OPT{'libdir'}';\n";
- print $F " \$_{INST_JARDIR } = '$OPT{'javadir'}';\n";
- print $F " \$_{INST_SHAREDIR} = '$OPT{'sharedir'}';\n";
- print $F "\n";
- print $F " \@_\n";
- print $F "}\n";
- print $F "\n";
- print $F "1\n";
-
- close $F;
+ # creation of Makefile.config.install is disabled, since nobody uses it now
+ # and I need to remove versions from prl scripts
+ if (0) {
+ # create Makefile.config.install
+ println "configure: creating '$INS_MAKEFILE'" unless ($AUTORUN);
+ open $F, ">$INS_MAKEFILE" or die "cannot open $INS_MAKEFILE to write";
+
+ $OPT{'javadir' } = '' unless ($OPT{'javadir' });
+ $OPT{'sharedir'} = '' unless ($OPT{'sharedir'});
+
+ print $F "sub CONFIGURE {\n";
+ print $F " \$_{PACKAGE_NAME } = '$PACKAGE_NAME';\n";
+ print $F " \$_{VERSION } = '\$VERSION';\n";
+ print $F " \$_{LNG } = '$PKG{LNG}';\n";
+ print $F " \$_{OS } = '$OS';\n";
+ print $F " \$_{BITS } = $BITS;\n";
+ print $F " \$_{MAJVERS } = \$MAJVERS;\n";
+ print $F " \$_{LPFX } = '$LPFX';\n";
+ print $F " \$_{LIBX } = '$LIBX';\n";
+ print $F " \$_{MAJVERS_LIBX } = '" . expand($E_MAJVERS_LIBX) . "';\n";
+ print $F " \$_{VERSION_LIBX } = '" . expand($E_VERSION_LIBX) . "';\n";
+ print $F " \$_{SHLX } = '$SHLX';\n";
+ print $F " \$_{MAJVERS_SHLX } = '" . expand($E_MAJVERS_SHLX) . "';\n";
+ print $F " \$_{VERSION_SHLX } = '" . expand($E_VERSION_SHLX) . "';\n";
+ print $F " \$_{VERSION_EXEX } = '" . expand($E_VERSION_EXEX) . "';\n";
+ print $F " \$_{MAJVERS_EXEX } = '" . expand($E_MAJVERS_EXEX) . "';\n";
+ print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n";
+ if ($PKG{LNG} ne 'PYTHON') {
+ print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n";
+ print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n";
+ } elsif ($OPT{PYTHON_LIB_PATH}) {
+ print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n";
+ }
+ print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n";
+ print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n";
+ print $F " \$_{INST_INCDIR } = '$OPT{'includedir'}';\n";
+ print $F " \$_{INST_BINDIR } = '$OPT{'bindir'}';\n";
+ print $F " \$_{INST_LIBDIR } = '$OPT{'libdir'}';\n";
+ print $F " \$_{INST_JARDIR } = '$OPT{'javadir'}';\n";
+ print $F " \$_{INST_SHAREDIR} = '$OPT{'sharedir'}';\n";
+ print $F "\n";
+ print $F " \@_\n";
+ print $F "}\n";
+ print $F "\n";
+ print $F "1\n";
+
+ close $F;
+ }
}
if (! $OPT{'status'} ) {
@@ -1254,15 +1283,12 @@ sub expand_path {
}
sub find_in_dir {
- my ($dir, $include, $lib, $ilib, $jar, $bin) = @_;
+ my ($dir, $include, $lib, $ilib, $jar, $bin, $src) = @_;
unless (-d $dir) {
-# println "no" unless ($AUTORUN);
println "\t\tnot found $dir" if ($OPT{'debug'});
return;
}
-# print "\t$dir... " unless ($AUTORUN);
-# print "[found] " if ($OPT{'debug'});
- my ($found_inc, $found_lib, $found_ilib);
+ my ($found_inc, $found_lib, $found_ilib, $found_src);
if ($include) {
print "\tincludes... " unless ($AUTORUN);
if (-e "$dir/$include") {
@@ -1280,7 +1306,6 @@ sub find_in_dir {
}
}
if ($lib || $ilib) {
-# print "\n\t" if ($nl && !$AUTORUN);
print "\tlibraries... " unless ($AUTORUN);
if ($lib) {
my $builddir = File::Spec->catdir($dir, $OS, $TOOLS, $ARCH, $BUILD);
@@ -1372,7 +1397,15 @@ sub find_in_dir {
$found_lib = $try;
}
}
- return ($found_inc, $found_lib, $found_ilib);
+ if ($src) {
+ print "\tsrc... " unless ($AUTORUN);
+ my $try = "$dir/$src";
+ if (-e "$try") {
+ println $dir unless ($AUTORUN);
+ $found_src = $dir;
+ }
+ }
+ return ($found_inc, $found_lib, $found_ilib, $found_src);
}
sub reverse_build {
@@ -1410,6 +1443,15 @@ sub check_no_array_bounds {
check_compiler('O', '-Wno-array-bounds');
}
+sub check_static_libstdcpp {
+ my $option = '-static-libstdc++';
+ my $save = $TOOLS;
+ $TOOLS = $CPP;
+ $_ = check_compiler('O', $option);
+ $TOOLS = $save;
+ $_ ? $option : ''
+}
+
sub find_lib {
check_compiler('L', @_);
}
@@ -1421,7 +1463,7 @@ sub check_compiler {
if ($t eq 'L') {
print "checking for $n library... ";
} elsif ($t eq 'O') {
- if ($tool && $tool =~ /gcc$/) {
+ if ($tool && ($tool =~ /gcc$/ || $tool =~ /g\+\+$/)) {
print "checking whether $tool accepts $n... ";
} else {
return;
@@ -1452,7 +1494,8 @@ sub check_compiler {
$library = '-lmagic';
$log = '#include <magic.h> \n int main() { magic_open (0); }\n'
} elsif ($n eq 'xml2') {
- $library = '-lxml2';
+ $library = '-lxml2';
+ $library .= ' -liconv' if ($OS eq 'mac');
$log = '#include <libxml/xmlreader.h>\n' .
'int main() { xmlInitParser ( ); }\n'
} else {
@@ -1504,7 +1547,6 @@ sub check {
die "No PACKAGE_NAME" unless PACKAGE_NAME();
die "No PACKAGE_NAMW" unless PACKAGE_NAMW();
die "No PACKAGE_TYPE" unless PACKAGE_TYPE();
- die "No VERSION" unless VERSION();
my %PKG = PKG();
diff --git a/ngs-python/setup/package.prl b/ngs-python/setup/package.prl
index 17135ee..71b45db 100644
--- a/ngs-python/setup/package.prl
+++ b/ngs-python/setup/package.prl
@@ -1,6 +1,5 @@
################################################################################
sub PACKAGE { 'ngs-python' }
-sub VERSION { '1.2.4' }
sub PACKAGE_TYPE { 'P' }
sub PACKAGE_NAME { 'NGS-PYTHON' }
sub PACKAGE_NAMW { 'NGS_PYTHON' }
diff --git a/ngs-sdk/.gitignore b/ngs-sdk/.gitignore
index 966470c..90761e1 100644
--- a/ngs-sdk/.gitignore
+++ b/ngs-sdk/.gitignore
@@ -1,4 +1,5 @@
*.o
+/ld.linux.exe_cmd.sh
/Makefile.config*
/Makefile.userconfig
/reconfigure
diff --git a/ngs-sdk/Makefile b/ngs-sdk/Makefile
index c774590..e963e9e 100644
--- a/ngs-sdk/Makefile
+++ b/ngs-sdk/Makefile
@@ -37,7 +37,7 @@ SUBTARGS = \
include $(CURDIR)/Makefile.rules
-sdk-libs: Makefile.config
+sdk-libs: $(SUBDIRS) Makefile.config
@ $(MAKE) -f Makefile.libs
sdk-libs_cln: Makefile.config
diff --git a/ngs-bam/Makefile b/ngs-sdk/Makefile.vers
similarity index 77%
copy from ngs-bam/Makefile
copy to ngs-sdk/Makefile.vers
index 210fbbf..2b4d03f 100644
--- a/ngs-bam/Makefile
+++ b/ngs-sdk/Makefile.vers
@@ -22,24 +22,5 @@
#
# ===========================================================================
-# default response to "make"
-default: std
-
-# the sub-targets
-SUBDIRS = \
-
-SUBTARGS = \
-
-include $(CURDIR)/Makefile.rules
-
-std: Makefile.config
- @ $(MAKE) -f Makefile.libs std
-
-clean: Makefile.config
- @ $(MAKE) -f Makefile.libs clean
-
-install: Makefile.config
- @ $(MAKE) -f Makefile.libs
- @ perl $(TOP)/setup/install
-
-.PHONY: std clean install
+# NGS-SDK and library version
+VERSION = 1.2.5
diff --git a/ngs-sdk/dispatch/version.h b/ngs-sdk/dispatch/version.h
index a9291c9..789296f 100644
--- a/ngs-sdk/dispatch/version.h
+++ b/ngs-sdk/dispatch/version.h
@@ -1 +1 @@
-#define NGS_SDK_VERSION "1.2.4"
+#define NGS_SDK_VERSION "1.2.5"
diff --git a/ngs-sdk/language/java/jni_String.cpp b/ngs-sdk/language/java/jni_String.cpp
index 984da44..89cf08f 100644
--- a/ngs-sdk/language/java/jni_String.cpp
+++ b/ngs-sdk/language/java/jni_String.cpp
@@ -123,11 +123,17 @@ jstring StringItfCopyToJString ( const ngs :: StringItf * self, JNIEnv * jenv )
at least when it comes to UTF-8 character sets... */
/* an awful, but effective, test to see if the string
- is already NUL terminated. */
+ is already NUL terminated:
+ 1. we assume that buffer SIZE is aligned to 12 bits
+ 2. we check if string size is less than buffer size,
+ i.e. if data[size] belongs buffer of not
+ 3. if data[size] belongs to the buffer,
+ we can check if string is followed by NULL byte */
if ( ( ( ( size_t ) & data [ size ] ) & 0xFFF ) != 0 )
{
/* we can read this address without fear of a seg-fault.
- if it's NUL, then we can send the string in directly. */
+ if it's NUL, then we can send the string in directly.
+ NB: valgrind may complain about this line, but it is okay */
if ( data [ size ] == 0 )
return jenv -> NewStringUTF ( data );
}
diff --git a/ngs-sdk/setup/konfigure.perl b/ngs-sdk/setup/konfigure.perl
index fe8d17c..a17309f 100644
--- a/ngs-sdk/setup/konfigure.perl
+++ b/ngs-sdk/setup/konfigure.perl
@@ -203,6 +203,14 @@ unless ($OSTYPE =~ /linux/i || $OSTYPE =~ /darwin/i || $OSTYPE eq 'win') {
exit 1;
}
+my $OS_DISTRIBUTOR = '';
+if ($OS eq 'linux') {
+ print "checking OS distributor... " unless ($AUTORUN);
+ $OS_DISTRIBUTOR = `lsb_release -si 2> /dev/null`;
+ chomp $OS_DISTRIBUTOR;
+ println $OS_DISTRIBUTOR unless ($AUTORUN);
+}
+
print "checking machine architecture... " unless ($AUTORUN);
println $MARCH unless ($AUTORUN);
unless ($MARCH =~ /x86_64/i || $MARCH =~ /i?86/i) {
@@ -284,10 +292,6 @@ $INS_MAKEFILE = File::Spec->catdir(CONFIG_OUT(), "$INS_MAKEFILE.$OS.$ARCH.prl");
my $TOOLS = "";
$TOOLS = "jdk" if ($PKG{LNG} eq 'JAVA');
-print "checking $PACKAGE_NAME version... " unless ($AUTORUN);
-my $FULL_VERSION = VERSION();
-println $FULL_VERSION unless ($AUTORUN);
-
# determine architecture
print "checking for supported architecture... " unless ($AUTORUN);
@@ -424,6 +428,11 @@ if ($TOOLS =~ /gcc$/ && check_no_array_bounds()) {
$NO_ARRAY_BOUNDS_WARNING = '-Wno-array-bounds';
}
+my $STATIC_LIBSTDCPP = '';
+if ($TOOLS =~ /gcc$/) {
+ $STATIC_LIBSTDCPP = check_static_libstdcpp();
+}
+
my @dependencies;
my %DEPEND_OPTIONS;
@@ -464,7 +473,8 @@ foreach my $href (@REQ) {
$href->{locbldpath} = expand($href->{locbldpath}) if ($href->{locbldpath});
# found directories
- my ($found_itf, $found_bin, $found_lib, $found_ilib, $found_jar);
+ my
+ ($found_itf, $found_bin, $found_lib, $found_ilib, $found_jar, $found_src);
my %a = %$href;
next if ($a{option} && $DEPEND_OPTIONS{$a{option}});
@@ -477,8 +487,8 @@ foreach my $href (@REQ) {
my $need_itf = ! ($a{type} =~ /D/ || $a{type} =~ /E/ || $a{type} =~ /J/);
my $need_jar = $a{type} =~ /J/;
- my ($bin, $inc, $lib, $ilib)
- = ($a{bin}, $a{include}, $a{lib}); # file names to check
+ my ($bin, $inc, $lib, $ilib, $src)
+ = ($a{bin}, $a{include}, $a{lib}, undef, $a{src}); # file names to check
$lib = '' unless ($lib);
$lib = expand($lib);
@@ -520,7 +530,8 @@ foreach my $href (@REQ) {
undef $il;
++$has_option{sources};
}
- my ($fi, $fl, $fil) = find_in_dir($try, $i, $l, $il);
+ my ($fi, $fl, $fil)
+ = find_in_dir($try, $i, $l, $il, undef, undef, $src);
if ($fi || $fl || $fil) {
$found_itf = $fi if (! $found_itf && $fi);
$found_lib = $fl if (! $found_lib && $fl);
@@ -541,7 +552,8 @@ foreach my $href (@REQ) {
}
if (! $found_itf && ! $has_option{sources} && $a{srcpath}) {
my $try = $a{srcpath};
- ($found_itf) = find_in_dir($try, $inc);
+ ($found_itf, undef, undef, $found_src)
+ = find_in_dir($try, $inc, undef, undef, undef, undef, $src);
}
if (! $has_option{prefix}) {
my $try = $a{pkgpath};
@@ -668,6 +680,11 @@ foreach my $href (@REQ) {
push(@dependencies, "$a{aname}_INCDIR = $found_itf");
println "includes: $found_itf";
}
+ if ($found_src) {
+ $found_src = abs_path($found_src);
+ push(@dependencies, "$a{aname}_SRCDIR = $found_src");
+ println "sources: $found_src";
+ }
if ($found_lib) {
$found_lib = abs_path($found_lib);
if ($a{aname} eq 'NGS' || $a{aname} eq 'VDB') {
@@ -699,8 +716,8 @@ foreach my $href (@REQ) {
}
}
-my ($E_BINDIR, $E_LIBDIR, $VERSION, $MAJVERS, $E_VERSION_LIBX, $E_MAJVERS_LIBX,
- $E_VERSION_EXEX, $E_MAJVERS_EXEX)
+my ($E_BINDIR, $E_LIBDIR, $E_VERSION_LIBX, $E_MAJVERS_LIBX,
+ $E_VERSION_EXEX, $E_MAJVERS_EXEX)
= ('' , '');
println unless ($AUTORUN);
@@ -714,6 +731,14 @@ if ($OS ne 'win' && ! $OPT{'status'}) {
close F;
}
+ if ($TOOLS =~ /gcc$/) {
+ my $EXECMDF = File::Spec->catdir(CONFIG_OUT(), 'ld.linux.exe_cmd.sh');
+ println "configure: creating '$EXECMDF'" unless ($AUTORUN);
+ open F, ">$EXECMDF" or die "cannot open $EXECMDF to write";
+ print F "EXE_CMD=\"\$LD $STATIC_LIBSTDCPP -static-libgcc\"\n";
+ close F;
+ }
+
# create Makefile.config
println "configure: creating '$OUT_MAKEFILE'" unless ($AUTORUN);
open my $F, ">$OUT_MAKEFILE" or die "cannot open $OUT_MAKEFILE to write";
@@ -773,6 +798,7 @@ BUILD = $BUILD
# target OS
OS = $OS
OSINC = $OSINC
+OS_DISTRIBUTOR = $OS_DISTRIBUTOR
# prefix string for system libraries
LPFX = $LPFX
@@ -866,23 +892,15 @@ EndText
L($F, "NO_ARRAY_BOUNDS_WARNING = $NO_ARRAY_BOUNDS_WARNING");
L($F);
- # version information
-
- my $MAJMIN;
-
- if ($FULL_VERSION =~ /(\d+)\.(\d+)\.(\d+)-?\w*\d*/) {
- $VERSION = "$1.$2.$3";
- $MAJMIN = "$1.$2";
- $MAJVERS = $1;
- } else {
- die $VERSION;
- }
-
print $F <<EndText;
# $PACKAGE_NAME and library version
-VERSION = $VERSION
-MAJMIN = $MAJMIN
-MAJVERS = $MAJVERS
+# \$(VERSION) is defined in a separate file which is updated every release
+include \$(TOP)/Makefile.vers
+
+empty :=
+space := \$(empty) \$(empty)
+MAJMIN = \$(subst \$(space),.,\$(wordlist 1,2,\$(subst .,\$(space),\$(VERSION))))
+MAJVERS = \$(firstword \$(subst .,\$(space),\$(VERSION)))
# output path
BUILD_PREFIX = $BUILD_PREFIX
@@ -974,6 +992,14 @@ EndText
L($F, $_) foreach (@dependencies);
L($F);
+ # pass HAVE_XML2 to build scripts
+ L($F, 'ifeq (,$(HAVE_XML2))');
+ L($F, ' HAVE_XML2=0');
+ L($F, 'endif');
+ L($F, 'CONFIGURE_FOUND_XML2=$(HAVE_XML2)');
+ L($F, 'export CONFIGURE_FOUND_XML2');
+ L($F);
+
if ($OS eq 'linux' || $OS eq 'mac') {
L($F, '# installation rules');
L($F,
@@ -1040,50 +1066,54 @@ EndText
}
close $F;
- # create Makefile.config.install
- println "configure: creating '$INS_MAKEFILE'" unless ($AUTORUN);
- open $F, ">$INS_MAKEFILE" or die "cannot open $INS_MAKEFILE to write";
-
- $OPT{'javadir' } = '' unless ($OPT{'javadir' });
- $OPT{'sharedir'} = '' unless ($OPT{'sharedir'});
-
- print $F "sub CONFIGURE {\n";
- print $F " \$_{PACKAGE_NAME } = '$PACKAGE_NAME';\n";
- print $F " \$_{VERSION } = '$VERSION';\n";
- print $F " \$_{LNG } = '$PKG{LNG}';\n";
- print $F " \$_{OS } = '$OS';\n";
- print $F " \$_{BITS } = $BITS;\n";
- print $F " \$_{MAJVERS } = $MAJVERS;\n";
- print $F " \$_{LPFX } = '$LPFX';\n";
- print $F " \$_{LIBX } = '$LIBX';\n";
- print $F " \$_{MAJVERS_LIBX } = '" . expand($E_MAJVERS_LIBX) . "';\n";
- print $F " \$_{VERSION_LIBX } = '" . expand($E_VERSION_LIBX) . "';\n";
- print $F " \$_{SHLX } = '$SHLX';\n";
- print $F " \$_{MAJVERS_SHLX } = '" . expand($E_MAJVERS_SHLX) . "';\n";
- print $F " \$_{VERSION_SHLX } = '" . expand($E_VERSION_SHLX) . "';\n";
- print $F " \$_{VERSION_EXEX } = '" . expand($E_VERSION_EXEX) . "';\n";
- print $F " \$_{MAJVERS_EXEX } = '" . expand($E_MAJVERS_EXEX) . "';\n";
- print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n";
- if ($PKG{LNG} ne 'PYTHON') {
- print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n";
- print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n";
- } elsif ($OPT{PYTHON_LIB_PATH}) {
- print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n";
- }
- print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n";
- print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n";
- print $F " \$_{INST_INCDIR } = '$OPT{'includedir'}';\n";
- print $F " \$_{INST_BINDIR } = '$OPT{'bindir'}';\n";
- print $F " \$_{INST_LIBDIR } = '$OPT{'libdir'}';\n";
- print $F " \$_{INST_JARDIR } = '$OPT{'javadir'}';\n";
- print $F " \$_{INST_SHAREDIR} = '$OPT{'sharedir'}';\n";
- print $F "\n";
- print $F " \@_\n";
- print $F "}\n";
- print $F "\n";
- print $F "1\n";
-
- close $F;
+ # creation of Makefile.config.install is disabled, since nobody uses it now
+ # and I need to remove versions from prl scripts
+ if (0) {
+ # create Makefile.config.install
+ println "configure: creating '$INS_MAKEFILE'" unless ($AUTORUN);
+ open $F, ">$INS_MAKEFILE" or die "cannot open $INS_MAKEFILE to write";
+
+ $OPT{'javadir' } = '' unless ($OPT{'javadir' });
+ $OPT{'sharedir'} = '' unless ($OPT{'sharedir'});
+
+ print $F "sub CONFIGURE {\n";
+ print $F " \$_{PACKAGE_NAME } = '$PACKAGE_NAME';\n";
+ print $F " \$_{VERSION } = '\$VERSION';\n";
+ print $F " \$_{LNG } = '$PKG{LNG}';\n";
+ print $F " \$_{OS } = '$OS';\n";
+ print $F " \$_{BITS } = $BITS;\n";
+ print $F " \$_{MAJVERS } = \$MAJVERS;\n";
+ print $F " \$_{LPFX } = '$LPFX';\n";
+ print $F " \$_{LIBX } = '$LIBX';\n";
+ print $F " \$_{MAJVERS_LIBX } = '" . expand($E_MAJVERS_LIBX) . "';\n";
+ print $F " \$_{VERSION_LIBX } = '" . expand($E_VERSION_LIBX) . "';\n";
+ print $F " \$_{SHLX } = '$SHLX';\n";
+ print $F " \$_{MAJVERS_SHLX } = '" . expand($E_MAJVERS_SHLX) . "';\n";
+ print $F " \$_{VERSION_SHLX } = '" . expand($E_VERSION_SHLX) . "';\n";
+ print $F " \$_{VERSION_EXEX } = '" . expand($E_VERSION_EXEX) . "';\n";
+ print $F " \$_{MAJVERS_EXEX } = '" . expand($E_MAJVERS_EXEX) . "';\n";
+ print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n";
+ if ($PKG{LNG} ne 'PYTHON') {
+ print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n";
+ print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n";
+ } elsif ($OPT{PYTHON_LIB_PATH}) {
+ print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n";
+ }
+ print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n";
+ print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n";
+ print $F " \$_{INST_INCDIR } = '$OPT{'includedir'}';\n";
+ print $F " \$_{INST_BINDIR } = '$OPT{'bindir'}';\n";
+ print $F " \$_{INST_LIBDIR } = '$OPT{'libdir'}';\n";
+ print $F " \$_{INST_JARDIR } = '$OPT{'javadir'}';\n";
+ print $F " \$_{INST_SHAREDIR} = '$OPT{'sharedir'}';\n";
+ print $F "\n";
+ print $F " \@_\n";
+ print $F "}\n";
+ print $F "\n";
+ print $F "1\n";
+
+ close $F;
+ }
}
if (! $OPT{'status'} ) {
@@ -1254,15 +1284,12 @@ sub expand_path {
}
sub find_in_dir {
- my ($dir, $include, $lib, $ilib, $jar, $bin) = @_;
+ my ($dir, $include, $lib, $ilib, $jar, $bin, $src) = @_;
unless (-d $dir) {
-# println "no" unless ($AUTORUN);
println "\t\tnot found $dir" if ($OPT{'debug'});
return;
}
-# print "\t$dir... " unless ($AUTORUN);
-# print "[found] " if ($OPT{'debug'});
- my ($found_inc, $found_lib, $found_ilib);
+ my ($found_inc, $found_lib, $found_ilib, $found_src);
if ($include) {
print "\tincludes... " unless ($AUTORUN);
if (-e "$dir/$include") {
@@ -1280,7 +1307,6 @@ sub find_in_dir {
}
}
if ($lib || $ilib) {
-# print "\n\t" if ($nl && !$AUTORUN);
print "\tlibraries... " unless ($AUTORUN);
if ($lib) {
my $builddir = File::Spec->catdir($dir, $OS, $TOOLS, $ARCH, $BUILD);
@@ -1372,7 +1398,15 @@ sub find_in_dir {
$found_lib = $try;
}
}
- return ($found_inc, $found_lib, $found_ilib);
+ if ($src) {
+ print "\tsrc... " unless ($AUTORUN);
+ my $try = "$dir/$src";
+ if (-e "$try") {
+ println $dir unless ($AUTORUN);
+ $found_src = $dir;
+ }
+ }
+ return ($found_inc, $found_lib, $found_ilib, $found_src);
}
sub reverse_build {
@@ -1410,6 +1444,15 @@ sub check_no_array_bounds {
check_compiler('O', '-Wno-array-bounds');
}
+sub check_static_libstdcpp {
+ my $option = '-static-libstdc++';
+ my $save = $TOOLS;
+ $TOOLS = $CPP;
+ $_ = check_compiler('O', $option);
+ $TOOLS = $save;
+ $_ ? $option : ''
+}
+
sub find_lib {
check_compiler('L', @_);
}
@@ -1421,7 +1464,7 @@ sub check_compiler {
if ($t eq 'L') {
print "checking for $n library... ";
} elsif ($t eq 'O') {
- if ($tool && $tool =~ /gcc$/) {
+ if ($tool && ($tool =~ /gcc$/ || $tool =~ /g\+\+$/)) {
print "checking whether $tool accepts $n... ";
} else {
return;
@@ -1452,7 +1495,8 @@ sub check_compiler {
$library = '-lmagic';
$log = '#include <magic.h> \n int main() { magic_open (0); }\n'
} elsif ($n eq 'xml2') {
- $library = '-lxml2';
+ $library = '-lxml2';
+ $library .= ' -liconv' if ($OS eq 'mac');
$log = '#include <libxml/xmlreader.h>\n' .
'int main() { xmlInitParser ( ); }\n'
} else {
@@ -1504,7 +1548,6 @@ sub check {
die "No PACKAGE_NAME" unless PACKAGE_NAME();
die "No PACKAGE_NAMW" unless PACKAGE_NAMW();
die "No PACKAGE_TYPE" unless PACKAGE_TYPE();
- die "No VERSION" unless VERSION();
my %PKG = PKG();
diff --git a/ngs-sdk/setup/package.prl b/ngs-sdk/setup/package.prl
index 6348b29..947ba65 100644
--- a/ngs-sdk/setup/package.prl
+++ b/ngs-sdk/setup/package.prl
@@ -1,6 +1,5 @@
################################################################################
sub PACKAGE { 'ngs-sdk' }
-sub VERSION { '1.2.4' }
sub PACKAGE_TYPE { 'L' }
sub PACKAGE_NAME { 'NGS-SDK' }
sub PACKAGE_NAMW { 'NGS' }
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/ngs-sdk.git
More information about the debian-med-commit
mailing list