Imported Upstream version 1.2.5
Olivier Sallou
7 years ago
25 | 25 | The NCBI NGS Software Development Kit |
26 | 26 | Contact: sra-tools@ncbi.nlm.nih.gov |
27 | 27 | |
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 | ||
28 | 43 | NCBI External Developer Release: NGS SDK 1.2.4 |
29 | 44 | May 25, 2016 |
30 | 45 |
0 | 0 | # 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 | ||
1 | 16 | |
2 | 17 | ## NGS SDK 1.2.4 |
3 | 18 | **May 25, 2016** |
4 | 19 | |
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 |
39 | 39 | |
40 | 40 | install: Makefile.config |
41 | 41 | @ $(MAKE) -f Makefile.libs |
42 | @ perl $(TOP)/setup/install | |
42 | @ $(MAKE) -s --no-print-directory -f Makefile.install install | |
43 | 43 | |
44 | 44 | .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 |
202 | 202 | exit 1; |
203 | 203 | } |
204 | 204 | |
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 | ||
205 | 213 | print "checking machine architecture... " unless ($AUTORUN); |
206 | 214 | println $MARCH unless ($AUTORUN); |
207 | 215 | unless ($MARCH =~ /x86_64/i || $MARCH =~ /i?86/i) { |
282 | 290 | |
283 | 291 | my $TOOLS = ""; |
284 | 292 | $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); | |
289 | 293 | |
290 | 294 | # determine architecture |
291 | 295 | |
423 | 427 | $NO_ARRAY_BOUNDS_WARNING = '-Wno-array-bounds'; |
424 | 428 | } |
425 | 429 | |
430 | my $STATIC_LIBSTDCPP = ''; | |
431 | if ($TOOLS =~ /gcc$/) { | |
432 | $STATIC_LIBSTDCPP = check_static_libstdcpp(); | |
433 | } | |
434 | ||
426 | 435 | my @dependencies; |
427 | 436 | |
428 | 437 | my %DEPEND_OPTIONS; |
463 | 472 | $href->{locbldpath} = expand($href->{locbldpath}) if ($href->{locbldpath}); |
464 | 473 | |
465 | 474 | # 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); | |
467 | 477 | |
468 | 478 | my %a = %$href; |
469 | 479 | next if ($a{option} && $DEPEND_OPTIONS{$a{option}}); |
476 | 486 | my $need_itf = ! ($a{type} =~ /D/ || $a{type} =~ /E/ || $a{type} =~ /J/); |
477 | 487 | my $need_jar = $a{type} =~ /J/; |
478 | 488 | |
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 | |
481 | 491 | $lib = '' unless ($lib); |
482 | 492 | $lib = expand($lib); |
483 | 493 | |
519 | 529 | undef $il; |
520 | 530 | ++$has_option{sources}; |
521 | 531 | } |
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); | |
523 | 534 | if ($fi || $fl || $fil) { |
524 | 535 | $found_itf = $fi if (! $found_itf && $fi); |
525 | 536 | $found_lib = $fl if (! $found_lib && $fl); |
540 | 551 | } |
541 | 552 | if (! $found_itf && ! $has_option{sources} && $a{srcpath}) { |
542 | 553 | 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); | |
544 | 556 | } |
545 | 557 | if (! $has_option{prefix}) { |
546 | 558 | my $try = $a{pkgpath}; |
667 | 679 | push(@dependencies, "$a{aname}_INCDIR = $found_itf"); |
668 | 680 | println "includes: $found_itf"; |
669 | 681 | } |
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 | } | |
670 | 687 | if ($found_lib) { |
671 | 688 | $found_lib = abs_path($found_lib); |
672 | 689 | if ($a{aname} eq 'NGS' || $a{aname} eq 'VDB') { |
698 | 715 | } |
699 | 716 | } |
700 | 717 | |
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) | |
703 | 720 | = ('' , ''); |
704 | 721 | |
705 | 722 | println unless ($AUTORUN); |
710 | 727 | println "configure: creating '$COMP' ($TOOLS)" unless ($AUTORUN); |
711 | 728 | open F, ">$COMP" or die "cannot open $COMP to write"; |
712 | 729 | 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"; | |
713 | 738 | close F; |
714 | 739 | } |
715 | 740 | |
772 | 797 | # target OS |
773 | 798 | OS = $OS |
774 | 799 | OSINC = $OSINC |
800 | OS_DISTRIBUTOR = $OS_DISTRIBUTOR | |
775 | 801 | |
776 | 802 | # prefix string for system libraries |
777 | 803 | LPFX = $LPFX |
865 | 891 | L($F, "NO_ARRAY_BOUNDS_WARNING = $NO_ARRAY_BOUNDS_WARNING"); |
866 | 892 | L($F); |
867 | 893 | |
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 | ||
880 | 894 | 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))) | |
885 | 902 | |
886 | 903 | # output path |
887 | 904 | BUILD_PREFIX = $BUILD_PREFIX |
971 | 988 | L($F, 'include $(wildcard $(CLSDIR)/*.d)'); |
972 | 989 | } |
973 | 990 | 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'); | |
974 | 999 | L($F); |
975 | 1000 | |
976 | 1001 | if ($OS eq 'linux' || $OS eq 'mac') { |
1038 | 1063 | T($F, ' fi'); |
1039 | 1064 | } |
1040 | 1065 | 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 | } | |
1086 | 1115 | } |
1087 | 1116 | |
1088 | 1117 | if (! $OPT{'status'} ) { |
1253 | 1282 | } |
1254 | 1283 | |
1255 | 1284 | sub find_in_dir { |
1256 | my ($dir, $include, $lib, $ilib, $jar, $bin) = @_; | |
1285 | my ($dir, $include, $lib, $ilib, $jar, $bin, $src) = @_; | |
1257 | 1286 | unless (-d $dir) { |
1258 | # println "no" unless ($AUTORUN); | |
1259 | 1287 | println "\t\tnot found $dir" if ($OPT{'debug'}); |
1260 | 1288 | return; |
1261 | 1289 | } |
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); | |
1265 | 1291 | if ($include) { |
1266 | 1292 | print "\tincludes... " unless ($AUTORUN); |
1267 | 1293 | if (-e "$dir/$include") { |
1279 | 1305 | } |
1280 | 1306 | } |
1281 | 1307 | if ($lib || $ilib) { |
1282 | # print "\n\t" if ($nl && !$AUTORUN); | |
1283 | 1308 | print "\tlibraries... " unless ($AUTORUN); |
1284 | 1309 | if ($lib) { |
1285 | 1310 | my $builddir = File::Spec->catdir($dir, $OS, $TOOLS, $ARCH, $BUILD); |
1371 | 1396 | $found_lib = $try; |
1372 | 1397 | } |
1373 | 1398 | } |
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); | |
1375 | 1408 | } |
1376 | 1409 | |
1377 | 1410 | sub reverse_build { |
1409 | 1442 | check_compiler('O', '-Wno-array-bounds'); |
1410 | 1443 | } |
1411 | 1444 | |
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 | ||
1412 | 1454 | sub find_lib { |
1413 | 1455 | check_compiler('L', @_); |
1414 | 1456 | } |
1420 | 1462 | if ($t eq 'L') { |
1421 | 1463 | print "checking for $n library... "; |
1422 | 1464 | } elsif ($t eq 'O') { |
1423 | if ($tool && $tool =~ /gcc$/) { | |
1465 | if ($tool && ($tool =~ /gcc$/ || $tool =~ /g\+\+$/)) { | |
1424 | 1466 | print "checking whether $tool accepts $n... "; |
1425 | 1467 | } else { |
1426 | 1468 | return; |
1451 | 1493 | $library = '-lmagic'; |
1452 | 1494 | $log = '#include <magic.h> \n int main() { magic_open (0); }\n' |
1453 | 1495 | } elsif ($n eq 'xml2') { |
1454 | $library = '-lxml2'; | |
1496 | $library = '-lxml2'; | |
1497 | $library .= ' -liconv' if ($OS eq 'mac'); | |
1455 | 1498 | $log = '#include <libxml/xmlreader.h>\n' . |
1456 | 1499 | 'int main() { xmlInitParser ( ); }\n' |
1457 | 1500 | } else { |
1503 | 1546 | die "No PACKAGE_NAME" unless PACKAGE_NAME(); |
1504 | 1547 | die "No PACKAGE_NAMW" unless PACKAGE_NAMW(); |
1505 | 1548 | die "No PACKAGE_TYPE" unless PACKAGE_TYPE(); |
1506 | die "No VERSION" unless VERSION(); | |
1507 | 1549 | |
1508 | 1550 | my %PKG = PKG(); |
1509 | 1551 |
0 | 0 | ################################################################################ |
1 | 1 | sub PACKAGE { 'ngs-bam' } |
2 | sub VERSION { '1.2.4' } | |
3 | 2 | sub PACKAGE_TYPE { 'L' } |
4 | 3 | sub PACKAGE_NAME { 'NGS-BAM' } |
5 | 4 | 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 |
28 | 28 | class LibDependencies { |
29 | 29 | final static String NGS_SDK = "ngs-sdk"; |
30 | 30 | 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"; | |
33 | 33 | } |
202 | 202 | exit 1; |
203 | 203 | } |
204 | 204 | |
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 | ||
205 | 213 | print "checking machine architecture... " unless ($AUTORUN); |
206 | 214 | println $MARCH unless ($AUTORUN); |
207 | 215 | unless ($MARCH =~ /x86_64/i || $MARCH =~ /i?86/i) { |
282 | 290 | |
283 | 291 | my $TOOLS = ""; |
284 | 292 | $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); | |
289 | 293 | |
290 | 294 | # determine architecture |
291 | 295 | |
423 | 427 | $NO_ARRAY_BOUNDS_WARNING = '-Wno-array-bounds'; |
424 | 428 | } |
425 | 429 | |
430 | my $STATIC_LIBSTDCPP = ''; | |
431 | if ($TOOLS =~ /gcc$/) { | |
432 | $STATIC_LIBSTDCPP = check_static_libstdcpp(); | |
433 | } | |
434 | ||
426 | 435 | my @dependencies; |
427 | 436 | |
428 | 437 | my %DEPEND_OPTIONS; |
463 | 472 | $href->{locbldpath} = expand($href->{locbldpath}) if ($href->{locbldpath}); |
464 | 473 | |
465 | 474 | # 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); | |
467 | 477 | |
468 | 478 | my %a = %$href; |
469 | 479 | next if ($a{option} && $DEPEND_OPTIONS{$a{option}}); |
476 | 486 | my $need_itf = ! ($a{type} =~ /D/ || $a{type} =~ /E/ || $a{type} =~ /J/); |
477 | 487 | my $need_jar = $a{type} =~ /J/; |
478 | 488 | |
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 | |
481 | 491 | $lib = '' unless ($lib); |
482 | 492 | $lib = expand($lib); |
483 | 493 | |
519 | 529 | undef $il; |
520 | 530 | ++$has_option{sources}; |
521 | 531 | } |
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); | |
523 | 534 | if ($fi || $fl || $fil) { |
524 | 535 | $found_itf = $fi if (! $found_itf && $fi); |
525 | 536 | $found_lib = $fl if (! $found_lib && $fl); |
540 | 551 | } |
541 | 552 | if (! $found_itf && ! $has_option{sources} && $a{srcpath}) { |
542 | 553 | 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); | |
544 | 556 | } |
545 | 557 | if (! $has_option{prefix}) { |
546 | 558 | my $try = $a{pkgpath}; |
667 | 679 | push(@dependencies, "$a{aname}_INCDIR = $found_itf"); |
668 | 680 | println "includes: $found_itf"; |
669 | 681 | } |
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 | } | |
670 | 687 | if ($found_lib) { |
671 | 688 | $found_lib = abs_path($found_lib); |
672 | 689 | if ($a{aname} eq 'NGS' || $a{aname} eq 'VDB') { |
698 | 715 | } |
699 | 716 | } |
700 | 717 | |
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) | |
703 | 720 | = ('' , ''); |
704 | 721 | |
705 | 722 | println unless ($AUTORUN); |
710 | 727 | println "configure: creating '$COMP' ($TOOLS)" unless ($AUTORUN); |
711 | 728 | open F, ">$COMP" or die "cannot open $COMP to write"; |
712 | 729 | 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"; | |
713 | 738 | close F; |
714 | 739 | } |
715 | 740 | |
772 | 797 | # target OS |
773 | 798 | OS = $OS |
774 | 799 | OSINC = $OSINC |
800 | OS_DISTRIBUTOR = $OS_DISTRIBUTOR | |
775 | 801 | |
776 | 802 | # prefix string for system libraries |
777 | 803 | LPFX = $LPFX |
865 | 891 | L($F, "NO_ARRAY_BOUNDS_WARNING = $NO_ARRAY_BOUNDS_WARNING"); |
866 | 892 | L($F); |
867 | 893 | |
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 | ||
880 | 894 | 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))) | |
885 | 902 | |
886 | 903 | # output path |
887 | 904 | BUILD_PREFIX = $BUILD_PREFIX |
971 | 988 | L($F, 'include $(wildcard $(CLSDIR)/*.d)'); |
972 | 989 | } |
973 | 990 | 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'); | |
974 | 999 | L($F); |
975 | 1000 | |
976 | 1001 | if ($OS eq 'linux' || $OS eq 'mac') { |
1039 | 1064 | } |
1040 | 1065 | close $F; |
1041 | 1066 | |
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 | } | |
1086 | 1115 | } |
1087 | 1116 | |
1088 | 1117 | if (! $OPT{'status'} ) { |
1253 | 1282 | } |
1254 | 1283 | |
1255 | 1284 | sub find_in_dir { |
1256 | my ($dir, $include, $lib, $ilib, $jar, $bin) = @_; | |
1285 | my ($dir, $include, $lib, $ilib, $jar, $bin, $src) = @_; | |
1257 | 1286 | unless (-d $dir) { |
1258 | # println "no" unless ($AUTORUN); | |
1259 | 1287 | println "\t\tnot found $dir" if ($OPT{'debug'}); |
1260 | 1288 | return; |
1261 | 1289 | } |
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); | |
1265 | 1291 | if ($include) { |
1266 | 1292 | print "\tincludes... " unless ($AUTORUN); |
1267 | 1293 | if (-e "$dir/$include") { |
1279 | 1305 | } |
1280 | 1306 | } |
1281 | 1307 | if ($lib || $ilib) { |
1282 | # print "\n\t" if ($nl && !$AUTORUN); | |
1283 | 1308 | print "\tlibraries... " unless ($AUTORUN); |
1284 | 1309 | if ($lib) { |
1285 | 1310 | my $builddir = File::Spec->catdir($dir, $OS, $TOOLS, $ARCH, $BUILD); |
1371 | 1396 | $found_lib = $try; |
1372 | 1397 | } |
1373 | 1398 | } |
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); | |
1375 | 1408 | } |
1376 | 1409 | |
1377 | 1410 | sub reverse_build { |
1409 | 1442 | check_compiler('O', '-Wno-array-bounds'); |
1410 | 1443 | } |
1411 | 1444 | |
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 | ||
1412 | 1454 | sub find_lib { |
1413 | 1455 | check_compiler('L', @_); |
1414 | 1456 | } |
1420 | 1462 | if ($t eq 'L') { |
1421 | 1463 | print "checking for $n library... "; |
1422 | 1464 | } elsif ($t eq 'O') { |
1423 | if ($tool && $tool =~ /gcc$/) { | |
1465 | if ($tool && ($tool =~ /gcc$/ || $tool =~ /g\+\+$/)) { | |
1424 | 1466 | print "checking whether $tool accepts $n... "; |
1425 | 1467 | } else { |
1426 | 1468 | return; |
1451 | 1493 | $library = '-lmagic'; |
1452 | 1494 | $log = '#include <magic.h> \n int main() { magic_open (0); }\n' |
1453 | 1495 | } elsif ($n eq 'xml2') { |
1454 | $library = '-lxml2'; | |
1496 | $library = '-lxml2'; | |
1497 | $library .= ' -liconv' if ($OS eq 'mac'); | |
1455 | 1498 | $log = '#include <libxml/xmlreader.h>\n' . |
1456 | 1499 | 'int main() { xmlInitParser ( ); }\n' |
1457 | 1500 | } else { |
1503 | 1546 | die "No PACKAGE_NAME" unless PACKAGE_NAME(); |
1504 | 1547 | die "No PACKAGE_NAMW" unless PACKAGE_NAMW(); |
1505 | 1548 | die "No PACKAGE_TYPE" unless PACKAGE_TYPE(); |
1506 | die "No VERSION" unless VERSION(); | |
1507 | 1549 | |
1508 | 1550 | my %PKG = PKG(); |
1509 | 1551 |
0 | 0 | ################################################################################ |
1 | 1 | sub PACKAGE { 'ngs-java' } |
2 | sub VERSION { '1.2.4' } | |
3 | 2 | sub PACKAGE_TYPE { 'J' } |
4 | 3 | sub PACKAGE_NAME { 'NGS-JAVA' } |
5 | 4 | sub PACKAGE_NAMW { 'NGS_JAVA' } |
0 | 0 | *.pyc |
1 | 1 | /build |
2 | /ld.linux.exe_cmd.sh | |
2 | 3 | /Makefile.userconfig |
3 | 4 | /Makefile.config* |
4 | 5 | /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 |
202 | 202 | exit 1; |
203 | 203 | } |
204 | 204 | |
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 | ||
205 | 213 | print "checking machine architecture... " unless ($AUTORUN); |
206 | 214 | println $MARCH unless ($AUTORUN); |
207 | 215 | unless ($MARCH =~ /x86_64/i || $MARCH =~ /i?86/i) { |
282 | 290 | |
283 | 291 | my $TOOLS = ""; |
284 | 292 | $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); | |
289 | 293 | |
290 | 294 | # determine architecture |
291 | 295 | |
423 | 427 | $NO_ARRAY_BOUNDS_WARNING = '-Wno-array-bounds'; |
424 | 428 | } |
425 | 429 | |
430 | my $STATIC_LIBSTDCPP = ''; | |
431 | if ($TOOLS =~ /gcc$/) { | |
432 | $STATIC_LIBSTDCPP = check_static_libstdcpp(); | |
433 | } | |
434 | ||
426 | 435 | my @dependencies; |
427 | 436 | |
428 | 437 | my %DEPEND_OPTIONS; |
463 | 472 | $href->{locbldpath} = expand($href->{locbldpath}) if ($href->{locbldpath}); |
464 | 473 | |
465 | 474 | # 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); | |
467 | 477 | |
468 | 478 | my %a = %$href; |
469 | 479 | next if ($a{option} && $DEPEND_OPTIONS{$a{option}}); |
476 | 486 | my $need_itf = ! ($a{type} =~ /D/ || $a{type} =~ /E/ || $a{type} =~ /J/); |
477 | 487 | my $need_jar = $a{type} =~ /J/; |
478 | 488 | |
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 | |
481 | 491 | $lib = '' unless ($lib); |
482 | 492 | $lib = expand($lib); |
483 | 493 | |
519 | 529 | undef $il; |
520 | 530 | ++$has_option{sources}; |
521 | 531 | } |
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); | |
523 | 534 | if ($fi || $fl || $fil) { |
524 | 535 | $found_itf = $fi if (! $found_itf && $fi); |
525 | 536 | $found_lib = $fl if (! $found_lib && $fl); |
540 | 551 | } |
541 | 552 | if (! $found_itf && ! $has_option{sources} && $a{srcpath}) { |
542 | 553 | 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); | |
544 | 556 | } |
545 | 557 | if (! $has_option{prefix}) { |
546 | 558 | my $try = $a{pkgpath}; |
667 | 679 | push(@dependencies, "$a{aname}_INCDIR = $found_itf"); |
668 | 680 | println "includes: $found_itf"; |
669 | 681 | } |
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 | } | |
670 | 687 | if ($found_lib) { |
671 | 688 | $found_lib = abs_path($found_lib); |
672 | 689 | if ($a{aname} eq 'NGS' || $a{aname} eq 'VDB') { |
698 | 715 | } |
699 | 716 | } |
700 | 717 | |
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) | |
703 | 720 | = ('' , ''); |
704 | 721 | |
705 | 722 | println unless ($AUTORUN); |
710 | 727 | println "configure: creating '$COMP' ($TOOLS)" unless ($AUTORUN); |
711 | 728 | open F, ">$COMP" or die "cannot open $COMP to write"; |
712 | 729 | 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"; | |
713 | 738 | close F; |
714 | 739 | } |
715 | 740 | |
772 | 797 | # target OS |
773 | 798 | OS = $OS |
774 | 799 | OSINC = $OSINC |
800 | OS_DISTRIBUTOR = $OS_DISTRIBUTOR | |
775 | 801 | |
776 | 802 | # prefix string for system libraries |
777 | 803 | LPFX = $LPFX |
865 | 891 | L($F, "NO_ARRAY_BOUNDS_WARNING = $NO_ARRAY_BOUNDS_WARNING"); |
866 | 892 | L($F); |
867 | 893 | |
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 | ||
880 | 894 | 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))) | |
885 | 902 | |
886 | 903 | # output path |
887 | 904 | BUILD_PREFIX = $BUILD_PREFIX |
971 | 988 | L($F, 'include $(wildcard $(CLSDIR)/*.d)'); |
972 | 989 | } |
973 | 990 | 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'); | |
974 | 999 | L($F); |
975 | 1000 | |
976 | 1001 | if ($OS eq 'linux' || $OS eq 'mac') { |
1039 | 1064 | } |
1040 | 1065 | close $F; |
1041 | 1066 | |
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 | } | |
1086 | 1115 | } |
1087 | 1116 | |
1088 | 1117 | if (! $OPT{'status'} ) { |
1253 | 1282 | } |
1254 | 1283 | |
1255 | 1284 | sub find_in_dir { |
1256 | my ($dir, $include, $lib, $ilib, $jar, $bin) = @_; | |
1285 | my ($dir, $include, $lib, $ilib, $jar, $bin, $src) = @_; | |
1257 | 1286 | unless (-d $dir) { |
1258 | # println "no" unless ($AUTORUN); | |
1259 | 1287 | println "\t\tnot found $dir" if ($OPT{'debug'}); |
1260 | 1288 | return; |
1261 | 1289 | } |
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); | |
1265 | 1291 | if ($include) { |
1266 | 1292 | print "\tincludes... " unless ($AUTORUN); |
1267 | 1293 | if (-e "$dir/$include") { |
1279 | 1305 | } |
1280 | 1306 | } |
1281 | 1307 | if ($lib || $ilib) { |
1282 | # print "\n\t" if ($nl && !$AUTORUN); | |
1283 | 1308 | print "\tlibraries... " unless ($AUTORUN); |
1284 | 1309 | if ($lib) { |
1285 | 1310 | my $builddir = File::Spec->catdir($dir, $OS, $TOOLS, $ARCH, $BUILD); |
1371 | 1396 | $found_lib = $try; |
1372 | 1397 | } |
1373 | 1398 | } |
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); | |
1375 | 1408 | } |
1376 | 1409 | |
1377 | 1410 | sub reverse_build { |
1409 | 1442 | check_compiler('O', '-Wno-array-bounds'); |
1410 | 1443 | } |
1411 | 1444 | |
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 | ||
1412 | 1454 | sub find_lib { |
1413 | 1455 | check_compiler('L', @_); |
1414 | 1456 | } |
1420 | 1462 | if ($t eq 'L') { |
1421 | 1463 | print "checking for $n library... "; |
1422 | 1464 | } elsif ($t eq 'O') { |
1423 | if ($tool && $tool =~ /gcc$/) { | |
1465 | if ($tool && ($tool =~ /gcc$/ || $tool =~ /g\+\+$/)) { | |
1424 | 1466 | print "checking whether $tool accepts $n... "; |
1425 | 1467 | } else { |
1426 | 1468 | return; |
1451 | 1493 | $library = '-lmagic'; |
1452 | 1494 | $log = '#include <magic.h> \n int main() { magic_open (0); }\n' |
1453 | 1495 | } elsif ($n eq 'xml2') { |
1454 | $library = '-lxml2'; | |
1496 | $library = '-lxml2'; | |
1497 | $library .= ' -liconv' if ($OS eq 'mac'); | |
1455 | 1498 | $log = '#include <libxml/xmlreader.h>\n' . |
1456 | 1499 | 'int main() { xmlInitParser ( ); }\n' |
1457 | 1500 | } else { |
1503 | 1546 | die "No PACKAGE_NAME" unless PACKAGE_NAME(); |
1504 | 1547 | die "No PACKAGE_NAMW" unless PACKAGE_NAMW(); |
1505 | 1548 | die "No PACKAGE_TYPE" unless PACKAGE_TYPE(); |
1506 | die "No VERSION" unless VERSION(); | |
1507 | 1549 | |
1508 | 1550 | my %PKG = PKG(); |
1509 | 1551 |
0 | 0 | ################################################################################ |
1 | 1 | sub PACKAGE { 'ngs-python' } |
2 | sub VERSION { '1.2.4' } | |
3 | 2 | sub PACKAGE_TYPE { 'P' } |
4 | 3 | sub PACKAGE_NAME { 'NGS-PYTHON' } |
5 | 4 | sub PACKAGE_NAMW { 'NGS_PYTHON' } |
36 | 36 | |
37 | 37 | include $(CURDIR)/Makefile.rules |
38 | 38 | |
39 | sdk-libs: Makefile.config | |
39 | sdk-libs: $(SUBDIRS) Makefile.config | |
40 | 40 | @ $(MAKE) -f Makefile.libs |
41 | 41 | |
42 | 42 | 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 |
122 | 122 | at least when it comes to UTF-8 character sets... */ |
123 | 123 | |
124 | 124 | /* 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 */ | |
126 | 131 | if ( ( ( ( size_t ) & data [ size ] ) & 0xFFF ) != 0 ) |
127 | 132 | { |
128 | 133 | /* 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 */ | |
130 | 136 | if ( data [ size ] == 0 ) |
131 | 137 | return jenv -> NewStringUTF ( data ); |
132 | 138 | } |
202 | 202 | exit 1; |
203 | 203 | } |
204 | 204 | |
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 | ||
205 | 213 | print "checking machine architecture... " unless ($AUTORUN); |
206 | 214 | println $MARCH unless ($AUTORUN); |
207 | 215 | unless ($MARCH =~ /x86_64/i || $MARCH =~ /i?86/i) { |
282 | 290 | |
283 | 291 | my $TOOLS = ""; |
284 | 292 | $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); | |
289 | 293 | |
290 | 294 | # determine architecture |
291 | 295 | |
423 | 427 | $NO_ARRAY_BOUNDS_WARNING = '-Wno-array-bounds'; |
424 | 428 | } |
425 | 429 | |
430 | my $STATIC_LIBSTDCPP = ''; | |
431 | if ($TOOLS =~ /gcc$/) { | |
432 | $STATIC_LIBSTDCPP = check_static_libstdcpp(); | |
433 | } | |
434 | ||
426 | 435 | my @dependencies; |
427 | 436 | |
428 | 437 | my %DEPEND_OPTIONS; |
463 | 472 | $href->{locbldpath} = expand($href->{locbldpath}) if ($href->{locbldpath}); |
464 | 473 | |
465 | 474 | # 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); | |
467 | 477 | |
468 | 478 | my %a = %$href; |
469 | 479 | next if ($a{option} && $DEPEND_OPTIONS{$a{option}}); |
476 | 486 | my $need_itf = ! ($a{type} =~ /D/ || $a{type} =~ /E/ || $a{type} =~ /J/); |
477 | 487 | my $need_jar = $a{type} =~ /J/; |
478 | 488 | |
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 | |
481 | 491 | $lib = '' unless ($lib); |
482 | 492 | $lib = expand($lib); |
483 | 493 | |
519 | 529 | undef $il; |
520 | 530 | ++$has_option{sources}; |
521 | 531 | } |
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); | |
523 | 534 | if ($fi || $fl || $fil) { |
524 | 535 | $found_itf = $fi if (! $found_itf && $fi); |
525 | 536 | $found_lib = $fl if (! $found_lib && $fl); |
540 | 551 | } |
541 | 552 | if (! $found_itf && ! $has_option{sources} && $a{srcpath}) { |
542 | 553 | 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); | |
544 | 556 | } |
545 | 557 | if (! $has_option{prefix}) { |
546 | 558 | my $try = $a{pkgpath}; |
667 | 679 | push(@dependencies, "$a{aname}_INCDIR = $found_itf"); |
668 | 680 | println "includes: $found_itf"; |
669 | 681 | } |
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 | } | |
670 | 687 | if ($found_lib) { |
671 | 688 | $found_lib = abs_path($found_lib); |
672 | 689 | if ($a{aname} eq 'NGS' || $a{aname} eq 'VDB') { |
698 | 715 | } |
699 | 716 | } |
700 | 717 | |
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) | |
703 | 720 | = ('' , ''); |
704 | 721 | |
705 | 722 | println unless ($AUTORUN); |
710 | 727 | println "configure: creating '$COMP' ($TOOLS)" unless ($AUTORUN); |
711 | 728 | open F, ">$COMP" or die "cannot open $COMP to write"; |
712 | 729 | 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"; | |
713 | 738 | close F; |
714 | 739 | } |
715 | 740 | |
772 | 797 | # target OS |
773 | 798 | OS = $OS |
774 | 799 | OSINC = $OSINC |
800 | OS_DISTRIBUTOR = $OS_DISTRIBUTOR | |
775 | 801 | |
776 | 802 | # prefix string for system libraries |
777 | 803 | LPFX = $LPFX |
865 | 891 | L($F, "NO_ARRAY_BOUNDS_WARNING = $NO_ARRAY_BOUNDS_WARNING"); |
866 | 892 | L($F); |
867 | 893 | |
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 | ||
880 | 894 | print $F <<EndText; |
881 | 895 | # $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))) | |
885 | 903 | |
886 | 904 | # output path |
887 | 905 | BUILD_PREFIX = $BUILD_PREFIX |
971 | 989 | L($F, 'include $(wildcard $(CLSDIR)/*.d)'); |
972 | 990 | } |
973 | 991 | 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'); | |
974 | 1000 | L($F); |
975 | 1001 | |
976 | 1002 | if ($OS eq 'linux' || $OS eq 'mac') { |
1039 | 1065 | } |
1040 | 1066 | close $F; |
1041 | 1067 | |
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 | } | |
1086 | 1116 | } |
1087 | 1117 | |
1088 | 1118 | if (! $OPT{'status'} ) { |
1253 | 1283 | } |
1254 | 1284 | |
1255 | 1285 | sub find_in_dir { |
1256 | my ($dir, $include, $lib, $ilib, $jar, $bin) = @_; | |
1286 | my ($dir, $include, $lib, $ilib, $jar, $bin, $src) = @_; | |
1257 | 1287 | unless (-d $dir) { |
1258 | # println "no" unless ($AUTORUN); | |
1259 | 1288 | println "\t\tnot found $dir" if ($OPT{'debug'}); |
1260 | 1289 | return; |
1261 | 1290 | } |
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); | |
1265 | 1292 | if ($include) { |
1266 | 1293 | print "\tincludes... " unless ($AUTORUN); |
1267 | 1294 | if (-e "$dir/$include") { |
1279 | 1306 | } |
1280 | 1307 | } |
1281 | 1308 | if ($lib || $ilib) { |
1282 | # print "\n\t" if ($nl && !$AUTORUN); | |
1283 | 1309 | print "\tlibraries... " unless ($AUTORUN); |
1284 | 1310 | if ($lib) { |
1285 | 1311 | my $builddir = File::Spec->catdir($dir, $OS, $TOOLS, $ARCH, $BUILD); |
1371 | 1397 | $found_lib = $try; |
1372 | 1398 | } |
1373 | 1399 | } |
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); | |
1375 | 1409 | } |
1376 | 1410 | |
1377 | 1411 | sub reverse_build { |
1409 | 1443 | check_compiler('O', '-Wno-array-bounds'); |
1410 | 1444 | } |
1411 | 1445 | |
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 | ||
1412 | 1455 | sub find_lib { |
1413 | 1456 | check_compiler('L', @_); |
1414 | 1457 | } |
1420 | 1463 | if ($t eq 'L') { |
1421 | 1464 | print "checking for $n library... "; |
1422 | 1465 | } elsif ($t eq 'O') { |
1423 | if ($tool && $tool =~ /gcc$/) { | |
1466 | if ($tool && ($tool =~ /gcc$/ || $tool =~ /g\+\+$/)) { | |
1424 | 1467 | print "checking whether $tool accepts $n... "; |
1425 | 1468 | } else { |
1426 | 1469 | return; |
1451 | 1494 | $library = '-lmagic'; |
1452 | 1495 | $log = '#include <magic.h> \n int main() { magic_open (0); }\n' |
1453 | 1496 | } elsif ($n eq 'xml2') { |
1454 | $library = '-lxml2'; | |
1497 | $library = '-lxml2'; | |
1498 | $library .= ' -liconv' if ($OS eq 'mac'); | |
1455 | 1499 | $log = '#include <libxml/xmlreader.h>\n' . |
1456 | 1500 | 'int main() { xmlInitParser ( ); }\n' |
1457 | 1501 | } else { |
1503 | 1547 | die "No PACKAGE_NAME" unless PACKAGE_NAME(); |
1504 | 1548 | die "No PACKAGE_NAMW" unless PACKAGE_NAMW(); |
1505 | 1549 | die "No PACKAGE_TYPE" unless PACKAGE_TYPE(); |
1506 | die "No VERSION" unless VERSION(); | |
1507 | 1550 | |
1508 | 1551 | my %PKG = PKG(); |
1509 | 1552 |