Index: third_party/morfeusz/Makefile.am =================================================================== --- third_party/morfeusz/Makefile.am.orig 2010-08-10 18:11:58.000000000 +0200 +++ third_party/morfeusz/Makefile.am 2012-07-04 11:15:13.500186560 +0200 @@ -1,10 +1,10 @@ install-exec-local: - $(INSTALL_PROGRAM) -D lib/libmorfeusz.so.0.6 $(pkglibdir)/libmorfeusz.so.0.6 - $(LN_S) -f libmorfeusz.so.0.6 $(pkglibdir)/libmorfeusz.so.0 - $(LN_S) -f libmorfeusz.so.0.6 $(pkglibdir)/libmorfeusz.so +# $(INSTALL_PROGRAM) -D lib/libmorfeusz.so.0.6 $(pkglibdir)/libmorfeusz.so.0.6 +# $(LN_S) -f libmorfeusz.so.0.6 $(pkglibdir)/libmorfeusz.so.0 +# $(LN_S) -f libmorfeusz.so.0.6 $(pkglibdir)/libmorfeusz.so uninstall-local: - rm -f $(pkglibdir)/libmorfeusz.so - rm -f $(pkglibdir)/libmorfeusz.so.0 - rm -f $(pkglibdir)/libmorfeusz.so.0.6 +# rm -f $(pkglibdir)/libmorfeusz.so +# rm -f $(pkglibdir)/libmorfeusz.so.0 +# rm -f $(pkglibdir)/libmorfeusz.so.0.6 Index: src/pantera.cpp =================================================================== --- src/pantera.cpp.orig 2011-11-21 17:25:45.000000000 +0100 +++ src/pantera.cpp 2012-07-04 11:26:38.940173323 +0200 @@ -35,7 +35,7 @@ #include "pantera_rules.h" #ifndef DEFAULT_TAGSET -#define DEFAULT_TAGSET "ipipan" +#define DEFAULT_TAGSET "nkjp" #endif #ifndef DEFAULT_ENGINE @@ -80,9 +80,9 @@ if (fs::is_regular_file(path)) { if (path.filename() == "text_structure.xml") { - candidates.push_back(make_pair(path.file_string(), "nkjp-text")); + candidates.push_back(make_pair(path.string(), "nkjp-text")); } else if (path.filename() == "morph.xml") { - candidates.push_back(make_pair(path.file_string(), + candidates.push_back(make_pair(path.string(), "ipipan-morph")); } else if (path.extension() == ".xml") { fs::ifstream stream(path); @@ -91,13 +91,13 @@ char line[1024]; stream.getline(line, sizeof(line)); if (!strncmp(pattern, line, strlen(pattern))) { - candidates.push_back(make_pair(path.file_string(), + candidates.push_back(make_pair(path.string(), "ipipan-morph")); break; } } } else if (path.extension() == ".txt" && specified_directly) { - candidates.push_back(make_pair(path.file_string(), + candidates.push_back(make_pair(path.string(), "plaintext")); } } else if (fs::is_directory(path)) { @@ -137,7 +137,7 @@ type) { vector ret; if (type == "ipipan-morph") { - ret.push_back(input_path.file_string() + ".disamb"); + ret.push_back(input_path.string() + ".disamb"); } else if (type == "nkjp-text" || type == "plaintext") { string segm_filename = "ann_segmentation.xml"; string morph_filename = "ann_morphosyntax.xml"; @@ -160,31 +160,33 @@ boost::scoped_ptr > lexer; static void preprocess_file(const fs::path& path, const string& type, - const Tagset* tagset, vector& text, bool only_lex = false) { + const Tagset* tagset, vector& text, const bool only_lex = false, + const bool ignoreSentsInsideSegment = false) { fs::ifstream data_stream(path); lexer.reset(make_lexer(type, data_stream)); // 1. Parser. - print_status("LEXER", path.file_string()); + print_status("LEXER", path.string()); text.clear(); lexer->setQuiet(options.count("verbose") == 0); lexer->parseStreamToVector(text, &tagset); if (only_lex) return; - // 2. Sentencer. if (options.count("no-sentencer") == 0) { - print_status("SENTENCER", path.file_string()); - static LibSegmentSentencer sentencer; - text = sentencer.addSentenceDelimiters(text); + print_status("SENTENCER", path.string()); + static LibSegmentSentencer sentencer(ignoreSentsInsideSegment); + string sentencerRulesFile = options.count("sentencer-rules") != 0 + ? options["sentencer-rules"].as() + : ""; + text = sentencer.addSentenceDelimiters(text, sentencerRulesFile); } // 3. Morphological analyzer. if (options.count("no-morph") == 0) { - static MorfeuszAnalyzer morfeusz(tagset, - options.count("no-guesser") == 0); + static MorfeuszAnalyzer morfeusz(tagset); static PolishSegmDisambiguator segm_disamb; static bool first_time = true; @@ -195,15 +197,19 @@ if (options.count("morph-dict")) { BOOST_FOREACH(const string& filename, - options["morph-dict"].as >()) - morfeusz.loadMorphDict(filename); + options["morph-dict"].as >()) { + ifstream stream(filename.c_str()); + stream.exceptions(ifstream::badbit); + morfeusz.loadMorphDict(stream); + } } } - print_status("MORPH", path.file_string()); - text = morfeusz.analyzeText(text); + print_status("MORPH", path.string()); + bool use_odgadywacz = options.count("no-guesser") == 0; + text = morfeusz.analyzeText(text, use_odgadywacz); - print_status("SEGM-DISAMB", path.file_string()); + print_status("SEGM-DISAMB", path.string()); segm_disamb.disambiguateSegmentation(text); } } @@ -211,7 +217,7 @@ static void postprocess_file(const fs::path& path, string type, const vector output_paths, const Tagset* tagset, vector& text) { - print_status("WRITER", path.file_string()); + print_status("WRITER", path.string()); string output_format = options["output-format"].as(); if (output_format == "xces") @@ -226,7 +232,7 @@ % output_format)); if (type == "ipipan-morph" || type == "ipipan-disamb") { - ofstream rewrite_out((path.file_string() + ".disamb").c_str()); + ofstream rewrite_out((path.string() + ".disamb").c_str()); IpiPanWriter writer(rewrite_out, type == "ipipan-morph"); writer.writeVectorToStream(tagset, text); } else if (type == "nkjp-text" || type == "plaintext") { @@ -333,6 +339,8 @@ ("morph-dict,d", po::value >(), "extra morphological dictionaries, see documentation " "on the project page for format examples.") + ("sentencer-rules,s", po::value(), "path to sentencer rules file (in SRX format)") + ("ignore-sents-inside-segment", "ignore sentence delimiters inside segment (instead of splitting the segment)") ("nkjp-tool-name", po::value()->default_value("pantera"), "the name of the tool to use when producing NKJP XML output " "(default is 'pantera').") @@ -451,7 +459,7 @@ BOOST_FOREACH(const input_pair_type& input_pair, training_files) { vector text; preprocess_file(input_pair.first, input_pair.second, tagset, - text, true); + text, true, options.count("ignore-sents-inside-segments") != 0); all_text.insert(all_text.end(), text.begin(), text.end()); } @@ -485,7 +493,7 @@ fs::ofstream data_ostream(engine_path, ios::out); boost::archive::text_oarchive engine_oarchive(data_ostream); engine_oarchive << engine; - data_stream.close(); + data_ostream.close(); cerr << endl; cerr << "The engine has been converted to a newer file format." @@ -553,7 +561,7 @@ input_pair.second); vector text; - preprocess_file(input_pair.first, input_pair.second, tagset, text); + preprocess_file(input_pair.first, input_pair.second, tagset, text, false); progress.set(done += 0.3); progress_left -= 0.3; Index: src/nlpcommon/libsegmentsentencer.h =================================================================== --- src/nlpcommon/libsegmentsentencer.h.orig 2011-01-20 22:28:22.000000000 +0100 +++ src/nlpcommon/libsegmentsentencer.h 2012-07-04 11:26:38.784173324 +0200 @@ -11,6 +11,12 @@ #include #include #include +#include +#include +#include + +#include +#include #include #include @@ -20,166 +26,288 @@ #include #include +#include + #ifndef SEGMENT_PATH #error SEGMENT_PATH should be defined automatically by build system #endif +#define DEFAULT_SEGMENT_RULES "segment.srx" + namespace NLPCommon { using namespace redi; template -class LibSegmentSentencer : public Sentencer -{ +class LibSegmentSentencer: public Sentencer { +public: + //~ typedef typename vector::iterator LexemsIterator; private: string segment_exec; + bool ignoreSentsInsideSegment; pstream ps; -public: - LibSegmentSentencer() - : Sentencer(), - segment_exec(find_with_path(SEGMENT_PATH, "segment_batch").file_string()) - { + std::string getCurrentChunk( + const std::string& response, + const int response_position, + const std::string& utf8_orth) { + string res = response.substr( + response_position, + std::min(response.length() - response_position, utf8_orth.length())); + int currPos = response_position + res.length(); + while (chunkWithoutSentenceDelimiters(res).length() < utf8_orth.length() + && currPos < response.length()) { + res += response[currPos]; + currPos++; + } + return res; } - virtual ~LibSegmentSentencer() { } - - vector addSentenceDelimiters(const vector& text) { - int len = text.size(); - vector out; + std::string chunkWithoutSentenceDelimiters(const std::string& chunk) { + std::string res = chunk; + res.erase(std::remove(res.begin(), res.end(), '\0'), res.end()); + return res; + } + + void splitChunk(vector& res, const string& chunk) { + std::stringstream currStream; + bool addedCurrStream; + BOOST_FOREACH( char c, chunk ) { + addedCurrStream = false; + if (c == '\0') { + res.push_back(currStream.str()); + currStream.str(""); + addedCurrStream = true; + } + else { + currStream << c; + } + } + if (!addedCurrStream) { + res.push_back(currStream.str()); + } + } + std::vector splitSegmentIntoSents(const Lexeme& lex, const std::string& currChunk) { + std::vector res; + std::vector delimitedChunks; + splitChunk(delimitedChunks, currChunk); + //~ std::cerr << "currChunk.length()=" << currChunk.length() << " delimitedChunks.size()=" << delimitedChunks.size() << std::endl; + bool isFirst = true; + BOOST_FOREACH( std::string chunk, delimitedChunks ) { + if (!isFirst) { + res.push_back(Lexeme(Lexeme::END_OF_SENTENCE)); + res.push_back(Lexeme(Lexeme::START_OF_SENTENCE)); + res.push_back(Lexeme(Lexeme::NO_SPACE)); + } + Lexeme currLex(Lexeme::SEGMENT); + currLex.setUtf8Orth(chunk); + res.push_back(currLex); + isFirst = false; + } + return res; + } + + void runSegmentSubprocess(const string& rulesPath) { if (!ps.is_open()) { - vector args; + vector < string > args; args.push_back(segment_exec); args.push_back("--null-delimiter"); + args.push_back("-l"); + args.push_back("pl"); + args.push_back("-s"); + args.push_back(rulesPath); + ps.open(segment_exec, args, - pstreams::pstdin|pstreams::pstdout|pstreams::pstderr); + pstreams::pstdin | pstreams::pstdout | pstreams::pstderr); if (!ps.is_open()) { - throw Exception("Cannot execute 'segment_batch' excutable " - "with path '" SEGMENT_PATH "')"); + throw Exception("Cannot execute 'segment_batch' excutable with path '" SEGMENT_PATH "')"); + } + } + } + + int rewriteNonParagraphLexems(const vector& text, int textIdx, vector& out) { + Lexeme lex = text[textIdx]; + while (textIdx < text.size() && lex.getType() != Lexeme::START_OF_PARAGRAPH) { + out.push_back(lex); + this->advanceProgress(); + + textIdx++; + lex = text[textIdx]; + } + return textIdx; + } + + int getOneParagraph(const vector& text, const int currTextIdx, vector& paragraph) { + int textIdx = currTextIdx; + assert(textIdx < text.size()); + assert(text[textIdx].getType() == Lexeme::START_OF_PARAGRAPH); + bool stop = false; + while (textIdx < text.size() && !stop) { + Lexeme lex = text[textIdx]; + paragraph.push_back(lex); + if (lex.getType() == Lexeme::END_OF_PARAGRAPH) { + stop = true; } + textIdx++; + } + return textIdx; + } + + void feedSentencerWithParagraph(const vector& paragraph) { + bool no_space = true; + BOOST_FOREACH( Lexeme lex, paragraph ) { + if (lex.getType() == Lexeme::NO_SPACE) { + no_space = true; + } + else if (lex.getType() == Lexeme::SEGMENT) { + if (!no_space) + ps << ' '; + ps << lex.getUtf8Orth(); + no_space = false; + } + } + ps << '\n'; + ps.flush(); + } + + void readSentencerResponse(string& response) { + if (!getline(ps.out(), response)) + throw Exception("No response returned by 'segment_batch' executable"); + } + + int handleSpacesAndNewSentMarks(const bool no_space, const bool first_sentence, const string& response, int response_position, vector& out) { + + bool was_space_before_newsent = false; + + // handle space before new sentence + if (response[response_position] == ' ' + && response[response_position + 1] == '\0') { + was_space_before_newsent = true; + response_position++; } + + // handle new sentence + if (response[response_position] == '\0') { + if (!first_sentence) { + out.push_back(Lexeme(Lexeme::END_OF_SENTENCE)); + } + out.push_back(Lexeme(Lexeme::START_OF_SENTENCE)); - try { - int i = -1, j; - for (;;) { - // Rewrite everything which is out of paragraphs. - for (i++; i < len; i++) { - const Lexeme& lex = text[i]; + response_position++; + } + + // handle regular space + if (!no_space && !was_space_before_newsent) { + if (response[response_position] != ' ') { + throw Exception( + boost::str(boost::format( + "Expected space not found in " + "output of segment_batch. " + "(Response there: '%1%')") + % response.substr(response_position))); + } + response_position++; + } + + return response_position; + } + + int handleCurrentToken(const Lexeme& lex, const string& response, int response_position, vector& out) { + string utf8_orth = lex.getUtf8Orth(); + string currChunk = getCurrentChunk(response, response_position, utf8_orth); + if (currChunk == utf8_orth) { + response_position += utf8_orth.length(); + out.push_back(lex); + } + else if (chunkWithoutSentenceDelimiters(currChunk) == utf8_orth) { + if (ignoreSentsInsideSegment) { + std::cerr << "WARN: ignoring sentence delimiters in segment '" << currChunk << "'." << std::endl; + out.push_back(lex); + response_position += currChunk.length(); + } + else { + std::cerr << "WARN: adding sentence delimiters into segment '" << currChunk << "'." << std::endl; + BOOST_FOREACH( Lexeme lex, splitSegmentIntoSents(lex, currChunk)) { + //~ if (lex.getType() == Lexeme::SEGMENT) + //~ std::cerr << "WARN: adding " << lex.getUtf8Orth() << std::endl; out.push_back(lex); - this->advanceProgress(); - if (lex.getType() == Lexeme::START_OF_PARAGRAPH) - break; } - - if (i == len) - break; - - // Feed the sentencer with the paragraph. - bool no_space = true; - for (j = i; j < len; j++) { - const Lexeme& lex = text[j]; - if (lex.getType() == Lexeme::END_OF_PARAGRAPH) { - break; - } else if (lex.getType() == Lexeme::NO_SPACE) { - no_space = true; - } else if (lex.getType() == Lexeme::SEGMENT) { - if (!no_space) - ps << ' '; - ps << lex.getUtf8Orth(); - no_space = false; - } - } - ps << '\n'; - - // Read response. - ps.flush(); - std::string response; - if (!getline(ps.out(), response)) { - std::cerr << "RESP: " << response << std::endl; - throw Exception("No response returned by 'segment_batch'" - " executable"); - } - - - // Read back and insert sentence delimiters. - bool first_sentence = true; - int response_position = 0; + response_position += currChunk.length(); + } + } + else { + throw Exception(boost::str(boost::format( + "Expected word '%1%' not found in" + "output of segment_batch. " + "(Response there: '%2%')") + % utf8_orth + % response.substr(response_position))); + } + + return response_position; + } + + void parseSentencerResponse(const vector& paragraph, const string& response, vector& out) { + bool no_space = true; + bool first_sentence = true; + int response_position = 0; + BOOST_FOREACH( Lexeme lex, paragraph ) { + if (lex.getType() == Lexeme::NO_SPACE) { no_space = true; - for (j = i + 1; j < len; j++) { - const Lexeme& lex = text[j]; - if (lex.getType() == Lexeme::END_OF_PARAGRAPH) { - break; - } else if (lex.getType() == Lexeme::NO_SPACE) { - out.push_back(lex); - no_space = true; - } else if (lex.getType() == Lexeme::SEGMENT) { - const std::string& utf8_orth = lex.getUtf8Orth(); - - if (response[response_position] == '\0') { - // New sentence starts here. - if (first_sentence) { - first_sentence = false; - } else { - out.push_back(Lexeme(Lexeme::END_OF_SENTENCE)); - } - out.push_back(Lexeme(Lexeme::START_OF_SENTENCE)); - - response_position++; - } - - // std::cerr << "response_pos " << response_position - // << " len " << response.length() << " utf8_orth '" << - // utf8_orth << "' no_space " << (no_space ? "Y" : "N") - // << std::endl; - - if (!no_space) { - if (response[response_position] != ' ') { - throw Exception(boost::str(boost::format( - "Expected space not found in " - "output of segment_batch. " - "(Response there: '%1%')") - % response.substr(response_position))); - } - response_position++; - } - - if (response.substr(response_position, - std::min(response.length() - response_position, - utf8_orth.length())) - != utf8_orth) { - std::cerr << "BAD " << utf8_orth << std::endl << - response.substr(response_position) << std::endl; - throw Exception(boost::str(boost::format( - "Expected word '%1%' not found in " - "output of segment_batch. " - "(Response there: '%2%')") - % utf8_orth - % response.substr(response_position))); - } - - response_position += utf8_orth.length(); - out.push_back(lex); - no_space = false; - } else { - out.push_back(lex); - } - this->advanceProgress(); - } - - if (!first_sentence) - out.push_back(Lexeme(Lexeme::END_OF_SENTENCE)); - out.push_back(Lexeme(Lexeme::END_OF_PARAGRAPH)); - - i = j; + out.push_back(lex); + } + else if (lex.getType() == Lexeme::SEGMENT) { + //~ std::cerr << "segment " << lex.getUtf8Orth() << std::endl; + response_position = handleSpacesAndNewSentMarks(no_space, first_sentence, response, response_position, out); + //~ std::cerr << "handled spaces and new sent marks " << response_position << std::endl; + response_position = handleCurrentToken(lex, response, response_position, out); + //~ std::cerr << "handled token itself " << response_position << std::endl; + no_space = false; + first_sentence = false; } + else + out.push_back(lex); + } + } + + int doOneParagraph(const vector& text, int textIdx, vector& out) { + vector paragraph; + string response; + textIdx = getOneParagraph(text, textIdx, paragraph); + feedSentencerWithParagraph(paragraph); + readSentencerResponse(response); + parseSentencerResponse(paragraph, response, out); + return textIdx; + } - return out; - } catch (...) { - ps.rdbuf()->kill(SIGKILL); - ps.close(); - throw; +public: + + LibSegmentSentencer(const bool ignoreSentsInsideSegment = false) : + Sentencer(), + segment_exec(find_with_path(SEGMENT_PATH, "segment_batch").string()), + ignoreSentsInsideSegment(ignoreSentsInsideSegment) {} + + virtual ~LibSegmentSentencer() { + } + + vector addSentenceDelimiters(const vector& text, const string& sentencerRules) { + vector res; + + string rulesPath = sentencerRules.empty() + ? find_with_path(SEGMENT_PATH, DEFAULT_SEGMENT_RULES).string() + : sentencerRules; + runSegmentSubprocess(rulesPath); + + int textIdx = 0; + + while (textIdx < text.size()) { + textIdx = rewriteNonParagraphLexems(text, textIdx, res); + if (textIdx < text.size()) + textIdx = doOneParagraph(text, textIdx, res); } + + return res; } }; Index: libpantera.pc.in =================================================================== --- libpantera.pc.in.orig 2011-06-08 22:20:59.000000000 +0200 +++ libpantera.pc.in 2012-07-04 11:15:13.500186560 +0200 @@ -9,6 +9,6 @@ Requires: Version: @PACKAGE_VERSION@ Libs: -L${pkglibdir} -lcorpus -lnlpcommon -lmorfeusz @BOOST_LDFLAGS@ @BOOST_SERIALIZATION_LIB@ @BOOST_REGEX_LIB@ @BOOST_PROGRAM_OPTIONS_LIB@ @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_IOSTREAMS_LIB@ @BOOST_MPI_LIB@ @ICU_LIBS@ @LIBICONV@ -lpantera -Cflags: +Cflags: @OPENMP_CXXFLAGS@ Index: src/Makefile.am =================================================================== --- src/Makefile.am.orig 2011-06-08 21:25:58.000000000 +0200 +++ src/Makefile.am 2012-07-04 16:28:02.691824049 +0200 @@ -1,6 +1,6 @@ AM_CXXFLAGS = @BOOST_CPPFLAGS@ @OPENMP_CXXFLAGS@ @MORFEUSZ_CFLAGS@ \ -I../third_party/TaKIPI18/Linux/Corpus \ - -DSEGMENT_PATH=\"$(libexecdir)/$(PACKAGE):@abs_top_srcdir@/third_party/segment\" \ + -DSEGMENT_PATH=\"$(libexecdir)/$(PACKAGE):$(pkgdatadir):@abs_top_srcdir@/third_party/segment\" \ -DENGINES_PATH=\"$(pkgdatadir)/engines:@abs_top_srcdir@/engines\" SUBDIRS = nlpcommon @@ -35,17 +35,18 @@ clean-local: +make -C ../third_party/TaKIPI18/Linux/bin clean + rm -rf ../third_party/TaKIPI18/Linux/bin/* install-exec-local: ../third_party/TaKIPI18/Linux/bin/Corpus/libcorpus.so - $(INSTALL_PROGRAM) -D ../third_party/TaKIPI18/Linux/bin/Corpus/libcorpus.so $(pkglibdir)/libcorpus.so + $(INSTALL_PROGRAM) -D ../third_party/TaKIPI18/Linux/bin/Corpus/libcorpus.so $(DESTDIR)$(pkglibdir)/libcorpus.so.1 + ln -s libcorpus.so.1 $(DESTDIR)$(pkglibdir)/libcorpus.so GLOBAL_LINK_FLAGS = -Wl,-rpath -Wl,$(pkglibdir) LIBCORPUS_LINK_FLAGS = -L../third_party/TaKIPI18/Linux/bin/Corpus \ - -Wl,-rpath -Wl,@abs_top_srcdir@/third_party/TaKIPI18/Linux/bin/Corpus \ -lcorpus -LIBMORFEUSZ_LINK_FLAGS = -Wl,-rpath -Wl,@abs_top_srcdir@/third_party/morfeusz/lib +LIBMORFEUSZ_LINK_FLAGS = BUILT_SOURCES = rules/c1.m4h @@ -59,46 +60,71 @@ rules/a.h rules/c1.m4h rules/p1.h rules/p2.h \ rules/impl.h rules/make.h brillengine.h \ brillexeme.h unigram.h rules.h pantera_rules.h \ - pantera.h + pantera.h TaggingOptions.h pantera_CXXFLAGS = $(AM_CXXFLAGS) -pantera_LDFLAGS = @BOOST_LDFLAGS@ @BOOST_SERIALIZATION_LIB@ \ - @BOOST_REGEX_LIB@ @BOOST_PROGRAM_OPTIONS_LIB@ \ +pantera_LDFLAGS = $(LIBCORPUS_LINK_FLAGS) $(GLOBAL_LINK_FLAGS) $(LIBMORFEUSZ_LINK_FLAGS) \ + @BOOST_LDFLAGS@ + +pantera_LDADD = nlpcommon/libnlpcommon.la \ + ../third_party/TaKIPI18/Linux/bin/Corpus/libcorpus.so \ + @BOOST_SERIALIZATION_LIB@ \ + @BOOST_PROGRAM_OPTIONS_LIB@ \ @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ \ @BOOST_IOSTREAMS_LIB@ \ @BOOST_MPI_LIB@ @ICU_LIBS@ @LIBICONV@ \ - @MORFEUSZ_LIBS@ $(LIBCORPUS_LINK_FLAGS) \ - $(GLOBAL_LINK_FLAGS) $(LIBMORFEUSZ_LINK_FLAGS) -pantera_LDADD = nlpcommon/libnlpcommon.la \ - ../third_party/TaKIPI18/Linux/bin/Corpus/libcorpus.so + @MORFEUSZ_LIBS@ @BOOST_REGEX_LIB@ + + + +libpantera_la_SOURCES = wrapper.cpp pantera_rules.cpp TaggingOptions.cpp +include_HEADERS = wrapper.h TaggingOptions.h -libpantera_la_SOURCES = wrapper.cpp pantera_rules.cpp -include_HEADERS = wrapper.h +libpantera_la_LDFLAGS = $(LIBCORPUS_LINK_FLAGS) $(GLOBAL_LINK_FLAGS) $(LIBMORFEUSZ_LINK_FLAGS) \ + @BOOST_LDFLAGS@ + +libpantera_la_LIBADD = ../third_party/TaKIPI18/Linux/bin/Corpus/libcorpus.so \ + @BOOST_SERIALIZATION_LIB@ \ + @BOOST_PROGRAM_OPTIONS_LIB@ \ + @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ \ + @BOOST_IOSTREAMS_LIB@ \ + @BOOST_MPI_LIB@ @ICU_LIBS@ @LIBICONV@ \ + @MORFEUSZ_LIBS@ @BOOST_REGEX_LIB@ wrapper_test_SOURCES = wrapper_test.cpp \ rules/a.h rules/c1.m4h rules/p1.h rules/p2.h \ rules/impl.h rules/make.h brillengine.h \ brillexeme.h unigram.h rules.h pantera_rules.h \ - pantera.h -wrapper_test_LDFLAGS = @BOOST_LDFLAGS@ @BOOST_SERIALIZATION_LIB@ \ - @BOOST_REGEX_LIB@ @BOOST_PROGRAM_OPTIONS_LIB@ \ + pantera.h TaggingOptions.h +wrapper_test_LDFLAGS = $(LIBCORPUS_LINK_FLAGS) $(GLOBAL_LINK_FLAGS) $(LIBMORFEUSZ_LINK_FLAGS) \ + @BOOST_LDFLAGS@ + + +wrapper_test_LDADD = libpantera.la nlpcommon/libnlpcommon.la \ + ../third_party/TaKIPI18/Linux/bin/Corpus/libcorpus.so \ + @BOOST_SERIALIZATION_LIB@ \ + @BOOST_PROGRAM_OPTIONS_LIB@ \ @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ \ @BOOST_IOSTREAMS_LIB@ \ @BOOST_MPI_LIB@ @ICU_LIBS@ @LIBICONV@ \ - @MORFEUSZ_LIBS@ $(LIBCORPUS_LINK_FLAGS) \ - $(GLOBAL_LINK_FLAGS) $(LIBMORFEUSZ_LINK_FLAGS) -wrapper_test_LDADD = libpantera.la nlpcommon/libnlpcommon.la \ - ../third_party/TaKIPI18/Linux/bin/Corpus/libcorpus.so + @MORFEUSZ_LIBS@ @BOOST_REGEX_LIB@ + + pantera_eval_SOURCES = eval.cpp -pantera_eval_LDFLAGS = @BOOST_LDFLAGS@ @BOOST_SERIALIZATION_LIB@ \ - @BOOST_REGEX_LIB@ @BOOST_PROGRAM_OPTIONS_LIB@ \ +pantera_eval_LDFLAGS = $(LIBCORPUS_LINK_FLAGS) $(GLOBAL_LINK_FLAGS) $(LIBMORFEUSZ_LINK_FLAGS) \ + @BOOST_LDFLAGS@ + +pantera_eval_LDADD = libpantera.la nlpcommon/libnlpcommon.la \ + ../third_party/TaKIPI18/Linux/bin/Corpus/libcorpus.so \ + @BOOST_SERIALIZATION_LIB@ \ + @BOOST_PROGRAM_OPTIONS_LIB@ \ @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ \ @BOOST_IOSTREAMS_LIB@ \ @BOOST_MPI_LIB@ @ICU_LIBS@ @LIBICONV@ \ - @MORFEUSZ_LIBS@ $(LIBCORPUS_LINK_FLAGS) \ - $(GLOBAL_LINK_FLAGS) $(LIBMORFEUSZ_LINK_FLAGS) -pantera_eval_LDADD = libpantera.la nlpcommon/libnlpcommon.la \ - ../third_party/TaKIPI18/Linux/bin/Corpus/libcorpus.so + @MORFEUSZ_LIBS@ @BOOST_REGEX_LIB@ + + + #eval_SOURCES = eval.cpp #eval_LDFLAGS = @BOOST_LDFLAGS@ @BOOST_REGEX_LIB@ \ Index: src/rules/c1.m4h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ src/rules/c1.m4h 2012-07-04 11:15:13.504186560 +0200 @@ -0,0 +1,813 @@ + + + + + + + + + + + + + + + + + + + + + + +#define TAGSET (this->tagsets[Phase]) + +#define ISNULL(offset) (text[index + (offset)].chosen_tag[Phase] == Lexeme::tag_type::getNullTag()) +#define POSNUM(offset) (text[index + (offset)].chosen_tag[Phase].getPos()) +#define ORTH(offset) (text[index + (offset)].getOrth()) +#define POS(offset) (TAGSET->getPartOfSpeech(POSNUM(offset))) +#define DEFPOS(name, offset) const PartOfSpeech* name = ISNULL(offset) ? NULL : POS(offset); + +#define FORCAT(name, name_idx, offset) \ + BOOST_FOREACH(const Category* name, POS(offset)->getCategories()) { \ + int name_idx = TAGSET->getCategoryIndex(name); +#define NEXTCAT \ + } + +#define VALUE(offset, cat_idx) \ + (text[index + offset].chosen_tag[Phase].getValue(cat_idx)) + +#define C(cat_num) \ + (p.params.categories[cat_num] == (uint8_t)-1 ? "pos" : \ + TAGSET->getCategory(p.params.categories[cat_num])->getName().c_str()) +#define P(p_num) \ + TAGSET->getPartOfSpeech(p.params.pos[p_num])->getName().c_str() +#define V(cat_num, v_num) \ + (p.params.categories[cat_num] == (uint8_t)-1 ? \ + P(v_num) :\ + TAGSET->getCategory(p.params.categories[cat_num])->getValue( \ + p.params.values[v_num]).c_str()) + +static inline bool match_prefix(const wstring& string, const wchar_t* pattern, int len) { + if (string.length() < len) + return false; + for (int i = 0; i < len; i++) + if (string[i] != pattern[i]) + return false; + return true; +} + +static inline bool match_suffix(const wstring& string, const wchar_t* pattern, int len) { + size_t slen = string.length(); + if (slen < len) + return false; + for (int i = 0; i < len; i++) + if (string[slen - len + i] != pattern[i]) + return false; + return true; +} + +static inline bool copy_prefix(const wstring& string, wchar_t* pattern, int len) { + if (string.length() < len) + return false; + for (int i = 0; i < len; i++) + pattern[i] = string[i]; + return true; +} + +static inline bool copy_suffix(const wstring& string, wchar_t* pattern, int len) { + size_t slen = string.length(); + if (slen < len) + return false; + for (int i = 0; i < len; i++) + pattern[i] = string[slen - len + i]; + return true; +} + +static wstring orth_match_repr(bool match_nearby, const wchar_t* pattern, int prefix_len, + int suffix_len) { + wchar_t wbuf[STR_SIZE]; + int plen = std::max(prefix_len, suffix_len); + wmemcpy(wbuf, pattern, plen); + wbuf[plen] = L'\0'; + if (!prefix_len && !suffix_len) + return L""; + return boost::str(boost::wformat(L" AND %hs %hs (%d chars) with '%ls'") + % (match_nearby ? "nearby segment" : "T[0]") + % (prefix_len > 0 ? "starts" : "ends") + % plen + % wbuf); +} + +static wstring history_match_repr(bool use_history, int rule_number) { + if (!use_history) + return L""; + if (rule_number == 0) + return L" AND T[0] was not changed"; + return boost::str(boost::wformat(L" AND T[0] was changed by rule %d in phase %d") + % (rule_number % 10000) % (rule_number / 10000)); +} + + + + + + + + +template + +class Nearby1CatPredicateTemplate : public PredicateTemplate +{ +public: + Nearby1CatPredicateTemplate(const vector tagsets) : PredicateTemplate(tagsets) { } + + + + + void findMatchingPredicates(vector >& v, + vector& text, + int index) { + assert(PrefixLen == 0 || SuffixLen == 0); + + if (ISNULL(0)) return; + + Predicate p = Predicate(this); + p.params.pos[0] = POSNUM(0); + if (UseHistory) + p.params.rule_number = text[index].last_matched_rule; + if (!MatchNearbyOrth && !copy_prefix(ORTH(0), p.params.chars, PrefixLen)) + return; + if (!MatchNearbyOrth && !copy_suffix(ORTH(0), p.params.chars, SuffixLen)) + return; + + + DEFPOS(pos1, Offset1); + + + FORCAT(cat, c, 0) { + p.params.categories[0] = c; + p.params.values[0] = VALUE(0, c); + +do { + if (pos1 && pos1->hasCategory(cat)) { + p.params.values[1] = VALUE(Offset1, c); + if (AlwaysPos) + p.params.pos[1] = POSNUM(Offset1); + if ((PrefixLen || SuffixLen) && MatchNearbyOrth) { + if (!copy_prefix(ORTH(Offset1), p.params.chars, PrefixLen)) + break; + if (!copy_suffix(ORTH(Offset1), p.params.chars, SuffixLen)) + break; + } + v.push_back(p); + } + } while(0); + + } NEXTCAT + + p.params.categories[0] = -1; + p.params.values[0] = -1; + p.params.values[1] = -1; + +do { + if (pos1) { + p.params.pos[1] = POSNUM(Offset1); + if ((PrefixLen || SuffixLen) && MatchNearbyOrth) { + if (!copy_prefix(ORTH(Offset1), p.params.chars, PrefixLen)) + break; + if (!copy_suffix(ORTH(Offset1), p.params.chars, SuffixLen)) + break; + } + v.push_back(p); + } + } while(0); + + } + + + bool predicateMatches(const Predicate& p, + vector& text, int index) { + if (p.params.pos[0] != POSNUM(0)) + return false; + if (UseHistory && text[index].last_matched_rule != p.params.rule_number) + return false; + if (PrefixLen || SuffixLen) { + if (!MatchNearbyOrth && !match_prefix(ORTH(0), p.params.chars, PrefixLen)) + return false; + if (!MatchNearbyOrth && !match_suffix(ORTH(0), p.params.chars, SuffixLen)) + return false; + } + int c = p.params.categories[0]; + if (c == (uint8_t)-1) { + return ( +(!ISNULL(Offset1) && p.params.pos[1] == POSNUM(Offset1) + && (!MatchNearbyOrth || (match_prefix(ORTH(Offset1), p.params.chars, PrefixLen) + && match_suffix(ORTH(Offset1), p.params.chars, SuffixLen))) + ) +); + } else { + return ( +(!ISNULL(Offset1) && p.params.values[1] == VALUE(Offset1, c) && (!AlwaysPos || p.params.pos[1] == POSNUM(Offset1)) + && (!MatchNearbyOrth || (match_prefix(ORTH(Offset1), p.params.chars, PrefixLen) + && match_suffix(ORTH(Offset1), p.params.chars, SuffixLen))) + ) +) + && p.params.values[0] == VALUE(0, c); + } + } + + + wstring predicateAsWString(const Predicate& p) { + wchar_t str[STR_SIZE]; + swprintf(str, STR_SIZE, L"(" +L"T[%d]|pos,%hs = %hs,%hs" + L") AND T[0]|pos,%hs = %hs,%hs%ls%ls", +Offset1,C(0),AlwaysPos ? P(1) : "*",V(0, 1), + + C(0),P(0),V(0, 0),orth_match_repr(MatchNearbyOrth, p.params.chars, PrefixLen, SuffixLen).c_str(),history_match_repr(UseHistory, p.params.rule_number).c_str()); + return wstring(str); + } + + + bool usesCategory0() { + return true; + } + + +}; + + + + + +template + +class Nearby2CatPredicateTemplate : public PredicateTemplate +{ +public: + Nearby2CatPredicateTemplate(const vector tagsets) : PredicateTemplate(tagsets) { } + + + + + void findMatchingPredicates(vector >& v, + vector& text, + int index) { + assert(PrefixLen == 0 || SuffixLen == 0); + + if (ISNULL(0)) return; + + Predicate p = Predicate(this); + p.params.pos[0] = POSNUM(0); + if (UseHistory) + p.params.rule_number = text[index].last_matched_rule; + if (!MatchNearbyOrth && !copy_prefix(ORTH(0), p.params.chars, PrefixLen)) + return; + if (!MatchNearbyOrth && !copy_suffix(ORTH(0), p.params.chars, SuffixLen)) + return; + + + DEFPOS(pos1, Offset1); + + DEFPOS(pos2, Offset2); + + + FORCAT(cat, c, 0) { + p.params.categories[0] = c; + p.params.values[0] = VALUE(0, c); + +do { + if (pos1 && pos1->hasCategory(cat)) { + p.params.values[1] = VALUE(Offset1, c); + if (AlwaysPos) + p.params.pos[1] = POSNUM(Offset1); + if ((PrefixLen || SuffixLen) && MatchNearbyOrth) { + if (!copy_prefix(ORTH(Offset1), p.params.chars, PrefixLen)) + break; + if (!copy_suffix(ORTH(Offset1), p.params.chars, SuffixLen)) + break; + } + v.push_back(p); + } + } while(0);do { + if (pos2 && pos2->hasCategory(cat)) { + p.params.values[1] = VALUE(Offset2, c); + if (AlwaysPos) + p.params.pos[1] = POSNUM(Offset2); + if ((PrefixLen || SuffixLen) && MatchNearbyOrth) { + if (!copy_prefix(ORTH(Offset2), p.params.chars, PrefixLen)) + break; + if (!copy_suffix(ORTH(Offset2), p.params.chars, SuffixLen)) + break; + } + v.push_back(p); + } + } while(0); + + } NEXTCAT + + p.params.categories[0] = -1; + p.params.values[0] = -1; + p.params.values[1] = -1; + +do { + if (pos1) { + p.params.pos[1] = POSNUM(Offset1); + if ((PrefixLen || SuffixLen) && MatchNearbyOrth) { + if (!copy_prefix(ORTH(Offset1), p.params.chars, PrefixLen)) + break; + if (!copy_suffix(ORTH(Offset1), p.params.chars, SuffixLen)) + break; + } + v.push_back(p); + } + } while(0);do { + if (pos2) { + p.params.pos[1] = POSNUM(Offset2); + if ((PrefixLen || SuffixLen) && MatchNearbyOrth) { + if (!copy_prefix(ORTH(Offset2), p.params.chars, PrefixLen)) + break; + if (!copy_suffix(ORTH(Offset2), p.params.chars, SuffixLen)) + break; + } + v.push_back(p); + } + } while(0); + + } + + + bool predicateMatches(const Predicate& p, + vector& text, int index) { + if (p.params.pos[0] != POSNUM(0)) + return false; + if (UseHistory && text[index].last_matched_rule != p.params.rule_number) + return false; + if (PrefixLen || SuffixLen) { + if (!MatchNearbyOrth && !match_prefix(ORTH(0), p.params.chars, PrefixLen)) + return false; + if (!MatchNearbyOrth && !match_suffix(ORTH(0), p.params.chars, SuffixLen)) + return false; + } + int c = p.params.categories[0]; + if (c == (uint8_t)-1) { + return ( +(!ISNULL(Offset1) && p.params.pos[1] == POSNUM(Offset1) + && (!MatchNearbyOrth || (match_prefix(ORTH(Offset1), p.params.chars, PrefixLen) + && match_suffix(ORTH(Offset1), p.params.chars, SuffixLen))) + )||(!ISNULL(Offset2) && p.params.pos[1] == POSNUM(Offset2) + && (!MatchNearbyOrth || (match_prefix(ORTH(Offset2), p.params.chars, PrefixLen) + && match_suffix(ORTH(Offset2), p.params.chars, SuffixLen))) + ) +); + } else { + return ( +(!ISNULL(Offset1) && p.params.values[1] == VALUE(Offset1, c) && (!AlwaysPos || p.params.pos[1] == POSNUM(Offset1)) + && (!MatchNearbyOrth || (match_prefix(ORTH(Offset1), p.params.chars, PrefixLen) + && match_suffix(ORTH(Offset1), p.params.chars, SuffixLen))) + )||(!ISNULL(Offset2) && p.params.values[1] == VALUE(Offset2, c) && (!AlwaysPos || p.params.pos[1] == POSNUM(Offset2)) + && (!MatchNearbyOrth || (match_prefix(ORTH(Offset2), p.params.chars, PrefixLen) + && match_suffix(ORTH(Offset2), p.params.chars, SuffixLen))) + ) +) + && p.params.values[0] == VALUE(0, c); + } + } + + + wstring predicateAsWString(const Predicate& p) { + wchar_t str[STR_SIZE]; + swprintf(str, STR_SIZE, L"(" +L"T[%d]|pos,%hs = %hs,%hs"L" OR "L"T[%d]|pos,%hs = %hs,%hs" + L") AND T[0]|pos,%hs = %hs,%hs%ls%ls", +Offset1,C(0),AlwaysPos ? P(1) : "*",V(0, 1),Offset2,C(0),AlwaysPos ? P(1) : "*",V(0, 1), + + C(0),P(0),V(0, 0),orth_match_repr(MatchNearbyOrth, p.params.chars, PrefixLen, SuffixLen).c_str(),history_match_repr(UseHistory, p.params.rule_number).c_str()); + return wstring(str); + } + + + bool usesCategory0() { + return true; + } + + +}; + + + + + +template + +class Nearby3CatPredicateTemplate : public PredicateTemplate +{ +public: + Nearby3CatPredicateTemplate(const vector tagsets) : PredicateTemplate(tagsets) { } + + + + + void findMatchingPredicates(vector >& v, + vector& text, + int index) { + assert(PrefixLen == 0 || SuffixLen == 0); + + if (ISNULL(0)) return; + + Predicate p = Predicate(this); + p.params.pos[0] = POSNUM(0); + if (UseHistory) + p.params.rule_number = text[index].last_matched_rule; + if (!MatchNearbyOrth && !copy_prefix(ORTH(0), p.params.chars, PrefixLen)) + return; + if (!MatchNearbyOrth && !copy_suffix(ORTH(0), p.params.chars, SuffixLen)) + return; + + + DEFPOS(pos1, Offset1); + + DEFPOS(pos2, Offset2); + + DEFPOS(pos3, Offset3); + + + FORCAT(cat, c, 0) { + p.params.categories[0] = c; + p.params.values[0] = VALUE(0, c); + +do { + if (pos1 && pos1->hasCategory(cat)) { + p.params.values[1] = VALUE(Offset1, c); + if (AlwaysPos) + p.params.pos[1] = POSNUM(Offset1); + if ((PrefixLen || SuffixLen) && MatchNearbyOrth) { + if (!copy_prefix(ORTH(Offset1), p.params.chars, PrefixLen)) + break; + if (!copy_suffix(ORTH(Offset1), p.params.chars, SuffixLen)) + break; + } + v.push_back(p); + } + } while(0);do { + if (pos2 && pos2->hasCategory(cat)) { + p.params.values[1] = VALUE(Offset2, c); + if (AlwaysPos) + p.params.pos[1] = POSNUM(Offset2); + if ((PrefixLen || SuffixLen) && MatchNearbyOrth) { + if (!copy_prefix(ORTH(Offset2), p.params.chars, PrefixLen)) + break; + if (!copy_suffix(ORTH(Offset2), p.params.chars, SuffixLen)) + break; + } + v.push_back(p); + } + } while(0);do { + if (pos3 && pos3->hasCategory(cat)) { + p.params.values[1] = VALUE(Offset3, c); + if (AlwaysPos) + p.params.pos[1] = POSNUM(Offset3); + if ((PrefixLen || SuffixLen) && MatchNearbyOrth) { + if (!copy_prefix(ORTH(Offset3), p.params.chars, PrefixLen)) + break; + if (!copy_suffix(ORTH(Offset3), p.params.chars, SuffixLen)) + break; + } + v.push_back(p); + } + } while(0); + + } NEXTCAT + + p.params.categories[0] = -1; + p.params.values[0] = -1; + p.params.values[1] = -1; + +do { + if (pos1) { + p.params.pos[1] = POSNUM(Offset1); + if ((PrefixLen || SuffixLen) && MatchNearbyOrth) { + if (!copy_prefix(ORTH(Offset1), p.params.chars, PrefixLen)) + break; + if (!copy_suffix(ORTH(Offset1), p.params.chars, SuffixLen)) + break; + } + v.push_back(p); + } + } while(0);do { + if (pos2) { + p.params.pos[1] = POSNUM(Offset2); + if ((PrefixLen || SuffixLen) && MatchNearbyOrth) { + if (!copy_prefix(ORTH(Offset2), p.params.chars, PrefixLen)) + break; + if (!copy_suffix(ORTH(Offset2), p.params.chars, SuffixLen)) + break; + } + v.push_back(p); + } + } while(0);do { + if (pos3) { + p.params.pos[1] = POSNUM(Offset3); + if ((PrefixLen || SuffixLen) && MatchNearbyOrth) { + if (!copy_prefix(ORTH(Offset3), p.params.chars, PrefixLen)) + break; + if (!copy_suffix(ORTH(Offset3), p.params.chars, SuffixLen)) + break; + } + v.push_back(p); + } + } while(0); + + } + + + bool predicateMatches(const Predicate& p, + vector& text, int index) { + if (p.params.pos[0] != POSNUM(0)) + return false; + if (UseHistory && text[index].last_matched_rule != p.params.rule_number) + return false; + if (PrefixLen || SuffixLen) { + if (!MatchNearbyOrth && !match_prefix(ORTH(0), p.params.chars, PrefixLen)) + return false; + if (!MatchNearbyOrth && !match_suffix(ORTH(0), p.params.chars, SuffixLen)) + return false; + } + int c = p.params.categories[0]; + if (c == (uint8_t)-1) { + return ( +(!ISNULL(Offset1) && p.params.pos[1] == POSNUM(Offset1) + && (!MatchNearbyOrth || (match_prefix(ORTH(Offset1), p.params.chars, PrefixLen) + && match_suffix(ORTH(Offset1), p.params.chars, SuffixLen))) + )||(!ISNULL(Offset2) && p.params.pos[1] == POSNUM(Offset2) + && (!MatchNearbyOrth || (match_prefix(ORTH(Offset2), p.params.chars, PrefixLen) + && match_suffix(ORTH(Offset2), p.params.chars, SuffixLen))) + )||(!ISNULL(Offset3) && p.params.pos[1] == POSNUM(Offset3) + && (!MatchNearbyOrth || (match_prefix(ORTH(Offset3), p.params.chars, PrefixLen) + && match_suffix(ORTH(Offset3), p.params.chars, SuffixLen))) + ) +); + } else { + return ( +(!ISNULL(Offset1) && p.params.values[1] == VALUE(Offset1, c) && (!AlwaysPos || p.params.pos[1] == POSNUM(Offset1)) + && (!MatchNearbyOrth || (match_prefix(ORTH(Offset1), p.params.chars, PrefixLen) + && match_suffix(ORTH(Offset1), p.params.chars, SuffixLen))) + )||(!ISNULL(Offset2) && p.params.values[1] == VALUE(Offset2, c) && (!AlwaysPos || p.params.pos[1] == POSNUM(Offset2)) + && (!MatchNearbyOrth || (match_prefix(ORTH(Offset2), p.params.chars, PrefixLen) + && match_suffix(ORTH(Offset2), p.params.chars, SuffixLen))) + )||(!ISNULL(Offset3) && p.params.values[1] == VALUE(Offset3, c) && (!AlwaysPos || p.params.pos[1] == POSNUM(Offset3)) + && (!MatchNearbyOrth || (match_prefix(ORTH(Offset3), p.params.chars, PrefixLen) + && match_suffix(ORTH(Offset3), p.params.chars, SuffixLen))) + ) +) + && p.params.values[0] == VALUE(0, c); + } + } + + + wstring predicateAsWString(const Predicate& p) { + wchar_t str[STR_SIZE]; + swprintf(str, STR_SIZE, L"(" +L"T[%d]|pos,%hs = %hs,%hs"L" OR "L"T[%d]|pos,%hs = %hs,%hs"L" OR "L"T[%d]|pos,%hs = %hs,%hs" + L") AND T[0]|pos,%hs = %hs,%hs%ls%ls", +Offset1,C(0),AlwaysPos ? P(1) : "*",V(0, 1),Offset2,C(0),AlwaysPos ? P(1) : "*",V(0, 1),Offset3,C(0),AlwaysPos ? P(1) : "*",V(0, 1), + + C(0),P(0),V(0, 0),orth_match_repr(MatchNearbyOrth, p.params.chars, PrefixLen, SuffixLen).c_str(),history_match_repr(UseHistory, p.params.rule_number).c_str()); + return wstring(str); + } + + + bool usesCategory0() { + return true; + } + + +}; + + + + + +template + +class NearbyExact2CatPredicateTemplate : public PredicateTemplate +{ +public: + NearbyExact2CatPredicateTemplate(const vector tagsets) : PredicateTemplate(tagsets) { } + + + + + void findMatchingPredicates(vector >& v, + vector& text, + int index) { + Predicate p = Predicate(this); + p.params.pos[0] = POSNUM(0); + + + DEFPOS(pos1, Offset1); + + DEFPOS(pos2, Offset2); + + + FORCAT(cat, c, 0) { + p.params.categories[0] = c; + p.params.values[0] = VALUE(0, c); + + + if (!(pos1 && pos1->hasCategory(cat))) + continue; + + if (!(pos2 && pos2->hasCategory(cat))) + continue; + + + + + p.params.values[1] = VALUE(Offset1, c); + if (AlwaysPos) + p.params.pos[1] = POSNUM(Offset1); + + p.params.values[2] = VALUE(Offset2, c); + if (AlwaysPos) + p.params.pos[2] = POSNUM(Offset2); + + + v.push_back(p); + } NEXTCAT + + p.params.categories[0] = -1; + p.params.values[0] = -1; + + + if (!pos1) + return; + p.params.values[1] = -1; + p.params.pos[1] = POSNUM(Offset1); + + if (!pos2) + return; + p.params.values[2] = -1; + p.params.pos[2] = POSNUM(Offset2); + + + v.push_back(p); + } + + + bool predicateMatches(const Predicate& p, + vector& text, int index) { + if (p.params.pos[0] != POSNUM(0)) + return false; + int c = p.params.categories[0]; + if (c == (uint8_t)-1) { + return ( +(!ISNULL(Offset1) && p.params.pos[1] == POSNUM(Offset1))&&(!ISNULL(Offset2) && p.params.pos[2] == POSNUM(Offset2)) +); + } else { + return ( +(!ISNULL(Offset1) && p.params.values[1] == VALUE(Offset1, c) && (!AlwaysPos || p.params.pos[1] == POSNUM(Offset1)))&&(!ISNULL(Offset2) && p.params.values[2] == VALUE(Offset2, c) && (!AlwaysPos || p.params.pos[2] == POSNUM(Offset2))) +) + && p.params.values[0] == VALUE(0, c); + } + } + + + wstring predicateAsWString(const Predicate& p) { + wchar_t str[STR_SIZE]; + swprintf(str, STR_SIZE, +L"T[%d]|pos,%hs = %hs,%hs"L" AND "L"T[%d]|pos,%hs = %hs,%hs" + L" AND T[0]|pos = %hs AND T[0]|%hs = %hs", +Offset1,C(0),AlwaysPos ? P(1) : "*",V(0, 1),Offset2,C(0),AlwaysPos ? P(2) : "*",V(0, 2), + + P(0),C(0),V(0, 0)); + return wstring(str); + } + + + bool usesCategory0() { + return true; + } + + +}; + + + +template +class CCaseCatPredicateTemplate : public PredicateTemplate +{ +public: +CCaseCatPredicateTemplate(const vector tagsets) : PredicateTemplate(tagsets) { } + +void findMatchingPredicates(vector >& v, + vector& text, + int index) { + + if (text[index].getOrth()[0] >= 'A' && text[index].getOrth()[0] <= 'Z') { + Predicate p = Predicate(this); + p.params.tags[0] = text[index].chosen_tag[Phase]; + v.push_back(p); + } +} +bool predicateMatches(const Predicate& p, + vector& text, int index) { + return (p.params.tags[0] == text[index].chosen_tag[Phase] + && text[index].getOrth()[0] >= 'A' && text[index].getOrth()[0] <= 'Z'); +} +wstring predicateAsWString(const Predicate& p) { + + char str[STR_SIZE]; + sprintf(str, "T[0] = %s AND ORTH[0] starts with capital letter", T(tags[0])); + return ascii_to_wstring(str); +} +}; + +template +class Prefix2CatPredicateTemplate : public PredicateTemplate +{ +public: +Prefix2CatPredicateTemplate(const vector tagsets) : PredicateTemplate(tagsets) { } + +void findMatchingPredicates(vector >& v, + vector& text, + int index) { + + const string& orth = text[index].getOrth(); + int len = orth.length(); + if (len >= 2) { + Predicate p = Predicate(this); + p.params.tags[0] = text[index].chosen_tag[Phase]; + p.params.chars[0] = orth[0]; + p.params.chars[1] = orth[1]; + v.push_back(p); + } +} +bool predicateMatches(const Predicate& p, + vector& text, int index) { + const string& orth = text[index].getOrth(); + int len = orth.length(); + return (len >= 2 && p.params.tags[0] == text[index].chosen_tag[Phase] + && orth[0] == p.params.chars[0] + && orth[1] == p.params.chars[1]); +} +wstring predicateAsWString(const Predicate& p) { + wchar_t str[STR_SIZE]; + swprintf(str, STR_SIZE, L"T[0] = %hs AND ORTH starts with '%lc%lc'", T(tags[0]), p.params.chars[0], p.params.chars[1]); + return wstring(str); +} +}; + +template +class Suffix2CatPredicateTemplate : public PredicateTemplate +{ +public: +Suffix2CatPredicateTemplate(const vector tagsets) : PredicateTemplate(tagsets) { } + +void findMatchingPredicates(vector >& v, + vector& text, + int index) { + + const string& orth = text[index].getOrth(); + int len = orth.length(); + if (len >= 2) { + Predicate p = Predicate(this); + p.params.tags[0] = text[index].chosen_tag[Phase]; + p.params.chars[0] = orth[len - 2]; + p.params.chars[1] = orth[len - 1]; + v.push_back(p); + } +} +bool predicateMatches(const Predicate& p, + vector& text, int index) { + const string& orth = text[index].getOrth(); + int len = orth.length(); + return (len >= 2 && p.params.tags[0] == text[index].chosen_tag[Phase] + && orth[len - 2] == p.params.chars[0] + && orth[len - 1] == p.params.chars[1]); +} +wstring predicateAsWString(const Predicate& p) { + wchar_t str[STR_SIZE]; + swprintf(str, STR_SIZE, L"T[0] = %hs AND ORTH ends with '%lc%lc'", T(tags[0]), p.params.chars[0], p.params.chars[1]); + return wstring(str); +} +}; + + + +#undef TAGSET +#undef POS +#undef DEFPOS +#undef FORCAT +#undef NEXTCAT +#undef VALUE +#undef C +#undef V + Index: src/eval.cpp =================================================================== --- src/eval.cpp.orig 2010-06-03 23:39:46.000000000 +0200 +++ src/eval.cpp 2012-07-04 11:15:13.528186561 +0200 @@ -27,6 +27,13 @@ using namespace std; using namespace NLPCommon; +// XXX bo jest jako extern w nlpcommon/util.h +boost::program_options::variables_map options; + +// XXX bo nie chcemy, by sie wywalało przez MPI +boost::mpi::environment env; +boost::mpi::communicator world; + typedef Lexeme MyLexeme; TaggingErrorsCollector* errors_collector; Index: aclocal/ltversion.m4 =================================================================== --- aclocal/ltversion.m4.orig 2010-10-02 22:51:03.000000000 +0200 +++ aclocal/ltversion.m4 2012-07-04 16:29:47.407822027 +0200 @@ -7,17 +7,17 @@ # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# Generated from ltversion.in. +# @configure_input@ -# serial 3175 ltversion.m4 +# serial 3337 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.2.10]) -m4_define([LT_PACKAGE_REVISION], [1.3175]) +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.10' -macro_revision='1.3175' +[macro_version='2.4.2' +macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) Index: ltmain.sh =================================================================== --- ltmain.sh.orig 2010-10-02 22:51:24.000000000 +0200 +++ ltmain.sh 2012-07-04 16:29:47.207822032 +0200 @@ -1,10 +1,9 @@ -# Generated from ltmain.m4sh. -# libtool (GNU libtool) 2.2.10 +# libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -42,6 +41,7 @@ # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) +# --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages @@ -70,17 +70,19 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.2.10 +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . PROGRAM=libtool PACKAGE=libtool -VERSION=2.2.10 +VERSION="2.4.2 Debian-2.4.2-1ubuntu1" TIMESTAMP="" -package_revision=1.3175 +package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -135,15 +137,10 @@ : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${EGREP="grep -E"} -: ${FGREP="grep -F"} -: ${GREP="grep"} -: ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} -: ${SED="sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} @@ -163,6 +160,27 @@ dirname="s,/[^/]*$,," basename="s,^.*/,," +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: @@ -177,17 +195,31 @@ # those functions but instead duplicate the functionality here. func_dirname_and_basename () { - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` -} + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation -# Generated shell functions inserted here. # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' @@ -351,7 +383,7 @@ ;; *) save_IFS="$IFS" - IFS=: + IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break @@ -370,6 +402,15 @@ # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. @@ -398,7 +439,7 @@ # name if it has been set yet. func_echo () { - $ECHO "$progname${mode+: }$mode: $*" + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... @@ -424,14 +465,14 @@ # Echo program name prefixed message to standard error. func_error () { - $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { - $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : @@ -650,11 +691,30 @@ fi } +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + # func_version # Echo version message to standard output and exit. func_version () { + $opt_debug + $SED -n '/(C)/!b go :more /\./!{ @@ -676,6 +736,8 @@ # Echo short help message to standard output and exit. func_usage () { + $opt_debug + $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// @@ -692,7 +754,10 @@ # unless 'noexit' is passed as argument. func_help () { + $opt_debug + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print s/^# // s/^# *$// s*\$progname*'$progname'* @@ -702,10 +767,14 @@ s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p - }' < "$progpath" + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" ret=$? if test -z "$1"; then exit $ret @@ -717,12 +786,39 @@ # exit_cmd. func_missing_arg () { + $opt_debug + func_error "missing argument for $1." exit_cmd=exit } -exit_cmd=: +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + +exit_cmd=: @@ -732,25 +828,64 @@ magic_exe="%%%MAGIC EXE variable%%%" # Global variables. -# $mode is unset nonopt= -execute_dlfiles= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 -opt_dry_run=false -opt_duplicate_deps=false -opt_silent=false -opt_debug=: - # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=\$${1}\${2}" +} # func_append may be replaced by extended shell implementation + +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation + + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "${@}"` +} # func_arith may be replaced by extended shell implementation + + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. @@ -840,129 +975,209 @@ esac } -# Parse options once, thoroughly. This comes as soon as possible in -# the script to make things like `libtool --version' happen quickly. +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () { + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false - # Shorthand for --mode=foo, only valid as the first argument - case $1 in - clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; - compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; - execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; - finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; - install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; - link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; - esac - # Parse non-mode specific arguments: - while test "$#" -gt 0; do +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do opt="$1" shift - case $opt in - --config) func_config ;; - - --debug) preserve_args="$preserve_args $opt" + --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" - opt_debug='set -x' $opt_debug ;; - - -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break - execute_dlfiles="$execute_dlfiles $1" - shift + --dry-run|--dryrun|-n) + opt_dry_run=: ;; - - --dry-run | -n) opt_dry_run=: ;; - --features) func_features ;; - --finish) mode="finish" ;; - - --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break - case $1 in - # Valid mode arguments: - clean) ;; - compile) ;; - execute) ;; - finish) ;; - install) ;; - link) ;; - relink) ;; - uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; - esac - - mode="$1" + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" shift ;; - --preserve-dup-deps) - opt_duplicate_deps=: ;; - - --quiet|--silent) preserve_args="$preserve_args $opt" - opt_silent=: - opt_verbose=false + opt_preserve_dup_deps=: ;; - - --no-quiet|--no-silent) - preserve_args="$preserve_args $opt" - opt_silent=false + --features) + opt_features=: +func_features ;; - - --verbose| -v) preserve_args="$preserve_args $opt" + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) opt_silent=false - opt_verbose=: +func_append preserve_args " $opt" ;; - - --no-verbose) preserve_args="$preserve_args $opt" + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) opt_verbose=false +func_append preserve_args " $opt" ;; - - --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break - preserve_args="$preserve_args $opt $1" - func_enable_tag "$1" # tagname is set here + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" shift ;; + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + # Separate optargs to long options: - -dlopen=*|--mode=*|--tag=*) - func_opt_split "$opt" - set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; - -\?|-h) func_usage ;; - --help) opt_help=: ;; - --help-all) opt_help=': help-all' ;; - --version) func_version ;; - - -*) func_fatal_help "unrecognized option \`$opt'" ;; - - *) nonopt="$opt" - break + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) @@ -970,82 +1185,44 @@ opt_duplicate_compiler_generated_deps=: ;; *) - opt_duplicate_compiler_generated_deps=$opt_duplicate_deps + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac - # Having warned about all mis-specified options, bail out if - # anything was wrong. - $exit_cmd $EXIT_FAILURE -} + $opt_help || { + # Sanity checks first: + func_check_version_match -# func_check_version_match -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" fi - exit $EXIT_MISMATCH - fi -} - - -## ----------- ## -## Main. ## -## ----------- ## + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" -$opt_help || { - # Sanity checks first: - func_check_version_match - - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi - test -z "$mode" && func_fatal_error "error: you must specify a MODE." + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$mode' for more information." -} +## ----------- ## +## Main. ## +## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. @@ -1110,12 +1287,9 @@ # temporary ltwrapper_script. func_ltwrapper_scriptname () { - func_ltwrapper_scriptname_result="" - if func_ltwrapper_executable_p "$1"; then - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" - fi + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file @@ -1161,6 +1335,37 @@ } +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. @@ -1173,8 +1378,7 @@ if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" + func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` @@ -1193,8 +1397,7 @@ CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" + func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` @@ -1244,24 +1447,504 @@ write_oldobj=none fi - $opt_dry_run || { - cat >${write_libobj}T <${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + -# Name of the PIC object. -pic_object=$write_lobj +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 -# Name of the non-PIC object -non_pic_object=$write_oldobj -EOF - $MV "${write_libobj}T" "${write_libobj}" - } +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi } +# end func_convert_path_nix_to_cygwin + # func_mode_compile arg... func_mode_compile () @@ -1303,12 +1986,12 @@ ;; -pie | -fpie | -fPIE) - pie_flag="$pie_flag $arg" + func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" + func_append later " $arg" continue ;; @@ -1329,15 +2012,14 @@ save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" - func_quote_for_eval "$arg" - lastarg="$lastarg $func_quote_for_eval_result" + func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" + func_append base_compile " $lastarg" continue ;; @@ -1353,8 +2035,7 @@ esac # case $arg_mode # Aesthetically quote the previous argument. - func_quote_for_eval "$lastarg" - base_compile="$base_compile $func_quote_for_eval_result" + func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in @@ -1379,7 +2060,7 @@ *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; @@ -1485,17 +2166,16 @@ $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi - removelist="$removelist $output_obj" + func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist - removelist="$removelist $lockfile" + func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result @@ -1515,7 +2195,7 @@ if test -z "$output_obj"; then # Place PIC objects in $objdir - command="$command -o $lobj" + func_append command " -o $lobj" fi func_show_eval_locale "$command" \ @@ -1562,11 +2242,11 @@ command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then - command="$command -o $obj" + func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" + func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' @@ -1611,13 +2291,13 @@ } $opt_help || { - test "$mode" = compile && func_mode_compile ${1+"$@"} + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. - case $mode in + case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. @@ -1793,7 +2473,7 @@ ;; *) - func_fatal_help "invalid operation mode \`$mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac @@ -1808,13 +2488,13 @@ else { func_help noexit - for mode in compile link execute install finish uninstall clean; do + for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit - for mode in compile link execute install finish uninstall clean; do + for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done @@ -1843,13 +2523,16 @@ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do + for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" @@ -1871,7 +2554,7 @@ dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" + func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" @@ -1928,8 +2611,7 @@ ;; esac # Quote arguments (to preserve shell metacharacters). - func_quote_for_eval "$file" - args="$args $func_quote_for_eval_result" + func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then @@ -1961,22 +2643,59 @@ fi } -test "$mode" = execute && func_mode_execute ${1+"$@"} +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug - libdirs="$nonopt" + libs= + libdirs= admincmds= - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. @@ -1986,7 +2705,7 @@ if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || admincmds="$admincmds + $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done @@ -1995,53 +2714,55 @@ # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" - $ECHO " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo - echo "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" - echo "pages." - ;; - *) - echo "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - echo "----------------------------------------------------------------------" + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi exit $EXIT_SUCCESS } -test "$mode" = finish && func_mode_finish ${1+"$@"} +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... @@ -2066,7 +2787,7 @@ # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" - install_prog="$install_prog$func_quote_for_eval_result" + func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; @@ -2086,7 +2807,7 @@ do arg2= if test -n "$dest"; then - files="$files $dest" + func_append files " $dest" dest=$arg continue fi @@ -2124,11 +2845,11 @@ # Aesthetically quote the argument. func_quote_for_eval "$arg" - install_prog="$install_prog $func_quote_for_eval_result" + func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi - install_shared_prog="$install_shared_prog $func_quote_for_eval_result" + func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ @@ -2140,7 +2861,7 @@ if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" - install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result" + func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi @@ -2198,10 +2919,13 @@ case $file in *.$libext) # Do the static libraries later. - staticlibs="$staticlibs $file" + func_append staticlibs " $file" ;; *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" @@ -2215,19 +2939,19 @@ if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; + *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; + *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" - dir="$dir$objdir" + func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. @@ -2304,7 +3028,7 @@ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) @@ -2478,11 +3202,13 @@ # Set up the ranlib parameters. oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $oldlib" 'exit $?' + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. @@ -2501,7 +3227,7 @@ fi } -test "$mode" = install && func_mode_install ${1+"$@"} +test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -2548,6 +3274,18 @@ #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + /* External symbol declarations for the compiler. */\ " @@ -2559,8 +3297,9 @@ # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do - func_verbose "extracting global C symbols from \`$progfile'" - $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then @@ -2609,10 +3348,52 @@ func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac done $opt_dry_run || { @@ -2650,26 +3431,9 @@ const char *name; void *address; } lt_dlsymlist; -" - case $host in - *cygwin* | *mingw* | *cegcc* ) - echo >> "$output_objdir/$my_dlsyms" "\ -/* DATA imports from DLLs on WIN32 con't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs. */" - lt_dlsym_const= ;; - *osf5*) - echo >> "$output_objdir/$my_dlsyms" "\ -/* This system does not cope well with relocations in const data */" - lt_dlsym_const= ;; - *) - lt_dlsym_const=const ;; - esac - - echo >> "$output_objdir/$my_dlsyms" "\ -extern $lt_dlsym_const lt_dlsymlist +extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; -$lt_dlsym_const lt_dlsymlist +LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," @@ -2709,7 +3473,7 @@ # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; @@ -2725,7 +3489,7 @@ for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; - *) symtab_cflags="$symtab_cflags $arg" ;; + *) func_append symtab_cflags " $arg" ;; esac done @@ -2788,7 +3552,8 @@ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - win32_nmres=`eval $NM -f posix -A $1 | + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ @@ -2817,6 +3582,131 @@ $ECHO "$win32_libid_type" } +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} # func_extract_an_archive dir oldlib @@ -3095,14 +3985,17 @@ # launches target application with the remaining arguments. func_exec_program () { - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac func_exec_program_core \${1+\"\$@\"} } @@ -3195,6 +4088,18 @@ if test -f \"\$progdir/\$program\"; then" + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ @@ -3209,14 +4114,6 @@ " fi - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. @@ -3234,166 +4131,6 @@ } -# func_to_host_path arg -# -# Convert paths to host format when used with build tools. -# Intended for use with "native" mingw (where libtool itself -# is running under the msys shell), or in the following cross- -# build environments: -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# where wine is equipped with the `winepath' executable. -# In the native mingw case, the (msys) shell automatically -# converts paths for any non-msys applications it launches, -# but that facility isn't available from inside the cwrapper. -# Similar accommodations are necessary for $host mingw and -# $build cygwin. Calling this function does no harm for other -# $host/$build combinations not listed above. -# -# ARG is the path (on $build) that should be converted to -# the proper representation for $host. The result is stored -# in $func_to_host_path_result. -func_to_host_path () -{ - func_to_host_path_result="$1" - if test -n "$1"; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - case $build in - *mingw* ) # actually, msys - # awkward: cmd appends spaces to result - func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_path_result=`cygpath -w "$1" | - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # Unfortunately, winepath does not exit with a non-zero - # error code, so we are forced to check the contents of - # stdout. On the other hand, if the command is not - # found, the shell will set an exit code of 127 and print - # *an error message* to stdout. So we must check for both - # error code of zero AND non-empty stdout, which explains - # the odd construction: - func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` - if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then - func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" | - $SED -e "$lt_sed_naive_backslashify"` - else - # Allow warning below. - func_to_host_path_result= - fi - ;; - esac - if test -z "$func_to_host_path_result" ; then - func_error "Could not determine host path corresponding to" - func_error " \`$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_path_result="$1" - fi - ;; - esac - fi -} -# end: func_to_host_path - -# func_to_host_pathlist arg -# -# Convert pathlists to host format when used with build tools. -# See func_to_host_path(), above. This function supports the -# following $build/$host combinations (but does no harm for -# combinations not listed here): -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# -# Path separators are also converted from $build format to -# $host format. If ARG begins or ends with a path separator -# character, it is preserved (but converted to $host format) -# on output. -# -# ARG is a pathlist (on $build) that should be converted to -# the proper representation on $host. The result is stored -# in $func_to_host_pathlist_result. -func_to_host_pathlist () -{ - func_to_host_pathlist_result="$1" - if test -n "$1"; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_pathlist_tmp1=$func_stripname_result - case $build in - *mingw* ) # Actually, msys. - # Awkward: cmd appends spaces to result. - func_to_host_pathlist_result=` - ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" | - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # unfortunately, winepath doesn't convert pathlists - func_to_host_pathlist_result="" - func_to_host_pathlist_oldIFS=$IFS - IFS=: - for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do - IFS=$func_to_host_pathlist_oldIFS - if test -n "$func_to_host_pathlist_f" ; then - func_to_host_path "$func_to_host_pathlist_f" - if test -n "$func_to_host_path_result" ; then - if test -z "$func_to_host_pathlist_result" ; then - func_to_host_pathlist_result="$func_to_host_path_result" - else - func_append func_to_host_pathlist_result ";$func_to_host_path_result" - fi - fi - fi - done - IFS=$func_to_host_pathlist_oldIFS - ;; - esac - if test -z "$func_to_host_pathlist_result"; then - func_error "Could not determine the host path(s) corresponding to" - func_error " \`$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This may break if $1 contains DOS-style drive - # specifications. The fix is not to complicate the expression - # below, but for the user to provide a working wine installation - # with winepath so that path translation in the cross-to-mingw - # case works properly. - lt_replace_pathsep_nix_to_dos="s|:|;|g" - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ - $SED -e "$lt_replace_pathsep_nix_to_dos"` - fi - # Now, add the leading and trailing path separators back - case "$1" in - :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" - ;; - esac - case "$1" in - *: ) func_append func_to_host_pathlist_result ";" - ;; - esac - ;; - esac - fi -} -# end: func_to_host_pathlist - # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because @@ -3563,14 +4300,14 @@ EOF cat </dev/null` + if test "$want_nocaseglob" = yes; then + shopt -s nocaseglob + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | @@ -7012,7 +7833,7 @@ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi @@ -7037,7 +7858,7 @@ ;; *) # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. @@ -7053,7 +7874,7 @@ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" ;; esac @@ -7066,7 +7887,7 @@ potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi @@ -7091,7 +7912,7 @@ ;; *) # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. @@ -7195,7 +8016,7 @@ *) case " $deplibs " in *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; + func_append new_libs " -L$path/$objdir" ;; esac ;; esac @@ -7205,10 +8026,10 @@ -L*) case " $new_libs " in *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" @@ -7220,15 +8041,22 @@ # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else @@ -7237,18 +8065,18 @@ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" + func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi done @@ -7256,17 +8084,13 @@ if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi @@ -7274,7 +8098,7 @@ fi shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -7300,7 +8124,7 @@ linknames= for link do - linknames="$linknames $link" + func_append linknames " $link" done # Use standard objects if they are pic @@ -7311,7 +8135,7 @@ if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" - delfiles="$delfiles $export_symbols" + func_append delfiles " $export_symbols" fi orig_export_symbols= @@ -7342,13 +8166,45 @@ $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + for cmd1 in $cmds; do IFS="$save_ifs" - eval cmd=\"$cmd\" - func_len " $cmd" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. @@ -7382,7 +8238,7 @@ # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -7392,7 +8248,7 @@ case " $convenience " in *" $test_deplib "*) ;; *) - tmp_deplibs="$tmp_deplibs $test_deplib" + func_append tmp_deplibs " $test_deplib" ;; esac done @@ -7412,21 +8268,21 @@ test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" + func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" + func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi @@ -7488,10 +8344,13 @@ echo 'INPUT (' > $output for obj in $save_libobjs do - $ECHO "$obj" >> $output + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output - delfiles="$delfiles $output" + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" @@ -7505,10 +8364,12 @@ fi for obj do - $ECHO "$obj" >> $output + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output done - delfiles="$delfiles $output" - output=$firstobj\"$file_list_spec$output\" + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." @@ -7559,7 +8420,7 @@ if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi - delfiles="$delfiles $output" + func_append delfiles " $output" else output= @@ -7593,7 +8454,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -7626,7 +8487,7 @@ # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -7667,10 +8528,10 @@ # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $dlprefiles - libobjs="$libobjs $func_extract_archives_result" + func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi @@ -7686,7 +8547,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -7698,7 +8559,7 @@ IFS="$save_ifs" # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then @@ -7782,13 +8643,16 @@ reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test @@ -7862,8 +8726,8 @@ if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" ;; esac fi @@ -7883,7 +8747,7 @@ *) case " $compile_deplibs " in *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; + func_append new_libs " -L$path/$objdir" ;; esac ;; esac @@ -7893,17 +8757,17 @@ -L*) case " $new_libs " in *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. @@ -7911,7 +8775,7 @@ # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; + *) func_append finalize_rpath " $libdir" ;; esac done fi @@ -7930,18 +8794,18 @@ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" + func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi case $host in @@ -7950,12 +8814,12 @@ case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; - *) dllsearchpath="$dllsearchpath:$libdir";; + *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) dllsearchpath="$dllsearchpath:$testbindir";; + *) func_append dllsearchpath ":$testbindir";; esac ;; esac @@ -7981,18 +8845,18 @@ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" + func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + *) func_append finalize_perm_rpath " $libdir" ;; esac fi done @@ -8043,6 +8907,12 @@ exit_status=0 func_show_eval "$link_command" 'exit_status=$?' + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' @@ -8065,7 +8935,7 @@ # We should set the runpath_var. rpath= for dir in $perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -8073,7 +8943,7 @@ # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -8088,6 +8958,13 @@ $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + exit $EXIT_SUCCESS fi @@ -8121,6 +8998,12 @@ func_show_eval "$link_command" 'exit $?' + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + # Now create the wrapper script. func_verbose "creating $output" @@ -8218,7 +9101,7 @@ else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then - oldobjs="$oldobjs $symfileobj" + func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" @@ -8226,10 +9109,10 @@ if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" + func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. @@ -8240,10 +9123,10 @@ # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $dlprefiles - oldobjs="$oldobjs $func_extract_archives_result" + func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have @@ -8261,7 +9144,7 @@ else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= @@ -8285,18 +9168,30 @@ esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" ;; - *) oldobjs="$oldobjs $obj" ;; + *) func_append oldobjs " $obj" ;; esac done fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." @@ -8390,12 +9285,23 @@ *.la) func_basename "$deplib" name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" - newdependency_libs="$newdependency_libs $libdir/$name" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; + *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" @@ -8409,9 +9315,9 @@ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - newdlfiles="$newdlfiles $libdir/$name" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; - *) newdlfiles="$newdlfiles $lib" ;; + *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" @@ -8428,7 +9334,7 @@ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - newdlprefiles="$newdlprefiles $libdir/$name" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done @@ -8440,7 +9346,7 @@ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - newdlfiles="$newdlfiles $abs" + func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= @@ -8449,7 +9355,7 @@ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - newdlprefiles="$newdlprefiles $abs" + func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi @@ -8534,7 +9440,7 @@ exit $EXIT_SUCCESS } -{ test "$mode" = link || test "$mode" = relink; } && +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} @@ -8554,9 +9460,9 @@ for arg do case $arg in - -f) RM="$RM $arg"; rmforce=yes ;; - -*) RM="$RM $arg" ;; - *) files="$files $arg" ;; + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; esac done @@ -8565,24 +9471,23 @@ rmdirs= - origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then - objdir="$origobjdir" + odir="$objdir" else - objdir="$dir/$origobjdir" + odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" - test "$mode" = uninstall && objdir="$dir" + test "$opt_mode" = uninstall && odir="$dir" - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; esac fi @@ -8608,18 +9513,17 @@ # Delete the libtool libraries and symlinks. for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" + func_append rmfiles " $odir/$n" done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + test -n "$old_library" && func_append rmfiles " $odir/$old_library" - case "$mode" in + case "$opt_mode" in clean) - case " $library_names " in - # " " in the beginning catches empty $dlname + case " $library_names " in *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then @@ -8647,19 +9551,19 @@ # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" + func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" + func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) - if test "$mode" = clean ; then + if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) @@ -8669,7 +9573,7 @@ noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe - rmfiles="$rmfiles $file" + func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. @@ -8678,7 +9582,7 @@ func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result - rmfiles="$rmfiles $func_ltwrapper_scriptname_result" + func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename @@ -8686,12 +9590,12 @@ # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" + func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" + func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi @@ -8699,7 +9603,6 @@ esac func_show_eval "$RM $rmfiles" 'exit_status=1' done - objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do @@ -8711,16 +9614,16 @@ exit $exit_status } -{ test "$mode" = uninstall || test "$mode" = clean; } && +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} -test -z "$mode" && { +test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" Index: aclocal/libtool.m4 =================================================================== --- aclocal/libtool.m4.orig 2010-10-02 22:51:03.000000000 +0200 +++ aclocal/libtool.m4 2012-07-04 16:29:47.243822029 +0200 @@ -1,8 +1,8 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -11,8 +11,8 @@ m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -146,6 +146,8 @@ AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -168,10 +170,13 @@ dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our @@ -634,7 +639,7 @@ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -748,15 +753,12 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - _LT_PROG_XSI_SHELLFNS + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) + _LT_PROG_REPLACE_SHELLFNS - mv -f "$cfgfile" "$ofile" || + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], @@ -801,6 +803,7 @@ m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], @@ -822,6 +825,31 @@ ])# _LT_LANG +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], @@ -852,6 +880,10 @@ m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) @@ -954,7 +986,13 @@ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -962,6 +1000,7 @@ rm -rf libconftest.dylib* rm -f conftest.* fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no @@ -973,6 +1012,7 @@ [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF @@ -990,7 +1030,9 @@ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1035,8 +1077,8 @@ ]) -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ @@ -1047,6 +1089,8 @@ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi @@ -1073,30 +1117,41 @@ fi ]) -# _LT_SYS_MODULE_PATH_AIX -# ----------------------- +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl -AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi ])# _LT_SYS_MODULE_PATH_AIX @@ -1121,7 +1176,7 @@ AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. -if test "X`print -r -- -n 2>/dev/null`" = X-n && \ +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then @@ -1165,6 +1220,39 @@ ])# _LT_PROG_ECHO_BACKSLASH +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], @@ -1286,14 +1374,27 @@ CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -1311,14 +1412,47 @@ ])# _LT_ENABLE_LOCK +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], -[AC_CHECK_TOOL(AR, ar, false) -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1]) +[_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: @@ -1337,13 +1471,13 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -1523,6 +1657,11 @@ lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -1562,7 +1701,7 @@ # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do @@ -1658,10 +1797,10 @@ /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -void fnord () __attribute__((visibility("default"))); +int fnord () __attribute__((visibility("default"))); #endif -void fnord () { int i=42; } +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -1903,21 +2042,6 @@ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi - # sanitize - new_sys_lib_search_path_spec= - for d in $sys_lib_search_path_spec ; do - # check if exists - if test -d $d -a -x $d ; then - # normalize - new_d=$(cd $d ; pwd) - # uniq - if ! echo "$new_sys_lib_search_path_spec" | grep -q -F -e " $new_d " ; then - new_sys_lib_search_path_spec="$new_sys_lib_search_path_spec $new_d " - fi - fi - done - # compress spaces - sys_lib_search_path_spec=`echo "$new_sys_lib_search_path_spec" | $SED -e 's/^ *//g;s/ \+/ /g;s/ $//g'` else need_locks=no fi @@ -2123,7 +2247,7 @@ case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -2132,7 +2256,7 @@ ;; aix[[4-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -2197,7 +2321,7 @@ ;; bsdi[[45]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -2216,8 +2340,9 @@ need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -2250,13 +2375,71 @@ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -2277,7 +2460,7 @@ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -2285,10 +2468,6 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -2296,7 +2475,7 @@ objformat=`/usr/bin/objformat` else case $host_os in - freebsd[[123]]*) objformat=aout ;; + freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -2314,7 +2493,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) @@ -2334,17 +2513,18 @@ ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" @@ -2405,7 +2585,7 @@ ;; interix[[3-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -2421,7 +2601,7 @@ nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -2458,9 +2638,9 @@ dynamic_linker=no ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2502,26 +2682,18 @@ # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' + ;; - # Find out which ABI we are using (multilib Linux x86_64 hack). - libsuff= - case "$host_cpu" in - x86_64*|s390x*|powerpc64*|sparc64*) - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *64-bit*) - libsuff=64 - ;; - esac - fi - rm -rf conftest* - ;; - *) - ;; - esac - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) @@ -2543,7 +2715,7 @@ ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -2612,7 +2784,7 @@ ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2637,7 +2809,7 @@ ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -2661,7 +2833,7 @@ sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -2692,7 +2864,7 @@ tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2702,7 +2874,7 @@ ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -2980,6 +3152,11 @@ esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -3119,12 +3296,12 @@ lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -3198,6 +3375,21 @@ ;; esac ]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -3205,7 +3397,11 @@ _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method == "file_magic"]) + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD @@ -3308,6 +3504,67 @@ dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + # LT_LIB_M # -------- @@ -3434,8 +3691,8 @@ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3459,6 +3716,7 @@ # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -3471,6 +3729,7 @@ else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -3504,6 +3763,18 @@ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + #ifdef __cplusplus extern "C" { #endif @@ -3515,7 +3786,7 @@ cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -const struct { +LT@&t@_DLSYM_CONST struct { const char *name; void *address; } @@ -3541,15 +3812,15 @@ _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi @@ -3582,6 +3853,13 @@ AC_MSG_RESULT(ok) fi +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], @@ -3592,6 +3870,8 @@ _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3603,7 +3883,6 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= -AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -3708,6 +3987,12 @@ ;; esac ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; dgux*) case $cc_basename in ec++*) @@ -3828,7 +4113,7 @@ ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -4016,7 +4301,9 @@ case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi ;; esac else @@ -4082,6 +4369,12 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -4102,18 +4395,33 @@ ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; esac ;; esac @@ -4201,9 +4509,11 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac -AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. @@ -4222,6 +4532,8 @@ _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # @@ -4242,6 +4554,7 @@ m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl @@ -4250,6 +4563,7 @@ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. @@ -4264,15 +4578,25 @@ ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - ;; + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= @@ -4287,7 +4611,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -4332,6 +4655,9 @@ openbsd*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes @@ -4440,10 +4766,11 @@ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $compiler_flags $deplibs -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then @@ -4452,7 +4779,7 @@ echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ - $CC -shared $output_objdir/$soname.def $libobjs $compiler_flags $deplibs -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4488,7 +4815,7 @@ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag= + tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler @@ -4524,21 +4851,20 @@ *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ @@ -4553,13 +4879,13 @@ fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -4577,8 +4903,8 @@ _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4624,8 +4950,8 @@ *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4730,6 +5056,7 @@ if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi + _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then @@ -4755,7 +5082,7 @@ _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else @@ -4766,7 +5093,7 @@ else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. @@ -4810,20 +5137,64 @@ # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $compiler_flags $libobjs `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac ;; darwin* | rhapsody*) @@ -4836,10 +5207,6 @@ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; - freebsd1*) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -4852,7 +5219,7 @@ ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -4861,7 +5228,7 @@ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $compiler_flags $libobjs $deplibs' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4869,7 +5236,7 @@ hpux9*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -4885,13 +5252,12 @@ hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes @@ -4909,10 +5275,10 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -4959,16 +5325,31 @@ irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - AC_LINK_IFELSE(int foo(void) {}, - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - ) - LDFLAGS="$save_LDFLAGS" + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' @@ -4980,7 +5361,7 @@ _LT_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -5008,8 +5389,8 @@ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $compiler_flags -o $lib $libobjs $deplibs' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $compiler_flags -o $lib $libobjs $deplibs ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else @@ -5053,7 +5434,7 @@ osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' @@ -5072,9 +5453,9 @@ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -5318,9 +5699,6 @@ _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [[If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], @@ -5346,8 +5724,6 @@ to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [fix_srcfile_path], [1], - [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], @@ -5358,6 +5734,8 @@ [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented @@ -5459,6 +5837,7 @@ m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then @@ -5477,7 +5856,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -5520,6 +5898,7 @@ # Allow CC to be a program name with arguments. lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -5537,6 +5916,7 @@ fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -5558,8 +5938,8 @@ # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5585,7 +5965,7 @@ # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists @@ -5700,7 +6080,7 @@ _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" @@ -5712,7 +6092,7 @@ else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. @@ -5754,29 +6134,75 @@ ;; cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $compiler_flags $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $compiler_flags $deplibs $postdep_objects -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; @@ -5799,7 +6225,7 @@ esac ;; - freebsd[[12]]*) + freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no @@ -5851,7 +6277,7 @@ ;; *) if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -5922,10 +6348,10 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -5966,9 +6392,9 @@ *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -5987,8 +6413,8 @@ # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -6014,16 +6440,16 @@ # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no @@ -6065,8 +6491,8 @@ ;; cxx*) # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -6086,12 +6512,12 @@ # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $compiler_flags $libobjs $deplibs ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) @@ -6170,10 +6596,10 @@ _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi @@ -6246,7 +6672,7 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -6333,9 +6759,9 @@ if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -6344,9 +6770,9 @@ else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $compiler_flags $predep_objects $libobjs $deplibs $postdep_objects~$RM $lib.exp' + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -6464,6 +6890,7 @@ fi # test -n "$compiler" CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -6478,6 +6905,29 @@ ])# _LT_LANG_CXX_CONFIG +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -6486,6 +6936,7 @@ # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= @@ -6535,7 +6986,20 @@ } }; _LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF ]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then @@ -6547,7 +7011,7 @@ pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case $p in + case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -6556,13 +7020,22 @@ test $p = "-R"; then prev=$p continue - else - prev= fi + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) + case ${prev} in + -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -6582,8 +7055,10 @@ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi + prev= ;; + *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -6619,6 +7094,7 @@ fi $RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], @@ -6718,7 +7194,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -6768,7 +7243,9 @@ # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} + CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -6822,6 +7299,7 @@ GCC=$lt_save_GCC CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP @@ -6848,7 +7326,6 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -6898,7 +7375,9 @@ # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} + CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu @@ -6954,7 +7433,8 @@ fi # test -n "$compiler" GCC=$lt_save_GCC - CC="$lt_save_CC" + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP @@ -6991,10 +7471,12 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC="$CC" +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" @@ -7025,10 +7507,82 @@ AC_LANG_RESTORE GCC=$lt_save_GCC -CC="$lt_save_CC" +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler @@ -7060,9 +7614,11 @@ # Allow CC to be a program name with arguments. lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} +CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -7075,7 +7631,8 @@ GCC=$lt_save_GCC AC_LANG_RESTORE -CC="$lt_save_CC" +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG @@ -7095,6 +7652,13 @@ dnl AC_DEFUN([LT_AC_PROG_GCJ], []) +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], @@ -7134,6 +7698,15 @@ AC_SUBST([OBJDUMP]) ]) +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) # _LT_DECL_SED # ------------ @@ -7227,8 +7800,8 @@ # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -7267,206 +7840,162 @@ ])# _LT_CHECK_SHELL_FEATURES -# _LT_PROG_XSI_SHELLFNS -# --------------------- -# Bourne and XSI compatible variants of some useful shell functions. -m4_defun([_LT_PROG_XSI_SHELLFNS], -[case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $[*] )) -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} - -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$basename"` -} +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) -dnl func_dirname_and_basename -dnl A portable version of this function is already defined in general.m4sh -dnl so there is no need for it here. -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) -# sed scripts: -my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[[^=]]*=//' + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` -} + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'` -} + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$[@]"` -} +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` -} + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi -_LT_EOF -esac +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]+=\$[2]" -} -_LT_EOF +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]=\$$[1]\$[2]" -} - -_LT_EOF + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac ;; - esac + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac ]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS Index: .autotools =================================================================== --- .autotools.orig 2010-01-04 13:53:05.000000000 +0100 +++ .autotools 2012-07-04 11:15:13.592186558 +0200 @@ -1,43 +1,42 @@ - - Index: src/wrapper.h =================================================================== --- src/wrapper.h.orig 2011-06-08 21:25:58.000000000 +0200 +++ src/wrapper.h 2012-07-04 11:26:39.048173321 +0200 @@ -14,28 +14,35 @@ #include #include #include +#include namespace Pantera { class PanteraWrapper { public: - static PanteraWrapper* createInstance(std::string enginePath, std::string tagsetName); - static PanteraWrapper* getInstance(); + static PanteraWrapper* createInstance(std::string enginePath, std::string tagsetName); + static PanteraWrapper* getInstance(); - virtual std::vector tag(const std::string& text) = 0; virtual NLPCommon::Tagset* getTagset(); + + virtual std::vector tag( + const std::vector& lexems, + const TaggingOptions& options) = 0; + + virtual std::vector tag( + const std::string& text, + const TaggingOptions& options) = 0; - virtual std::vector tag(const - std::vector& lexems, bool doSentSplit, - bool doMorphAnalysis, bool doSegmentDisamb, bool doTagging) = 0; + virtual ~PanteraWrapper() {} protected: - PanteraWrapper(std::string tagsetName = ""); + PanteraWrapper(std::string tagsetName = ""); NLPCommon::Tagset* tagset; std::vector tagsets; }; + } #endif /* PANTERAWRAPPER_H_ */ Index: src/concrete_wrapper.h =================================================================== --- src/concrete_wrapper.h.orig 2011-06-08 22:20:59.000000000 +0200 +++ src/concrete_wrapper.h 2012-07-04 11:26:38.620173329 +0200 @@ -39,18 +39,23 @@ class ConcretePanteraWrapper : public PanteraWrapper { public: - virtual std::vector tag(const std::string& text); - ConcretePanteraWrapper(string enginePath, string tagsetName); virtual ~ConcretePanteraWrapper(); - virtual std::vector tag(const - std::vector& lexems, bool doSentSplit, - bool doMorphAnalysis, bool doSegmentDisamb, bool doTagging); + + virtual std::vector tag( + const std::vector& lexems, + const TaggingOptions& options); + + virtual std::vector tag( + const std::string& text, + const TaggingOptions& options); private: - void morphAnalyze(vector& lexems); + void morphAnalyze(vector& lexems, const string& morphDict, const bool useGuesser); void segmentDisamb(vector& lexems); - + + void doTag(vector& lexems, const TaggingOptions& opts); + MorfeuszAnalyzer morfeusz; PolishSegmDisambiguator segm_disamb; BTagger::BrillEngine engine; Index: src/wrapper_test.cpp =================================================================== --- src/wrapper_test.cpp.orig 2010-12-06 10:12:01.000000000 +0100 +++ src/wrapper_test.cpp 2012-07-04 11:26:39.104173318 +0200 @@ -7,15 +7,14 @@ #include #include -#include "wrapper.h" +#include using namespace std; using namespace Pantera; int main(int argc, char** argv) { PanteraWrapper* pantera = PanteraWrapper::getInstance(); - pantera->tag("Ala ma kota.\nMiałem kota.\n\nLecę."); - pantera->tag("Zażółć gęślą jaźń."); + pantera->tag("Ala ma kota.\n Miałem. \nMiałem kota.\n\nLecę.", TaggingOptions().useGuesser(false).doSegmentDisamb(false)); + pantera->tag("Zażółć gęślą jaźń.", TaggingOptions()); return 0; } - Index: src/TaggingOptions.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ src/TaggingOptions.h 2012-07-04 16:28:56.547823009 +0200 @@ -0,0 +1,61 @@ +/* + * File: TaggingOptions.h + * Author: mlenart + * + * Created on 28 maj 2012, 11:53 + */ + +#ifndef TAGGINGOPTIONS_H +#define TAGGINGOPTIONS_H + +#include +#include +#include + +namespace Pantera { + +class TaggingOptions { + +public: + TaggingOptions(); + virtual ~TaggingOptions(); + + TaggingOptions& morphDict(std::string morphDict); + std::string morphDict() const; + + TaggingOptions& sentencerRules(std::string segmentRules); + std::string sentencerRules() const; + + TaggingOptions& doTagging(bool doTagging); + bool doTagging() const; + + TaggingOptions& doSegmentDisamb(bool doSegmentDisamb); + bool doSegmentDisamb() const; + + TaggingOptions& doMorphAnalysis(bool doMorphAnalysis); + bool doMorphAnalysis() const; + + TaggingOptions& doSentSplit(bool doSentSplit); + bool doSentSplit() const; + + TaggingOptions& useGuesser(bool useGuesser); + bool useGuesser() const; + + TaggingOptions& ignoreSentsInsideSegment(const bool ignore); + bool ignoreSentsInsideSegment() const; + +private: + bool _doSentSplit; + bool _doMorphAnalysis; + bool _doSegmentDisamb; + bool _doTagging; + bool _useGuesser; + bool _ignoreSentsInsideSegment; + + std::string _segmentRules; + std::string _morphDict; +}; +} + +#endif /* TAGGINGOPTIONS_H */ + Index: src/TaggingOptions.cpp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ src/TaggingOptions.cpp 2012-07-04 11:26:38.568173331 +0200 @@ -0,0 +1,98 @@ +/* + * File: TaggingOptions.cpp + * Author: mlenart + * + * Created on 28 maj 2012, 11:53 + */ + +#include "TaggingOptions.h" + +namespace Pantera { + +TaggingOptions::TaggingOptions() { + _doSentSplit = true; + _doMorphAnalysis = true; + _doSegmentDisamb = true; + _doTagging = true; + _useGuesser = false; + _segmentRules = ""; + _morphDict = ""; + _ignoreSentsInsideSegment = false; +} + +TaggingOptions::~TaggingOptions() { +} + +TaggingOptions& TaggingOptions::morphDict(std::string morphDict) { + this->_morphDict = morphDict; + return *(this); +} + +std::string TaggingOptions::morphDict() const { + return _morphDict; +} + +TaggingOptions& TaggingOptions::sentencerRules( + std::string segmentRules) { + this->_segmentRules = segmentRules; + return *(this); +} + +std::string TaggingOptions::sentencerRules() const { + return _segmentRules; +} + +TaggingOptions& TaggingOptions::doTagging(bool doTagging) { + this->_doTagging = doTagging; + return *(this); +} + +bool TaggingOptions::doTagging() const { + return _doTagging; +} + +TaggingOptions& TaggingOptions::doSegmentDisamb(bool doSegmentDisamb) { + this->_doSegmentDisamb = doSegmentDisamb; + return *(this); +} + +bool TaggingOptions::doSegmentDisamb() const { + return _doSegmentDisamb; +} + +TaggingOptions& TaggingOptions::doMorphAnalysis(bool doMorphAnalysis) { + this->_doMorphAnalysis = doMorphAnalysis; + return *(this); +} + +bool TaggingOptions::doMorphAnalysis() const { + return _doMorphAnalysis; +} + +TaggingOptions& TaggingOptions::doSentSplit(bool doSentSplit) { + this->_doSentSplit = doSentSplit; + return *(this); +} + +bool TaggingOptions::doSentSplit() const { + return _doSentSplit; +} + +TaggingOptions& TaggingOptions::useGuesser(bool useGuesser) { + this->_useGuesser = useGuesser; + return *(this); +} + +bool TaggingOptions::useGuesser() const { + return _useGuesser; +} + +TaggingOptions& TaggingOptions::ignoreSentsInsideSegment(const bool ignore) { + this->_ignoreSentsInsideSegment = ignore; +} + +bool TaggingOptions::ignoreSentsInsideSegment() const { + return this->_ignoreSentsInsideSegment; +} +} + Index: src/wrapper.cpp =================================================================== --- src/wrapper.cpp.orig 2011-06-08 21:25:58.000000000 +0200 +++ src/wrapper.cpp 2012-07-04 11:26:38.992173320 +0200 @@ -2,15 +2,18 @@ * PanteraWrapper.cpp * * Created on: 30-11-2010 - * Author: lennyn + * Author: mlenart * * Modified by: bz */ #include "concrete_wrapper.h" +#include #include #include +#include +#include #include #include @@ -46,15 +49,14 @@ static void load_engine_from_archive( BTagger::BrillEngine& engine, string enginePath) { - fs::path engine_path = find_with_path(ENGINES_PATH, enginePath); + fs::path engine_path = find_with_path(ENGINES_PATH, enginePath); fs::ifstream data_stream(engine_path, ios::in); boost::archive::text_iarchive engine_archive(data_stream); - engine_archive >> engine; } static Lexer* make_lexer(istream& stream) { - return new PlainTextLexer (stream); + return new PlainTextLexer(stream); } static vector tokenize(const string& text, const Tagset* tagset) { @@ -68,16 +70,37 @@ return lexems; } -static void splitIntoSents(vector& lexems) { - static LibSegmentSentencer sentencer; - lexems = sentencer.addSentenceDelimiters(lexems); +static void writeToFile(const string& fname, const string& data) { + ofstream out(fname.c_str()); + out.exceptions(ofstream::badbit); + out << data << endl; } -void ConcretePanteraWrapper::morphAnalyze(vector& lexems) { - lexems = morfeusz.analyzeText(lexems); +static void splitIntoSents(vector& lexems, const string& rules) { + static LibSegmentSentencer sentencer; + char tmpName[L_tmpnam]; + tmpnam(tmpName); + try { + writeToFile(string(tmpName), rules); + lexems = sentencer.addSentenceDelimiters(lexems, string(tmpName)); + remove(tmpName); + } catch (...) { + remove(tmpName); + throw; + } +} + +void ConcretePanteraWrapper::morphAnalyze(vector& lexems, + const string& morphDict, const bool useGuesser) { + morfeusz.clearMorphDict(); + if (!morphDict.empty()) { + istringstream stream(morphDict); + morfeusz.loadMorphDict(stream); + } + lexems = morfeusz.analyzeText(lexems, useGuesser); } -void ConcretePanteraWrapper::segmentDisamb(vector& lexems){ +void ConcretePanteraWrapper::segmentDisamb(vector& lexems) { segm_disamb.disambiguateSegmentation(lexems); } @@ -88,19 +111,20 @@ cerr << out.str() << endl; } -PanteraWrapper::PanteraWrapper(string tagsetName){ - tagsets = load_tagsets(tagsetName); - tagset = const_cast (tagsets[tagsets.size() - 1]); +PanteraWrapper::PanteraWrapper(string tagsetName) { + tagsets = load_tagsets(tagsetName); + tagset = const_cast(tagsets[tagsets.size() - 1]); } -ConcretePanteraWrapper::ConcretePanteraWrapper(string engineName, string tagsetName) : - PanteraWrapper(tagsetName), morfeusz(tagset, true) { +ConcretePanteraWrapper::ConcretePanteraWrapper(string engineName, + string tagsetName) : + PanteraWrapper(tagsetName), morfeusz(tagset) { - morfeusz.setQuiet(true); + morfeusz.setQuiet(true); - add_phases_to_engine(engine, tagsets, rule_generators); - load_engine_from_archive(engine, engineName); - engine.setQuiet(true); + add_phases_to_engine(engine, tagsets, rule_generators); + load_engine_from_archive(engine, engineName); + engine.setQuiet(true); } @@ -108,72 +132,56 @@ } PanteraWrapper* PanteraWrapper::getInstance() { - static ConcretePanteraWrapper pantera(DEFAULT_ENGINE, DEFAULT_LIB_TAGSET); - return &pantera; + static ConcretePanteraWrapper pantera(DEFAULT_ENGINE, DEFAULT_LIB_TAGSET); + return &pantera; } -PanteraWrapper* PanteraWrapper::createInstance(string enginePath, string tagsetName) { - return new ConcretePanteraWrapper(enginePath.empty() ? DEFAULT_ENGINE : enginePath, - tagsetName.empty() ? DEFAULT_LIB_TAGSET : tagsetName); +PanteraWrapper* PanteraWrapper::createInstance(string enginePath, + string tagsetName) { + return new ConcretePanteraWrapper( + enginePath.empty() ? DEFAULT_ENGINE : enginePath, + tagsetName.empty() ? DEFAULT_LIB_TAGSET : tagsetName); } -vector ConcretePanteraWrapper::tag(const string& text) { - - vector < MyLexeme > lexems = tokenize(text, tagset); - -// debug(lexems, tagset); +vector ConcretePanteraWrapper::tag(const string& text, + const TaggingOptions& options) { - //cerr << "tokenized" << endl; - splitIntoSents(lexems); - //cerr << "split" << endl; - morphAnalyze(lexems); - - segmentDisamb(lexems); - //cerr << "morphed" << endl; - - LexemesFilter < MyLexeme > segments_filter(MyLexeme::SEGMENT); - lexems = segments_filter.filterText(lexems); - //cerr << "filtered" << endl; - engine.tagText(lexems); - //cerr << "tagged" << endl; - lexems = segments_filter.unfilterText(lexems); - //cerr << "unfiltered" << endl; -// debug(lexems, tagset); - - vector res(lexems.begin(), lexems.end()); - return res; + vector lexems = tokenize(text, tagset); + doTag(lexems, options); + return vector(lexems.begin(), lexems.end()); } vector ConcretePanteraWrapper::tag( - const std::vector &lexems_, - bool doSentSplit, bool doMorphAnalysis, bool doSegmentDisamb, bool doTagging){ + const std::vector &lexems_, + const TaggingOptions& options) { - vector lexems(lexems_.begin(), lexems_.end()); + vector lexems(lexems_.begin(), lexems_.end()); -// debug(lexems, tagset); - - if (doSentSplit) - splitIntoSents(lexems); - - if (doMorphAnalysis) - morphAnalyze(lexems); - - if (doSegmentDisamb) - segmentDisamb(lexems); - - if (!doTagging) - return vector(lexems.begin(), lexems.end()); - - LexemesFilter < MyLexeme > segments_filter(MyLexeme::SEGMENT); - lexems = segments_filter.filterText(lexems); - engine.tagText(lexems); - lexems = segments_filter.unfilterText(lexems); - -// debug(lexems, tagset); + // debug(lexems, tagset); + this->doTag(lexems, options); return vector(lexems.begin(), lexems.end()); } +void ConcretePanteraWrapper::doTag(vector& lexems, + const TaggingOptions& options) { + if (options.doSentSplit()) + splitIntoSents(lexems, options.sentencerRules()); + + if (options.doMorphAnalysis()) + morphAnalyze(lexems, options.morphDict(), options.useGuesser()); + + if (options.doSegmentDisamb()) + this->segmentDisamb(lexems); + + if (options.doTagging()) { + LexemesFilter segments_filter(MyLexeme::SEGMENT); + lexems = segments_filter.filterText(lexems); + engine.tagText(lexems); + lexems = segments_filter.unfilterText(lexems); + } +} + Tagset* PanteraWrapper::getTagset() { return tagset; } Index: src/nlpcommon/morfeusz.h =================================================================== --- src/nlpcommon/morfeusz.h.orig 2011-05-24 22:23:52.000000000 +0200 +++ src/nlpcommon/morfeusz.h 2012-07-04 11:26:38.836173325 +0200 @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include @@ -73,7 +73,6 @@ const Tagset* odg_tagset; TagsetConverter* odg_converter; - bool use_odgadywacz; bool quiet; // lowercase form -> vector of (base, tag) @@ -293,7 +292,7 @@ } public: - MorfeuszAnalyzer(const Tagset* out_tagset, bool use_odgadywacz = true) + MorfeuszAnalyzer(const Tagset* out_tagset) : out_tagset(out_tagset), morf_tagset(load_tagset(MORFEUSZ_TAGSET)), morf_converter(PolishTagsetConverter::getSharedInstance( @@ -301,7 +300,6 @@ odg_tagset(load_tagset(ODGADYWACZ_TAGSET)), odg_converter(PolishTagsetConverter::getSharedInstance( odg_tagset, out_tagset)), - use_odgadywacz(use_odgadywacz), quiet(false) { } @@ -321,14 +319,14 @@ // // Full-line comments starting with # are allowed. // - void loadMorphDict(const string& filename) { + void loadMorphDict(std::istream& stream) { wstring key; wstring base; std::vector > interps; char line_buffer[1024]; - ifstream stream(filename.c_str()); - stream.exceptions(ifstream::badbit); +// ifstream stream(filename.c_str()); +// stream.exceptions(ifstream::badbit); while (!stream.eof()) { stream.getline(line_buffer, sizeof(line_buffer)); string line(line_buffer); @@ -381,7 +379,11 @@ } } - vector analyzeText(const vector& text) { + void clearMorphDict() { + morph_dict.clear(); + } + + vector analyzeText(const vector& text, const bool use_odgadywacz) { vector ret; int tidx = -1; BOOST_FOREACH(const Lexeme& lex, text) { Index: src/nlpcommon/sentencer.h =================================================================== --- src/nlpcommon/sentencer.h.orig 2010-06-28 06:49:45.000000000 +0200 +++ src/nlpcommon/sentencer.h 2012-07-04 11:26:38.888173322 +0200 @@ -23,7 +23,9 @@ Sentencer() { } virtual ~Sentencer() { } - virtual vector addSentenceDelimiters(const vector& text) = 0; + virtual vector addSentenceDelimiters( + const vector& text, + const string& sentencerRulesFile) = 0; }; } // namespace NLPCommon Index: third_party/segment/segment.srx =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ third_party/segment/segment.srx 2012-07-04 11:15:13.596186558 +0200 @@ -0,0 +1,5071 @@ + + +
+ + + + +Ingevolge paragraaf 4.7.4. van het SGR is ... +Jestem zły, bo... (wpisz własną odpowiedź) drażni mnie krowa. +Kierownictwo toleruje pracę z konieczności ("Skąd wezmę innego pracownika?") i jest zadowolone. Józek D. (45 l.) T.Love +Planowany wzrost przychodów najludniejszych gmin w br. będzie o 2 pkt. proc. wyższy od prognozowanej na br. stopy średniorocznej inflacji (15 proc.) natomiast wzrost wydatków przewyższa o 12 pkt. proc. stopę inflacji (co za dziwota! - przyp. red.) i tak dalej. +Nie jesteś Rosjaninem? - spytał przedstawiciel okręgu. 11.X.2001 (b. dobra gra). +Temperatura wody w systemie wynosi 30°C.W skład obiegu.. +H. Spiegel i D. Spiegel uczą pacjenta wchodzenia w autohipnozę na s. 112. Koncert pana Sarasetego skrzypka) ze współudziałem p. Schlozera, profesora konserwatorium warszawskiego. +To jest św. Paweł. W r. 1994 pojechałem do Rygi. To jest parę spraw itd., ale trzeba to załatwić. (Dz. U. Nr 22 poz. 162). +{0>Utopia.<0} +Po zakończeniu jego kadencji (pod koniec maja br.) zamierzam ubiegać się o wybór do zarządu. (5 tys.) złotych. Tu jest 5 ww. autorów, np. Józek. Zrobiłem wiele dobrego itd. Współczynniki załamania. On nie. Określone współczynniki załamania itd.Ten proces prowadzi. +Pochodził z rodziny Roberta E. Po wojnie wyzwolił się. Jerzy W. Urban, doktor psychiatra. Patrz art. 3 ust. 3. To piękne m. st. Warszawa. +Ik vind dat R. Baars een slechte (!) programmeur is. Als voetballer wordt hij nooit een prof. Maar prof. N.A.W. Th.Ch. Janssen wordt dat wel. Maar of dat zo blijft ... dat weet ik niet. Hij is m.a.w. een beginneling. Ook moet je rekening houden met af- +gebroken regels.En soms vergeet je het begin gewoon. "Ik ben gek" zei hij "op voetbal." Of je dat wil horen is niet duidelijk. + +U.S. Dist. Judge William G. Bush and Gen. J. Nugent Jr. Dumont, as well as William B. Hartslef Jr. are here. Dr. Jekyll and Mr. Hyde welcome you. +It [really!] works. This is e.g. Mr. Smith, who talks slowly... And this is another sentence. Leave me alone!, he yelled. I am in the U.S. Army. Charles (Ind.) said he. Let's go to the U. S. A. He won't. Really. On p. 6 there's nothing. Sentence ends here. (Another one). Let's meet at 5 p.m. It was Thursday. I met her at 5 p.m. and went to the movies. There are dogs, cats etc. and you should know it. + +
+ + + + + + +\bκ\.λπ\.\s + + + + +\bπ\.χ\.\s + + + + +\b(Ιαν|Φεβ|Μαρ|Απρ|Μαϊ|Ιουν|Ιουλ|Αυγ|Σεπ|Οκτ|Νοε|Δεκ)\.\s + + + +[\.!;…][\u00BB\u2019\u201D\u203A"'\p{Pe}\u0002]*\s + + + +[\.!;…]['"\u00BB\u2019\u201D\u203A\p{Pe}\u0002]* +\p{Lu}[^\p{Lu}] + + +\s\p{L}[\.!;…]\s +\p{Lu}\p{Ll} + + + + + +\badw\.\s + + + +\bafr\.\s + + + +\bakad\.\s + + + +\b[Aa]l\.\s + + + +\bam\.\s + + + +\bamer\.\s + + + +\barch\.\s + + + +\b[Aa]rt\.\s + + + +\bartyst\.\s + + + +\bastr\.\s + + + +\baustr\.\s + + + +\bbałt\.\s + + + +\bbdb\.\s + + + +\bbł\.\s + + + +\bbm\.\s + + + +\bbr\.\p{Pe}?\s + + + +\bbry[gt]\.\s + + + +\bcentr\.\s + + + +\bces\.\s + + + +\bchem\.\s + + + +\bchiń\.\s + + + +\bchir\.\s + + + +\bc\.k\.\s + + + +\bc\.o\.\s + + + +\bcyg\.\s + + + +\bcyw\.\s + + + +\bcyt\.\s + + + +\bczes\.\s + + + +\bczw\.\s + + + +\b[Cc]d\.\s + + + +\bczyt\.\s + + + +\bćw\.\s + + + +\bćwicz\.\s + + + +\bdaw\.\s + + + +\bdcn\.\s + + + +\bdekl\.\s + + + +\bdemokr\.\s + + + +\bdet\.\s + + + +\bdiec\.\s + + + +\bdł\.\s + + + +\bdn\.\s + + + + +\bdo[tlp]\.\s + + + +\bdost\.\s + + + +\bdosł\.\s + + + +\bh\.c\.\s + + + +\bds\.\s + + + +\bdst\.\s + + + +\bduszp\.\s + + + +\bdypl\.\s + + + +\begz\.\s + + + +\bekol\.\s + + + +\bekon\.\s + + + +\belektr\.\s + + + +\bem\.\s + + + +\bew\.\s + + + +\bfab\.\s + + + +\bfarm\.\s + + + +\bfot\.\s + + + +\bfr\.\s + + + +\bgat\.\s + + + +\bgastr\.\s + + + +\bgeogr\.\s + + + +\bgeol\.\s + + + +\bgimn\.\s + + + +\bgłęb\.\s + + + +\bgm\.\s + + + +\bgodz\.\s + + + +\bgórn\.\s + + + +\bgosp\.\s + + + +\bgr\.\s + + + +\bgram\.\s + + + +\bhist\.\s + + + +\bhiszp\.\s + + + +\b[Hh]r\.\s + + + +\bhot\.\s + + + +\bid\.\s + + + +\bin\.\s + + + +\bim\.\s + + + +\biron\.\s + + + +\bjn\.\s + + + +\bkard\.\s + + + +\bkat\.\s + + + +\bkatol\.\s + + + +\bk\.k\.\s + + + +\bkk\.\s + + + + +\bko?l\.\s + + + +\bk\.p\.a\.\s + + + +\bkpc\.\s + + + +\bk\.p\.c\.\s + + + +\bkpt\.\s + + + +\bkr\.\s + + + +\bk\.r\.\s + + + +\bkrak\.\s + + + +\bk\.r\.o\.\s + + + +\bkryt\.\s + + + +\bkult\.\s + + + +\blaic\.\s + + + +\błac\.\s + + + +\bniem\.\s + + + +\bwoj\.\s + + + +\b[Nn][bp]\.\s + + + +\bpo[lw]\.\s + + + +\bm\.in\.\s + + + + +\b[Pp][ts]\.\s + + + +\bcdn\.\s + + + +\bjw\.\s + + + +\b[Rr]y[cs]\.\s + + + +\btj\.\s + + + +\b[Tt]zw\.\s + + + +\btzn\.\s + + + +\bzob\.\s + + + +\bang\.\s + + + + +\bu[lb]\.\s? + + + + +\bp[wnl]\.\s + + + +\bal\.\s + + + +\bk\.\s + + + +\bn\.\s + + + + +\b[Oo]k\.\s +[\p{Ll}\d] + + + +\b[\d,\.]*ty[sś]\.\p{Pe}?\s + + + + +\b[Nn]r\.\s +\d + + + +\bw[wł]\.\s + + + +\bur\.\s + + + +\bzm\.\s + + + +\bżyd\.\s + + + +\bżarg\.\s + + + +\bżyw\.\s + + + +\bwył\.\s + + + +\b[bu]p\.\s + + + +\bwyst\.\s + + + +\b(?iu)mazeł\stow\.\s + + + +\b[Tt]ow\.\s + + + +\bo\.\s + + + +\b([sS]p|st|[Ss]półdz|społ|spółgł|[Ss]to[łw])\.\s + + + +\bzn\.\s + + + +\bzew\.\s + + + +\bzewn\.\s + + + +\bzdr\.\s + + + +\bzazw\.\s + + + +\bzast\.\s + + + +\bzaw\.\s + + + +\bzał\.\s + + + +\bzal\.\s + + + +\bzam\.\s + + + +\bzak\.\s + + + +\bzakł\.\s + + + +\bzagr\.\s + + + +\bzach\.\s + + + +\b[Aa]dw\.\s + + + +\b[Ll]ek\.\s + + + +\bmed\.\s + + + +\b[Mm]ec\.\s + + + +\b[Dd]oc\.\s + + + + +\b[Dd]y[wr]\.\s + + + +\b[Ii]nż\.\s + + + +\b(?iu)mgr\.\s + + + + +\b[dD][hr]\.\s + + + + +\b[pP]\.\s +\p{Lu}\p{Ll}+ + + +\b[Rr]ed\.\)?\s + + + +\b(?iu)pro[fk]\.\s + + + +\bhab\.\s + + + +\b[Pp]łk\.\s + + + +\b([Nn]a|[Pp]o)dkom\.\s + + + +\b[kK]s\.\s + + + +\b(?iu)gen\.\s + + + +\b(?iu)por\.\s + + + +\b[Rr]eż\.\s + + + +\b[Pp]rzyp\.\s + + + + +\b[śŚ][pwW]\.\s + + + +\betc\.\s +\p{Ll} + + + +\bit[dp]\.\s +[„”"]?\p{Ll} + + +\bproc\.\)?\s +\p{Ll}|\p{Lu}\p{Lu}+ + + +\b[rwn]\.\s +\p{Ll} + + +\bit[dp]\.\s +\p{Ll} + + +\bcdn\.\s +\p{Ll} + + +\b[Ss]zer\.\s + + + +\bjw\.\s +\p{Ll} + + +\bn\.e\.\s +\p{Ll} + + +\bw\.\s +\p{Ll} + + + +\bn[tn]\.\s +\p{Ll} + + +\b[dm]l\.\s +\p{Ll} + + +\bdag\.\s +\p{Ll} + + +\b[cd]?m\.\s +\p{Ll} + + +\b[Zz][Łł]\.\s +\p{Ll} + + +\b[Gg][rR]\.\s +\p{Ll} + + +\b[d]?kg\.\s +\p{Ll} + + +\bml[nd]\.\s +\p{Ll} + + +\bnpl\.\s +\p{Ll} + + +\bpkt\.\s +[\p{Ll}\d] + + + +\bstr\.\s +[\p{Ll}\d] + + + +\b[Tt]ab\.\s +[\p{Ll}\d] + + +\btel\.\s + + + +\b[ptw]g\.\s +\p{Ll} + + +\bcos\.\s +\p{Ll} + + +\bcosec\.\s +\p{Ll} + + +\bsec\.\s +\p{Ll} + + +\bsin\.\s +\p{Ll} + + +\brkm\.\s +\p{Ll} + + +\bust\.\s +\d + + +\bpar\.\s +\d + + + +\blit\.\s +\p{Ll}\p{Pe}?\p{P}?\s + + + +\b[Pp]on\.\s +\p{Ll} + + + +\b[Ss]ob\.\s +\p{Ll} + + + +\bba!\s +\p{Ll} + + + +\bpo[zk]\.\s + + + + +\b[Oo][Oo]\.\s + + + + +\b([CDSR]z|Ch)\.\s +\p{Ll} + + + +\b[rls]\.\s +[1-9]+ + + + +\b[,uoi]\ss\.\s + + + + +\b[Nn]ajśw\.\s + + + + +\b[Nn]a\sos\.\s + + + + +\bmin\.\s +[\p{Ll}\d] + + + +\bW\s\d{4}\sr\.\s +[\p{Lu}-–—„"] + + +\b\d+\.\s +\p{Ll}|\p{Lu}{2,} + + +\b\p{L}\.\s +\p{L}\.\s + + +\b\p{L}\. +\p{L}\. + + +\.\p{L}+\.\s +\p{Ll} + + + +[\s\(\[][\p{L}&&[^rwn]]\.\s+ +\p{Ll}\p{Ll}|\p{Lu}[\p{Punct}\p{Lu}] + + +['"„][\.!?…]['"”]\s + + + +["”']\s* +\s*\p{Ll} + + +[!?]+\p{Pe} +\p{Ll} + + +[\p{Ps}][!?]+[\p{Pe}] + + + +[\[\(]*\.\.\.[\]\)]* +\p{Ll} + + +[\[\(]*…[\]\)]* +\p{Ll} + + +\b\p{Lu}\.\s\p{Lu}\.\s + + + +\b\p{Lu}\.\p{Lu}\.\s + + + +\b\p{Lu}\p{Ll}\.\s? +\p{Lu}[^\p{Lu}] + + +\.\p{Lu}\p{Ll}\.\s? +\p{Lu}[^\p{Lu}] + + +\s(?<!\.)[„"\p{Ps}]?[A-Z]\.\s +\p{Ll}|\p{Lu}\p{Ll}\p{Ll}+ + + +^[„"]?[A-ZŚĆŻŹ]\.\s +\p{Ll}|\p{Lu}\p{Ll}\p{Ll}+ + + + +\s[A-Z]\.\s +\(\d + + +\bDz\.\s?U\.\s + + + + +[\p{Ll}&&[^aeouiyęąó]][\p{Ll}&&[^aeouiyęąó]]+\.\s +\p{Ll}+ + + + +[\.!?…]+['"\p{Pe}\u00BB\u2019\u201D\u203A\u0002]*\s +[\p{Ps}-–—]\s?\p{Ll} + + + +[\.!?…]['"\u00BB\u2019\u201D\u203A\u0002]*\p{Pe}\s +\p{Ll} + + +[\.!?…]['"\p{Pe}\u00BB\u2019\u201D\u203A\u0002]*\s + + + +[\.!?…]['»"”\p{Pe}]* +\p{Lu}[^\p{Lu}\.] + + +\s\p{L}[\.!?…]\s +\p{Lu}\p{Ll} + + + + +\b[nN]o\.\s +\p{N} + + +\b(pp|[Vv]iz|i\.?\s*e|[Vvol]|[Rr]col|maj|Lt|[Ff]ig|[Ff]igs|[Vv]iz|[Vv]ols|[Aa]pprox|[Ii]ncl|Pres|[Dd]ept|min|max|[Gg]ovt|lb|ft|c\.?\s*f|vs)\.\s +[^\p{Lu}]|I + + +\b[Ff]igs?\.\s +\p{N} + + +\be\.g\.\s + + + +\bvs\.\s + + + +\besp\.\s + + + + +\b[Ee]tc\.\s +[^p{Lu}] + + +\bJan\.\s + + + +\bFeb\.\s + + + +\bMar\.\s + + + +\bApr\.\s + + + +\bJun\.\s + + + +\bJul\.\s + + + +\bAug\.\s + + + +\bSept?\.\s + + + +\bOct\.\s + + + +\bNov\.\s + + + +\bDec\.\s + + + +\bPh\.?D\.\s + + + +\bet\b\s\bal\.\s + + + +\b(St|Gen|Hon|Prof|Dr|Mr|Ms|Mrs|[JS]r|Col|Maj|Brig|Sgt|Capt|Cmnd|Sen|Rev|Rep|Revd)\.\s + + + +\b(St|Gen|Hon|Prof|Dr|Mr|Ms|Mrs|[JS]r|Col|Maj|Brig|Sgt|Capt|Cmnd|Sen|Rev|Rep|Revd)\.\s[A-Z]\.\s + + + +\bcf\.\s + + + +\bInc\.\s + + + +\bCorp\.\s + + + +\bBros\.\s + + + +\bDist\.\s + + + +\bCo\.\s + + + +[\[\(]*…[\]\)]* +\p{Ll} + + +\p{Ps}[!?]+\p{Pe} + + + +[\.!?…]+\p{Pe} +\p{Ll} + + +["”']\s* +\s*\p{Ll} + + +['"„][\.!?…]['"”]\s + + + +\b\p{L}\.\s +\p{L}\.\s + + +\b\p{L}\. +\p{L}\. + + +[\.\s]\p{L}{1,2}\.\s +[\p{N}\p{Ll}] + + +[\[\(]*\.\.\.[\]\)]* +[^\p{Lu}] + + +\b\p{Lu}\.\s\p{Lu}\.\s + + + +\b\p{Lu}\.\p{Lu}\.\s + + + +[^\.]\s[A-Z]\.\s + + + +[\.!?…][\u00BB\u2019\u201D\u203A"'\p{Pe}\u0002]*\s + + + +[\.!?…]['"\u00BB\u2019\u201D\u203A\p{Pe}\u0002]* +\p{Lu}[^\p{Lu}] + + +\s\p{L}[\.!?…]\s +\p{Lu}\p{Ll} + + + + +\b\d+\.\s +\p{Ll}|\p{Lu}{2,} + + +["”']\s* +\s*\p{Ll} + + +['"„][\.!?…]['"”]\s + + + +\b\p{L}\.\s +\p{L}\.\s + + +\b\p{L}\. +\p{L}\. + + +[\.\s]\p{L}{1,2}\.\s +[\p{N}\p{Ll}] + + +[!?]+\p{Pe} +\p{Ll} + + +[\p{Ps}][!?]+[\p{Pe}] + + + +[\[\(]*\.\.\.[\]\)]* +[^\p{Lu}] + + +\b(etc|șamd)\.\s +[A-Z] + + +\b(pag|leg|art)\.\s + + + +\b(ian|feb|febr|mar|mart|apr|iun|iul|aug|sep|sept|oct|nov|dec)\.\s +[^\p{Lu}] + + +\bdpdv\.\s + + + +\b(etc|șamd)\.\s + + + +\b(M)\. +Ap\.N\.\s + + +\b(M)\.Ap\. +N\.\s + + +\b([Dd]l|[Dd]-na|[Dd]vs|[Pp]t)\.\s + + + +\b([Dd]l|[Dd]-na|[Dd]vs|[Pp]t)\.\s[A-Z]\.\s + + + +[\[\(]*\.\.\.[\]\)]* +\p{Ll} + + +[\[\(]*…[\]\)]* +\p{Ll} + + +[\.!?…]['"\u00BB\u2019\u201D\u203A\u0002]*\s + + + +[\.!?…]['»"”\p{Pe}]* +\p{Lu}[^\p{Lu}] + + +\s\p{L}[\.!?…]\s +\p{Lu}\p{Ll} + + + + +\b(Afr|Am|Ar|Br|Cie|Comp|Dhr|Dr|Em|Fa|Kon)\.\s + + + +\b(Mej|Mevr|Mgr|Mw|Ndl|Ned|Nl|No|Secr)\.\s + + + +\b(Sr|St|Ued|Vz|aanh|aanw|aardew|aardr)\.\s + + + +\b(abs|abstr|adj|adm|afb|[Aa]fd|afk|afl)\.\s + + + +\b(al|ald|alg|amb|ambt|anat|antrop|apoth)\.\s + + + +\b(arch|archeol|art|bc|betr|bez|bibl|bijl|bijv)\.\s + + + +\b(bijz|blz|bw|ca|cat|centr|cf|cfr|cmpl)\.\s + + + +\b(conf|ct|dal|derg|dhr|dir|div|dra|drs|ds)\.\s + + + +\b(ed|em|enz|etc|ev|excl|fa|fam|fig|fl|fr.)\.\s + + + +\b(geb|get|gld|id|incl|ing|intern|ir|jhr|jkvr)\.\s + + + +\b(jl|jr|kr|kt|lab|lic|ll|lt|lw|max|mi|min|mld)\.\s + + + +\b(mln|mr|mw|nl|no|nr|nrs|ob|obl|ong|onov|o.a)\.\s + + + +\b(opm|org|ov|pag|par|penn|plm|plv)\.\s + + + +\b(prov|pseud|red|ref|resp|soc|st|tab|tel|tk)\.\s + + + +\b(uitsl|ver|vgl|vnl|vnw|voorz|ww|zat|zg)\.\s + + + +\b(mm|cm|km|ml|kg|kW|h|mg)\.\s + + + +[\[\(]*…[\]\)]* +\p{Ll} + + +\p{Ps}[!?]+\p{Pe} + + + +[\.!?…]+\p{Pe} +\p{Ll} + + +["”']\s* +\s*\p{Ll} + + +['"„][\.!?…]['"”]\s + + + +\b\p{L}\.\s +\p{L}\.\s + + +\b\p{L}\. +\p{L}\. + + +[\.\s]\p{L}{1,2}\.\s +[\p{N}\p{Ll}] + + +[\[\(]*\.\.\.[\]\)]* +[^\p{Lu}] + + +\b\p{Lu}\.\s\p{Lu}\.\s + + + +\b\p{Lu}\.\p{Lu}\.\s + + + +[^\.]\s[A-Z]\.\s + + + +\b\p{Lu}\p{Ll}\.\s? +\p{Lu}[^\p{Lu}] + + +\.\p{Lu}\p{Ll}\.\s? +\p{Lu}[^\p{Lu}] + + + +\b\d+\.\s +\p{Ll}|\p{Lu}{2,} + + +\been\sprof\.\s +[^\p{Ll}] + + +\bprof\.\s + + + +[\.!?…][\u00BB\u2019\u201D\u203A\u00AB\p{Pe}\u0002]*\s + + + +[\.!?…]['"\u00BB\u2019\u201D\u203A\u00AB\p{Pe}\u0002]* +\p{Lu}[^\p{Lu}] + + +\s\p{L}[\.!?…]\s +\p{Lu}\p{Ll} + + + + +\b(Bc|Mgr|RNDr|PharmDr|PhDr|JUDr|PaedDr|ThDr|Ing|MUDr|MDDr|MVDr|Dr|ThLic|PhD|ArtD|ThDr|Dr|DrSc|CSs|prof)\.\s + + + +\b([Oo]br|[Čč])\.\s +\p{N} + + +\babl\.\s + + + +\babsol\.\s + + + +\badj\.\s + + + +\badmin\.\s + + + +\b[Aa]dr\.\s + + + +\badv\.\s + + + +\badvok\.\s + + + +\bafr\.\s + + + +\bak\.\s + + + +\bakad\.\s + + + +\bakc\.\s + + + +\bakuz\.\s + + + +\bet\b\s\bal\.\s + + + +\bal\.\s + + + +\balch\.\s + + + +\bamer\.\s + + + +\banat\.\s + + + +\b[Aa]ngl\.\s + + + +\banglosas\.\s + + + +\banorg\.\s + + + +\bap\.\s + + + +\bapod\.\s + + + +\barch\.\s + + + +\barcheol\.\s + + + +\barchit\.\s + + + +\barg\.\s + + + +\bart\.\s + + + +\bastr\.\s + + + +\bastrol\.\s + + + +\bastron\.\s + + + +\batp\.\s + + + +\batď\.\s + + + +\b[Aa]ustr\.\s + + + +\baut\.\s + + + +\b[Bb]elg\.\s + + + +\b[Bb]ibl\.\s + + + +\bbiol\.\s + + + +\bbot\.\s + + + +\bbud\.\s + + + +\bbás\.\s + + + +\bbýv\.\s + + + +\bcest\.\s + + + +\bchem\.\s + + + +\bcirk\.\s + + + +\bcsl\.\s + + + +\b[Čč]s\.\s + + + +\bdat\.\s + + + +\bdep\.\s + + + +\bdet\.\s + + + +\bdial\.\s + + + +\bdiaľ\.\s + + + +\bdipl\.\s + + + +\bdistrib\.\s + + + +\bdokl\.\s + + + +\bdosl\.\s + + + +\bdopr\.\s + + + +\bdram\.\s + + + +\bduš\.\s + + + +\bdv\.\s + + + +\bdvojčl\.\s + + + +\bdór\.\s + + + +\bekol\.\s + + + +\bekon\.\s + + + +\bel\.\s + + + +\belektr\.\s + + + +\belektrotech\.\s + + + +\benerget\.\s + + + +\bepic\.\s + + + +\best\.\s + + + +\betc\.\s + + + +\betonym\.\s + + + +\beufem\.\s + + + +\b[Ee]uróp\.\s + + + +\bev\.\s + + + +\bevid\.\s + + + +\bexpr\.\s + + + +\bfa\.\s + + + +\bfam\.\s + + + +\bfarm\.\s + + + +\bfem\.\s + + + +\bfeud\.\s + + + +\bfil\.\s + + + +\bfilat\.\s + + + +\bfiloz\.\s + + + +\bfi\.\s + + + +\bfon\.\s + + + +\bform\.\s + + + +\bfot\.\s + + + +\b[Ff]r\.\s + + + +\b[Ff]ranc\.\s + + + +\bfraz\.\s + + + +\bfut\.\s + + + +\bfyz\.\s + + + +\bfyziol\.\s + + + +\bgarb\.\s + + + +\bgen\.\s + + + +\bgenet\.\s + + + +\bgenpor\.\s + + + +\bgeod\.\s + + + +\bgeogr\.\s + + + +\bgeol\.\s + + + +\bgeom\.\s + + + +\bgerm\.\s + + + +\b[Gg]r\.\s + + + +\b[Gg]réc\.\s + + + +\bgréckokat\.\s + + + +\bhebr\.\s + + + +\bherald\.\s + + + +\bhist\.\s + + + +\bhl\.\s + + + +\bhlav\.\s + + + +\bhosp\.\s + + + +\bhromad\.\s + + + +\bhud\.\s + + + +\bhypok\.\s + + + +\bident\.\s + + + +\bi\.?e\.\s + + + +\bident\.\s + + + +\bimp\.\s + + + +\bimpf\.\s + + + +\bindoeur\.\s + + + +\binf\.\s + + + +\binform\.\s + + + +\binstr\.\s + + + +\bint\.\s + + + +\binterj\.\s + + + +\binšt\.\s + + + +\binštr\.\s + + + +\biron\.\s + + + +\b[Jj]ap\.\s + + + +\bjaz\.\s + + + +\bjedn\.\s + + + +\bjuhoamer\.\s + + + +\bjuhových\.\s + + + +\bjuhozáp\.\s + + + +\bjuž\.\s + + + +\b[Kk]anad\.\s + + + +\bkanc\.\s + + + +\bkapit\.\s + + + +\bkpt\.\s + + + +\bkart\.\s + + + +\bkatastr\.\s + + + +\bknih\.\s + + + +\bkniž\.\s + + + +\bkomp\.\s + + + +\bkonj\.\s + + + +\bkonkr\.\s + + + +\bkozmet\.\s + + + +\bkrajč\.\s + + + +\bkresť\.\s + + + +\bkt\.\s + + + +\bkuch\.\s + + + +\blat\.\s + + + +\blatinskoamer\.\s + + + +\blek\.\s + + + +\blex\.\s + + + +\blingv\.\s + + + +\blit\.\s + + + +\blitur\.\s + + + +\blog\.\s + + + +\blok\.\s + + + +\b[Mm]ax\.\s + + + +\b[Mm]aď\.\s + + + +\bmedzinár\.\s + + + +\bmest\.\s + + + +\bmetr\.\s + + + +\b[Mm]il\.\s + + + +\b[Mm]in\.\s + + + +\bminer\.\s + + + +\bml\.\s + + + +\bmld\.\s + + + +\bmn\.\s + + + +\bmod\.\s + + + +\bmytol\.\s + + + +\bnapr\.\s + + + +\b[Nn]ar\.\s + + + +\bnasl\.\s + + + +\bnedok\.\s + + + +\bneg\.\s + + + +\bnegat\.\s + + + +\bneklas\.\s + + + +\b[Nn]em\.\s + + + +\bneodb\.\s + + + +\bneos\.\s + + + +\bneskl\.\s + + + +\bnesklon\.\s + + + +\bnespis\.\s + + + +\bnespráv\.\s + + + +\bneved\.\s + + + +\bnež\.\s + + + +\bniekt\.\s + + + +\bniž\.\s + + + +\bnom\.\s + + + +\bnáb\.\s + + + +\bnákl\.\s + + + +\bnámor\.\s + + + +\bnár\.\s + + + +\bobch\.\s + + + +\bobj\.\s + + + +\bobv\.\s + + + +\bobyč\.\s + + + +\bobč\.\s + + + +\bobčian\.\s + + + +\bodb\.\s + + + +\bodd\.\s + + + +\bods\.\s + + + +\bojed\.\s + + + +\b[Oo]kr\.\s + + + +\bopt\.\s + + + +\bopyt\.\s + + + +\borg\.\s + + + +\bos\.\s + + + +\bosob\.\s + + + +\bot\.\s + + + +\bovoc\.\s + + + +\bpar\.\s + + + +\bpart\.\s + + + +\bpejor\.\s + + + +\bpers\.\s + + + +\b(pf|Pf|P\.f|p\.f)\.\s + + + +\bpl\.\s + + + +\bPlk\.\s + + + +\bpod\.\s + + + +\bpodst\.\s + + + +\bpokl\.\s + + + +\bpolit\.\s + + + +\bpolitol\.\s + + + +\bpolygr\.\s + + + +\bpomn\.\s + + + +\bpopl\.\s + + + +\bpor\.\s + + + +\bporad\.\s + + + +\bporov\.\s + + + +\bposch\.\s + + + +\bpotrav\.\s + + + +\bpouž\.\s + + + +\bpoz\.\s + + + +\bpozit\.\s + + + +\bpoľ\.\s + + + +\bpoľno\.\s + + + +\bpoľnohosp\.\s + + + +\bpoľov\.\s + + + +\bpošt\.\s + + + +\bpož\.\s + + + +\bprac\.\s + + + +\bpredl\.\s + + + +\bpren\.\s + + + +\bprep\.\s + + + +\bpreuk\.\s + + + +\b[Pp]riezv\.\s + + + +\bprivl\.\s + + + +\bprof\.\s + + + +\bpráv\.\s + + + +\bpríd\.\s + + + +\bpríj\.\s + + + +\bprík\.\s + + + +\bpríp\.\s + + + +\bprír\.\s + + + +\bprísl\.\s + + + +\bpríslov\.\s + + + +\bpríč\.\s + + + +\bpsych\.\s + + + +\bpubl\.\s + + + +\bpís\.\s + + + +\bpísm\.\s + + + +\bpôv\.\s + + + +\brefl\.\s + + + +\breg\.\s + + + +\brep\.\s + + + +\bresp\.\s + + + +\brozk\.\s + + + +\brozlič\.\s + + + +\brozpráv\.\s + + + +\b[Rr]oč\.\s + + + +\bryb\.\s + + + +\brádiotech\.\s + + + +\brím\.\s + + + +\bsamohl\.\s + + + +\bsemest\.\s + + + +\bsev\.\s + + + +\bseveroamer\.\s + + + +\bseverových\.\s + + + +\bseverozáp\.\s + + + +\bsg\.\s + + + +\bskr\.\s + + + +\bskup\.\s + + + +\bsl\.\s + + + +\bSloven\.\s + + + +\bsoc\.\s + + + +\bsoch\.\s + + + +\bsociol\.\s + + + +\bsp\.\s + + + +\b[Ss]pol\.\s + + + +\bspoloč\.\s + + + +\bspoluhl\.\s + + + +\bspráv\.\s + + + +\bspôs\.\s + + + +\bst\.\s + + + +\bstar\.\s + + + +\bstarogréc\.\s + + + +\bstarorím\.\s + + + +\bs\.r\.o\.\s + + + +\bstol\.\s + + + +\bstor\.\s + + + +\bstr\.\s + + + +\bstredoamer\.\s + + + +\bstredoškol\.\s + + + +\bsubj\.\s + + + +\bsubst\.\s + + + +\bsuperl\.\s + + + +\bsv\.\s + + + +\bsz\.\s + + + +\bsúkr\.\s + + + +\bsúp\.\s + + + +\bsúvzť\.\s + + + +\b[Tt]al\.\s + + + +\btech\.\s + + + +\b[Tt]el\.\s + + + +\btelef\.\s + + + +\bteles\.\s + + + +\btelev\.\s + + + +\bteol\.\s + + + +\btrans\.\s + + + +\bturist\.\s + + + +\btuzem\.\s + + + +\btypogr\.\s + + + +\btzn\.\s + + + +\btzv\.\s + + + +\bukaz\.\s + + + +\b[Uu]l\.\s + + + +\bumel\.\s + + + +\buniv\.\s + + + +\bust\.\s + + + +\bved\.\s + + + +\bvedľ\.\s + + + +\bverb\.\s + + + +\bveter\.\s + + + +\bvin\.\s + + + +\bviď\.\s + + + +\bvl\.\s + + + +\bvod\.\s + + + +\bvodohosp\.\s + + + +\bp?nl\.\s + + + +\bvulg\.\s + + + +\bvyj\.\s + + + +\bvys\.\s + + + +\bvysokoškol\.\s + + + +\bvzťaž\.\s + + + +\bvôb\.\s + + + +\bvých\.\s + + + +\bvýd\.\s + + + +\bvýrob\.\s + + + +\bvýsk\.\s + + + +\bvýsl\.\s + + + +\bvýtv\.\s + + + +\bvýtvar\.\s + + + +\bvýzn\.\s + + + +\bvčel\.\s + + + +\bvš\.\s + + + +\bvšeob\.\s + + + +\bzahr\.\s + + + +\bzar\.\s + + + +\bzariad\.\s + + + +\bzast\.\s + + + +\bzastar\.\s + + + +\bzastaráv\.\s + + + +\bzb\.\s + + + +\bzdravot\.\s + + + +\bzdruž\.\s + + + +\bzjemn\.\s + + + +\bzlat\.\s + + + +\b[Zz]n\.\s + + + +\bzool\.\s + + + +\bzr\.\s + + + +\bzried\.\s + + + +\bzv\.\s + + + +\bzáhr\.\s + + + +\bzák\.\s + + + +\bzákl\.\s + + + +\bzám\.\s + + + +\bzáp\.\s + + + +\bzápadoeur\.\s + + + +\bzázn\.\s + + + +\bázij\.\s + + + +\búzem\.\s + + + +\búčt\.\s + + + +\bčast\.\s + + + +\b[Čč]es\.\s + + + +\bčl\.\s + + + +\bčísl\.\s + + + +\bživ\.\s + + + +\bpr\.\s + + + +\bfak\.\s + + + +\b[Ss]lov\.\s +\p{Ll} + + +\bKr\.\s + + + +\bp\.n\.l\.\s +[^\p{Lu}] + + +\b[Jj]r\.\s + + + +\b(P\.\s?S|p\.\s?s|P\.\s?s)\.\s + + + +\b\d+\.\s +\p{Ll}|\p{Lu}{2,} + + +\p{Ps}[!?]+\p{Pe} + + + +[\[\(]*…[\]\)]* +\p{Ll} + + +[\.!?…]+\p{Pe} +\p{Ll} + + +["”']\s* +\s*\p{Ll} + + +['"„][\.!?…]['"”]\s + + + +\b\p{L}\.\s +\p{L}\.\s + + +\b\p{L}\. +\p{L}\. + + +[\.\s]\p{L}{1,2}\.\s +[\p{N}\p{Ll}] + + +[\[\(]*\.\.\.[\]\)]* +[^\p{Lu}] + + +\b\p{Lu}\.\s\p{Lu}\.\s + + + +\b\p{Lu}\.\p{Lu}\.\s + + + +[^\.]\s[A-Z]\.\s + + + +\b\p{Lu}\p{Ll}\.\s? +\p{Lu}[^\p{Lu}] + + +[\.\s]\p{L}{1,2}\.\s +[\p{N}\p{Ll}] + + +[\.!?…][\u00BB\u2019\u201D\u203A"'\p{Pe}\u0002]*\s + + + +[\.!?…]['"\u00BB\u2019\u201D\u203A\p{Pe}\u0002]* +\p{Lu}[^\p{Lu}] + + +\s\p{L}[\.!?…]\s +\p{Lu}\p{Ll} + + + + + +\b[nN]o\.\s +\p{N} + + +\b[nN][rR]\.\s +\p{N} + + + +\b\p{N}+\.\s +\b(janúar|febrúar|mars|apríl|maí|júní|júlí|ágúst|september|október|nóvember|desember) + + +\b\p{N}+\.\s +\b(jan|feb|mar|apr|maí|jún|júl|ágú|sep|sept|okt|nóv|des) + + + +\b[a-z[^íáóæ]]\.\s + + + +\b\p{L}\. +\p{L}\. + + + +\bab\.fn\.\s + + + +\ba\.fn\.\s + + + +\bafs\.\s + + + +\bal\.\s + + + +\balm\.\s + + + +\balg\.\s + + + +\bandh\.\s + + + +\bath\.\s + + + +\baths\.\s + + + +\batr\.\s + + + +\bao\.\s + + + +\bau\.\s + + + +\baukaf\.\s + + + + +\báfn\.\s + + + +\báhrl\.s\.\s + + + +\báhrs\.\s + + + +\bákv\.gr\.\s + + + +\bákv\.\s + + + + +\bbh\.\s + + + +\bbls\.\s + + + + +\bdr\.\s + + + + +\be\.Kr\.\s + + + +\bet\.\s + + + +\bef\.\s + + + +\befn\.\s + + + +\bennfr\.\s + + + +\beink\.\s + + + +\bend\.\s + + + +\be\.st\.\s + + + +\berl\.\s + + + + +\bfél\.\s + + + +\bfskj\.\s + + + +\bfh\.\s + + + +\bf\.hl\.\s + + + +\bfísl\.\s + + + +\b[A-ZÁ-Þ][a-zá-þ]+fj\.\s + + + +\bfl\.\s + + + +\bfn\.\s + + + +\bfo\.\s + + + +\bforl\.\s + + + +\bfrb\.\s + + + +\bfrl\.\s + + + +\bfrh\.\s + + + +\bfrt\.\s + + + +\bfsl\.\s + + + +\bfsh\.\s + + + +\bfs\.\s + + + +\bfsk\.\s + + + +\bfst\.\s + + + +\bf\.Kr\.\s + + + +\bft\.\s + + + +\bfv\.\s + + + +\bfyrrn\.\s + + + +\bfyrrv\.\s + + + + +\bgerm\.\s + + + +\bgm\.\s + + + +\bgr\.\s + + + + +\bhdl\.\s + + + +\bhdr\.\s + + + +\bhf\.\s + + + +\bhl\.\s + + + +\bhlsk\.\s + + + +\bhljsk\.\s + + + +\bhljv\.\s + + + +\bhljóðv\.\s + + + +\bhr\.\s + + + +\b[A-ZÁ-Þ][a-zá-þ]+hr\.\s + + + +\bhv\.\s + + + +\bhvk\.\s + + + +\bholl\.\s + + + +\bHos\.\s + + + +\bhöf\.\s + + + +\bhk\.\s + + + +\bhrl\.\s + + + + +\bísl\.\s + + + + +\bkaf\.\s + + + +\bkap\.\s + + + +\bKhöfn\.\s + + + +\bkk\.\s + + + +\bkg\.\s + + + +\bkk\.\s + + + +\bkm\.\s + + + +\bkl\.\s + + + +\bklst\.\s + + + +\bkr\.\s + + + +\bkt\.\s + + + +\bkgúrsk\.\s + + + +\bkvk\.\s + + + + +\bleturbr\.\s + + + +\blh\.\s + + + +\blh\.nt\.\s + + + +\blh\.þt\.\s + + + +\blo\.\s + + + +\bltr\.\s + + + + +\bmlja\.\s + + + +\bmljó\.\s + + + +\bmillj\.\s + + + +\bmm\.\s + + + +\bmms\.\s + + + +\bm\.fl\.\s + + + +\bmiðm\.\s + + + +\bmgr\.\s + + + +\bmst\.\s + + + +\bmín\.\s + + + + +\bnf\.\s + + + +\bnh\.\s + + + +\bnhm\.\s + + + +\bnl\.\s + + + +\bnk\.\s + + + +\bnmgr\.\s + + + +\bno\.\s + + + +\bnúv\.\s + + + +\bnt\.\s + + + + +\bo\.áfr\.\s + + + +\bo\.m\.fl\.\s + + + +\bohf\.\s + + + +\bo\.fl\.\s + + + +\bo\.s\.frv\.\s + + + + +\bófn\.\s + + + +\bób\.\s + + + +\bóákv\.gr\.\s + + + +\bóákv\.\s + + + + +\bpfn\.\s + + + +\bPR\.\s + + + +\bpr\.\s + + + + +\bRitstj\.\s + + + +\bRvík\.\s + + + +\bRvk\.\s + + + + +\bsamb\.\s + + + +\bsamhlj\.\s + + + +\bsamn\.\s + + + +\bsamn\.\s + + + +\bsbr\.\s + + + +\bsek\.\s + + + +\bsérn\.\s + + + +\bsf\.\s + + + +\bsfn\.\s + + + +\bsh\.\s + + + +\bsfn\.\s + + + +\bsh\.\s + + + +\bs\.hl\.\s + + + +\bsk\.\s + + + +\bskv\.\s + + + +\bsl\.\s + + + +\bsn\.\s + + + +\bso\.\s + + + +\bss\.us\.\s + + + +\bs\.st\.\s + + + +\bsamþ\.\s + + + +\bsbr\.\s + + + +\bshlj\.\s + + + +\bsign\.\s + + + +\bskál\.\s + + + +\bst\.\s + + + +\bst\.s\.\s + + + +\bstk\.\s + + + +\bsþ\.\s + + + + +\bteg\.\s + + + +\btbl\.\s + + + +\btfn\.\s + + + +\btl\.\s + + + +\btvíhlj\.\s + + + +\btvt\.\s + + + +\btill\.\s + + + +\bto\.\s + + + + +\bumr\.\s + + + +\buh\.\s + + + +\bus\.\s + + + +\buppl\.\s + + + + +\bútg\.\s + + + + +\bvb\.\s + + + +\bVf\.\s + + + +\bvh\.\s + + + +\bvkf\.\s + + + +\bVl\.\s + + + +\bvl\.\s + + + +\bvlf\.\s + + + +\bvmf\.\s + + + +\b8vo\.\s + + + +\bvsk\.\s + + + +\bvth\.\s + + + + +\bþt\.\s + + + +\bþf\.\s + + + +\bþjs\.\s + + + +\bþgf\.\s + + + +\bþlt\.\s + + + +\bþolm\.\s + + + +\bþm\.\s + + + +\bþml\.\s + + + +\bþýð\.\s + + + + +[\.!?…][\u00BB\u2019\u201D\u203A"'\p{Pe}\u0002]*\s + + + +[\.!?…]['"\u00BB\u2019\u201D\u203A\p{Pe}\u0002]* +\p{Lu}[^\p{Lu}] + + +\s\p{L}[\.!?…]\s +\p{Lu}\p{Ll} + + + + +\b\d+\.\s +\p{Ll}|\p{Lu}{2,} + + + +\b[А-Я]\.\s + + + +\b[A-Z]\.\s + + + +\b\p{L}\. +\p{L}\. + + + +\b[0-9]+(гг|г)\.\s + + + +\b[XVILMC]+(в|вв)\.\s + + + +\b[0-9]+(\.|:)[0-9][0-9]\s + + + +\b[0-9]+(\.|:)[0-9][0-9](\.|:)[0-9][0-9]\s + + + + +\b[0-9]+(м|мм|см|дм|л|км|га|кг|т|г|мг)\.\s + + + + +\b(бульв|в|вв|г|га|гг|гл|гос|грн|д|дм|доп|др|е|ед|ед|зам|Зам|и|инд|исп|Исп)\.\s + + + +\b(к|кап|кг|кв|кл|км|кол|комн|коп|куб|л|лиц|лл|м|макс|мг|мин|мл|млн|Млн|млрд|Млрд|мм)\.\s + + + +\b(н|наб|нач|неуд|ном|о|обл|обр|общ|ок|ост|отл|п|пер|Пер|перераб|пл|пос|пр|просп|Просп|проф|Проф)\.\s + + + +\b(р|ред|руб|Руб|с|сб|св|см|См|соч|ср|ст|стр|т|тел|Тел|тех|тт|туп|тыс|Тыс)\.\s + + + +\b(уд|ул|уч|физ|х|хор|ч|чел|шт|экз|э)\.\s + + + +['"„“][\.!?…]['"”]\s + + + +[\u00AB][\.!?…][\u00BB]\s + + + +[\[\(]*\.\.\.[\]\)]* +\p{Ll} + + +[\[\(]*…[\]\)]* +\p{Ll} + + +["”'\u00BB]\s* +\s*\p{Ll} + + + +[\.!?…]['"\u00BB\u2019\u201D\u203A\u0002]*\s + + + +\u005D\u005D\s + + + +[\.!?…]['»"”\p{Pe}]* +\p{Lu}[^\p{Lu}] + + +\s\p{L}[\.!?…]\s +\p{Lu}\p{Ll} + + + + +\u2029 + + + + + +<0\} + + + +\{0> + + + + + +\r?\n + + + + + +\r?\n\s*\r?\n[\t]* + + + + + +\b[dD]r\.\s + + + +\bitd\.\s + + + +\bitn\.\s + + + +\b[šŠ]t\.\s +\p{N} + + +[\[\(]*\.\.\.[\]\)]* +\p{Ll} + + +[\[\(]*…[\]\)]* +\p{Ll} + + +['"„][\.!?…]['"”]\s + + + +\bd\.\s + + + +\b[jJ]an\.\s + + + +\b[fF]eb\.\s + + + +\b[mM]ar\.\s + + + +\b[aA]pr\.\s + + + +\b[jJ]un\.\s + + + +\b[jJ]ul\.\s + + + +\b[aA]vg\.\s + + + +\b[sS]ept?\.\s + + + +\b[oO]kt\.\s + + + +\b[nN]ov\.\s + + + +\b[dD]ec\.\s + + + +\b[tT]j\.\s + + + +\b[nN]pr\.\s + + + +\b[sS]l\.\s + + + +\b[oO]p\.\s + + + +\b[gG]l\.\s + + + +\b[oO]z\.\s + + + +\bprev\.\s + + + +\bdipl\.\s + + + +\bing\.\s + + + +\b[pP]rim\.\s + + + +\b[cC]f\.\s + + + +\b[0-9]+(\.|:)[0-9][0-9](\.|:)[0-9][0-9]\s + + + +\b[0-3][0-9]+(\.|:)[0-9][0-9](\.|:)[0-9][0-9]\s + + + +\b[0-9]*\.\s + + + +\b[XVILMC]*\.\s + + + +\b[gG]l\.\s + + + +[\.!?…][\u00BB\u2019\u201D\u203A"'\p{Pe}\u0002]*\s + + + +[\.!?…]['"\u00BB\u2019\u201D\u203A\p{Pe}\u0002]* +\p{Lu}[^\p{Lu}] + + +\s\p{L}[\.!?…]\s +\p{Lu}\p{Ll} + + + + + +\b([Aa]vda|[Pp][ol]|Pl?za|[Aa]dm|[Dd]pto)\.\s + + + +\b(Dña|Dr[a]?|Sra|Sto|S(ri)?ta|Ldo|Ing|Prof|Excmo|Ilmo|Mgfco|admdor|admdora)\.\s + + + +\b([Aa]rt|[Cc][óo]d|[Ss]ecc|[Tt]ít)\.\s + + + +\b([Ee]d(it)?|[Nn]o|n|[Nn]úm|[Pp]ág|p|c|\d+er|[V\.]gr)\.\s + + + + +\b(Sr|Jr|Admón|Adm|Inc|Co|Hnos|Vda|[VU]d[s]?)\.[\p{Pe}\p{Pf}\p{Pd}"']*\s +\p{Ll} + + + +\b(\p{L}\.)+[\p{Pe}\p{Pf}\p{Pd}"']*\s +\p{Ll} + + + +\b([\p{Lu}]{2}\.)+[\p{Pe}\p{Pf}\p{Pd}"']*\s +\p{Ll} + + + +\b([Ee]tc|m[aáà]x|m[ií]n|aprox|\d+o)\.[\p{Pe}\p{Pf}\p{Pd}"']*\s +\p{Ll} + + + +\bet al\.[\p{Pe}\p{Pf}\p{Pd}"']*\s + + + + +\b([Pp]ta[s]?|K[gm][s]|[mc]?[gmls]|[Hh](rs)?)\.[\p{Pe}\p{Pf}\p{Pd}"']*\s +\p{Ll} + + + +\b(\Q...\E|…)\p{Pe}\s +\p{Ll} + + + +[\.…][\u00BB\u2019\u201D\u203A"'\u0002]*\s + + + +\s\p{L}+[\p{Pf}\p{Pe}\u00BB\u2019\u201D\u203A"'\u0002]*[\.:!?…]+\s* +[¡¿«»"'\p{Ps}]*\p{Lu}\p{L}* + + + + + +\b([Aa]vda|[Pp][ol]|Pl?za|[Aa]dm|[Dd]pto)\.\s + + + +\b(Dña|Dr[a]?|Sra|Sto|S(ri)?ta|Ldo|Ing|Prof|Excmo|Ilmo|Mgfco|admdor|admdora)\.\s + + + +\b([Aa]rt|[Cc]ód|[Ss]ecc|[Tt]ít)\.\s + + + +\b([Ee]d(it)?|[Nn]o|n|[Nn]úm|[Pp]ág|p|c|\d+er)|[V\.]gr\.\s + + + + +\b(Sr|Jr|Admón|Inc|Co|Hnos|Vda|[VU]d[s]?)\.[\p{Pe}\p{Pf}\p{Pd}"']*\s +\p{Ll} + + + +\b(\p{L}\.)+[\p{Pe}\p{Pf}\p{Pd}"']*\s +\p{Ll} + + + +\b([\p{Lu}]{2}\.)+[\p{Pe}\p{Pf}\p{Pd}"']*\s +\p{Ll} + + + +\b([Ee]tc|m[aá]x|m[ií]n|aprox|\d+o)\.[\p{Pe}\p{Pf}\p{Pd}"']*\s +\p{Ll} + + + +\bet al\.[\p{Pe}\p{Pf}\p{Pd}"']*\s + + + + +\b([Pp]ta[s]?|K[gm][s]|[mc]?[gmls]|[Hh](rs)?)\.[\p{Pe}\p{Pf}\p{Pd}"']*\s +\p{Ll} + + + +\b(\Q...\E|…)\p{Pe}\s +\p{Ll} + + + +[\.…][\u00BB\u2019\u201D\u203A"'\u0002]*\s + + + +\s\p{L}+[\p{Pf}\p{Pe}\u00BB\u2019\u201D\u203A"'\u0002]*[\.:!?…]+\s* +[¡¿«»"'\p{Ps}]*\p{Lu}\p{L}* + + + + + +'\p{L}[\.!?…]\s +\p{Lu} + + + +\sno[\.!?…]\s +\p{Lu} + + + +[ap]\.m\.\s +\p{Lu} + + + +[^-\p{L}]\p{L}[\.!?…]['|"|«|\)|\]|\}]?\s + + + + +\b\p{L}\. + + + + +\s\p{L}\.\s +\p{L}\. + + + +[\[\(]?\.\.\.[\]\)]?\s +\p{Ll} + + + +['"][\.!?…]['"]\s + + + + +["']\s +\p{Ll} + + + +\s([\.!?]{1,3}|…)['|"|«|\)|\]|\}]?\s + + + + +\b\d+\.\s +\p{Ll}|\p{Lu}{2,} + + + +[\(\[][!?]{1,3}[\]\)]\s + + + + +[!?]{1,3}[\)\]]\s + + + + +[\(\)\[\]]\s + + + + +\s[IVX]+\.\s +[^\p{Lu}]+ + + + +\d+\.\s +(und|oder|bis)\s + + + +\d+\.\s +Januar|Februar|März|April|Mai|Juni|Juli|August|September|Oktober|November|Dezember + + + +\d+\.\s +Jh|Jhd|Jahrhundert|Jahrhunderts|Geburtstag|Geburtstags|Platz|Platzes|Loch|Lochs|Loches + + + +\b(Mr|Mrs|No|pp|St|no|Sr|Jr|Bros|etc|vs|esp|[Ff]ig|Jan|Feb|Mar|Apr|Jun|Jul|Aug|Sep|Sept|Oct|Okt|Nov|Dec|Ph.D|PhD|al|cf|Inc|Ms|Gen|Sen|Prof|Corp|Co|Ltd)\.\s + + + + +\b(versch|d|Übers|usw|bzw|Abh|Abk|Abt|ahd|Akk|allg|alltagsspr|altdt|alttest|amerikan|Anh|Ank|Anm|Art|Az|Bat|bayr|Bd|Bde|Bed|Bem|bes|bez|Bez|Bhf|bspw|btto|bw|bzw)\.\s + + + +\b(cts|ct|Ca|ca|chem|chin|Chr|cresc|dat|Dat|desgl|ders|dgl|Di|Dipl|Dir|Do|Doz|Dr|dt|ebd|Ed|eigtl|engl|Erg|al|etc|etw|ev|evtl|Evtl|exkl|Expl|Exz)\.\s + + + +\b(ff|Fa|fachspr|fam|fem|Fem|Fr|fr|franz|frz|frdl|Frl|Fut|Gd|geb|gebr|Gebr|geh|geh|geleg|gen|Gen|germ|gesch|ges|get|ggf|Ggs|ggT|griech)\.\s + + + +\b(hebr|hg|hl|Hrsg|Hg|hist|hochd|hochspr|Hptst|Hr|Allg|ill|inkl|incl|Ind|Inf|Ing|ital|Tr|Jb|Jg|Jh|Jhd|jmd|jmdm|jmdn|jmds|jur|Kap|kart|kath|kfm|kaufm|Kfm|kgl|Kl|Konj|Krs|Kr|Kto)\.\s + + + +\b(lat|lfd|Lit|lt|Lz|Mask|mask|Mrd|mdal|med|met|mhd|Mi|Mio|min|Mo|mod|nachm|nördlBr|neutr|Nhd|Nom|Nr|Nrn|Num|Obj|od|dgl|offz)\.\s + + + +\b(Part|Perf|Pers|Pfd|Pl|Plur|pl|Plusq|Pos|pp|Präp|Präs|Prät|Prov|Prof|rd|reg|resp|Rhld|rit|Sa|südl|Br|sel|sen|Sept|Sing|sign|So|sog|Sp|St|St|Std|stacc|Str|stud|Subst|sva|svw|sZ)\.\s + + + +\b(Tel|Temp|trans|Tsd|übertr|übl|ff|ugs|univ|urspr|usw|vgl|Vol|vorm|vorm|Vp|Vs|vs|wg|Hd|Ztr|zus|Zus|zzt|zz|Zz|Zt|Min|bzgl|Frhr)\.\s + + + + +[\.!?…]['|"|«|\)|\]|\}]?\s+ + + + +[\.!?…]['"\p{Pe}\u00BB\u201D]? +\p{Lu}[^\p{Lu}] + + +\s\p{L}[\.!?…]\s +\p{Lu}\p{Ll} + + + + + +'\p{L}[\.!?…]\s +\p{Lu} + + + +\sno[\.!?…]\s +\p{Lu} + + + +[ap]\.m\.\s +\p{Lu} + + + +[^-\p{L}]\p{L}[\.!?…]['|"|«|\)|\]|\}]?\s + + + + +\b\p{L}\. + + + + +\s\p{L}\.\s +\p{L}\. + + + +[\[\(]?\.\.\.[\]\)]?\s +\p{Ll} + + + +['"][\.!?…]['"]\s + + + + +["']\s +\p{Ll} + + + +\b\d+\.\s +\p{Ll}|\p{Lu}{2,} + + + +[\(\[][!?]{1,3}[\]\)]\s + + + + +[!?]{1,3}[\)\]]\s + + + + +[\(\)\[\]]\s + + + + +\d+\.\s +(og|eller|til)\s + + +\b\p{N}+\.\s +januar|februar|marts|april|maj|juni|juli|august|september|oktober|november|december + + + +\d+\.\s +januar|februar|marts|april|maj|juni|juli|august|september|oktober|november|december + + + +\b(Mr|Mrs|No|pp|St|no|Sr|Jr|Bros|vs|esp|[Ff]ig|Jan|Feb|Mar|Apr|Jun|Jul|Aug|Sep|Sept|Oct|Okt|Nov|Dec|Ph.D|PhD|al|cf|Inc|Ms|Gen|Sen|Prof|Corp|Co)\.\s + + + + +\b(abs|abstr|adj|adm|adr|adv|afd|afg|afl|afs|afvig|agro|akad|akk|allr|alm|amer|anat|ang|anm|anv|apot|appos|apr|arab|arb|arkais|arkæol|arp|arr|art|ass|astr|att|attrib|aud|aug|aut)\.\s + + + +\b(bag|barb|barnespr|bd|bdt|beg|besl|best|bet|bhk|biavl|bibet|bibl|bibliot|billard|billedl|biol|bjergv|bk|bl|bogb|bogh|bogtr|bornh|bot|br|bryg|bto|bygn|bødk)\.\s + + + +\b(ca|cand|Chr|cirk|cit|co|d|da|dagl|dans|dat|dec|def|demonstr|dep|dial|diam|dim|dipl|disp|distr|distrib|dobb|dok|dr|dvs|e|egl|ejd|eks|eksam|ekskl|eksp|ekspl|el|ell|ellipt|emb|endv|eng|enk|ent|etnogr|eufem|eur|event|evt)\.\s + + + +\b(f|fagl|fakt|farv|feb|ff|fhv|fig|filos|fin|fisk|fk|fl|flg|flt|flyv|fmd|fon|foragt|forb|foreg|forf|forsikr|fors|forsk|forst|forv|foræld|fot|fr|fre|fris|frk|fsv|fuldm|fx|fys|fysiol|fægt|gart|gartn|garv|gdr|gen|genopt|geogr|geol|geom|germ|gl|glarm|glda|gldgs|glholl|glno|gns|got|gr|gradbøjn|graf|gram|gross|grundbet|græc|guldsm|gym)\.\s + + + +\b(h|hat|hd|hebr|henh|hensobj|herald|hhv|hist|hj|holl|hovedbet|hr|hty|højtid|haandarb|haandv|i|if|iflg|ifm|ift|iht|imp|incl|indb|indik|inf|ing|Inkl|inkl|insp|instr|interj|intk|intr|iron|isl|ital|jan|jarg|jernb|jf|jnr|jr|jul|jun|jur|jy|jæg|jærnb|jød)\.\s + + + +\b(Kbh|kbh|kem|kgl|kirk|kl|kld|knsp|kog|koll|komm|komp|konj|konkr|kons|Kr|kr|kurv|kvt|køkkenspr|l|landbr|landmaaling|lat|lb|lic|lign|litt|Ll|log|Loll|loll|lrs|lør)\.\s + + + +\b(m|maj|maks|mal|man|mar|mark|mat|mdl|mdr|med|medl|meng|merc|meteorol|meton|metr|mf|mfl|mht|mia|mil|min|mineral|mio|ml|mlat|mm|mnt|mods|modsætn|modt|mr|mrk|mur|mvh|mytol|møl|mønt|n|naturv|ndf|Ndr|nedsæt|nht|no|nom|nov|nr|nt|num|nyda|nydann|nylat|naal)\.\s + + + +\b(obj|obl|oblik|obs|odont|oecon|oeng|ofl|ogs|oht|okt|oldfr|oldfris|oldn|olgn|omg|omkr|omtr|ons|opr|ordspr|org|osax|ovenst|overf|overs|ovf|p|pag|parl|part|pass|pat|pct|perf|pers|pga|ph|pharm|phil|pk|pkt|pl|plur|poet|pol|polit|pop|port|poss|post|pott|pr|prod|pron|propr|prov|præd|præp|præs|præt|psych|pt|pæd|paavirkn)\.\s + + + +\b(reb|ref|refl|regn|rekl|relat|relig|resp|retor|rev|rid|rigsspr|run|russ|s|sa|sanskr|scient|sdjy|sdr|sek|sen|sep|sept|shetl|sj|sjæll|skibsbygn|sko|skol|skr|skriftspr|skræd|Skt|slagt|slutn|smed|sml|smsat|smst|snedk|soc|soldat|sp|spec|sport|spot|spr|sprogv|spøg|ssg|ssgr|st|stat|stk|str|straf|stud|subj|subst|superl|sv|sætn|søfors|søn)\.\s + + + +\b(talem|talespr|tandl|td|tdl|teat|techn|telef|telegr|telekom|teol|th|theol|tir|tirs|tlf|told|tor|tors|trans|tsk|ty|tyrk|tøm|u|ubesl|ubest|udd|uddan|udenl|udg|udtr|uegl|ugtl|ult|underbet|undt|univ|upers|ur|urnord)\.\s + + + +\b(v|var|varem|vbs|vedk|vedl|vedr|vejl|verb|vet|vha|vol|vs|vsa|vulg|væv|zool|æ|æda|ænht|ænyd|æstet|ø|økon|å|årg|årh)\.\s + + + + +\b(etc|mv|osv)\.\s +\p{Ll} + + + +[\.!?…]['|"|«|\)|\]|\}]?\s+ + + + +[\.!?…]['"\p{Pe}\u00BB\u201D]? +\p{Lu}[^\p{Lu}] + + +\s\p{L}[\.!?…]\s +\p{Lu}\p{Ll} + + + + + +\b(div|[Ee]kz|h|[Ii]nkl|p|[Rr]ed|[Rr]im|ktp)\.\s +\p{Ll} + + +\b([Bb]v|[Ĉĉ]|i\.a|k\.[acs]|[Tt]\.[ne]|k\.t\.p|n\.b|P\.S)\.\s + + + +\b[Ll]ernu!\s +\p{Ll} + + + +[\.!?…]['|"|«|\)|\]|\}]?\s+ + + + +[\.!?…]['"\p{Pe}\u00BB\u201D]? +\p{Lu}[^\p{Lu}] + + +\s\p{L}[\.!?…]\s +\p{Lu}\p{Ll} + + + + + +\b\d+\.\s +\p{Ll}|\p{Lu}{2,} + + + +\b[А-Я]\.\s + + + +\bҐ\.\s + + + +\bЇ\.\s + + + +\bЄ\.\s + + + +\b[A-Z]\.\s + + + +\b\p{L}\. +\p{L}\. + + + +\b[0-9]+(р)\.\s + + + +\b[XVILMC]+(ст)\.\s + + + +\b[0-9]+(\.|:)[0-9][0-9]\s + + + +\b[0-9]+(\.|:)[0-9][0-9](\.|:)[0-9][0-9]\s + + + + +\b[0-9]+(г|гг|грн|млн|млрд|руб|тис)\.\s + + + + +\bв\.\s + + + +\bвв\.\s + + + +\bвул\.\s + + + +\bг\.\s + + + +\bгг\.\s + + + +\bгрн\.\s + + + +\bмлн\.\s + + + +\bмлрд\.\s + + + +\bруб\.\s + + + +\bст\.\s + + + +\bр\.\s + + + +\bтис\.\s + + + +['"„][\.!?…]['"”]\s + + + +[\u00AB][\.!?…][\u00BB]\s + + + +[\[\(]*\.\.\.[\]\)]* +\p{Ll} + + +[\[\(]*…[\]\)]* +\p{Ll} + + +["”'\u00BB]\s* +\s*\p{Ll} + + + +[\.!?…]['"\u00BB\u2019\u201D\u203A\u0002]*\s + + + +\u005D\u005D\s + + + +[\.!?…]['»"”\p{Pe}]* +\p{Lu}[^\p{Lu}] + + +\s\p{L}[\.!?…]\s +\p{Lu}\p{Ll} + + + + + +\b\d+\.\s +\p{Ll}|\p{Lu}{2,} + + + +\b[А-Я]\.\s + + + +\bЎ\.\s + + + +\b[A-Z]\.\s + + + +\b\p{L}\. +\p{L}\. + + + +\b[0-9]+(г)\.\s + + + +\b[XVILMC]+(ст)\.\s + + + +\b[0-9]+(\.|:)[0-9][0-9]\s + + + +\b[0-9]+(\.|:)[0-9][0-9](\.|:)[0-9][0-9]\s + + + + +\b[0-9]+(г|гг|грн|млн|млрд|руб|тыс)\.\s + + + + +\b(в|вв|г|гг|грн|млн|млрд|руб|ст|р|тыс)\.\s + + + +['"„][\.!?…]['"”]\s + + + +[\u00AB][\.!?…][\u00BB]\s + + + +[\[\(]*\.\.\.[\]\)]* +\p{Ll} + + +[\[\(]*…[\]\)]* +\p{Ll} + + +["”'\u00BB]\s* +\s*\p{Ll} + + + +[\.!?…]['"\u00BB\u2019\u201D\u203A\u0002]*\s + + + +\u005D\u005D\s + + + +[\.!?…]['»"”\p{Pe}]* +\p{Lu}[^\p{Lu}] + + +\s\p{L}[\.!?…]\s +\p{Lu}\p{Ll} + + + + + + +\bs([eé]c)?\.\s? +[IVXVDMCL]+ + + +\b[Ee]tc\.[\p{Pe}\p{Pf}\p{Pd}"']*\s +\p{Ll} + + +\b(m[aá]x|m[ií]n|[aA]prox)\.[\p{Pe}\p{Pf}\p{Pd}"']*\s +[\p{Ll}\p{N}] + + +\b([aA]pt?do|[aA]sdo|[aA]vd?a?|[Cc]ód|[Dd]e?pto|[Ff]ac|[Ii]nst)\.\s + + + + +\b(S\.A\.[IRS]\.|S\.R\.M\.|A\.R\.|S\.[ME]\.)\s +\p{Lu} + + +\b([\p{Ll}\p{Lu}]\.)+[\p{Pe}\p{Pf}\p{Pd}"']*\s +\p{Ll} + + + +\b\p{L}\.\s? +((\p{L}\.\s?)+|\p{Ll}) + + + +\b\p{Lu}{2}\.\s? +(\p{Lu}{2}\.?\s?|\p{Ll}) + + + +\b([Aa]fm[oa]s?|Emcia|Ilt?m[ao]s?|Iltres?|MM|Exc?m[ao]s?|Magf[oa]|D(na)?|Sra?|Sr[ea]s|Srta|Dra?|Dr[ea]s?|Rm[ao]|Rev|Revm[ao]|Mons|Emmo|Rv?d[ao]|[Ll]icd[oa]|[Ll]ic|[Ll]d[oa]|[pP]rofs?)\.\s + + + + +\b([Nn][úu]ms?|[fF]igs?|[Pp][aá]xs?|pp?|cc?a)\.\s +\p{N} + + + +\b([Vv]ols?|[Cc]aps?)\.\s +\p{N}|[IVXVDMCL]+ + + + +\b([Aa]dmóns?|[aA]d(mt)?v[oa]s?)\.\s +\p{Ll} + + + +\b([pP]pal|[Vv]des?|[Ii]b[íi]d|[Rr]efs?|[Cc]it|[Aa]brevs?|[Aa]bl|[Aa]dx|[Aa]dv|[Aa]cr|[Cc]onx|[Ll]oc|[Pp]rep|[Ss]ubst)\.\s +[^\p{Lu}] + + +\b([vV]id|[Cc]fr?)\.\s + + + + +\b([Cc]oord|[Ee]d)s?\.\s + + + +\b([Cc]t[ae]|[Tt]e?lf|[Tt]fno|[Tt]el[eé]f|[Tt]el)s?\.\s +[^\p{Lu}] + + + +\b([oO]p|[lL]oc)\.\s? +cit\. + + + +\bet [aá]l\.\s? +[\p{Ll}\p{N}] + + + +['"\(][\.!?…]['"\)]\s + + + +\bvs\.\s + + + +\besp\.\s + + + +(…|\.\.\.)\s +\p{Ll} + + + +[\.…][\u00BB\u2019\u201D\u203A"'\u0002]*\s + + + +\s\p{L}+[\p{Pf}\p{Pe}\u00BB\u2019\u201D\u203A"'\u0002]*[\.:!?…]+\s* +[¡¿«»"'\p{Ps}]*\p{Lu}\p{L}* + + +[^\s]:\s +['"«¡¿\p{Ps}\p{Pi}]?\p{Lu}\p{Ll}* + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Index: third_party/segment/Makefile.am =================================================================== --- third_party/segment/Makefile.am.orig 2010-08-10 17:33:08.000000000 +0200 +++ third_party/segment/Makefile.am 2012-07-04 11:15:13.620186558 +0200 @@ -1,5 +1,9 @@ AM_JAVACFLAGS = -cp '$(CLASSPATH):*' javadir = $(libexecdir)/$(PACKAGE) +segmentdatadir = $(pkgdatadir) + +dist_segmentdata_DATA = segment.srx + dist_java_JAVA = SegmentInterface.java dist_java_DATA = \ activation.jar \