Codebase list ngs-sdk / 62d125b
Imported Upstream version 1.2.5 Olivier Sallou 7 years ago
23 changed file(s) with 775 addition(s) and 346 deletion(s). Raw diff Collapse all Expand all
2525 The NCBI NGS Software Development Kit
2626 Contact: sra-tools@ncbi.nlm.nih.gov
2727
28 NCBI External Developer Release: NGS SDK 1.2.5
29 July 11, 2016
30
31 blast, kfg, ncbi-vdb, sra-tools, vfs: restored possibility to disable local caching
32 htsjdk: Several JVM crashes related to a number of open files were fixed. New property to disable auto-download was integrated into HTSJDK
33 kfg: When loading configuration files on Windows USERPROFILE environment variable is used before HOME
34 ngs, search, sra-search: sra-search was modified to support multiple threads.
35 ngs-engine, ngs-tools, sra-tools, vfs: The "auxiliary" nodes in configuration are now ignored
36 ngs-engine: Added support for blob-by-blob access to SEQUENCE table
37 ngs-engine: removed a potential memory leak in NGS_CursorMake()
38 ngs: Fixed a bug in ngs::Alignment::getMateReferenceSpec() affecting pre-March 2015 runs
39 ngs: now supports parallel compilation with "make -j N"
40 vfs: environment variable VDB_PWFILE is no longer used
41
42
2843 NCBI External Developer Release: NGS SDK 1.2.4
2944 May 25, 2016
3045
00 # NCBI External Developer Release:
1
2 ## NGS SDK 1.2.5
3 **July 12, 2016**
4
5 **blast, kfg, ncbi-vdb, sra-tools, vfs**: restored possibility to disable local caching
6 **htsjdk**: Several JVM crashes related to a number of open files were fixed. New property to disable auto-download was integrated into HTSJDK
7 **kfg**: When loading configuration files on Windows USERPROFILE environment variable is used before HOME
8 **ngs, search, sra-search**: sra-search was modified to support multiple threads.
9 **ngs-engine, ngs-tools, sra-tools, vfs**: The "auxiliary" nodes in configuration are now ignored
10 **ngs-engine**: Added support for blob-by-blob access to SEQUENCE table
11 **ngs-engine**: removed a potential memory leak in NGS_CursorMake()
12 **ngs**: Fixed a bug in ngs::Alignment::getMateReferenceSpec() affecting pre-March 2015 runs
13 **ngs**: now supports parallel compilation with "make -j N"
14 **vfs**: environment variable VDB_PWFILE is no longer used
15
116
217 ## NGS SDK 1.2.4
318 **May 25, 2016**
419
5 **build**: MSVS 2013 toolset (12.0) is now supported across all repositories
6 **doc, ngs**: updated javadoc to include throws and other missing tags
7 **examples, ngs**: added DumpReferenceFASTA.py example
8 **htsjdk**: added code to HTS-JDK to avoid involving NGS unless we are sure that it is being requested
9 **ngs, ngs-engine**: Added filtering to NGS of secondary alignments that do not have primary alignments
10 **ngs, test**: ngs-python: fixed bug in String processing for Python 3.*
11 **ngs-engine**: ncbi-ngs engine was updated: fixed a bug that made NGS read iterator return 0 reads on WGS accessions.
12 **ngs**: Improved native library load in ngs-java, enhanced its error reporting and added a mode to disable auto-download of native libraries
13 **ngs**: Python code will check for the latest version of the libraries and update if newer ones are available
14 **ngs**: check for the latest version of the libraries and update if newer ones are available
15 **ngs**: simplified ngs-python bindings
20 **build**: MSVS 2013 toolset (12.0) is now supported across all repositories
21 **doc, ngs**: updated javadoc to include throws and other missing tags
22 **examples, ngs**: added DumpReferenceFASTA.py example
23 **htsjdk**: added code to HTS-JDK to avoid involving NGS unless we are sure that it is being requested
24 **ngs, ngs-engine**: Added filtering to NGS of secondary alignments that do not have primary alignments
25 **ngs, test, ngs-python**: fixed bug in String processing for Python 3.x
26 **ngs-engine**: ncbi-ngs engine was updated - fixed a bug that made NGS read iterator return 0 reads on WGS accessions.
27 **ngs**: Improved native library load in ngs-java, enhanced its error reporting and added a mode to disable auto-download of native libraries
28 **ngs**: Python code will check for the latest version of the libraries and update if newer ones are available
29 **ngs**: check for the latest version of the libraries and update if newer ones are available
30 **ngs**: simplified ngs-python bindings
0 /ld.linux.exe_cmd.sh
01 /Makefile.config*
12 /reconfigure
3939
4040 install: Makefile.config
4141 @ $(MAKE) -f Makefile.libs
42 @ perl $(TOP)/setup/install
42 @ $(MAKE) -s --no-print-directory -f Makefile.install install
4343
4444 .PHONY: std clean install
0 # ===========================================================================
1 #
2 # PUBLIC DOMAIN NOTICE
3 # National Center for Biotechnology Information
4 #
5 # This software/database is a "United States Government Work" under the
6 # terms of the United States Copyright Act. It was written as part of
7 # the author's official duties as a United States Government employee and
8 # thus cannot be copyrighted. This software/database is freely available
9 # to the public for use. The National Library of Medicine and the U.S.
10 # Government have not placed any restriction on its use or reproduction.
11 #
12 # Although all reasonable efforts have been taken to ensure the accuracy
13 # and reliability of the software and data, the NLM and the U.S.
14 # Government do not and cannot warrant the performance or results that
15 # may be obtained by using this software or data. The NLM and the U.S.
16 # Government disclaim all warranties, express or implied, including
17 # warranties of performance, merchantability or fitness for any particular
18 # purpose.
19 #
20 # Please cite the author in any work or product based on this material.
21 #
22 # ===========================================================================
23
24 default: install
25
26 TOP ?= $(CURDIR)
27 MODPATH =
28
29 include $(TOP)/Makefile.config
30
31 #-------------------------------------------------------------------------------
32 # install
33 #
34 LIBRARIES_TO_INSTALL = \
35 ngs-bam.$(VERSION_SHLX) \
36 ngs-bam-c++.$(VERSION_LIBX) \
37
38 LIB_TARGET = $(INST_LIBDIR)$(BITS)
39
40 LIBRARIES_WITH_PREFIX = \
41 $(addprefix $(LIB_TARGET)/$(LPFX),$(LIBRARIES_TO_INSTALL))
42
43 copylibs: $(LIB_TARGET)
44 @ echo "Installing libraries to $(LIB_TARGET)"
45 @ $(MAKE) -f Makefile.install $(LIBRARIES_WITH_PREFIX)
46
47 copyincludes:
48 @ echo "Installing includes to $(INST_INCDIR)"
49 @ mkdir -p $(INST_INCDIR)/
50 @ cp -r $(TOP)/ngs-bam $(INST_INCDIR)/
51
52 copyexamples:
53 ifneq ($(INST_SHAREDIR),)
54 @ echo "Installing examples to $(INST_SHAREDIR)"
55 @ mkdir -p $(INST_SHAREDIR)/examples
56 @ $(MAKE) -C $(TOP)/examples install INST_TARGET=$(INST_SHAREDIR)/examples
57 endif
58
59 #fake root for debugging
60 #uncomment this line and change the test for root ( see under install: ) to succeed:
61 #ROOT = ~/root
62
63 INCLUDE_SYMLINK = $(ROOT)/usr/include/ngs-bam
64 PROFILE_FILE = $(ROOT)/etc/profile.d/ngs-bam
65
66 ifeq (linux, $(OS))
67 ifeq (0, $(shell id -u))
68 LINUX_ROOT = true
69 endif
70 endif
71
72 install: copylibs copyincludes copyexamples
73 ifeq (true, $(LINUX_ROOT))
74 @ # install symlink to includes
75 @ echo "Updating $(INCLUDE_SYMLINK)"
76 @ rm -f $(INCLUDE_SYMLINK)
77 @ ln -s $(INST_INCDIR)/ngs-bam $(INCLUDE_SYMLINK)
78 @ #
79 @ echo "Updating $(PROFILE_FILE).[c]sh"
80 @ printf \
81 "#version $(VERSION)\n"\
82 "if ! echo \$$LD_LIBRARY_PATH | /bin/grep -q $(LIB_TARGET)\n"\
83 "then export LD_LIBRARY_PATH=$(LIB_TARGET):\$$LD_LIBRARY_PATH\n"\
84 "fi\n"\
85 "export NGS_LIBDIR=$(LIB_TARGET)\n" \
86 >$(PROFILE_FILE).sh && chmod 644 $(PROFILE_FILE).sh || true;
87 @ printf \
88 "#version $(VERSION)\n"\
89 "echo \$$LD_LIBRARY_PATH | /bin/grep -q $(LIB_TARGET)\n"\
90 "if ( \$$status ) setenv LD_LIBRARY_PATH $(LIB_TARGET):\$$LD_LIBRARY_PATH\n"\
91 "setenv NGS_LIBDIR $(LIB_TARGET)\n" \
92 >$(PROFILE_FILE).csh && chmod 644 $(PROFILE_FILE).csh || true;
93 @ #TODO: check version of the files above
94 @ #
95 @ echo "Use \$$NGS_LIBDIR in your link commands, e.g.:"
96 @ echo " ld -L\$$NGS_LIBDIR -lngs-bam ..."
97 else
98 @ #
99 @ echo "Please add $(LIB_TARGET) to your LD_LIBRARY_PATH, e.g.:"
100 @ echo " export LD_LIBRARY_PATH=$(LIB_TARGET):\$$LD_LIBRARY_PATH"
101 @ #
102 @ echo "Use $(LIB_TARGET) in your link commands, e.g.:"
103 @ echo " export NGS_LIBDIR=$(LIB_TARGET)"
104 @ echo " ld -L\$$NGS_LIBDIR -lngs-bam ..."
105 endif
106
107 TO_UNINSTALL = $(LIB_TARGET)/libngs-bam* $(INST_INCDIR)/ngs-bam $(INST_SHAREDIR)/examples
108 TO_UNINSTALL_AS_ROOT = $(INST_INCDIR)/ngs-bam $(INCLUDE_SYMLINK) $(PROFILE_FILE).*
109
110 uninstall:
111 @ echo "Uninstalling $(TO_UNINSTALL) ..."
112 @ rm -rf $(TO_UNINSTALL)
113 ifeq (true, $(LINUX_ROOT))
114 @ echo "Uninstalling $(TO_UNINSTALL_AS_ROOT) ..."
115 @ rm -rf $(TO_UNINSTALL_AS_ROOT)
116 endif
117 @ echo "done."
118
119 .PHONY: install copylibs copyincludes copyexamples uninstall
120
0 # ===========================================================================
1 #
2 # PUBLIC DOMAIN NOTICE
3 # National Center for Biotechnology Information
4 #
5 # This software/database is a "United States Government Work" under the
6 # terms of the United States Copyright Act. It was written as part of
7 # the author's official duties as a United States Government employee and
8 # thus cannot be copyrighted. This software/database is freely available
9 # to the public for use. The National Library of Medicine and the U.S.
10 # Government have not placed any restriction on its use or reproduction.
11 #
12 # Although all reasonable efforts have been taken to ensure the accuracy
13 # and reliability of the software and data, the NLM and the U.S.
14 # Government do not and cannot warrant the performance or results that
15 # may be obtained by using this software or data. The NLM and the U.S.
16 # Government disclaim all warranties, express or implied, including
17 # warranties of performance, merchantability or fitness for any particular
18 # purpose.
19 #
20 # Please cite the author in any work or product based on this material.
21 #
22 # ===========================================================================
23
24 # NGS-BAM and library version
25 VERSION = 1.2.5
202202 exit 1;
203203 }
204204
205 my $OS_DISTRIBUTOR = '';
206 if ($OS eq 'linux') {
207 print "checking OS distributor... " unless ($AUTORUN);
208 $OS_DISTRIBUTOR = `lsb_release -si 2> /dev/null`;
209 chomp $OS_DISTRIBUTOR;
210 println $OS_DISTRIBUTOR unless ($AUTORUN);
211 }
212
205213 print "checking machine architecture... " unless ($AUTORUN);
206214 println $MARCH unless ($AUTORUN);
207215 unless ($MARCH =~ /x86_64/i || $MARCH =~ /i?86/i) {
282290
283291 my $TOOLS = "";
284292 $TOOLS = "jdk" if ($PKG{LNG} eq 'JAVA');
285
286 print "checking $PACKAGE_NAME version... " unless ($AUTORUN);
287 my $FULL_VERSION = VERSION();
288 println $FULL_VERSION unless ($AUTORUN);
289293
290294 # determine architecture
291295
423427 $NO_ARRAY_BOUNDS_WARNING = '-Wno-array-bounds';
424428 }
425429
430 my $STATIC_LIBSTDCPP = '';
431 if ($TOOLS =~ /gcc$/) {
432 $STATIC_LIBSTDCPP = check_static_libstdcpp();
433 }
434
426435 my @dependencies;
427436
428437 my %DEPEND_OPTIONS;
463472 $href->{locbldpath} = expand($href->{locbldpath}) if ($href->{locbldpath});
464473
465474 # found directories
466 my ($found_itf, $found_bin, $found_lib, $found_ilib, $found_jar);
475 my
476 ($found_itf, $found_bin, $found_lib, $found_ilib, $found_jar, $found_src);
467477
468478 my %a = %$href;
469479 next if ($a{option} && $DEPEND_OPTIONS{$a{option}});
476486 my $need_itf = ! ($a{type} =~ /D/ || $a{type} =~ /E/ || $a{type} =~ /J/);
477487 my $need_jar = $a{type} =~ /J/;
478488
479 my ($bin, $inc, $lib, $ilib)
480 = ($a{bin}, $a{include}, $a{lib}); # file names to check
489 my ($bin, $inc, $lib, $ilib, $src)
490 = ($a{bin}, $a{include}, $a{lib}, undef, $a{src}); # file names to check
481491 $lib = '' unless ($lib);
482492 $lib = expand($lib);
483493
519529 undef $il;
520530 ++$has_option{sources};
521531 }
522 my ($fi, $fl, $fil) = find_in_dir($try, $i, $l, $il);
532 my ($fi, $fl, $fil)
533 = find_in_dir($try, $i, $l, $il, undef, undef, $src);
523534 if ($fi || $fl || $fil) {
524535 $found_itf = $fi if (! $found_itf && $fi);
525536 $found_lib = $fl if (! $found_lib && $fl);
540551 }
541552 if (! $found_itf && ! $has_option{sources} && $a{srcpath}) {
542553 my $try = $a{srcpath};
543 ($found_itf) = find_in_dir($try, $inc);
554 ($found_itf, undef, undef, $found_src)
555 = find_in_dir($try, $inc, undef, undef, undef, undef, $src);
544556 }
545557 if (! $has_option{prefix}) {
546558 my $try = $a{pkgpath};
667679 push(@dependencies, "$a{aname}_INCDIR = $found_itf");
668680 println "includes: $found_itf";
669681 }
682 if ($found_src) {
683 $found_src = abs_path($found_src);
684 push(@dependencies, "$a{aname}_SRCDIR = $found_src");
685 println "sources: $found_src";
686 }
670687 if ($found_lib) {
671688 $found_lib = abs_path($found_lib);
672689 if ($a{aname} eq 'NGS' || $a{aname} eq 'VDB') {
698715 }
699716 }
700717
701 my ($E_BINDIR, $E_LIBDIR, $VERSION, $MAJVERS, $E_VERSION_LIBX, $E_MAJVERS_LIBX,
702 $E_VERSION_EXEX, $E_MAJVERS_EXEX)
718 my ($E_BINDIR, $E_LIBDIR, $E_VERSION_LIBX, $E_MAJVERS_LIBX,
719 $E_VERSION_EXEX, $E_MAJVERS_EXEX)
703720 = ('' , '');
704721
705722 println unless ($AUTORUN);
710727 println "configure: creating '$COMP' ($TOOLS)" unless ($AUTORUN);
711728 open F, ">$COMP" or die "cannot open $COMP to write";
712729 print F "$TOOLS\n";
730 close F;
731 }
732
733 if ($TOOLS =~ /gcc$/) {
734 my $EXECMDF = File::Spec->catdir(CONFIG_OUT(), 'ld.linux.exe_cmd.sh');
735 println "configure: creating '$EXECMDF'" unless ($AUTORUN);
736 open F, ">$EXECMDF" or die "cannot open $EXECMDF to write";
737 print F "EXE_CMD=\"\$LD $STATIC_LIBSTDCPP -static-libgcc\"\n";
713738 close F;
714739 }
715740
772797 # target OS
773798 OS = $OS
774799 OSINC = $OSINC
800 OS_DISTRIBUTOR = $OS_DISTRIBUTOR
775801
776802 # prefix string for system libraries
777803 LPFX = $LPFX
865891 L($F, "NO_ARRAY_BOUNDS_WARNING = $NO_ARRAY_BOUNDS_WARNING");
866892 L($F);
867893
868 # version information
869
870 my $MAJMIN;
871
872 if ($FULL_VERSION =~ /(\d+)\.(\d+)\.(\d+)-?\w*\d*/) {
873 $VERSION = "$1.$2.$3";
874 $MAJMIN = "$1.$2";
875 $MAJVERS = $1;
876 } else {
877 die $VERSION;
878 }
879
880894 print $F <<EndText;
881 # $PACKAGE_NAME and library version
882 VERSION = $VERSION
883 MAJMIN = $MAJMIN
884 MAJVERS = $MAJVERS
895 # \$(VERSION) is defined in a separate file which is updated every release
896 include \$(TOP)/Makefile.vers
897
898 empty :=
899 space := \$(empty) \$(empty)
900 MAJMIN = \$(subst \$(space),.,\$(wordlist 1,2,\$(subst .,\$(space),\$(VERSION))))
901 MAJVERS = \$(firstword \$(subst .,\$(space),\$(VERSION)))
885902
886903 # output path
887904 BUILD_PREFIX = $BUILD_PREFIX
971988 L($F, 'include $(wildcard $(CLSDIR)/*.d)');
972989 }
973990 L($F, $_) foreach (@dependencies);
991 L($F);
992
993 # pass HAVE_XML2 to build scripts
994 L($F, 'ifeq (,$(HAVE_XML2))');
995 L($F, ' HAVE_XML2=0');
996 L($F, 'endif');
997 L($F, 'CONFIGURE_FOUND_XML2=$(HAVE_XML2)');
998 L($F, 'export CONFIGURE_FOUND_XML2');
974999 L($F);
9751000
9761001 if ($OS eq 'linux' || $OS eq 'mac') {
10381063 T($F, ' fi');
10391064 }
10401065 close $F;
1041
1042 # create Makefile.config.install
1043 println "configure: creating '$INS_MAKEFILE'" unless ($AUTORUN);
1044 open $F, ">$INS_MAKEFILE" or die "cannot open $INS_MAKEFILE to write";
1045
1046 $OPT{'javadir' } = '' unless ($OPT{'javadir' });
1047 $OPT{'sharedir'} = '' unless ($OPT{'sharedir'});
1048
1049 print $F "sub CONFIGURE {\n";
1050 print $F " \$_{PACKAGE_NAME } = '$PACKAGE_NAME';\n";
1051 print $F " \$_{VERSION } = '$VERSION';\n";
1052 print $F " \$_{LNG } = '$PKG{LNG}';\n";
1053 print $F " \$_{OS } = '$OS';\n";
1054 print $F " \$_{BITS } = $BITS;\n";
1055 print $F " \$_{MAJVERS } = $MAJVERS;\n";
1056 print $F " \$_{LPFX } = '$LPFX';\n";
1057 print $F " \$_{LIBX } = '$LIBX';\n";
1058 print $F " \$_{MAJVERS_LIBX } = '" . expand($E_MAJVERS_LIBX) . "';\n";
1059 print $F " \$_{VERSION_LIBX } = '" . expand($E_VERSION_LIBX) . "';\n";
1060 print $F " \$_{SHLX } = '$SHLX';\n";
1061 print $F " \$_{MAJVERS_SHLX } = '" . expand($E_MAJVERS_SHLX) . "';\n";
1062 print $F " \$_{VERSION_SHLX } = '" . expand($E_VERSION_SHLX) . "';\n";
1063 print $F " \$_{VERSION_EXEX } = '" . expand($E_VERSION_EXEX) . "';\n";
1064 print $F " \$_{MAJVERS_EXEX } = '" . expand($E_MAJVERS_EXEX) . "';\n";
1065 print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n";
1066 if ($PKG{LNG} ne 'PYTHON') {
1067 print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n";
1068 print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n";
1069 } elsif ($OPT{PYTHON_LIB_PATH}) {
1070 print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n";
1071 }
1072 print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n";
1073 print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n";
1074 print $F " \$_{INST_INCDIR } = '$OPT{'includedir'}';\n";
1075 print $F " \$_{INST_BINDIR } = '$OPT{'bindir'}';\n";
1076 print $F " \$_{INST_LIBDIR } = '$OPT{'libdir'}';\n";
1077 print $F " \$_{INST_JARDIR } = '$OPT{'javadir'}';\n";
1078 print $F " \$_{INST_SHAREDIR} = '$OPT{'sharedir'}';\n";
1079 print $F "\n";
1080 print $F " \@_\n";
1081 print $F "}\n";
1082 print $F "\n";
1083 print $F "1\n";
1084
1085 close $F;
1066
1067 # creation of Makefile.config.install is disabled, since nobody uses it now
1068 # and I need to remove versions from prl scripts
1069 if (0) {
1070 # create Makefile.config.install
1071 println "configure: creating '$INS_MAKEFILE'" unless ($AUTORUN);
1072 open $F, ">$INS_MAKEFILE" or die "cannot open $INS_MAKEFILE to write";
1073
1074 $OPT{'javadir' } = '' unless ($OPT{'javadir' });
1075 $OPT{'sharedir'} = '' unless ($OPT{'sharedir'});
1076
1077 print $F "sub CONFIGURE {\n";
1078 print $F " \$_{PACKAGE_NAME } = '$PACKAGE_NAME';\n";
1079 print $F " \$_{VERSION } = '\$VERSION';\n";
1080 print $F " \$_{LNG } = '$PKG{LNG}';\n";
1081 print $F " \$_{OS } = '$OS';\n";
1082 print $F " \$_{BITS } = $BITS;\n";
1083 print $F " \$_{MAJVERS } = \$MAJVERS;\n";
1084 print $F " \$_{LPFX } = '$LPFX';\n";
1085 print $F " \$_{LIBX } = '$LIBX';\n";
1086 print $F " \$_{MAJVERS_LIBX } = '" . expand($E_MAJVERS_LIBX) . "';\n";
1087 print $F " \$_{VERSION_LIBX } = '" . expand($E_VERSION_LIBX) . "';\n";
1088 print $F " \$_{SHLX } = '$SHLX';\n";
1089 print $F " \$_{MAJVERS_SHLX } = '" . expand($E_MAJVERS_SHLX) . "';\n";
1090 print $F " \$_{VERSION_SHLX } = '" . expand($E_VERSION_SHLX) . "';\n";
1091 print $F " \$_{VERSION_EXEX } = '" . expand($E_VERSION_EXEX) . "';\n";
1092 print $F " \$_{MAJVERS_EXEX } = '" . expand($E_MAJVERS_EXEX) . "';\n";
1093 print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n";
1094 if ($PKG{LNG} ne 'PYTHON') {
1095 print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n";
1096 print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n";
1097 } elsif ($OPT{PYTHON_LIB_PATH}) {
1098 print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n";
1099 }
1100 print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n";
1101 print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n";
1102 print $F " \$_{INST_INCDIR } = '$OPT{'includedir'}';\n";
1103 print $F " \$_{INST_BINDIR } = '$OPT{'bindir'}';\n";
1104 print $F " \$_{INST_LIBDIR } = '$OPT{'libdir'}';\n";
1105 print $F " \$_{INST_JARDIR } = '$OPT{'javadir'}';\n";
1106 print $F " \$_{INST_SHAREDIR} = '$OPT{'sharedir'}';\n";
1107 print $F "\n";
1108 print $F " \@_\n";
1109 print $F "}\n";
1110 print $F "\n";
1111 print $F "1\n";
1112
1113 close $F;
1114 }
10861115 }
10871116
10881117 if (! $OPT{'status'} ) {
12531282 }
12541283
12551284 sub find_in_dir {
1256 my ($dir, $include, $lib, $ilib, $jar, $bin) = @_;
1285 my ($dir, $include, $lib, $ilib, $jar, $bin, $src) = @_;
12571286 unless (-d $dir) {
1258 # println "no" unless ($AUTORUN);
12591287 println "\t\tnot found $dir" if ($OPT{'debug'});
12601288 return;
12611289 }
1262 # print "\t$dir... " unless ($AUTORUN);
1263 # print "[found] " if ($OPT{'debug'});
1264 my ($found_inc, $found_lib, $found_ilib);
1290 my ($found_inc, $found_lib, $found_ilib, $found_src);
12651291 if ($include) {
12661292 print "\tincludes... " unless ($AUTORUN);
12671293 if (-e "$dir/$include") {
12791305 }
12801306 }
12811307 if ($lib || $ilib) {
1282 # print "\n\t" if ($nl && !$AUTORUN);
12831308 print "\tlibraries... " unless ($AUTORUN);
12841309 if ($lib) {
12851310 my $builddir = File::Spec->catdir($dir, $OS, $TOOLS, $ARCH, $BUILD);
13711396 $found_lib = $try;
13721397 }
13731398 }
1374 return ($found_inc, $found_lib, $found_ilib);
1399 if ($src) {
1400 print "\tsrc... " unless ($AUTORUN);
1401 my $try = "$dir/$src";
1402 if (-e "$try") {
1403 println $dir unless ($AUTORUN);
1404 $found_src = $dir;
1405 }
1406 }
1407 return ($found_inc, $found_lib, $found_ilib, $found_src);
13751408 }
13761409
13771410 sub reverse_build {
14091442 check_compiler('O', '-Wno-array-bounds');
14101443 }
14111444
1445 sub check_static_libstdcpp {
1446 my $option = '-static-libstdc++';
1447 my $save = $TOOLS;
1448 $TOOLS = $CPP;
1449 $_ = check_compiler('O', $option);
1450 $TOOLS = $save;
1451 $_ ? $option : ''
1452 }
1453
14121454 sub find_lib {
14131455 check_compiler('L', @_);
14141456 }
14201462 if ($t eq 'L') {
14211463 print "checking for $n library... ";
14221464 } elsif ($t eq 'O') {
1423 if ($tool && $tool =~ /gcc$/) {
1465 if ($tool && ($tool =~ /gcc$/ || $tool =~ /g\+\+$/)) {
14241466 print "checking whether $tool accepts $n... ";
14251467 } else {
14261468 return;
14511493 $library = '-lmagic';
14521494 $log = '#include <magic.h> \n int main() { magic_open (0); }\n'
14531495 } elsif ($n eq 'xml2') {
1454 $library = '-lxml2';
1496 $library = '-lxml2';
1497 $library .= ' -liconv' if ($OS eq 'mac');
14551498 $log = '#include <libxml/xmlreader.h>\n' .
14561499 'int main() { xmlInitParser ( ); }\n'
14571500 } else {
15031546 die "No PACKAGE_NAME" unless PACKAGE_NAME();
15041547 die "No PACKAGE_NAMW" unless PACKAGE_NAMW();
15051548 die "No PACKAGE_TYPE" unless PACKAGE_TYPE();
1506 die "No VERSION" unless VERSION();
15071549
15081550 my %PKG = PKG();
15091551
00 ################################################################################
11 sub PACKAGE { 'ngs-bam' }
2 sub VERSION { '1.2.4' }
32 sub PACKAGE_TYPE { 'L' }
43 sub PACKAGE_NAME { 'NGS-BAM' }
54 sub PACKAGE_NAMW { 'NGS_BAM' }
0 # ===========================================================================
1 #
2 # PUBLIC DOMAIN NOTICE
3 # National Center for Biotechnology Information
4 #
5 # This software/database is a "United States Government Work" under the
6 # terms of the United States Copyright Act. It was written as part of
7 # the author's official duties as a United States Government employee and
8 # thus cannot be copyrighted. This software/database is freely available
9 # to the public for use. The National Library of Medicine and the U.S.
10 # Government have not placed any restriction on its use or reproduction.
11 #
12 # Although all reasonable efforts have been taken to ensure the accuracy
13 # and reliability of the software and data, the NLM and the U.S.
14 # Government do not and cannot warrant the performance or results that
15 # may be obtained by using this software or data. The NLM and the U.S.
16 # Government disclaim all warranties, express or implied, including
17 # warranties of performance, merchantability or fitness for any particular
18 # purpose.
19 #
20 # Please cite the author in any work or product based on this material.
21 #
22 # ===========================================================================
23
24 # NGS-JAVA and library version
25 VERSION = 1.2.5
2828 class LibDependencies {
2929 final static String NGS_SDK = "ngs-sdk";
3030 final static String NCBI_VDB = "ncbi-vdb";
31 final static String NGS_SDK_VERSION = "1.2.4";
32 final static String NCBI_VDB_VERSION = "2.6.2";
31 final static String NGS_SDK_VERSION = "1.2.5";
32 final static String NCBI_VDB_VERSION = "2.7.0";
3333 }
202202 exit 1;
203203 }
204204
205 my $OS_DISTRIBUTOR = '';
206 if ($OS eq 'linux') {
207 print "checking OS distributor... " unless ($AUTORUN);
208 $OS_DISTRIBUTOR = `lsb_release -si 2> /dev/null`;
209 chomp $OS_DISTRIBUTOR;
210 println $OS_DISTRIBUTOR unless ($AUTORUN);
211 }
212
205213 print "checking machine architecture... " unless ($AUTORUN);
206214 println $MARCH unless ($AUTORUN);
207215 unless ($MARCH =~ /x86_64/i || $MARCH =~ /i?86/i) {
282290
283291 my $TOOLS = "";
284292 $TOOLS = "jdk" if ($PKG{LNG} eq 'JAVA');
285
286 print "checking $PACKAGE_NAME version... " unless ($AUTORUN);
287 my $FULL_VERSION = VERSION();
288 println $FULL_VERSION unless ($AUTORUN);
289293
290294 # determine architecture
291295
423427 $NO_ARRAY_BOUNDS_WARNING = '-Wno-array-bounds';
424428 }
425429
430 my $STATIC_LIBSTDCPP = '';
431 if ($TOOLS =~ /gcc$/) {
432 $STATIC_LIBSTDCPP = check_static_libstdcpp();
433 }
434
426435 my @dependencies;
427436
428437 my %DEPEND_OPTIONS;
463472 $href->{locbldpath} = expand($href->{locbldpath}) if ($href->{locbldpath});
464473
465474 # found directories
466 my ($found_itf, $found_bin, $found_lib, $found_ilib, $found_jar);
475 my
476 ($found_itf, $found_bin, $found_lib, $found_ilib, $found_jar, $found_src);
467477
468478 my %a = %$href;
469479 next if ($a{option} && $DEPEND_OPTIONS{$a{option}});
476486 my $need_itf = ! ($a{type} =~ /D/ || $a{type} =~ /E/ || $a{type} =~ /J/);
477487 my $need_jar = $a{type} =~ /J/;
478488
479 my ($bin, $inc, $lib, $ilib)
480 = ($a{bin}, $a{include}, $a{lib}); # file names to check
489 my ($bin, $inc, $lib, $ilib, $src)
490 = ($a{bin}, $a{include}, $a{lib}, undef, $a{src}); # file names to check
481491 $lib = '' unless ($lib);
482492 $lib = expand($lib);
483493
519529 undef $il;
520530 ++$has_option{sources};
521531 }
522 my ($fi, $fl, $fil) = find_in_dir($try, $i, $l, $il);
532 my ($fi, $fl, $fil)
533 = find_in_dir($try, $i, $l, $il, undef, undef, $src);
523534 if ($fi || $fl || $fil) {
524535 $found_itf = $fi if (! $found_itf && $fi);
525536 $found_lib = $fl if (! $found_lib && $fl);
540551 }
541552 if (! $found_itf && ! $has_option{sources} && $a{srcpath}) {
542553 my $try = $a{srcpath};
543 ($found_itf) = find_in_dir($try, $inc);
554 ($found_itf, undef, undef, $found_src)
555 = find_in_dir($try, $inc, undef, undef, undef, undef, $src);
544556 }
545557 if (! $has_option{prefix}) {
546558 my $try = $a{pkgpath};
667679 push(@dependencies, "$a{aname}_INCDIR = $found_itf");
668680 println "includes: $found_itf";
669681 }
682 if ($found_src) {
683 $found_src = abs_path($found_src);
684 push(@dependencies, "$a{aname}_SRCDIR = $found_src");
685 println "sources: $found_src";
686 }
670687 if ($found_lib) {
671688 $found_lib = abs_path($found_lib);
672689 if ($a{aname} eq 'NGS' || $a{aname} eq 'VDB') {
698715 }
699716 }
700717
701 my ($E_BINDIR, $E_LIBDIR, $VERSION, $MAJVERS, $E_VERSION_LIBX, $E_MAJVERS_LIBX,
702 $E_VERSION_EXEX, $E_MAJVERS_EXEX)
718 my ($E_BINDIR, $E_LIBDIR, $E_VERSION_LIBX, $E_MAJVERS_LIBX,
719 $E_VERSION_EXEX, $E_MAJVERS_EXEX)
703720 = ('' , '');
704721
705722 println unless ($AUTORUN);
710727 println "configure: creating '$COMP' ($TOOLS)" unless ($AUTORUN);
711728 open F, ">$COMP" or die "cannot open $COMP to write";
712729 print F "$TOOLS\n";
730 close F;
731 }
732
733 if ($TOOLS =~ /gcc$/) {
734 my $EXECMDF = File::Spec->catdir(CONFIG_OUT(), 'ld.linux.exe_cmd.sh');
735 println "configure: creating '$EXECMDF'" unless ($AUTORUN);
736 open F, ">$EXECMDF" or die "cannot open $EXECMDF to write";
737 print F "EXE_CMD=\"\$LD $STATIC_LIBSTDCPP -static-libgcc\"\n";
713738 close F;
714739 }
715740
772797 # target OS
773798 OS = $OS
774799 OSINC = $OSINC
800 OS_DISTRIBUTOR = $OS_DISTRIBUTOR
775801
776802 # prefix string for system libraries
777803 LPFX = $LPFX
865891 L($F, "NO_ARRAY_BOUNDS_WARNING = $NO_ARRAY_BOUNDS_WARNING");
866892 L($F);
867893
868 # version information
869
870 my $MAJMIN;
871
872 if ($FULL_VERSION =~ /(\d+)\.(\d+)\.(\d+)-?\w*\d*/) {
873 $VERSION = "$1.$2.$3";
874 $MAJMIN = "$1.$2";
875 $MAJVERS = $1;
876 } else {
877 die $VERSION;
878 }
879
880894 print $F <<EndText;
881 # $PACKAGE_NAME and library version
882 VERSION = $VERSION
883 MAJMIN = $MAJMIN
884 MAJVERS = $MAJVERS
895 # \$(VERSION) is defined in a separate file which is updated every release
896 include \$(TOP)/Makefile.vers
897
898 empty :=
899 space := \$(empty) \$(empty)
900 MAJMIN = \$(subst \$(space),.,\$(wordlist 1,2,\$(subst .,\$(space),\$(VERSION))))
901 MAJVERS = \$(firstword \$(subst .,\$(space),\$(VERSION)))
885902
886903 # output path
887904 BUILD_PREFIX = $BUILD_PREFIX
971988 L($F, 'include $(wildcard $(CLSDIR)/*.d)');
972989 }
973990 L($F, $_) foreach (@dependencies);
991 L($F);
992
993 # pass HAVE_XML2 to build scripts
994 L($F, 'ifeq (,$(HAVE_XML2))');
995 L($F, ' HAVE_XML2=0');
996 L($F, 'endif');
997 L($F, 'CONFIGURE_FOUND_XML2=$(HAVE_XML2)');
998 L($F, 'export CONFIGURE_FOUND_XML2');
974999 L($F);
9751000
9761001 if ($OS eq 'linux' || $OS eq 'mac') {
10391064 }
10401065 close $F;
10411066
1042 # create Makefile.config.install
1043 println "configure: creating '$INS_MAKEFILE'" unless ($AUTORUN);
1044 open $F, ">$INS_MAKEFILE" or die "cannot open $INS_MAKEFILE to write";
1045
1046 $OPT{'javadir' } = '' unless ($OPT{'javadir' });
1047 $OPT{'sharedir'} = '' unless ($OPT{'sharedir'});
1048
1049 print $F "sub CONFIGURE {\n";
1050 print $F " \$_{PACKAGE_NAME } = '$PACKAGE_NAME';\n";
1051 print $F " \$_{VERSION } = '$VERSION';\n";
1052 print $F " \$_{LNG } = '$PKG{LNG}';\n";
1053 print $F " \$_{OS } = '$OS';\n";
1054 print $F " \$_{BITS } = $BITS;\n";
1055 print $F " \$_{MAJVERS } = $MAJVERS;\n";
1056 print $F " \$_{LPFX } = '$LPFX';\n";
1057 print $F " \$_{LIBX } = '$LIBX';\n";
1058 print $F " \$_{MAJVERS_LIBX } = '" . expand($E_MAJVERS_LIBX) . "';\n";
1059 print $F " \$_{VERSION_LIBX } = '" . expand($E_VERSION_LIBX) . "';\n";
1060 print $F " \$_{SHLX } = '$SHLX';\n";
1061 print $F " \$_{MAJVERS_SHLX } = '" . expand($E_MAJVERS_SHLX) . "';\n";
1062 print $F " \$_{VERSION_SHLX } = '" . expand($E_VERSION_SHLX) . "';\n";
1063 print $F " \$_{VERSION_EXEX } = '" . expand($E_VERSION_EXEX) . "';\n";
1064 print $F " \$_{MAJVERS_EXEX } = '" . expand($E_MAJVERS_EXEX) . "';\n";
1065 print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n";
1066 if ($PKG{LNG} ne 'PYTHON') {
1067 print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n";
1068 print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n";
1069 } elsif ($OPT{PYTHON_LIB_PATH}) {
1070 print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n";
1071 }
1072 print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n";
1073 print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n";
1074 print $F " \$_{INST_INCDIR } = '$OPT{'includedir'}';\n";
1075 print $F " \$_{INST_BINDIR } = '$OPT{'bindir'}';\n";
1076 print $F " \$_{INST_LIBDIR } = '$OPT{'libdir'}';\n";
1077 print $F " \$_{INST_JARDIR } = '$OPT{'javadir'}';\n";
1078 print $F " \$_{INST_SHAREDIR} = '$OPT{'sharedir'}';\n";
1079 print $F "\n";
1080 print $F " \@_\n";
1081 print $F "}\n";
1082 print $F "\n";
1083 print $F "1\n";
1084
1085 close $F;
1067 # creation of Makefile.config.install is disabled, since nobody uses it now
1068 # and I need to remove versions from prl scripts
1069 if (0) {
1070 # create Makefile.config.install
1071 println "configure: creating '$INS_MAKEFILE'" unless ($AUTORUN);
1072 open $F, ">$INS_MAKEFILE" or die "cannot open $INS_MAKEFILE to write";
1073
1074 $OPT{'javadir' } = '' unless ($OPT{'javadir' });
1075 $OPT{'sharedir'} = '' unless ($OPT{'sharedir'});
1076
1077 print $F "sub CONFIGURE {\n";
1078 print $F " \$_{PACKAGE_NAME } = '$PACKAGE_NAME';\n";
1079 print $F " \$_{VERSION } = '\$VERSION';\n";
1080 print $F " \$_{LNG } = '$PKG{LNG}';\n";
1081 print $F " \$_{OS } = '$OS';\n";
1082 print $F " \$_{BITS } = $BITS;\n";
1083 print $F " \$_{MAJVERS } = \$MAJVERS;\n";
1084 print $F " \$_{LPFX } = '$LPFX';\n";
1085 print $F " \$_{LIBX } = '$LIBX';\n";
1086 print $F " \$_{MAJVERS_LIBX } = '" . expand($E_MAJVERS_LIBX) . "';\n";
1087 print $F " \$_{VERSION_LIBX } = '" . expand($E_VERSION_LIBX) . "';\n";
1088 print $F " \$_{SHLX } = '$SHLX';\n";
1089 print $F " \$_{MAJVERS_SHLX } = '" . expand($E_MAJVERS_SHLX) . "';\n";
1090 print $F " \$_{VERSION_SHLX } = '" . expand($E_VERSION_SHLX) . "';\n";
1091 print $F " \$_{VERSION_EXEX } = '" . expand($E_VERSION_EXEX) . "';\n";
1092 print $F " \$_{MAJVERS_EXEX } = '" . expand($E_MAJVERS_EXEX) . "';\n";
1093 print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n";
1094 if ($PKG{LNG} ne 'PYTHON') {
1095 print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n";
1096 print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n";
1097 } elsif ($OPT{PYTHON_LIB_PATH}) {
1098 print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n";
1099 }
1100 print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n";
1101 print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n";
1102 print $F " \$_{INST_INCDIR } = '$OPT{'includedir'}';\n";
1103 print $F " \$_{INST_BINDIR } = '$OPT{'bindir'}';\n";
1104 print $F " \$_{INST_LIBDIR } = '$OPT{'libdir'}';\n";
1105 print $F " \$_{INST_JARDIR } = '$OPT{'javadir'}';\n";
1106 print $F " \$_{INST_SHAREDIR} = '$OPT{'sharedir'}';\n";
1107 print $F "\n";
1108 print $F " \@_\n";
1109 print $F "}\n";
1110 print $F "\n";
1111 print $F "1\n";
1112
1113 close $F;
1114 }
10861115 }
10871116
10881117 if (! $OPT{'status'} ) {
12531282 }
12541283
12551284 sub find_in_dir {
1256 my ($dir, $include, $lib, $ilib, $jar, $bin) = @_;
1285 my ($dir, $include, $lib, $ilib, $jar, $bin, $src) = @_;
12571286 unless (-d $dir) {
1258 # println "no" unless ($AUTORUN);
12591287 println "\t\tnot found $dir" if ($OPT{'debug'});
12601288 return;
12611289 }
1262 # print "\t$dir... " unless ($AUTORUN);
1263 # print "[found] " if ($OPT{'debug'});
1264 my ($found_inc, $found_lib, $found_ilib);
1290 my ($found_inc, $found_lib, $found_ilib, $found_src);
12651291 if ($include) {
12661292 print "\tincludes... " unless ($AUTORUN);
12671293 if (-e "$dir/$include") {
12791305 }
12801306 }
12811307 if ($lib || $ilib) {
1282 # print "\n\t" if ($nl && !$AUTORUN);
12831308 print "\tlibraries... " unless ($AUTORUN);
12841309 if ($lib) {
12851310 my $builddir = File::Spec->catdir($dir, $OS, $TOOLS, $ARCH, $BUILD);
13711396 $found_lib = $try;
13721397 }
13731398 }
1374 return ($found_inc, $found_lib, $found_ilib);
1399 if ($src) {
1400 print "\tsrc... " unless ($AUTORUN);
1401 my $try = "$dir/$src";
1402 if (-e "$try") {
1403 println $dir unless ($AUTORUN);
1404 $found_src = $dir;
1405 }
1406 }
1407 return ($found_inc, $found_lib, $found_ilib, $found_src);
13751408 }
13761409
13771410 sub reverse_build {
14091442 check_compiler('O', '-Wno-array-bounds');
14101443 }
14111444
1445 sub check_static_libstdcpp {
1446 my $option = '-static-libstdc++';
1447 my $save = $TOOLS;
1448 $TOOLS = $CPP;
1449 $_ = check_compiler('O', $option);
1450 $TOOLS = $save;
1451 $_ ? $option : ''
1452 }
1453
14121454 sub find_lib {
14131455 check_compiler('L', @_);
14141456 }
14201462 if ($t eq 'L') {
14211463 print "checking for $n library... ";
14221464 } elsif ($t eq 'O') {
1423 if ($tool && $tool =~ /gcc$/) {
1465 if ($tool && ($tool =~ /gcc$/ || $tool =~ /g\+\+$/)) {
14241466 print "checking whether $tool accepts $n... ";
14251467 } else {
14261468 return;
14511493 $library = '-lmagic';
14521494 $log = '#include <magic.h> \n int main() { magic_open (0); }\n'
14531495 } elsif ($n eq 'xml2') {
1454 $library = '-lxml2';
1496 $library = '-lxml2';
1497 $library .= ' -liconv' if ($OS eq 'mac');
14551498 $log = '#include <libxml/xmlreader.h>\n' .
14561499 'int main() { xmlInitParser ( ); }\n'
14571500 } else {
15031546 die "No PACKAGE_NAME" unless PACKAGE_NAME();
15041547 die "No PACKAGE_NAMW" unless PACKAGE_NAMW();
15051548 die "No PACKAGE_TYPE" unless PACKAGE_TYPE();
1506 die "No VERSION" unless VERSION();
15071549
15081550 my %PKG = PKG();
15091551
00 ################################################################################
11 sub PACKAGE { 'ngs-java' }
2 sub VERSION { '1.2.4' }
32 sub PACKAGE_TYPE { 'J' }
43 sub PACKAGE_NAME { 'NGS-JAVA' }
54 sub PACKAGE_NAMW { 'NGS_JAVA' }
00 *.pyc
11 /build
2 /ld.linux.exe_cmd.sh
23 /Makefile.userconfig
34 /Makefile.config*
45 /reconfigure
0 # ===========================================================================
1 #
2 # PUBLIC DOMAIN NOTICE
3 # National Center for Biotechnology Information
4 #
5 # This software/database is a "United States Government Work" under the
6 # terms of the United States Copyright Act. It was written as part of
7 # the author's official duties as a United States Government employee and
8 # thus cannot be copyrighted. This software/database is freely available
9 # to the public for use. The National Library of Medicine and the U.S.
10 # Government have not placed any restriction on its use or reproduction.
11 #
12 # Although all reasonable efforts have been taken to ensure the accuracy
13 # and reliability of the software and data, the NLM and the U.S.
14 # Government do not and cannot warrant the performance or results that
15 # may be obtained by using this software or data. The NLM and the U.S.
16 # Government disclaim all warranties, express or implied, including
17 # warranties of performance, merchantability or fitness for any particular
18 # purpose.
19 #
20 # Please cite the author in any work or product based on this material.
21 #
22 # ===========================================================================
23
24 # NGS-PYTHON and library version
25 VERSION = 1.2.5
202202 exit 1;
203203 }
204204
205 my $OS_DISTRIBUTOR = '';
206 if ($OS eq 'linux') {
207 print "checking OS distributor... " unless ($AUTORUN);
208 $OS_DISTRIBUTOR = `lsb_release -si 2> /dev/null`;
209 chomp $OS_DISTRIBUTOR;
210 println $OS_DISTRIBUTOR unless ($AUTORUN);
211 }
212
205213 print "checking machine architecture... " unless ($AUTORUN);
206214 println $MARCH unless ($AUTORUN);
207215 unless ($MARCH =~ /x86_64/i || $MARCH =~ /i?86/i) {
282290
283291 my $TOOLS = "";
284292 $TOOLS = "jdk" if ($PKG{LNG} eq 'JAVA');
285
286 print "checking $PACKAGE_NAME version... " unless ($AUTORUN);
287 my $FULL_VERSION = VERSION();
288 println $FULL_VERSION unless ($AUTORUN);
289293
290294 # determine architecture
291295
423427 $NO_ARRAY_BOUNDS_WARNING = '-Wno-array-bounds';
424428 }
425429
430 my $STATIC_LIBSTDCPP = '';
431 if ($TOOLS =~ /gcc$/) {
432 $STATIC_LIBSTDCPP = check_static_libstdcpp();
433 }
434
426435 my @dependencies;
427436
428437 my %DEPEND_OPTIONS;
463472 $href->{locbldpath} = expand($href->{locbldpath}) if ($href->{locbldpath});
464473
465474 # found directories
466 my ($found_itf, $found_bin, $found_lib, $found_ilib, $found_jar);
475 my
476 ($found_itf, $found_bin, $found_lib, $found_ilib, $found_jar, $found_src);
467477
468478 my %a = %$href;
469479 next if ($a{option} && $DEPEND_OPTIONS{$a{option}});
476486 my $need_itf = ! ($a{type} =~ /D/ || $a{type} =~ /E/ || $a{type} =~ /J/);
477487 my $need_jar = $a{type} =~ /J/;
478488
479 my ($bin, $inc, $lib, $ilib)
480 = ($a{bin}, $a{include}, $a{lib}); # file names to check
489 my ($bin, $inc, $lib, $ilib, $src)
490 = ($a{bin}, $a{include}, $a{lib}, undef, $a{src}); # file names to check
481491 $lib = '' unless ($lib);
482492 $lib = expand($lib);
483493
519529 undef $il;
520530 ++$has_option{sources};
521531 }
522 my ($fi, $fl, $fil) = find_in_dir($try, $i, $l, $il);
532 my ($fi, $fl, $fil)
533 = find_in_dir($try, $i, $l, $il, undef, undef, $src);
523534 if ($fi || $fl || $fil) {
524535 $found_itf = $fi if (! $found_itf && $fi);
525536 $found_lib = $fl if (! $found_lib && $fl);
540551 }
541552 if (! $found_itf && ! $has_option{sources} && $a{srcpath}) {
542553 my $try = $a{srcpath};
543 ($found_itf) = find_in_dir($try, $inc);
554 ($found_itf, undef, undef, $found_src)
555 = find_in_dir($try, $inc, undef, undef, undef, undef, $src);
544556 }
545557 if (! $has_option{prefix}) {
546558 my $try = $a{pkgpath};
667679 push(@dependencies, "$a{aname}_INCDIR = $found_itf");
668680 println "includes: $found_itf";
669681 }
682 if ($found_src) {
683 $found_src = abs_path($found_src);
684 push(@dependencies, "$a{aname}_SRCDIR = $found_src");
685 println "sources: $found_src";
686 }
670687 if ($found_lib) {
671688 $found_lib = abs_path($found_lib);
672689 if ($a{aname} eq 'NGS' || $a{aname} eq 'VDB') {
698715 }
699716 }
700717
701 my ($E_BINDIR, $E_LIBDIR, $VERSION, $MAJVERS, $E_VERSION_LIBX, $E_MAJVERS_LIBX,
702 $E_VERSION_EXEX, $E_MAJVERS_EXEX)
718 my ($E_BINDIR, $E_LIBDIR, $E_VERSION_LIBX, $E_MAJVERS_LIBX,
719 $E_VERSION_EXEX, $E_MAJVERS_EXEX)
703720 = ('' , '');
704721
705722 println unless ($AUTORUN);
710727 println "configure: creating '$COMP' ($TOOLS)" unless ($AUTORUN);
711728 open F, ">$COMP" or die "cannot open $COMP to write";
712729 print F "$TOOLS\n";
730 close F;
731 }
732
733 if ($TOOLS =~ /gcc$/) {
734 my $EXECMDF = File::Spec->catdir(CONFIG_OUT(), 'ld.linux.exe_cmd.sh');
735 println "configure: creating '$EXECMDF'" unless ($AUTORUN);
736 open F, ">$EXECMDF" or die "cannot open $EXECMDF to write";
737 print F "EXE_CMD=\"\$LD $STATIC_LIBSTDCPP -static-libgcc\"\n";
713738 close F;
714739 }
715740
772797 # target OS
773798 OS = $OS
774799 OSINC = $OSINC
800 OS_DISTRIBUTOR = $OS_DISTRIBUTOR
775801
776802 # prefix string for system libraries
777803 LPFX = $LPFX
865891 L($F, "NO_ARRAY_BOUNDS_WARNING = $NO_ARRAY_BOUNDS_WARNING");
866892 L($F);
867893
868 # version information
869
870 my $MAJMIN;
871
872 if ($FULL_VERSION =~ /(\d+)\.(\d+)\.(\d+)-?\w*\d*/) {
873 $VERSION = "$1.$2.$3";
874 $MAJMIN = "$1.$2";
875 $MAJVERS = $1;
876 } else {
877 die $VERSION;
878 }
879
880894 print $F <<EndText;
881 # $PACKAGE_NAME and library version
882 VERSION = $VERSION
883 MAJMIN = $MAJMIN
884 MAJVERS = $MAJVERS
895 # \$(VERSION) is defined in a separate file which is updated every release
896 include \$(TOP)/Makefile.vers
897
898 empty :=
899 space := \$(empty) \$(empty)
900 MAJMIN = \$(subst \$(space),.,\$(wordlist 1,2,\$(subst .,\$(space),\$(VERSION))))
901 MAJVERS = \$(firstword \$(subst .,\$(space),\$(VERSION)))
885902
886903 # output path
887904 BUILD_PREFIX = $BUILD_PREFIX
971988 L($F, 'include $(wildcard $(CLSDIR)/*.d)');
972989 }
973990 L($F, $_) foreach (@dependencies);
991 L($F);
992
993 # pass HAVE_XML2 to build scripts
994 L($F, 'ifeq (,$(HAVE_XML2))');
995 L($F, ' HAVE_XML2=0');
996 L($F, 'endif');
997 L($F, 'CONFIGURE_FOUND_XML2=$(HAVE_XML2)');
998 L($F, 'export CONFIGURE_FOUND_XML2');
974999 L($F);
9751000
9761001 if ($OS eq 'linux' || $OS eq 'mac') {
10391064 }
10401065 close $F;
10411066
1042 # create Makefile.config.install
1043 println "configure: creating '$INS_MAKEFILE'" unless ($AUTORUN);
1044 open $F, ">$INS_MAKEFILE" or die "cannot open $INS_MAKEFILE to write";
1045
1046 $OPT{'javadir' } = '' unless ($OPT{'javadir' });
1047 $OPT{'sharedir'} = '' unless ($OPT{'sharedir'});
1048
1049 print $F "sub CONFIGURE {\n";
1050 print $F " \$_{PACKAGE_NAME } = '$PACKAGE_NAME';\n";
1051 print $F " \$_{VERSION } = '$VERSION';\n";
1052 print $F " \$_{LNG } = '$PKG{LNG}';\n";
1053 print $F " \$_{OS } = '$OS';\n";
1054 print $F " \$_{BITS } = $BITS;\n";
1055 print $F " \$_{MAJVERS } = $MAJVERS;\n";
1056 print $F " \$_{LPFX } = '$LPFX';\n";
1057 print $F " \$_{LIBX } = '$LIBX';\n";
1058 print $F " \$_{MAJVERS_LIBX } = '" . expand($E_MAJVERS_LIBX) . "';\n";
1059 print $F " \$_{VERSION_LIBX } = '" . expand($E_VERSION_LIBX) . "';\n";
1060 print $F " \$_{SHLX } = '$SHLX';\n";
1061 print $F " \$_{MAJVERS_SHLX } = '" . expand($E_MAJVERS_SHLX) . "';\n";
1062 print $F " \$_{VERSION_SHLX } = '" . expand($E_VERSION_SHLX) . "';\n";
1063 print $F " \$_{VERSION_EXEX } = '" . expand($E_VERSION_EXEX) . "';\n";
1064 print $F " \$_{MAJVERS_EXEX } = '" . expand($E_MAJVERS_EXEX) . "';\n";
1065 print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n";
1066 if ($PKG{LNG} ne 'PYTHON') {
1067 print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n";
1068 print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n";
1069 } elsif ($OPT{PYTHON_LIB_PATH}) {
1070 print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n";
1071 }
1072 print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n";
1073 print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n";
1074 print $F " \$_{INST_INCDIR } = '$OPT{'includedir'}';\n";
1075 print $F " \$_{INST_BINDIR } = '$OPT{'bindir'}';\n";
1076 print $F " \$_{INST_LIBDIR } = '$OPT{'libdir'}';\n";
1077 print $F " \$_{INST_JARDIR } = '$OPT{'javadir'}';\n";
1078 print $F " \$_{INST_SHAREDIR} = '$OPT{'sharedir'}';\n";
1079 print $F "\n";
1080 print $F " \@_\n";
1081 print $F "}\n";
1082 print $F "\n";
1083 print $F "1\n";
1084
1085 close $F;
1067 # creation of Makefile.config.install is disabled, since nobody uses it now
1068 # and I need to remove versions from prl scripts
1069 if (0) {
1070 # create Makefile.config.install
1071 println "configure: creating '$INS_MAKEFILE'" unless ($AUTORUN);
1072 open $F, ">$INS_MAKEFILE" or die "cannot open $INS_MAKEFILE to write";
1073
1074 $OPT{'javadir' } = '' unless ($OPT{'javadir' });
1075 $OPT{'sharedir'} = '' unless ($OPT{'sharedir'});
1076
1077 print $F "sub CONFIGURE {\n";
1078 print $F " \$_{PACKAGE_NAME } = '$PACKAGE_NAME';\n";
1079 print $F " \$_{VERSION } = '\$VERSION';\n";
1080 print $F " \$_{LNG } = '$PKG{LNG}';\n";
1081 print $F " \$_{OS } = '$OS';\n";
1082 print $F " \$_{BITS } = $BITS;\n";
1083 print $F " \$_{MAJVERS } = \$MAJVERS;\n";
1084 print $F " \$_{LPFX } = '$LPFX';\n";
1085 print $F " \$_{LIBX } = '$LIBX';\n";
1086 print $F " \$_{MAJVERS_LIBX } = '" . expand($E_MAJVERS_LIBX) . "';\n";
1087 print $F " \$_{VERSION_LIBX } = '" . expand($E_VERSION_LIBX) . "';\n";
1088 print $F " \$_{SHLX } = '$SHLX';\n";
1089 print $F " \$_{MAJVERS_SHLX } = '" . expand($E_MAJVERS_SHLX) . "';\n";
1090 print $F " \$_{VERSION_SHLX } = '" . expand($E_VERSION_SHLX) . "';\n";
1091 print $F " \$_{VERSION_EXEX } = '" . expand($E_VERSION_EXEX) . "';\n";
1092 print $F " \$_{MAJVERS_EXEX } = '" . expand($E_MAJVERS_EXEX) . "';\n";
1093 print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n";
1094 if ($PKG{LNG} ne 'PYTHON') {
1095 print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n";
1096 print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n";
1097 } elsif ($OPT{PYTHON_LIB_PATH}) {
1098 print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n";
1099 }
1100 print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n";
1101 print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n";
1102 print $F " \$_{INST_INCDIR } = '$OPT{'includedir'}';\n";
1103 print $F " \$_{INST_BINDIR } = '$OPT{'bindir'}';\n";
1104 print $F " \$_{INST_LIBDIR } = '$OPT{'libdir'}';\n";
1105 print $F " \$_{INST_JARDIR } = '$OPT{'javadir'}';\n";
1106 print $F " \$_{INST_SHAREDIR} = '$OPT{'sharedir'}';\n";
1107 print $F "\n";
1108 print $F " \@_\n";
1109 print $F "}\n";
1110 print $F "\n";
1111 print $F "1\n";
1112
1113 close $F;
1114 }
10861115 }
10871116
10881117 if (! $OPT{'status'} ) {
12531282 }
12541283
12551284 sub find_in_dir {
1256 my ($dir, $include, $lib, $ilib, $jar, $bin) = @_;
1285 my ($dir, $include, $lib, $ilib, $jar, $bin, $src) = @_;
12571286 unless (-d $dir) {
1258 # println "no" unless ($AUTORUN);
12591287 println "\t\tnot found $dir" if ($OPT{'debug'});
12601288 return;
12611289 }
1262 # print "\t$dir... " unless ($AUTORUN);
1263 # print "[found] " if ($OPT{'debug'});
1264 my ($found_inc, $found_lib, $found_ilib);
1290 my ($found_inc, $found_lib, $found_ilib, $found_src);
12651291 if ($include) {
12661292 print "\tincludes... " unless ($AUTORUN);
12671293 if (-e "$dir/$include") {
12791305 }
12801306 }
12811307 if ($lib || $ilib) {
1282 # print "\n\t" if ($nl && !$AUTORUN);
12831308 print "\tlibraries... " unless ($AUTORUN);
12841309 if ($lib) {
12851310 my $builddir = File::Spec->catdir($dir, $OS, $TOOLS, $ARCH, $BUILD);
13711396 $found_lib = $try;
13721397 }
13731398 }
1374 return ($found_inc, $found_lib, $found_ilib);
1399 if ($src) {
1400 print "\tsrc... " unless ($AUTORUN);
1401 my $try = "$dir/$src";
1402 if (-e "$try") {
1403 println $dir unless ($AUTORUN);
1404 $found_src = $dir;
1405 }
1406 }
1407 return ($found_inc, $found_lib, $found_ilib, $found_src);
13751408 }
13761409
13771410 sub reverse_build {
14091442 check_compiler('O', '-Wno-array-bounds');
14101443 }
14111444
1445 sub check_static_libstdcpp {
1446 my $option = '-static-libstdc++';
1447 my $save = $TOOLS;
1448 $TOOLS = $CPP;
1449 $_ = check_compiler('O', $option);
1450 $TOOLS = $save;
1451 $_ ? $option : ''
1452 }
1453
14121454 sub find_lib {
14131455 check_compiler('L', @_);
14141456 }
14201462 if ($t eq 'L') {
14211463 print "checking for $n library... ";
14221464 } elsif ($t eq 'O') {
1423 if ($tool && $tool =~ /gcc$/) {
1465 if ($tool && ($tool =~ /gcc$/ || $tool =~ /g\+\+$/)) {
14241466 print "checking whether $tool accepts $n... ";
14251467 } else {
14261468 return;
14511493 $library = '-lmagic';
14521494 $log = '#include <magic.h> \n int main() { magic_open (0); }\n'
14531495 } elsif ($n eq 'xml2') {
1454 $library = '-lxml2';
1496 $library = '-lxml2';
1497 $library .= ' -liconv' if ($OS eq 'mac');
14551498 $log = '#include <libxml/xmlreader.h>\n' .
14561499 'int main() { xmlInitParser ( ); }\n'
14571500 } else {
15031546 die "No PACKAGE_NAME" unless PACKAGE_NAME();
15041547 die "No PACKAGE_NAMW" unless PACKAGE_NAMW();
15051548 die "No PACKAGE_TYPE" unless PACKAGE_TYPE();
1506 die "No VERSION" unless VERSION();
15071549
15081550 my %PKG = PKG();
15091551
00 ################################################################################
11 sub PACKAGE { 'ngs-python' }
2 sub VERSION { '1.2.4' }
32 sub PACKAGE_TYPE { 'P' }
43 sub PACKAGE_NAME { 'NGS-PYTHON' }
54 sub PACKAGE_NAMW { 'NGS_PYTHON' }
00 *.o
1 /ld.linux.exe_cmd.sh
12 /Makefile.config*
23 /Makefile.userconfig
34 /reconfigure
3636
3737 include $(CURDIR)/Makefile.rules
3838
39 sdk-libs: Makefile.config
39 sdk-libs: $(SUBDIRS) Makefile.config
4040 @ $(MAKE) -f Makefile.libs
4141
4242 sdk-libs_cln: Makefile.config
0 # ===========================================================================
1 #
2 # PUBLIC DOMAIN NOTICE
3 # National Center for Biotechnology Information
4 #
5 # This software/database is a "United States Government Work" under the
6 # terms of the United States Copyright Act. It was written as part of
7 # the author's official duties as a United States Government employee and
8 # thus cannot be copyrighted. This software/database is freely available
9 # to the public for use. The National Library of Medicine and the U.S.
10 # Government have not placed any restriction on its use or reproduction.
11 #
12 # Although all reasonable efforts have been taken to ensure the accuracy
13 # and reliability of the software and data, the NLM and the U.S.
14 # Government do not and cannot warrant the performance or results that
15 # may be obtained by using this software or data. The NLM and the U.S.
16 # Government disclaim all warranties, express or implied, including
17 # warranties of performance, merchantability or fitness for any particular
18 # purpose.
19 #
20 # Please cite the author in any work or product based on this material.
21 #
22 # ===========================================================================
23
24 # NGS-SDK and library version
25 VERSION = 1.2.5
0 #define NGS_SDK_VERSION "1.2.4"
0 #define NGS_SDK_VERSION "1.2.5"
122122 at least when it comes to UTF-8 character sets... */
123123
124124 /* an awful, but effective, test to see if the string
125 is already NUL terminated. */
125 is already NUL terminated:
126 1. we assume that buffer SIZE is aligned to 12 bits
127 2. we check if string size is less than buffer size,
128 i.e. if data[size] belongs buffer of not
129 3. if data[size] belongs to the buffer,
130 we can check if string is followed by NULL byte */
126131 if ( ( ( ( size_t ) & data [ size ] ) & 0xFFF ) != 0 )
127132 {
128133 /* we can read this address without fear of a seg-fault.
129 if it's NUL, then we can send the string in directly. */
134 if it's NUL, then we can send the string in directly.
135 NB: valgrind may complain about this line, but it is okay */
130136 if ( data [ size ] == 0 )
131137 return jenv -> NewStringUTF ( data );
132138 }
202202 exit 1;
203203 }
204204
205 my $OS_DISTRIBUTOR = '';
206 if ($OS eq 'linux') {
207 print "checking OS distributor... " unless ($AUTORUN);
208 $OS_DISTRIBUTOR = `lsb_release -si 2> /dev/null`;
209 chomp $OS_DISTRIBUTOR;
210 println $OS_DISTRIBUTOR unless ($AUTORUN);
211 }
212
205213 print "checking machine architecture... " unless ($AUTORUN);
206214 println $MARCH unless ($AUTORUN);
207215 unless ($MARCH =~ /x86_64/i || $MARCH =~ /i?86/i) {
282290
283291 my $TOOLS = "";
284292 $TOOLS = "jdk" if ($PKG{LNG} eq 'JAVA');
285
286 print "checking $PACKAGE_NAME version... " unless ($AUTORUN);
287 my $FULL_VERSION = VERSION();
288 println $FULL_VERSION unless ($AUTORUN);
289293
290294 # determine architecture
291295
423427 $NO_ARRAY_BOUNDS_WARNING = '-Wno-array-bounds';
424428 }
425429
430 my $STATIC_LIBSTDCPP = '';
431 if ($TOOLS =~ /gcc$/) {
432 $STATIC_LIBSTDCPP = check_static_libstdcpp();
433 }
434
426435 my @dependencies;
427436
428437 my %DEPEND_OPTIONS;
463472 $href->{locbldpath} = expand($href->{locbldpath}) if ($href->{locbldpath});
464473
465474 # found directories
466 my ($found_itf, $found_bin, $found_lib, $found_ilib, $found_jar);
475 my
476 ($found_itf, $found_bin, $found_lib, $found_ilib, $found_jar, $found_src);
467477
468478 my %a = %$href;
469479 next if ($a{option} && $DEPEND_OPTIONS{$a{option}});
476486 my $need_itf = ! ($a{type} =~ /D/ || $a{type} =~ /E/ || $a{type} =~ /J/);
477487 my $need_jar = $a{type} =~ /J/;
478488
479 my ($bin, $inc, $lib, $ilib)
480 = ($a{bin}, $a{include}, $a{lib}); # file names to check
489 my ($bin, $inc, $lib, $ilib, $src)
490 = ($a{bin}, $a{include}, $a{lib}, undef, $a{src}); # file names to check
481491 $lib = '' unless ($lib);
482492 $lib = expand($lib);
483493
519529 undef $il;
520530 ++$has_option{sources};
521531 }
522 my ($fi, $fl, $fil) = find_in_dir($try, $i, $l, $il);
532 my ($fi, $fl, $fil)
533 = find_in_dir($try, $i, $l, $il, undef, undef, $src);
523534 if ($fi || $fl || $fil) {
524535 $found_itf = $fi if (! $found_itf && $fi);
525536 $found_lib = $fl if (! $found_lib && $fl);
540551 }
541552 if (! $found_itf && ! $has_option{sources} && $a{srcpath}) {
542553 my $try = $a{srcpath};
543 ($found_itf) = find_in_dir($try, $inc);
554 ($found_itf, undef, undef, $found_src)
555 = find_in_dir($try, $inc, undef, undef, undef, undef, $src);
544556 }
545557 if (! $has_option{prefix}) {
546558 my $try = $a{pkgpath};
667679 push(@dependencies, "$a{aname}_INCDIR = $found_itf");
668680 println "includes: $found_itf";
669681 }
682 if ($found_src) {
683 $found_src = abs_path($found_src);
684 push(@dependencies, "$a{aname}_SRCDIR = $found_src");
685 println "sources: $found_src";
686 }
670687 if ($found_lib) {
671688 $found_lib = abs_path($found_lib);
672689 if ($a{aname} eq 'NGS' || $a{aname} eq 'VDB') {
698715 }
699716 }
700717
701 my ($E_BINDIR, $E_LIBDIR, $VERSION, $MAJVERS, $E_VERSION_LIBX, $E_MAJVERS_LIBX,
702 $E_VERSION_EXEX, $E_MAJVERS_EXEX)
718 my ($E_BINDIR, $E_LIBDIR, $E_VERSION_LIBX, $E_MAJVERS_LIBX,
719 $E_VERSION_EXEX, $E_MAJVERS_EXEX)
703720 = ('' , '');
704721
705722 println unless ($AUTORUN);
710727 println "configure: creating '$COMP' ($TOOLS)" unless ($AUTORUN);
711728 open F, ">$COMP" or die "cannot open $COMP to write";
712729 print F "$TOOLS\n";
730 close F;
731 }
732
733 if ($TOOLS =~ /gcc$/) {
734 my $EXECMDF = File::Spec->catdir(CONFIG_OUT(), 'ld.linux.exe_cmd.sh');
735 println "configure: creating '$EXECMDF'" unless ($AUTORUN);
736 open F, ">$EXECMDF" or die "cannot open $EXECMDF to write";
737 print F "EXE_CMD=\"\$LD $STATIC_LIBSTDCPP -static-libgcc\"\n";
713738 close F;
714739 }
715740
772797 # target OS
773798 OS = $OS
774799 OSINC = $OSINC
800 OS_DISTRIBUTOR = $OS_DISTRIBUTOR
775801
776802 # prefix string for system libraries
777803 LPFX = $LPFX
865891 L($F, "NO_ARRAY_BOUNDS_WARNING = $NO_ARRAY_BOUNDS_WARNING");
866892 L($F);
867893
868 # version information
869
870 my $MAJMIN;
871
872 if ($FULL_VERSION =~ /(\d+)\.(\d+)\.(\d+)-?\w*\d*/) {
873 $VERSION = "$1.$2.$3";
874 $MAJMIN = "$1.$2";
875 $MAJVERS = $1;
876 } else {
877 die $VERSION;
878 }
879
880894 print $F <<EndText;
881895 # $PACKAGE_NAME and library version
882 VERSION = $VERSION
883 MAJMIN = $MAJMIN
884 MAJVERS = $MAJVERS
896 # \$(VERSION) is defined in a separate file which is updated every release
897 include \$(TOP)/Makefile.vers
898
899 empty :=
900 space := \$(empty) \$(empty)
901 MAJMIN = \$(subst \$(space),.,\$(wordlist 1,2,\$(subst .,\$(space),\$(VERSION))))
902 MAJVERS = \$(firstword \$(subst .,\$(space),\$(VERSION)))
885903
886904 # output path
887905 BUILD_PREFIX = $BUILD_PREFIX
971989 L($F, 'include $(wildcard $(CLSDIR)/*.d)');
972990 }
973991 L($F, $_) foreach (@dependencies);
992 L($F);
993
994 # pass HAVE_XML2 to build scripts
995 L($F, 'ifeq (,$(HAVE_XML2))');
996 L($F, ' HAVE_XML2=0');
997 L($F, 'endif');
998 L($F, 'CONFIGURE_FOUND_XML2=$(HAVE_XML2)');
999 L($F, 'export CONFIGURE_FOUND_XML2');
9741000 L($F);
9751001
9761002 if ($OS eq 'linux' || $OS eq 'mac') {
10391065 }
10401066 close $F;
10411067
1042 # create Makefile.config.install
1043 println "configure: creating '$INS_MAKEFILE'" unless ($AUTORUN);
1044 open $F, ">$INS_MAKEFILE" or die "cannot open $INS_MAKEFILE to write";
1045
1046 $OPT{'javadir' } = '' unless ($OPT{'javadir' });
1047 $OPT{'sharedir'} = '' unless ($OPT{'sharedir'});
1048
1049 print $F "sub CONFIGURE {\n";
1050 print $F " \$_{PACKAGE_NAME } = '$PACKAGE_NAME';\n";
1051 print $F " \$_{VERSION } = '$VERSION';\n";
1052 print $F " \$_{LNG } = '$PKG{LNG}';\n";
1053 print $F " \$_{OS } = '$OS';\n";
1054 print $F " \$_{BITS } = $BITS;\n";
1055 print $F " \$_{MAJVERS } = $MAJVERS;\n";
1056 print $F " \$_{LPFX } = '$LPFX';\n";
1057 print $F " \$_{LIBX } = '$LIBX';\n";
1058 print $F " \$_{MAJVERS_LIBX } = '" . expand($E_MAJVERS_LIBX) . "';\n";
1059 print $F " \$_{VERSION_LIBX } = '" . expand($E_VERSION_LIBX) . "';\n";
1060 print $F " \$_{SHLX } = '$SHLX';\n";
1061 print $F " \$_{MAJVERS_SHLX } = '" . expand($E_MAJVERS_SHLX) . "';\n";
1062 print $F " \$_{VERSION_SHLX } = '" . expand($E_VERSION_SHLX) . "';\n";
1063 print $F " \$_{VERSION_EXEX } = '" . expand($E_VERSION_EXEX) . "';\n";
1064 print $F " \$_{MAJVERS_EXEX } = '" . expand($E_MAJVERS_EXEX) . "';\n";
1065 print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n";
1066 if ($PKG{LNG} ne 'PYTHON') {
1067 print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n";
1068 print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n";
1069 } elsif ($OPT{PYTHON_LIB_PATH}) {
1070 print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n";
1071 }
1072 print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n";
1073 print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n";
1074 print $F " \$_{INST_INCDIR } = '$OPT{'includedir'}';\n";
1075 print $F " \$_{INST_BINDIR } = '$OPT{'bindir'}';\n";
1076 print $F " \$_{INST_LIBDIR } = '$OPT{'libdir'}';\n";
1077 print $F " \$_{INST_JARDIR } = '$OPT{'javadir'}';\n";
1078 print $F " \$_{INST_SHAREDIR} = '$OPT{'sharedir'}';\n";
1079 print $F "\n";
1080 print $F " \@_\n";
1081 print $F "}\n";
1082 print $F "\n";
1083 print $F "1\n";
1084
1085 close $F;
1068 # creation of Makefile.config.install is disabled, since nobody uses it now
1069 # and I need to remove versions from prl scripts
1070 if (0) {
1071 # create Makefile.config.install
1072 println "configure: creating '$INS_MAKEFILE'" unless ($AUTORUN);
1073 open $F, ">$INS_MAKEFILE" or die "cannot open $INS_MAKEFILE to write";
1074
1075 $OPT{'javadir' } = '' unless ($OPT{'javadir' });
1076 $OPT{'sharedir'} = '' unless ($OPT{'sharedir'});
1077
1078 print $F "sub CONFIGURE {\n";
1079 print $F " \$_{PACKAGE_NAME } = '$PACKAGE_NAME';\n";
1080 print $F " \$_{VERSION } = '\$VERSION';\n";
1081 print $F " \$_{LNG } = '$PKG{LNG}';\n";
1082 print $F " \$_{OS } = '$OS';\n";
1083 print $F " \$_{BITS } = $BITS;\n";
1084 print $F " \$_{MAJVERS } = \$MAJVERS;\n";
1085 print $F " \$_{LPFX } = '$LPFX';\n";
1086 print $F " \$_{LIBX } = '$LIBX';\n";
1087 print $F " \$_{MAJVERS_LIBX } = '" . expand($E_MAJVERS_LIBX) . "';\n";
1088 print $F " \$_{VERSION_LIBX } = '" . expand($E_VERSION_LIBX) . "';\n";
1089 print $F " \$_{SHLX } = '$SHLX';\n";
1090 print $F " \$_{MAJVERS_SHLX } = '" . expand($E_MAJVERS_SHLX) . "';\n";
1091 print $F " \$_{VERSION_SHLX } = '" . expand($E_VERSION_SHLX) . "';\n";
1092 print $F " \$_{VERSION_EXEX } = '" . expand($E_VERSION_EXEX) . "';\n";
1093 print $F " \$_{MAJVERS_EXEX } = '" . expand($E_MAJVERS_EXEX) . "';\n";
1094 print $F " \$_{INCDIR } = '" . expand("$Bin/.." ) . "';\n";
1095 if ($PKG{LNG} ne 'PYTHON') {
1096 print $F " \$_{BINDIR$BITS} = '" . expand($E_BINDIR ) . "';\n";
1097 print $F " \$_{LIBDIR$BITS} = '" . expand($E_LIBDIR ) . "';\n";
1098 } elsif ($OPT{PYTHON_LIB_PATH}) {
1099 print $F " \$_{LIBDIR$BITS} = '$OPT{PYTHON_LIB_PATH}';\n";
1100 }
1101 print $F " \$_{OTHER_PREFIX } = '$PKG{UPATH}';\n";
1102 print $F " \$_{PREFIX } = '$OPT{'prefix'}';\n";
1103 print $F " \$_{INST_INCDIR } = '$OPT{'includedir'}';\n";
1104 print $F " \$_{INST_BINDIR } = '$OPT{'bindir'}';\n";
1105 print $F " \$_{INST_LIBDIR } = '$OPT{'libdir'}';\n";
1106 print $F " \$_{INST_JARDIR } = '$OPT{'javadir'}';\n";
1107 print $F " \$_{INST_SHAREDIR} = '$OPT{'sharedir'}';\n";
1108 print $F "\n";
1109 print $F " \@_\n";
1110 print $F "}\n";
1111 print $F "\n";
1112 print $F "1\n";
1113
1114 close $F;
1115 }
10861116 }
10871117
10881118 if (! $OPT{'status'} ) {
12531283 }
12541284
12551285 sub find_in_dir {
1256 my ($dir, $include, $lib, $ilib, $jar, $bin) = @_;
1286 my ($dir, $include, $lib, $ilib, $jar, $bin, $src) = @_;
12571287 unless (-d $dir) {
1258 # println "no" unless ($AUTORUN);
12591288 println "\t\tnot found $dir" if ($OPT{'debug'});
12601289 return;
12611290 }
1262 # print "\t$dir... " unless ($AUTORUN);
1263 # print "[found] " if ($OPT{'debug'});
1264 my ($found_inc, $found_lib, $found_ilib);
1291 my ($found_inc, $found_lib, $found_ilib, $found_src);
12651292 if ($include) {
12661293 print "\tincludes... " unless ($AUTORUN);
12671294 if (-e "$dir/$include") {
12791306 }
12801307 }
12811308 if ($lib || $ilib) {
1282 # print "\n\t" if ($nl && !$AUTORUN);
12831309 print "\tlibraries... " unless ($AUTORUN);
12841310 if ($lib) {
12851311 my $builddir = File::Spec->catdir($dir, $OS, $TOOLS, $ARCH, $BUILD);
13711397 $found_lib = $try;
13721398 }
13731399 }
1374 return ($found_inc, $found_lib, $found_ilib);
1400 if ($src) {
1401 print "\tsrc... " unless ($AUTORUN);
1402 my $try = "$dir/$src";
1403 if (-e "$try") {
1404 println $dir unless ($AUTORUN);
1405 $found_src = $dir;
1406 }
1407 }
1408 return ($found_inc, $found_lib, $found_ilib, $found_src);
13751409 }
13761410
13771411 sub reverse_build {
14091443 check_compiler('O', '-Wno-array-bounds');
14101444 }
14111445
1446 sub check_static_libstdcpp {
1447 my $option = '-static-libstdc++';
1448 my $save = $TOOLS;
1449 $TOOLS = $CPP;
1450 $_ = check_compiler('O', $option);
1451 $TOOLS = $save;
1452 $_ ? $option : ''
1453 }
1454
14121455 sub find_lib {
14131456 check_compiler('L', @_);
14141457 }
14201463 if ($t eq 'L') {
14211464 print "checking for $n library... ";
14221465 } elsif ($t eq 'O') {
1423 if ($tool && $tool =~ /gcc$/) {
1466 if ($tool && ($tool =~ /gcc$/ || $tool =~ /g\+\+$/)) {
14241467 print "checking whether $tool accepts $n... ";
14251468 } else {
14261469 return;
14511494 $library = '-lmagic';
14521495 $log = '#include <magic.h> \n int main() { magic_open (0); }\n'
14531496 } elsif ($n eq 'xml2') {
1454 $library = '-lxml2';
1497 $library = '-lxml2';
1498 $library .= ' -liconv' if ($OS eq 'mac');
14551499 $log = '#include <libxml/xmlreader.h>\n' .
14561500 'int main() { xmlInitParser ( ); }\n'
14571501 } else {
15031547 die "No PACKAGE_NAME" unless PACKAGE_NAME();
15041548 die "No PACKAGE_NAMW" unless PACKAGE_NAMW();
15051549 die "No PACKAGE_TYPE" unless PACKAGE_TYPE();
1506 die "No VERSION" unless VERSION();
15071550
15081551 my %PKG = PKG();
15091552
00 ################################################################################
11 sub PACKAGE { 'ngs-sdk' }
2 sub VERSION { '1.2.4' }
32 sub PACKAGE_TYPE { 'L' }
43 sub PACKAGE_NAME { 'NGS-SDK' }
54 sub PACKAGE_NAMW { 'NGS' }