Commit 688b6eac authored by SWHL's avatar SWHL
Browse files

Update files

parents
#define BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
#define BOOST_TEST_MODULE FakeOStreamTest
#include "string_stream.hh"
#include <boost/test/unit_test.hpp>
#include <boost/lexical_cast.hpp>
#include <cstddef>
#include <limits>
namespace util { namespace {
template <class T> void TestEqual(const T value) {
StringStream strme;
strme << value;
BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(value), strme.str());
}
template <class T> void TestCorners() {
TestEqual(std::numeric_limits<T>::max());
TestEqual(std::numeric_limits<T>::min());
TestEqual(static_cast<T>(0));
TestEqual(static_cast<T>(-1));
TestEqual(static_cast<T>(1));
}
BOOST_AUTO_TEST_CASE(Integer) {
TestCorners<char>();
TestCorners<signed char>();
TestCorners<unsigned char>();
TestCorners<short>();
TestCorners<signed short>();
TestCorners<unsigned short>();
TestCorners<int>();
TestCorners<unsigned int>();
TestCorners<signed int>();
TestCorners<long>();
TestCorners<unsigned long>();
TestCorners<signed long>();
TestCorners<long long>();
TestCorners<unsigned long long>();
TestCorners<signed long long>();
TestCorners<std::size_t>();
}
enum TinyEnum { EnumValue };
BOOST_AUTO_TEST_CASE(EnumCase) {
TestEqual(EnumValue);
}
BOOST_AUTO_TEST_CASE(Strings) {
TestEqual("foo");
const char *a = "bar";
TestEqual(a);
StringPiece piece("abcdef");
TestEqual(piece);
TestEqual(StringPiece());
char non_const[3];
non_const[0] = 'b';
non_const[1] = 'c';
non_const[2] = 0;
StringStream out;
out << "a" << non_const << 'c';
BOOST_CHECK_EQUAL("abcc", out.str());
// Now test as a separate object.
StringStream stream;
stream << "a" << non_const << 'c' << piece;
BOOST_CHECK_EQUAL("abccabcdef", stream.str());
}
}} // namespaces
#ifndef UTIL_THREAD_POOL_H
#define UTIL_THREAD_POOL_H
#include "pcqueue.hh"
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/optional.hpp>
#include <boost/thread.hpp>
#include <iostream>
#include <cstdlib>
namespace util {
template <class HandlerT> class Worker : boost::noncopyable {
public:
typedef HandlerT Handler;
typedef typename Handler::Request Request;
template <class Construct> Worker(PCQueue<Request> &in, Construct &construct, const Request &poison)
: in_(in), handler_(construct), poison_(poison), thread_(boost::ref(*this)) {}
// Only call from thread.
void operator()() {
Request request;
while (1) {
in_.Consume(request);
if (request == poison_) return;
try {
(*handler_)(request);
}
catch(const std::exception &e) {
std::cerr << "Handler threw " << e.what() << std::endl;
abort();
}
catch(...) {
std::cerr << "Handler threw an exception, dropping request" << std::endl;
abort();
}
}
}
void Join() {
thread_.join();
}
private:
PCQueue<Request> &in_;
boost::optional<Handler> handler_;
const Request poison_;
boost::thread thread_;
};
template <class HandlerT> class ThreadPool : boost::noncopyable {
public:
typedef HandlerT Handler;
typedef typename Handler::Request Request;
template <class Construct> ThreadPool(std::size_t queue_length, std::size_t workers, Construct handler_construct, Request poison) : in_(queue_length), poison_(poison) {
for (size_t i = 0; i < workers; ++i) {
workers_.push_back(new Worker<Handler>(in_, handler_construct, poison));
}
}
~ThreadPool() {
for (std::size_t i = 0; i < workers_.size(); ++i) {
Produce(poison_);
}
for (typename boost::ptr_vector<Worker<Handler> >::iterator i = workers_.begin(); i != workers_.end(); ++i) {
i->Join();
}
}
void Produce(const Request &request) {
in_.Produce(request);
}
// For adding to the queue.
PCQueue<Request> &In() { return in_; }
private:
PCQueue<Request> in_;
boost::ptr_vector<Worker<Handler> > workers_;
Request poison_;
};
template <class Handler> class RecyclingHandler {
public:
typedef typename Handler::Request Request;
template <class Construct> RecyclingHandler(PCQueue<Request> &recycling, Construct &handler_construct)
: inner_(handler_construct), recycling_(recycling) {}
void operator()(Request &request) {
inner_(request);
recycling_.Produce(request);
}
private:
Handler inner_;
PCQueue<Request> &recycling_;
};
template <class HandlerT> class RecyclingThreadPool : boost::noncopyable {
public:
typedef HandlerT Handler;
typedef typename Handler::Request Request;
// Remember to call PopulateRecycling afterwards in most cases.
template <class Construct> RecyclingThreadPool(std::size_t queue, std::size_t workers, Construct handler_construct, Request poison)
: recycling_(queue), pool_(queue, workers, RecyclingHandler<Handler>(recycling_, handler_construct), poison) {}
// Initialization: put stuff into the recycling queue. This could also be
// done by calling Produce without Consume, but it's often easier to
// initialize with PopulateRecycling then do a Consume/Produce loop.
void PopulateRecycling(const Request &request) {
recycling_.Produce(request);
}
Request Consume() {
return recycling_.Consume();
}
void Produce(const Request &request) {
pool_.Produce(request);
}
private:
PCQueue<Request> recycling_;
ThreadPool<RecyclingHandler<Handler> > pool_;
};
} // namespace util
#endif // UTIL_THREAD_POOL_H
#ifndef UTIL_TOKENIZE_PIECE_H
#define UTIL_TOKENIZE_PIECE_H
#include "exception.hh"
#include "spaces.hh"
#include "string_piece.hh"
#include <algorithm>
#include <cstring>
#include <iterator>
namespace util {
// Thrown on dereference when out of tokens to parse
class OutOfTokens : public Exception {
public:
OutOfTokens() throw() {}
~OutOfTokens() throw() {}
};
class SingleCharacter {
public:
SingleCharacter() {}
explicit SingleCharacter(char delim) : delim_(delim) {}
StringPiece Find(const StringPiece &in) const {
return StringPiece(std::find(in.data(), in.data() + in.size(), delim_), 1);
}
private:
char delim_;
};
class MultiCharacter {
public:
MultiCharacter() {}
explicit MultiCharacter(const StringPiece &delimiter) : delimiter_(delimiter) {}
StringPiece Find(const StringPiece &in) const {
return StringPiece(std::search(in.data(), in.data() + in.size(), delimiter_.data(), delimiter_.data() + delimiter_.size()), delimiter_.size());
}
private:
StringPiece delimiter_;
};
class AnyCharacter {
public:
AnyCharacter() {}
explicit AnyCharacter(const StringPiece &chars) : chars_(chars) {}
StringPiece Find(const StringPiece &in) const {
return StringPiece(std::find_first_of(in.data(), in.data() + in.size(), chars_.data(), chars_.data() + chars_.size()), 1);
}
private:
StringPiece chars_;
};
class BoolCharacter {
public:
BoolCharacter() {}
explicit BoolCharacter(const bool *delimiter = kSpaces) { delimiter_ = delimiter; }
StringPiece Find(const StringPiece &in) const {
for (const char *i = in.data(); i != in.data() + in.size(); ++i) {
if (delimiter_[static_cast<unsigned char>(*i)]) return StringPiece(i, 1);
}
return StringPiece(in.data() + in.size(), 0);
}
template <unsigned Length> static void Build(const char (&characters)[Length], bool (&out)[256]) {
memset(out, 0, sizeof(out));
for (const char *i = characters; i != characters + Length; ++i) {
out[static_cast<unsigned char>(*i)] = true;
}
}
private:
const bool *delimiter_;
};
class AnyCharacterLast {
public:
AnyCharacterLast() {}
explicit AnyCharacterLast(const StringPiece &chars) : chars_(chars) {}
StringPiece Find(const StringPiece &in) const {
return StringPiece(std::find_end(in.data(), in.data() + in.size(), chars_.data(), chars_.data() + chars_.size()), 1);
}
private:
StringPiece chars_;
};
template <class Find, bool SkipEmpty = false> class TokenIter : public std::iterator<std::forward_iterator_tag, const StringPiece, std::ptrdiff_t, const StringPiece *, const StringPiece &> {
public:
TokenIter() {}
template <class Construct> TokenIter(const StringPiece &str, const Construct &construct) : after_(str), finder_(construct) {
++*this;
}
bool operator!() const {
return current_.data() == 0;
}
operator bool() const {
return current_.data() != 0;
}
static TokenIter<Find, SkipEmpty> end() {
return TokenIter<Find, SkipEmpty>();
}
bool operator==(const TokenIter<Find, SkipEmpty> &other) const {
return current_.data() == other.current_.data();
}
bool operator!=(const TokenIter<Find, SkipEmpty> &other) const {
return !(*this == other);
}
TokenIter<Find, SkipEmpty> &operator++() {
do {
StringPiece found(finder_.Find(after_));
current_ = StringPiece(after_.data(), found.data() - after_.data());
if (found.data() == after_.data() + after_.size()) {
after_ = StringPiece(NULL, 0);
} else {
after_ = StringPiece(found.data() + found.size(), after_.data() - found.data() + after_.size() - found.size());
}
} while (SkipEmpty && current_.data() && current_.empty()); // Compiler should optimize this away if SkipEmpty is false.
return *this;
}
TokenIter<Find, SkipEmpty> &operator++(int) {
TokenIter<Find, SkipEmpty> ret(*this);
++*this;
return ret;
}
const StringPiece &operator*() const {
UTIL_THROW_IF(!current_.data(), OutOfTokens, "Ran out of tokens");
return current_;
}
const StringPiece *operator->() const {
UTIL_THROW_IF(!current_.data(), OutOfTokens, "Ran out of tokens");
return &current_;
}
private:
StringPiece current_;
StringPiece after_;
Find finder_;
};
inline StringPiece Trim(StringPiece str, const bool *spaces = kSpaces) {
while (!str.empty() && spaces[static_cast<unsigned char>(*str.data())]) {
str = StringPiece(str.data() + 1, str.size() - 1);
}
while (!str.empty() && spaces[static_cast<unsigned char>(str.data()[str.size() - 1])]) {
str = StringPiece(str.data(), str.size() - 1);
}
return str;
}
} // namespace util
#endif // UTIL_TOKENIZE_PIECE_H
#include "tokenize_piece.hh"
#include "string_piece.hh"
#define BOOST_TEST_MODULE TokenIteratorTest
#include <boost/test/unit_test.hpp>
#include <iostream>
namespace util {
namespace {
BOOST_AUTO_TEST_CASE(pipe_pipe_none) {
const char str[] = "nodelimit at all";
TokenIter<MultiCharacter> it(str, MultiCharacter("|||"));
BOOST_REQUIRE(it);
BOOST_CHECK_EQUAL(StringPiece(str), *it);
++it;
BOOST_CHECK(!it);
}
BOOST_AUTO_TEST_CASE(pipe_pipe_two) {
const char str[] = "|||";
TokenIter<MultiCharacter> it(str, MultiCharacter("|||"));
BOOST_REQUIRE(it);
BOOST_CHECK_EQUAL(StringPiece(), *it);
++it;
BOOST_REQUIRE(it);
BOOST_CHECK_EQUAL(StringPiece(), *it);
++it;
BOOST_CHECK(!it);
}
BOOST_AUTO_TEST_CASE(remove_empty) {
const char str[] = "|||";
TokenIter<MultiCharacter, true> it(str, MultiCharacter("|||"));
BOOST_CHECK(!it);
}
BOOST_AUTO_TEST_CASE(remove_empty_keep) {
const char str[] = " |||";
TokenIter<MultiCharacter, true> it(str, MultiCharacter("|||"));
BOOST_REQUIRE(it);
BOOST_CHECK_EQUAL(StringPiece(" "), *it);
++it;
BOOST_CHECK(!it);
}
} // namespace
} // namespace util
#include "usage.hh"
#include "exception.hh"
#include <fstream>
#include <ostream>
#include <sstream>
#include <set>
#include <string>
#include <cstring>
#include <cctype>
#include <ctime>
#if defined(_WIN32) || defined(_WIN64)
// This code lifted from physmem.c in gnulib. See the copyright statement
// below.
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
/* MEMORYSTATUSEX is missing from older windows headers, so define
a local replacement. */
typedef struct
{
DWORD dwLength;
DWORD dwMemoryLoad;
DWORDLONG ullTotalPhys;
DWORDLONG ullAvailPhys;
DWORDLONG ullTotalPageFile;
DWORDLONG ullAvailPageFile;
DWORDLONG ullTotalVirtual;
DWORDLONG ullAvailVirtual;
DWORDLONG ullAvailExtendedVirtual;
} lMEMORYSTATUSEX;
// Is this really supposed to be defined like this?
typedef int WINBOOL;
typedef WINBOOL (WINAPI *PFN_MS_EX) (lMEMORYSTATUSEX*);
#else
#include <sys/resource.h>
#include <sys/time.h>
#include <unistd.h>
#endif
#if defined(__MACH__) || defined(__APPLE__)
#include <sys/types.h>
#include <sys/sysctl.h>
#include <mach/task.h>
#include <mach/mach.h>
#include <libproc.h>
#endif
namespace util {
namespace {
#if defined(__MACH__)
typedef struct timeval Wall;
Wall GetWall() {
struct timeval tv;
gettimeofday(&tv, NULL);
return tv;
}
#elif defined(_WIN32) || defined(_WIN64)
typedef time_t Wall;
Wall GetWall() {
return time(NULL);
}
#else
typedef struct timespec Wall;
Wall GetWall() {
Wall ret;
UTIL_THROW_IF(-1 == clock_gettime(CLOCK_MONOTONIC, &ret), ErrnoException, "Could not get wall time");
return ret;
}
#endif
// gcc possible-unused function flags
#ifdef __GNUC__
double Subtract(time_t first, time_t second) __attribute__ ((unused));
double DoubleSec(time_t tv) __attribute__ ((unused));
#if !defined(_WIN32) && !defined(_WIN64)
double Subtract(const struct timeval &first, const struct timeval &second) __attribute__ ((unused));
double Subtract(const struct timespec &first, const struct timespec &second) __attribute__ ((unused));
double DoubleSec(const struct timeval &tv) __attribute__ ((unused));
double DoubleSec(const struct timespec &tv) __attribute__ ((unused));
#endif
#endif
// Some of these functions are only used on some platforms.
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
#endif
// These all assume first > second
double Subtract(time_t first, time_t second) {
return difftime(first, second);
}
double DoubleSec(time_t tv) {
return static_cast<double>(tv);
}
#if !defined(_WIN32) && !defined(_WIN64)
double Subtract(const struct timeval &first, const struct timeval &second) {
return static_cast<double>(first.tv_sec - second.tv_sec) + static_cast<double>(first.tv_usec - second.tv_usec) / 1000000.0;
}
double Subtract(const struct timespec &first, const struct timespec &second) {
return static_cast<double>(first.tv_sec - second.tv_sec) + static_cast<double>(first.tv_nsec - second.tv_nsec) / 1000000000.0;
}
double DoubleSec(const struct timeval &tv) {
return static_cast<double>(tv.tv_sec) + (static_cast<double>(tv.tv_usec) / 1000000.0);
}
double DoubleSec(const struct timespec &tv) {
return static_cast<double>(tv.tv_sec) + (static_cast<double>(tv.tv_nsec) / 1000000000.0);
}
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
class RecordStart {
public:
RecordStart() {
started_ = GetWall();
}
const Wall &Started() const {
return started_;
}
private:
Wall started_;
};
const RecordStart kRecordStart;
const char *SkipSpaces(const char *at) {
for (; *at == ' ' || *at == '\t'; ++at) {}
return at;
}
} // namespace
double WallTime() {
return Subtract(GetWall(), kRecordStart.Started());
}
double CPUTime() {
#if defined(_WIN32) || defined(_WIN64)
return 0.0;
#elif defined(__MACH__) || defined(__FreeBSD__) || defined(__APPLE__)
struct rusage usage;
UTIL_THROW_IF(getrusage(RUSAGE_SELF, &usage), ErrnoException, "getrusage failed");
return DoubleSec(usage.ru_utime) + DoubleSec(usage.ru_stime);
#else
struct timespec usage;
UTIL_THROW_IF(clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &usage), ErrnoException, "clock_gettime failed?!");
return DoubleSec(usage);
#endif
}
double ThreadTime() {
#if defined(_WIN32) || defined(_WIN64)
// Output parameters for querying thread CPU usage:
FILETIME sys_time, user_time;
// Unused, but apparently need to be passed:
FILETIME c_time, e_time;
HANDLE this_thread = GetCurrentThread();
UTIL_THROW_IF(!GetThreadTimes(this_thread, &c_time, &e_time, &sys_time, &user_time), WindowsException, "GetThreadTime");
// Convert LPFILETIME to 64-bit number, and from there to double.
ULARGE_INTEGER sys_ticks, user_ticks;
sys_ticks.LowPart = sys_time.dwLowDateTime;
sys_ticks.HighPart = sys_time.dwHighDateTime;
user_ticks.LowPart = user_time.dwLowDateTime;
user_ticks.HighPart = user_time.dwHighDateTime;
const double ticks = double(sys_ticks.QuadPart + user_ticks.QuadPart);
// GetThreadTimes() reports in units of 100 nanoseconds, i.e. ten-millionths
// of a second.
return ticks / (10 * 1000 * 1000);
#elif defined(HAVE_CLOCKGETTIME)
struct timespec usage;
UTIL_THROW_IF(clock_gettime(CLOCK_THREAD_CPUTIME_ID, &usage), ErrnoException, "clock_gettime failed?!");
return DoubleSec(usage);
#elif defined(__MACH__) || defined(__APPLE__)
struct task_basic_info t_info;
mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT;
task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count);
return 0.0;
#endif
}
uint64_t RSSMax() {
#if defined(_WIN32) || defined(_WIN64)
return 0;
#else
struct rusage usage;
if (getrusage(RUSAGE_SELF, &usage))
return 0;
return static_cast<uint64_t>(usage.ru_maxrss) * 1024;
#endif
}
void PrintUsage(std::ostream &out) {
#if !defined(_WIN32) && !defined(_WIN64)
#if defined(__MACH__) || defined(__APPLE__)
struct mach_task_basic_info t_info;
char name[2 * MAXCOMLEN] = {0};
proc_name(getpid(), name, sizeof(name));
mach_msg_type_number_t t_info_count = MACH_TASK_BASIC_INFO_COUNT;
task_info(mach_task_self(), MACH_TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count);
out << name << '\t';
out << t_info.resident_size_max << '\t';
out << t_info.resident_size << '\t';
#else
// Linux doesn't set memory usage in getrusage :-(
std::set<std::string> headers;
headers.insert("Name:");
headers.insert("VmPeak:");
headers.insert("VmRSS:");
std::ifstream status("/proc/self/status", std::ios::in);
std::string header, value;
while ((status >> header) && getline(status, value)) {
if (headers.find(header) != headers.end()) {
out << header << SkipSpaces(value.c_str()) << '\t';
}
}
#endif
struct rusage usage;
if (getrusage(RUSAGE_SELF, &usage)) {
perror("getrusage");
return;
}
out << "RSSMax:" << usage.ru_maxrss << " kB" << '\t';
out << "user:" << DoubleSec(usage.ru_utime) << "\tsys:" << DoubleSec(usage.ru_stime) << '\t';
out << "CPU:" << CPUTime() << '\t';
#endif
out << "real:" << WallTime() << '\n';
}
/* Adapted from physmem.c in gnulib 831b84c59ef413c57a36b67344467d66a8a2ba70 */
/* Calculate the size of physical memory.
Copyright (C) 2000-2001, 2003, 2005-2006, 2009-2013 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */
uint64_t GuessPhysicalMemory() {
#if defined(_SC_PHYS_PAGES) && defined(_SC_PAGESIZE)
{
long pages = sysconf(_SC_PHYS_PAGES);
long page_size = sysconf(_SC_PAGESIZE);
if (pages != -1 && page_size != -1)
return static_cast<uint64_t>(pages) * static_cast<uint64_t>(page_size);
}
#endif
#ifdef HW_PHYSMEM
{ /* This works on *bsd and darwin. */
unsigned int physmem;
size_t len = sizeof physmem;
static int mib[2] = { CTL_HW, HW_PHYSMEM };
if (sysctl (mib, sizeof(mib) / sizeof(mib[0]), &physmem, &len, NULL, 0) == 0
&& len == sizeof (physmem))
return static_cast<uint64_t>(physmem);
}
#endif
#if defined(_WIN32) || defined(_WIN64)
{ /* this works on windows */
PFN_MS_EX pfnex;
HMODULE h = GetModuleHandle (TEXT("kernel32.dll"));
if (!h)
return 0;
/* Use GlobalMemoryStatusEx if available. */
if ((pfnex = (PFN_MS_EX) GetProcAddress (h, "GlobalMemoryStatusEx")))
{
lMEMORYSTATUSEX lms_ex;
lms_ex.dwLength = sizeof lms_ex;
if (!pfnex (&lms_ex))
return 0;
return lms_ex.ullTotalPhys;
}
/* Fall back to GlobalMemoryStatus which is always available.
but returns wrong results for physical memory > 4GB. */
else
{
MEMORYSTATUS ms;
GlobalMemoryStatus (&ms);
return ms.dwTotalPhys;
}
}
#endif
return 0;
}
namespace {
class SizeParseError : public Exception {
public:
explicit SizeParseError(const std::string &str) throw() {
*this << "Failed to parse " << str << " into a memory size ";
}
};
template <class Num> uint64_t ParseNum(const std::string &arg) {
std::stringstream stream(arg);
Num value;
stream >> value;
UTIL_THROW_IF_ARG(!stream, SizeParseError, (arg), "for the leading number.");
std::string after;
stream >> after;
UTIL_THROW_IF_ARG(after.size() > 1, SizeParseError, (arg), "because there are more than two characters after the number.");
std::string throwaway;
UTIL_THROW_IF_ARG(stream >> throwaway, SizeParseError, (arg), "because there was more cruft " << throwaway << " after the number.");
// Silly sort, using kilobytes as your default unit.
if (after.empty()) after = "K";
if (after == "%") {
uint64_t mem = GuessPhysicalMemory();
UTIL_THROW_IF_ARG(!mem, SizeParseError, (arg), "because % was specified but the physical memory size could not be determined.");
return static_cast<uint64_t>(static_cast<double>(value) * static_cast<double>(mem) / 100.0);
}
if (after == "k") after = "K";
std::string units("bKMGTPEZY");
std::string::size_type index = units.find(after[0]);
UTIL_THROW_IF_ARG(index == std::string::npos, SizeParseError, (arg), "the allowed suffixes are " << units << "%.");
for (std::string::size_type i = 0; i < index; ++i) {
value *= 1024;
}
return static_cast<uint64_t>(value);
}
} // namespace
uint64_t ParseSize(const std::string &arg) {
return arg.find('.') == std::string::npos ? ParseNum<double>(arg) : ParseNum<uint64_t>(arg);
}
} // namespace util
#ifndef UTIL_USAGE_H
#define UTIL_USAGE_H
#include <cstddef>
#include <iosfwd>
#include <string>
#include <stdint.h>
namespace util {
// Time in seconds since process started. Zero on unsupported platforms.
double WallTime();
// User + system time, process-wide.
double CPUTime();
// User + system time, thread-specific.
double ThreadTime();
// Resident usage in bytes.
uint64_t RSSMax();
void PrintUsage(std::ostream &to);
// Determine how much physical memory there is. Return 0 on failure.
uint64_t GuessPhysicalMemory();
// Parse a size like unix sort. Sadly, this means the default multiplier is K.
uint64_t ParseSize(const std::string &arg);
} // namespace util
#endif // UTIL_USAGE_H
Principal Contacts:
Cyril Allauzen <allauzen@google.com>
Michael Riley <riley@google.com>
Contributors:
These contributions range from fundamental algorithmic contributions (e.g.,
Mehryar Mohri) to implementation of core components and extensions.
Tom Bagby
Dan Bikel
Kyle Gorman
Martin Jansche
Boulos Harb
Mehryar Mohri
Dan Povey
Kasturi Raghavan
Jacob Ratkiewicz
Jesse Rosenstock
Johan Schalkwyk
Masha Shugrina
Wojtek Skut
Jeffrey Sorensen
Richard Sproat
Ananda Theertha Suresh
Terry Tai
Ke Wu
# OpenFST Windows Port Bugs And Limitations
"Fixed in" means that all previous releases are likely affected.
## Fixed in win/1.7.2.1+01
* stdout newline conversion of binary data (#20)
## Unimplemented features
* Memory-mapped files are not supported (we may add the support in the future
though), because it is very system-dependent. OpenFST supports reading e. g.
CompactFST files into allocated memory when memory mapping is not compiled in.
Since Kaldi is now using it, this is on an implementation track, issue #31.
* Dynamic registration of arc and FST types is not supported in the Visual Studio
project versions (as they build only static libraries). CMake build does not
have this limitation. Due to ABI being specific to Microsoft compiler version,
dynamically registered types must be compiled with strictly the same compiler
of the same major version, and mostly same build flags. This is quite hard to
get right, and is not recommended. No current plans to implement.
# Copyright 2015-2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache 2.0
exports_files(["COPYING"])
prefix_dir = "src/"
static_binary = 1
# Core library (lib/)
cc_library(
name = "fst-decl",
hdrs = [prefix_dir + "include/fst/fst-decl.h"],
includes = [prefix_dir + "include"],
deps = [":base"],
)
PUBLIC_HEADERS = [
# One-stop header file which includes the remaining headers below:
prefix_dir + "include/fst/fstlib.h",
# Fine-grained headers:
prefix_dir + "include/fst/accumulator.h",
prefix_dir + "include/fst/add-on.h",
prefix_dir + "include/fst/arc-arena.h",
prefix_dir + "include/fst/arc-map.h",
prefix_dir + "include/fst/arc.h",
prefix_dir + "include/fst/arcfilter.h",
prefix_dir + "include/fst/arcsort.h",
prefix_dir + "include/fst/bi-table.h",
prefix_dir + "include/fst/cache.h",
prefix_dir + "include/fst/closure.h",
prefix_dir + "include/fst/compact-fst.h",
prefix_dir + "include/fst/complement.h",
prefix_dir + "include/fst/compose-filter.h",
prefix_dir + "include/fst/compose.h",
prefix_dir + "include/fst/concat.h",
prefix_dir + "include/fst/connect.h",
prefix_dir + "include/fst/const-fst.h",
prefix_dir + "include/fst/determinize.h",
prefix_dir + "include/fst/dfs-visit.h",
prefix_dir + "include/fst/difference.h",
prefix_dir + "include/fst/disambiguate.h",
prefix_dir + "include/fst/edit-fst.h",
prefix_dir + "include/fst/encode.h",
prefix_dir + "include/fst/epsnormalize.h",
prefix_dir + "include/fst/equal.h",
prefix_dir + "include/fst/equivalent.h",
prefix_dir + "include/fst/expanded-fst.h",
prefix_dir + "include/fst/factor-weight.h",
prefix_dir + "include/fst/filter-state.h",
prefix_dir + "include/fst/fst.h",
prefix_dir + "include/fst/heap.h",
prefix_dir + "include/fst/intersect.h",
prefix_dir + "include/fst/invert.h",
prefix_dir + "include/fst/isomorphic.h",
prefix_dir + "include/fst/label-reachable.h",
prefix_dir + "include/fst/lookahead-filter.h",
prefix_dir + "include/fst/lookahead-matcher.h",
prefix_dir + "include/fst/map.h",
prefix_dir + "include/fst/matcher-fst.h",
prefix_dir + "include/fst/matcher.h",
prefix_dir + "include/fst/memory.h",
prefix_dir + "include/fst/minimize.h",
prefix_dir + "include/fst/mutable-fst.h",
prefix_dir + "include/fst/partition.h",
prefix_dir + "include/fst/project.h",
prefix_dir + "include/fst/properties.h",
prefix_dir + "include/fst/prune.h",
prefix_dir + "include/fst/push.h",
prefix_dir + "include/fst/queue.h",
prefix_dir + "include/fst/randequivalent.h",
prefix_dir + "include/fst/randgen.h",
prefix_dir + "include/fst/rational.h",
prefix_dir + "include/fst/relabel.h",
prefix_dir + "include/fst/replace-util.h",
prefix_dir + "include/fst/replace.h",
prefix_dir + "include/fst/reverse.h",
prefix_dir + "include/fst/reweight.h",
prefix_dir + "include/fst/rmepsilon.h",
prefix_dir + "include/fst/rmfinalepsilon.h",
prefix_dir + "include/fst/shortest-distance.h",
prefix_dir + "include/fst/shortest-path.h",
prefix_dir + "include/fst/state-map.h",
prefix_dir + "include/fst/state-reachable.h",
prefix_dir + "include/fst/state-table.h",
prefix_dir + "include/fst/statesort.h",
prefix_dir + "include/fst/string.h",
prefix_dir + "include/fst/symbol-table-ops.h",
prefix_dir + "include/fst/synchronize.h",
prefix_dir + "include/fst/test-properties.h",
prefix_dir + "include/fst/topsort.h",
prefix_dir + "include/fst/union.h",
prefix_dir + "include/fst/vector-fst.h",
prefix_dir + "include/fst/verify.h",
prefix_dir + "include/fst/visit.h",
]
# This version does not have the export-dynamic flag set and should not be
# used to load dynamic-shared object FST extensions. Please see the
# "lib_export_dynamic" target below for binaries that need DSO loading.
cc_library(
name = "lib_lite",
srcs = [
prefix_dir + "lib/fst.cc",
prefix_dir + "lib/properties.cc",
prefix_dir + "lib/symbol-table-ops.cc",
],
hdrs = PUBLIC_HEADERS,
copts = ["-Wno-sign-compare"],
includes = [prefix_dir + "include"],
linkopts = ["-lm"],
deps = [
":base",
":fst-decl",
":icu",
":interval-set",
":register",
":symbol-table",
":union-find",
":util",
":weight",
],
)
cc_library(
name = "fst",
hdrs = PUBLIC_HEADERS,
includes = [prefix_dir + "include"],
deps = [
":fst-types",
":lib_lite",
],
)
cc_library(
name = "lib_export_dynamic",
linkopts = ["-Wl,--export-dynamic"],
deps = [":fst"],
)
cc_library(
name = "fst-types",
srcs = [prefix_dir + "lib/fst-types.cc"],
deps = [":lib_lite"],
alwayslink = 1, # because of registration
)
cc_library(
name = "symbol-table",
srcs = [prefix_dir + "lib/symbol-table.cc"],
hdrs = [prefix_dir + "include/fst/symbol-table.h"],
copts = ["-Wno-sign-compare"],
includes = [prefix_dir + "include"],
deps = [
":base",
":util",
],
)
cc_library(
name = "weight",
srcs = [prefix_dir + "lib/weight.cc"],
hdrs = [
prefix_dir + "include/fst/expectation-weight.h",
prefix_dir + "include/fst/float-weight.h",
prefix_dir + "include/fst/lexicographic-weight.h",
prefix_dir + "include/fst/pair-weight.h",
prefix_dir + "include/fst/power-weight.h",
prefix_dir + "include/fst/product-weight.h",
prefix_dir + "include/fst/set-weight.h",
prefix_dir + "include/fst/signed-log-weight.h",
prefix_dir + "include/fst/sparse-power-weight.h",
prefix_dir + "include/fst/sparse-tuple-weight.h",
prefix_dir + "include/fst/string-weight.h",
prefix_dir + "include/fst/tuple-weight.h",
prefix_dir + "include/fst/union-weight.h",
prefix_dir + "include/fst/weight.h",
],
includes = [prefix_dir + "include"],
linkopts = ["-lm"],
deps = [
":base",
":util",
],
)
cc_library(
name = "interval-set",
hdrs = [prefix_dir + "include/fst/interval-set.h"],
includes = [prefix_dir + "include"],
deps = [
":base",
":util",
],
)
cc_library(
name = "register",
hdrs = [
prefix_dir + "include/fst/generic-register.h",
prefix_dir + "include/fst/register.h",
],
includes = [prefix_dir + "include"],
linkopts = ["-ldl"],
deps = [
":base",
":util",
],
)
cc_library(
name = "icu",
hdrs = [
prefix_dir + "include/fst/icu.h",
],
)
cc_library(
name = "union-find",
hdrs = [prefix_dir + "include/fst/union-find.h"],
includes = [prefix_dir + "include"],
deps = [":base"],
)
cc_library(
name = "util",
srcs = [
prefix_dir + "lib/mapped-file.cc",
prefix_dir + "lib/util.cc",
],
hdrs = [
prefix_dir + "include/fst/mapped-file.h",
prefix_dir + "include/fst/util.h",
],
includes = [prefix_dir + "include"],
deps = [":base"],
)
cc_library(
name = "base",
srcs = [
prefix_dir + "lib/compat.cc",
prefix_dir + "lib/flags.cc",
],
hdrs = [
prefix_dir + "include/fst/compat.h",
prefix_dir + "include/fst/config.h",
prefix_dir + "include/fst/flags.h",
prefix_dir + "include/fst/icu.h",
prefix_dir + "include/fst/lock.h",
prefix_dir + "include/fst/log.h",
prefix_dir + "include/fst/types.h",
],
includes = [prefix_dir + "include"],
)
# Core library tests (test/)
cc_test(
name = "fst_test",
timeout = "short",
srcs = [
prefix_dir + "test/fst_test.cc",
prefix_dir + "include/fst/test/fst_test.h",
],
deps = [":fst"],
)
cc_library(
name = "weight-tester",
testonly = 1,
hdrs = [prefix_dir + "include/fst/test/weight-tester.h"],
includes = [prefix_dir],
deps = [":weight"],
)
cc_test(
name = "weight_test",
timeout = "short",
srcs = [prefix_dir + "test/weight_test.cc"],
copts = ["-Wno-unused-local-typedefs"],
deps = [
":fst",
":weight-tester",
],
)
[
cc_test(
name = "algo_test_%s" % weight,
srcs = [
prefix_dir + "test/algo_test.cc",
prefix_dir + "include/fst/test/algo_test.h",
prefix_dir + "include/fst/test/rand-fst.h",
],
defines = ["TEST_%s" % weight.upper()],
deps = [":fst"],
)
for weight in [
"tropical",
"log",
"minmax",
"lexicographic",
"power",
]
]
# Non-template scripting-language integration (script/)
cc_library(
name = "fstscript_base",
srcs = [
prefix_dir + "script/arciterator-class.cc",
prefix_dir + "script/encodemapper-class.cc",
prefix_dir + "script/fst-class.cc",
prefix_dir + "script/getters.cc",
prefix_dir + "script/stateiterator-class.cc",
prefix_dir + "script/text-io.cc",
prefix_dir + "script/weight-class.cc",
],
hdrs = [
prefix_dir + "include/fst/script/arc-class.h",
prefix_dir + "include/fst/script/arciterator-class.h",
prefix_dir + "include/fst/script/arg-packs.h",
prefix_dir + "include/fst/script/encodemapper-class.h",
prefix_dir + "include/fst/script/fst-class.h",
prefix_dir + "include/fst/script/fstscript-decl.h",
prefix_dir + "include/fst/script/fstscript.h",
prefix_dir + "include/fst/script/getters.h",
prefix_dir + "include/fst/script/register.h",
prefix_dir + "include/fst/script/script-impl.h",
prefix_dir + "include/fst/script/stateiterator-class.h",
prefix_dir + "include/fst/script/text-io.h",
prefix_dir + "include/fst/script/weight-class.h",
#
prefix_dir + "include/fst/script/arcsort.h",
prefix_dir + "include/fst/script/closure.h",
prefix_dir + "include/fst/script/compile.h",
prefix_dir + "include/fst/script/compile-impl.h",
prefix_dir + "include/fst/script/compose.h",
prefix_dir + "include/fst/script/concat.h",
prefix_dir + "include/fst/script/connect.h",
prefix_dir + "include/fst/script/convert.h",
prefix_dir + "include/fst/script/decode.h",
prefix_dir + "include/fst/script/determinize.h",
prefix_dir + "include/fst/script/difference.h",
prefix_dir + "include/fst/script/disambiguate.h",
prefix_dir + "include/fst/script/draw.h",
prefix_dir + "include/fst/script/draw-impl.h",
prefix_dir + "include/fst/script/encode.h",
prefix_dir + "include/fst/script/epsnormalize.h",
prefix_dir + "include/fst/script/equal.h",
prefix_dir + "include/fst/script/equivalent.h",
prefix_dir + "include/fst/script/info.h",
prefix_dir + "include/fst/script/info-impl.h",
prefix_dir + "include/fst/script/intersect.h",
prefix_dir + "include/fst/script/invert.h",
prefix_dir + "include/fst/script/isomorphic.h",
prefix_dir + "include/fst/script/map.h",
prefix_dir + "include/fst/script/minimize.h",
prefix_dir + "include/fst/script/print.h",
prefix_dir + "include/fst/script/print-impl.h",
prefix_dir + "include/fst/script/project.h",
prefix_dir + "include/fst/script/prune.h",
prefix_dir + "include/fst/script/push.h",
prefix_dir + "include/fst/script/randequivalent.h",
prefix_dir + "include/fst/script/randgen.h",
prefix_dir + "include/fst/script/relabel.h",
prefix_dir + "include/fst/script/replace.h",
prefix_dir + "include/fst/script/reverse.h",
prefix_dir + "include/fst/script/reweight.h",
prefix_dir + "include/fst/script/rmepsilon.h",
prefix_dir + "include/fst/script/shortest-distance.h",
prefix_dir + "include/fst/script/shortest-path.h",
prefix_dir + "include/fst/script/synchronize.h",
prefix_dir + "include/fst/script/topsort.h",
prefix_dir + "include/fst/script/union.h",
prefix_dir + "include/fst/script/verify.h",
],
copts = ["-Wno-sign-compare"],
includes = [prefix_dir + "include"],
deps = [":fst"],
)
[
cc_library(
name = "fstscript_%s" % operation,
srcs = [prefix_dir + "script/%s.cc" % operation],
hdrs = [prefix_dir + "include/fst/script/%s.h" % operation],
includes = [prefix_dir + "include"],
deps = [":fstscript_base"],
)
for operation in [
"arcsort",
"closure",
"concat",
"connect",
"convert",
"decode",
"determinize",
"disambiguate",
"encode",
"epsnormalize",
"equal",
"equivalent",
"invert",
"isomorphic",
"map",
"minimize",
"project",
"prune",
"push",
"randgen",
"relabel",
"replace",
"reverse",
"reweight",
"synchronize",
"topsort",
"union",
"verify",
]
]
cc_library(
name = "fstscript_compile",
srcs = [prefix_dir + "script/compile.cc"],
hdrs = [
prefix_dir + "include/fst/script/compile.h",
prefix_dir + "include/fst/script/compile-impl.h",
],
includes = [prefix_dir + "include"],
deps = [":fstscript_base"],
)
cc_library(
name = "fstscript_compose",
srcs = [prefix_dir + "script/compose.cc"],
hdrs = [prefix_dir + "include/fst/script/compose.h"],
includes = [prefix_dir + "include"],
deps = [
":fstscript_base",
":fstscript_connect",
],
)
cc_library(
name = "fstscript_difference",
srcs = [prefix_dir + "script/difference.cc"],
hdrs = [prefix_dir + "include/fst/script/difference.h"],
includes = [prefix_dir + "include"],
deps = [
":fstscript_base",
":fstscript_compose",
],
)
cc_library(
name = "fstscript_draw",
srcs = [prefix_dir + "script/draw.cc"],
hdrs = [
prefix_dir + "include/fst/script/draw.h",
prefix_dir + "include/fst/script/draw-impl.h",
],
includes = [prefix_dir + "include"],
deps = [":fstscript_base"],
)
cc_library(
name = "fstscript_info",
srcs = [
prefix_dir + "script/info.cc",
prefix_dir + "script/info-impl.cc",
],
hdrs = [
prefix_dir + "include/fst/script/info.h",
prefix_dir + "include/fst/script/info-impl.h",
],
includes = [prefix_dir + "include"],
deps = [":fstscript_base"],
)
cc_library(
name = "fstscript_intersect",
srcs = [prefix_dir + "script/intersect.cc"],
hdrs = [prefix_dir + "include/fst/script/intersect.h"],
includes = [prefix_dir + "include"],
deps = [
":fstscript_base",
":fstscript_compose",
],
)
cc_library(
name = "fstscript_print",
srcs = [prefix_dir + "script/print.cc"],
hdrs = [
prefix_dir + "include/fst/script/print.h",
prefix_dir + "include/fst/script/print-impl.h",
],
includes = [prefix_dir + "include"],
deps = [":fstscript_base"],
)
cc_library(
name = "fstscript_randequivalent",
srcs = [prefix_dir + "script/randequivalent.cc"],
hdrs = [prefix_dir + "include/fst/script/randequivalent.h"],
includes = [prefix_dir + "include"],
deps = [
":fstscript_base",
":fstscript_randgen",
],
)
cc_library(
name = "fstscript_rmepsilon",
srcs = [prefix_dir + "script/rmepsilon.cc"],
hdrs = [prefix_dir + "include/fst/script/rmepsilon.h"],
includes = [prefix_dir + "include"],
deps = [
":fstscript_base",
":fstscript_shortest_distance",
],
)
cc_library(
name = "fstscript_shortest_distance",
srcs = [prefix_dir + "script/shortest-distance.cc"],
hdrs = [prefix_dir + "include/fst/script/shortest-distance.h"],
includes = [prefix_dir + "include"],
deps = [
":fstscript_base",
":fstscript_prune",
],
)
cc_library(
name = "fstscript_shortest_path",
srcs = [prefix_dir + "script/shortest-path.cc"],
hdrs = [prefix_dir + "include/fst/script/shortest-path.h"],
includes = [prefix_dir + "include"],
deps = [
":fstscript_base",
":fstscript_shortest_distance",
],
)
cc_library(
name = "fstscript",
deps = [
":fstscript_arcsort",
":fstscript_closure",
":fstscript_compile",
":fstscript_compose",
":fstscript_concat",
":fstscript_connect",
":fstscript_convert",
":fstscript_decode",
":fstscript_determinize",
":fstscript_difference",
":fstscript_disambiguate",
":fstscript_draw",
":fstscript_encode",
":fstscript_epsnormalize",
":fstscript_equal",
":fstscript_equivalent",
":fstscript_info",
":fstscript_intersect",
":fstscript_invert",
":fstscript_isomorphic",
":fstscript_map",
":fstscript_minimize",
":fstscript_print",
":fstscript_project",
":fstscript_prune",
":fstscript_push",
":fstscript_randequivalent",
":fstscript_randgen",
":fstscript_relabel",
":fstscript_replace",
":fstscript_reverse",
":fstscript_reweight",
":fstscript_rmepsilon",
":fstscript_shortest_distance",
":fstscript_shortest_path",
":fstscript_synchronize",
":fstscript_topsort",
":fstscript_union",
":fstscript_verify",
],
)
# Command-line binaries (bin/)
[
cc_binary(
name = "fst%s" % operation.replace("_", ""),
srcs = [
prefix_dir + "bin/fst%s.cc" % operation.replace("_", ""),
prefix_dir + "bin/fst%s-main.cc" % operation.replace("_", ""),
],
linkstatic = static_binary,
deps = [":fstscript_%s" % operation],
)
for operation in [
"arcsort",
"closure",
"compile",
"compose",
"concat",
"connect",
"convert",
"determinize",
"difference",
"disambiguate",
"draw",
"epsnormalize",
"equal",
"info",
"intersect",
"invert",
"isomorphic",
"map",
"minimize",
"print",
"project",
"prune",
"push",
"randgen",
"relabel",
"replace",
"reverse",
"reweight",
"rmepsilon",
"shortest_distance",
"shortest_path",
"synchronize",
"topsort",
"union",
]
]
cc_binary(
name = "fstencode",
srcs = [
prefix_dir + "bin/fstencode.cc",
prefix_dir + "bin/fstencode-main.cc",
],
linkstatic = static_binary,
deps = [
":fstscript_decode",
":fstscript_encode",
],
)
cc_binary(
name = "fstequivalent",
srcs = [
prefix_dir + "bin/fstequivalent.cc",
prefix_dir + "bin/fstequivalent-main.cc",
],
linkstatic = static_binary,
deps = [
":fstscript_equivalent",
":fstscript_randequivalent",
],
)
cc_binary(
name = "fstsymbols",
srcs = [
prefix_dir + "bin/fstsymbols.cc",
prefix_dir + "bin/fstsymbols-main.cc",
],
linkstatic = static_binary,
deps = [":fstscript_verify"],
)
# Extension: Fst ARchive a/k/a FAR (extensions/far/)
cc_library(
name = "sttable",
srcs = [
prefix_dir + "extensions/far/stlist.cc",
prefix_dir + "extensions/far/sttable.cc",
],
hdrs = [
prefix_dir + "include/fst/extensions/far/stlist.h",
prefix_dir + "include/fst/extensions/far/sttable.h",
],
includes = [prefix_dir + "include"],
deps = [":util"],
)
cc_library(
name = "far_base",
hdrs = [
prefix_dir + "include/fst/extensions/far/far.h",
],
includes = [prefix_dir + "include"],
deps = [
":fst",
":sttable",
],
)
cc_library(
name = "far",
srcs = [prefix_dir + "extensions/far/strings.cc"],
hdrs = [
prefix_dir + "include/fst/extensions/far/compile-strings.h",
prefix_dir + "include/fst/extensions/far/create.h",
prefix_dir + "include/fst/extensions/far/equal.h",
prefix_dir + "include/fst/extensions/far/extract.h",
prefix_dir + "include/fst/extensions/far/farlib.h",
prefix_dir + "include/fst/extensions/far/info.h",
prefix_dir + "include/fst/extensions/far/isomorphic.h",
prefix_dir + "include/fst/extensions/far/print-strings.h",
],
includes = [prefix_dir + "include"],
deps = [
":far_base",
":fst",
],
)
cc_library(
name = "farscript",
srcs = [
prefix_dir + "extensions/far/far-class.cc",
prefix_dir + "extensions/far/farscript.cc",
prefix_dir + "extensions/far/getters.cc",
prefix_dir + "extensions/far/script-impl.cc",
prefix_dir + "extensions/far/strings.cc",
],
hdrs = [
prefix_dir + "include/fst/extensions/far/compile-strings.h",
prefix_dir + "include/fst/extensions/far/far-class.h",
prefix_dir + "include/fst/extensions/far/farscript.h",
prefix_dir + "include/fst/extensions/far/getters.h",
prefix_dir + "include/fst/extensions/far/script-impl.h",
],
includes = [prefix_dir + "include"],
deps = [
":base",
":far",
":fstscript_base",
],
)
[
cc_binary(
name = "far%s" % operation,
srcs = [prefix_dir + "extensions/far/far%s.cc" % operation],
linkstatic = static_binary,
deps = [":farscript"],
)
for operation in [
"compilestrings",
"create",
"equal",
"extract",
"info",
"isomorphic",
"printstrings",
]
]
# Extension: PushDown Transducers a/k/a PDT (extensions/pdt/)
cc_library(
name = "pdt",
hdrs = [
prefix_dir + "include/fst/extensions/pdt/collection.h",
prefix_dir + "include/fst/extensions/pdt/compose.h",
prefix_dir + "include/fst/extensions/pdt/expand.h",
prefix_dir + "include/fst/extensions/pdt/getters.h",
prefix_dir + "include/fst/extensions/pdt/info.h",
prefix_dir + "include/fst/extensions/pdt/paren.h",
prefix_dir + "include/fst/extensions/pdt/pdt.h",
prefix_dir + "include/fst/extensions/pdt/pdtlib.h",
prefix_dir + "include/fst/extensions/pdt/replace.h",
prefix_dir + "include/fst/extensions/pdt/reverse.h",
prefix_dir + "include/fst/extensions/pdt/shortest-path.h",
],
includes = [prefix_dir + "include"],
deps = [
":fst",
],
)
cc_library(
name = "pdtscript",
srcs = [
prefix_dir + "extensions/pdt/getters.cc",
prefix_dir + "extensions/pdt/pdtscript.cc",
],
hdrs = [
prefix_dir + "include/fst/extensions/pdt/getters.h",
prefix_dir + "include/fst/extensions/pdt/pdtscript.h",
],
includes = [prefix_dir + "include"],
deps = [
":fst",
":fstscript_base",
":pdt",
],
)
cc_binary(
name = "pdtcompose",
srcs = [prefix_dir + "extensions/pdt/pdtcompose.cc"],
linkstatic = static_binary,
deps = [
":fstscript_connect",
":pdtscript",
],
)
[
cc_binary(
name = "pdt%s" % operation,
srcs = [prefix_dir + "extensions/pdt/pdt%s.cc" % operation],
linkstatic = static_binary,
deps = [":pdtscript"],
)
for operation in [
"expand",
"info",
"replace",
"reverse",
"shortestpath",
]
]
# Extension: Multi PushDown Transducers a/k/a MPDT (extensions/mpdt/)
cc_library(
name = "mpdt",
hdrs = [
prefix_dir + "include/fst/extensions/mpdt/compose.h",
prefix_dir + "include/fst/extensions/mpdt/expand.h",
prefix_dir + "include/fst/extensions/mpdt/info.h",
prefix_dir + "include/fst/extensions/mpdt/mpdt.h",
prefix_dir + "include/fst/extensions/mpdt/mpdtlib.h",
prefix_dir + "include/fst/extensions/mpdt/read_write_utils.h",
prefix_dir + "include/fst/extensions/mpdt/reverse.h",
],
includes = [prefix_dir + "include"],
deps = [
":fst",
":pdt",
],
)
cc_library(
name = "mpdtscript",
srcs = [prefix_dir + "extensions/mpdt/mpdtscript.cc"],
hdrs = [prefix_dir + "include/fst/extensions/mpdt/mpdtscript.h"],
includes = [prefix_dir + "include"],
deps = [
":fst",
":fstscript_base",
":mpdt",
":pdtscript",
],
)
cc_binary(
name = "mpdtcompose",
srcs = [prefix_dir + "extensions/mpdt/mpdtcompose.cc"],
linkstatic = static_binary,
deps = [
":fstscript_connect",
":mpdtscript",
],
)
[
cc_binary(
name = "mpdt%s" % operation,
srcs = [prefix_dir + "extensions/mpdt/mpdt%s.cc" % operation],
linkstatic = static_binary,
deps = [":mpdtscript"],
)
for operation in [
"expand",
"info",
"reverse",
]
]
# Extension: LOUDS compressed n-gram language models (extensions/ngram/)
cc_library(
name = "ngram",
srcs = [
prefix_dir + "extensions/ngram/bitmap-index.cc",
prefix_dir + "extensions/ngram/ngram-fst.cc",
prefix_dir + "extensions/ngram/nthbit.cc",
],
hdrs = [
prefix_dir + "include/fst/extensions/ngram/bitmap-index.h",
prefix_dir + "include/fst/extensions/ngram/ngram-fst.h",
prefix_dir + "include/fst/extensions/ngram/nthbit.h",
],
includes = [prefix_dir + "include"],
deps = [
":fst",
],
)
# TODO: Extensions compact, compress, const, linear, lookahead, python, special
project(openfst)
include(CTest)
find_package(ICU COMPONENTS data i18n io test tu uc)
if (ICU_FOUND)
include_directories(${ICU_INCLUDE_DIRS})
set(LIBS ${LIBS} ${ICU_LIBRARIES})
endif (ICU_FOUND)
find_package(ZLIB)
if (ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIRECTORIES})
set(ZLIBS ${ZLIB_LIBRARIES})
endif (ZLIB_FOUND)
cmake_minimum_required(VERSION 3.1)
set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_CXX_STANDARD 11)
if (WIN32)
add_definitions(/bigobj)
set(WHOLEFST "/WHOLEARCHIVE:fst")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${WHOLEFST}")
#set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS 1)
#this must be disabled unless the previous option (CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS) is enabled
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
else()
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
endif (WIN32)
set(SOVERSION "16")
OPTION(BUILD_USE_SOLUTION_FOLDERS "Enable grouping of projects in VS" ON)
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ${BUILD_USE_SOLUTION_FOLDERS})
option(HAVE_BIN "Build the fst binaries" ON)
option(HAVE_SCRIPT "Build the fstscript" ON)
option(HAVE_COMPACT "Build compact" ON)
option(HAVE_COMPRESS "Build compress" OFF)
option(HAVE_CONST "Build const" ON)
option(HAVE_FAR "Build far" ON)
option(HAVE_GRM "Build grm" ON)
option(HAVE_PDT "Build pdt" ON)
option(HAVE_MPDT "Build mpdt" ON)
option(HAVE_LINEAR "Build linear" ON)
option(HAVE_LOOKAHEAD "Build lookahead" ON)
option(HAVE_NGRAM "Build ngram" ON)
option(HAVE_PYTHON "Build python" OFF)
option(HAVE_SPECIAL "Build special" ON)
add_subdirectory(src)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use these files except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Copyright 2005-2018 Google, Inc.
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006, 2007 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
6. Often, you can also type `make uninstall' to remove the installed
files again.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
SUBDIRS = src
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = BUILD.bazel
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h $(top_builddir)/src/include/fst/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)config.h.in
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/src/include/fst/config.h.in AUTHORS COPYING \
INSTALL NEWS README ar-lib compile config.guess config.sub \
install-sh ltmain.sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
DIST_TARGETS = dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DL_LIBS = @DL_LIBS@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PYTHON = @PYTHON@
PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
libfstdir = @libfstdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = src
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = BUILD.bazel
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
config.h: stamp-h1
@test -f $@ || rm -f stamp-h1
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
src/include/fst/config.h: src/include/fst/stamp-h2
@test -f $@ || rm -f src/include/fst/stamp-h2
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) src/include/fst/stamp-h2
src/include/fst/stamp-h2: $(top_srcdir)/src/include/fst/config.h.in $(top_builddir)/config.status
@rm -f src/include/fst/stamp-h2
cd $(top_builddir) && $(SHELL) ./config.status src/include/fst/config.h
distclean-hdr:
-rm -f config.h stamp-h1 src/include/fst/config.h src/include/fst/stamp-h2
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool config.lt
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile config.h
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr \
distclean-libtool distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(am__recursive_targets) all install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
clean-libtool cscope cscopelist-am ctags ctags-am dist \
dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
dist-xz dist-zip distcheck distclean distclean-generic \
distclean-hdr distclean-libtool distclean-tags distcleancheck \
distdir distuninstallcheck dvi dvi-am html html-am info \
info-am install install-am install-data install-data-am \
install-dvi install-dvi-am install-exec install-exec-am \
install-html install-html-am install-info install-info-am \
install-man install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
OpenFst: Release 1.7
* Fixes bug with coinaccessible states in NaturalAStarEstimate (1.7.2)
* Optionally allows building with Bazel (1.7.2)
* Simplifies string printing interface (1.7.2)
* Marks weight converters const (1.7.2)
* Adds NoMatchComposeFilter (1.7.2)
* Removed static assertions that trigger bugs in GCC (1.7.1)
* Evaluates many weight operations at compile-time (1.7.1)
* Adds configure-time test for float equality reflexivity (1.7.0)
* Adds additional overloads to Equals (1.7.0)
* Removes volatile qualifiers from float weights (1.7.0)
* Improved use of move semantics, especially in cache-backed FSTs (1.7.0)
* Protections for signedness in string compiler (1.7.0)
* Clean-up to weight constructors (1.7.0)
OpenFst: Release 1.6
* Optimized label lookup in SymbolTable (1.6.9)
* Fixed PROGRAM_FLAGS documentation string in binaries (1.6.8)
* Fixed handling of symbol tables in EpsNormalize (1.6.8)
* Fixed HashMatcher issues with SetState() and Find() consistency (1.6.8)
* Fixed error reporting when FST arc type unknown (1.6.8)
* The `first_path` option to ShortestPath is now optimal for A* (1.6.7)
* Renames SymbolTable::kNoSymbol to kNoSymbol (1.6.7)
* Exposes PowerMapper to the scripting API (1.6.7)
* Fixes linking of the special SOs (1.6.7)
* Fixes error handling in HashMatcher (1.6.6)
* Adds kShortestDelta for operations dependent on shortest-distance (1.6.6)
* Adds Python methods for (un)pickling and (de)serializing FSTs (1.6.6)
* Adds constructive variants of Invert and Project (1.6.6)
* Increases code sharing in MemoryPool/MemoryArena (1.6.6)
* Improves consistency of matcher FST ownership (1.6.6)
* Adds non-trivial A* estimator class (1.6.6)
* Prevents unreachable code generation in libfstscript (1.6.5)
* Adds move constructors for non-trivial weight types (1.6.5)
* Standardizes method names for tuple weight types (1.6.5)
* Eliminates undefined behavior in weight hashing (1.6.5)
* Optimizes binary search in SortedMatcher (1.6.5)
* Adds SetWeight (1.6.5)
* Fixes typing error in Python FAR reader (1.6.4)
* Removes restriction that Prune argument have commutative weights (1.6.3)
* Improves configuration of CompositeWeight readers and writers (1.6.3)
* Improves accuracy of ShortestDistance summation (1.6.3)
* SetFinal now "moves" its weight argument (1.6.3)
* Exposes ArcIterator and EncodeMapper flags in Python (1.6.3)
* Properly sets return codes in FST binaries (1.6.3)
* Eliminates StringWeight macros (1.6.3)
* Finalizes most virtual method overrides (1.6.2)
* Fixes missing includes of <fst/log.h> (1.6.1)
* Adds float format support to FST drawing (1.6.1)
* Extensive modernization for C++11 style (1.6.0)
* Many classes and constants moved into an internal namespace (1.6.0)
* Adds HashMatcher (1.6.0)
* Adds Member method to SymbolTable (1.6.0)
* Adds the "special" extension and the fstspecial binary; this is similar to
fstconvert but accepts arguments for specifying special labels (phi, rho,
and sigma) of FSTs (1.6.0)
* Exposes allow_negative_label option for Python symbol tables (1.6.0)
OpenFst: Release 1.5
* Added p-subsequential determinization (1.5.0)
* Generalized epsilon normalization to non-functional case (1.5.0)
* Added general gallic (plus is union) semiring (1.5.0)
* Added FST compression extension (1.5.0)
* Added Python extension (1.5.0)
* Added multiple pushdown transducer (MPDT) support (1.5.0)
* Fixed Isomorphic function (1.5.0)
* Added final method to matchers (1.5.0)
* Fixed various compiler issues (1.5.0)
* Fixed missing Isomorphic components (1.5.0)
* Added UnionWeight (1.5.0)
* Added InputEpsilonMapper and OutputEpsilonMapper arc mappers (1.5.1)
* Added TrivialComposeFilter for more efficient composition when one
of the arguments is epsilon-free (1.5.1)
* Added properties bits kUnweightedCycles and kWeightedCycles (1.5.1)
* Added missing const qualification to (1.5.1):
- SymbolTableIterator access
- EncodeMapper writing to file
- EncodeMapper SymbolTable access
* Replaced internal custom reference-counting (RefCounter) with
C++11 smart pointers where possible, and fixed associated
reference-counting bugs (1.5.1)
* When calling DeleteStates on a MutableFst with a shared impl, the impl
is set to a new empty impl rather than copying and deleting (1.5.1)
* Prepended `Pdt` to the Expand libraries and classes in the PDT
extension, and prepended `MPdt` to the Expand libraries and classes
in the MPDT extension, so that both can be used in the same compilation
unit (1.5.1)
* Added option to PDT Replace for compiling a strongly-regular RTN into a
bounded-stack PDT (1.5.1)
* Improved symbol table support for PDT Replace, including automatic
generation of parentheses symbols (1.5.1)
* Improvements to scripting API (1.5.1):
- Added methods for FST access and mutation
- Added additional checks for arc/weight compatibility
- WeightClass::One and WeightClass::Zero now require a specified weight
type at time of construction
- Improved VectorFstClass constructors
- Added linear-time check for cyclic dependencies in Replace
- Added EncodeMapperClass, a template-free box for an EncodeMapper
* Improvements to the binaries (1.5.1):
- Fixed no-op --precision flag to fstdraw (1.5.1)
- Fixed no-op --file_list_input flag to farcreate (1.5.1)
* Improvements to the Python extension (1.5.1):
- Adds methods for creating an empty mutable FST
- Adds methods for FST access via state and arc iteration
- Adds FST compilation from arclists (cf. fstcompile)
- Adds FST printing and drawing
- Adds FarReader and FarWriter classes.
* FarReader's GetFst method now returns a pointer (1.5.2)
* Fixed FSTERROR macro (1.5.2)
* Fixed build flags for dlopen (1.5.2)
* Consolidated Python extension into single module (1.5.2)
* Python add_arc now takes an Arc object (1.5.2)
* Adds optional minimization of non-deterministic FSTs (1.5.3)
* Mutation methods of the Python Fst object now support chaining (1.5.3)
* Scripting API and Python weight objects now support semiring arithmetic
(1.5.3)
* Adds RemoveSymbol method to SymbolTable (1.5.4)
* Prevents underflow when using LogProbArcSelector in random generation
(1.5.4)
* Makes random weight generators a single template class (1.5.4)
* Makes weight Properties constexpr where possible (1.5.4)
* Adds check for error when opening files when compiling strings into FARs
(1.5.4)
* Adds routines for parsing string flags to the scripting API (1.5.4)
OpenFst: Release 1.4
* Port to C++11 (1.4.0)
* Disambiguate function added (1.4.0)
* Isomorphic function added (1.4.0)
* Matcher interface augmented with Priority method.
* Special matchers (rho/sigma/phi) can match special symbols
on both input FSTs in composition/intersection provided at each
state pair they only match one side (1.4.0)
* Added ExplicitMatcher to suppress implicit matches (e.g. epsilon
self-loops) (1.4.0)
* Linear{Tagger,Classifier}Fst extensions added (1.4.0).
* Generalized state-reachable to work when input is cyclic (so long as no
final state is in a cycle). This ensures label-reachable (and hence label
lookahead) works with cyclic input (1.4.0)
* Added Condense to build the condensation graph (SCCs condensed to single
states) of an FST (1.4.0).
* Added an option to Reverse to specify whether a super-initial state
should always be created (1.4.0).
* Fixed bugs in FirstCacheStore, PowerWeight, and StringCompiler (1.4.0).
* Changed SymbolTable to use faster data structure (1.4.0).
* Added 'min' disambiguation in determinizaton to keep only the minimum
output in a non-functional transducer when plus=min/max
(flag --disambiguate_output) (1.4.1)
* Compiler issues in linear-fst fixed (1.4.1)
OpenFst: Release 1.3
* Support for non-fatal exits on errors: (1.3.1)
- Added FLAGS_fst_error_fatal: FST errors are
fatal if true (default); o.w. return objects flagged as bad:
e.g., FSTs - kError
prop. true, FST weights - not a Member().
- Added kError property bit signifying bad FST
- Added NoWeight() method to FST weight requirements that returns
weight that is not a Member().
* Various improvements to the FAR extensions (1.3.1)
- a single FST is now a FAR type
- FLAGS_initial_symbols: Uses the symbol table from the
first FST in the archive for all entries"
- Input/output to standard input/output for some FAR and arc types
* --with-icu configuration option no longer needed (1.3.1)
* Improved flags usage esp. if use SET_FLAGS not SetFlags/InitFst (1.3.2)
* Added 'fst' as possible far writer type (1.3.2)
* phi matcher can now accept 0 as the phi label (1.3.2)
* Added ngram-fst extension (1.3.2)
* Improved performance of PDT composition (1.3.3)
* Memory-map support (1.3.3)
* Fixed cross-FST serialization issues (1.3.3)
* Fixed NGramFst off-by-one issue (1.3.3)
* farextract now allows one to specify a list of comma-separated keys,
including key ranges (1.3.3)
* Fixed bug in PDT replace that could cause close paren IDs to collide
with open paren IDs (1.3.4)
OpenFst: Release 1.2
* Added lookahead matching and filtering for faster composition
* Added EditFst for mutation of o.w. immutable FSTs
* Added script sub-namespace defining type FstClass, a non-templated
Fst<Arc> to hold the arc template type internally. This and FST
operations on it allow easier I/O and scripting at the cost of some
runtime dispatching.
* Added per-arc-iterator control of Fst caching.
* Added PowerWeight and Power Arc.
* Added SparsePowerWeight and SparsePowerArc (1.2.4)
* Added SignedLogWeight and SignedLogArc (1.2.4)
* Added ExpectationWeight and ExpectationArc (1.2.4)
* Added AStarQueue, PruneQueue and NaturalPruneQueue disciplines (1.2.6)
* Added Log64Weight and Log64Arc to FST library throughout, including
support throughout scripts/bins/dsos (1.2.8)
* Added delayed RandGenFst that outputs tree of paths weighted
by count (1.2.8)
* Added fstsymbols shell-level command
* Added total weight removal option to pushing
* Changed methods for symbol table mutation:
use MutableInputSymbols()/MutableOutputSymbols().
* Numerous efficiency improvements esp in composition, replace, and caching
* Made "fstmap" handle semiring conversion by adding "to_std", "to_log"
and "to_log64" as supported 'map_type' arguments (1.2.8).
* Made the destructive implementation of RmEpsilon skip over states
admitting no non-epsilon incoming transition (1.2.8).
* Fixed numerous bugs (1.2 through 1.2.9) including:
- improper types of some approximation deltas
- sub-optimal hashing functions
- issues in internal reuse of shortest distance
- hashing bug in FloatWeight
- bug in shortest path queue
- symbol table checksumming issues
- various C++ standards issues
- Visit() behavior when visitation aborted
- Decode() hash performance bug (1.2.1)
- EditFst::Copy(bool) method when the boolean parameter is true (1.2.7)
- SymbolTable memory leak in Invert() (1.2.8)
- Added escaping of " and \ in labels in fstdraw, needed for dot to
function properly (1.2.8)
- Fixed handling of final weight of start state in fstpush (1.2.8)
- Added FST_LL_FORMAT to fix 64-bit integer printf issues (1.2.9)
- Fixed missing <functional> includes (1.2.9)
- Fixed reused local variable names (1.2.9)
- Fixed passing string by reference in FstDraw args (1.2.9)
* Added extensions directories including:
- finite-state archive (FAR) utilities,
added stlist format supporting writing/reading to/from standard out/in
at the library-level (1.2.8)
- compact FSTs
- lookahead FSTs
- pushdown transducers (improved in 1.2.1 through 1.2.7).
* Added StateMap/StateMapFst; renamed Map/MapFst to ArcMap/ArcMapFst;
map/MapFst retained (but deprecated) (1.2.9)
* Deleted ArcSum() and ArcMerge; use StateMap w/ ArcSumMapper and
ArcUniqueMapper (1.2.9).
* Incremented version of ConstFst/CompactFsts to stop memory alignment
that fails on pipes. Made old version raises errors when read on
pipes (1.2.9).
* Improved determinize hash (1.2.9)
* Removed stdio uses (1.2.10)
* Fixed library ordering issues esp. with newer GNU build tools (1.2.10)
OpenFst: Release 1.1
* Added compat.h to src/include/fst to fix missing defines
* Fixed bug in acyclic minimization that led to non-minimal
(but equivalent) results
* Fixed missing FST typedef in various matchers in matcher.h
so that they can be cascaded
* Opened file streams binary where appropriate
OpenFst: Release 1.0 (Additions to beta version):
* Matcher class added for matching labels at FST states. Includes
special matchers for sigma (any), rho ('rest'), and phi ('fail')
labels.
* Composition generalized with arbitrary filters, matchers, and state
tables.
* Sequence and matching composition filters provided. (see compose.h,
compose-filter.h, matcher.h, state-table.h)
* Unique n-best (see shortest-path.h)
* Pruning in determinization and epsilon removal (see determinize.h,
rmepsilon.h)
* New Fst class:
- Compact FSTs for space-efficient representation (see compact-fst.h)
* New Weight classes:
- MinMax
- Lexicographic
* Miscellaneous bug fixes
OpenFst: Release 1.7.2.
OpenFst is a library for constructing, combining, optimizing, and searching
weighted finite-state transducers (FSTs).
REQUIREMENTS:
This version is known to work under Linux using g++ (>= 4.9) and OS X using
XCode (>= 5). It is expected to work wherever adequate POSIX (dlopen,
ssize_t, basename), C99 (snprintf, strtoll, <stdint.h>), and C++11
(<unordered_set>, <unordered_map>, <forward_list>) support is available.
INSTALLATION:
Follow the generic GNU build system instructions in ./INSTALL. We
recommend configuring with --enable-static=no for faster compiles.
Optional features:
--enable-bin Enable fst::script and executables (def: yes)
--enable-compact-fsts Enable CompactFst extensions (def: no)
--enable-compress Enable compression extension (def: no)
--enable-const-fsts Enable ConstFst extensions (def: no)
--enable-far Enable FAR extensions (def: no)
--enable-grm Enable all dependencies of OpenGrm (def: no)
--enable-linear-fsts Enable LinearTagger/ClassifierFst extensions (def: no)
--enable-lookahead-fsts Enable LookAheadFst extensions (def: no)
--enable-mpdt Enable MPDT extensions (def: no)
--enable-ngram-fsts Enable NGramFst extensions (def: no)
--enable-pdt Enable PDT extensions (def: no)
--enable-python Enable Python extension (def: no)
--enable-special Enable special-matcher extensions (def: no)
Configuring with --enable-bin=no gives very fast compiles, but excludes the
command line utilities.
Configuring with --enable-python will attempt to install the Python module to
whichever site-packages (or dist-packages, on Debian or Ubuntu) is found
during configuration.
The flag --with-libfstdir specifies where FST extensions should be installed;
it defaults to ${libdir}/fst.
Compiling with -Wall -Wno-sign-compare under g++ should give no warnings from
this library.
If you encounter an error about loading shared objects when attempting to use
the library immediately after installation, (e.g, `...cannot open shared
object file...`) you may need to refresh your system's shared object cache.
On Linux, this is accomplished by invoking ldconfig; the corresponding command
on OS X is called update_dyld_shared_cache. Both of these require superuser
privileges (and so should be executed with sudo).
USAGE:
Assuming you've installed under the default /usr/local, the FST binaries are
found on /usr/local/bin.
To use in your own program, include <fst/fstlib.h> and compile with
-I/usr/local/include. The compiler must support C++11 (for g++ add the flag
-std=c++11). Link against /usr/local/lib/libfst.so and -ldl. Set your
LD_LIBRARY_PATH (or equivalent) to contain /usr/local/lib. The linking is,
by default, dynamic so that the Fst and Arc type DSO extensions can be used
correctly if desired. Any extensions will be found under /usr/local/lib/fst
or /usr/local/include/fst/extensions.
BUILDING WITH BAZEL:
As of release 1.7.2 it is possible to build the core library and binaries as
well as several extensions with Bazel and to depend on OpenFst as an
external dependency in other projects compiled with Bazel. Please refer to
https://bazel.build for information on using Bazel. OpenFst can be compiled
from anywhere in the source tree, as follows:
$ bazel build //:all
Tests can be run in a similar fashion:
$ bazel test //:all
DOCUMENTATION:
See www.openfst.org for general documentation.
See ./NEWS for updates since the last release.
# OpenFST port for Windows
OpenFst is a library for constructing, combining, optimizing, and searching
weighted finite-state transducers (FSTs), maintained by Google and released
under the [Apache 2.0 license](./COPYING). The home page for the library is
located at http://openfst.org/. Check the [original README file](./README)
for the current version, as we are not updating this file with the current
release version. Make sure also to check the [NEWS](./NEWS) file for the
latest changes. This file is part of the original distribution.
## Bugs And Limitations
Refer to [BUGS.md](./BUGS.md) for known issues.
## Releases
We track [original releases](http://www.openfst.org/twiki/bin/view/FST/FstDownload)
of the library, and try to keep [ours](https://github.com/kkm000/openfst/releases)
in step. Sometimes we may skip a release, but we strive for that to be rather an
exception. With each release, we drop a set of pre-built .exe files compiled for
the x64 architecture and optimized for execution speed. We use the latest
Microsoft compilers for it, so you may find you need to download and install the
latest Microsoft C runtime. See [Microsoft KB2977003](
https://support.microsoft.com/help/2977003/) for instructions.
We do not release pre-built libraries, however, because Microsoft compiler ABI
changes between versions, and is different for Debug and Release builds. You
must build a library matching your toolset on your own.
## Build
There are two build options: Visual Studio and CMake. We maintain a set of
build scripts for both. You will need a recent enough Visual Studio for either
build flavor. Microsoft provides an option to download the free Visual Studio
[Community Edition](https://visualstudio.microsoft.com/downloads/), which is
adequate.
### Visual Studio
Open `openfst.sln`, then read the comments in files under the "READ ME BEFORE
BUILD" solution folder. Generally, you may just hit Build and get the
libraries, unless you need fine-tuning, such as selecting a different toolset,
or want to build with MSBuild from command line. The solutions builds only
static libraries, with debug information embedded in C7 format for the
simplicity of use. Set the platform to `x86` or `x64` to build a respective
32- or 64-bit version of the library and tools.
The `bin` project builds multiple executable files by invoking itself
recursively once for each executable. All .vcxproj files have been scripted and
are maintained by hand. It takes a long time to build in Release mode. If you
only need the libfst library, build it alone from the Project Explorer.
All build outputs are placed into the `build_output` directory under the
solution root.
### CMake
Follow the normal CMake build procedure to generate build files. With CMake you
have an option of building dynamic libraries shared by the executables.
## Structure of the repository and tagging
The `original` branch contains only imported original OpenFST files, with one
exception of .gitignore file added. Tags of the form `orig/1.6.9.1` specify the
version and revision number of the library. Every commit on the `orignal` branch
contains the source URL for the tarball release of OpenFST that was committed.
The last version point corresponds to the revision of OpenFST version. Most (but
not all) of the versions has had only one revision, and therefore end in `.1`.
The `winport` branch contains the port, with corresponding tags of the form
`win/1.6.9.1`.
Bug fix releases are marked with a `+` following a sequential number, for
example, `win/1.7.2.1+01`
You can review the changes to source code only with the git command e. g.
`git diff orig/1.6.9.1..win/1.6.9.1 -- "*.cc" "*.h"`
The GitHub interface does not provide filtering by extension, so you will see
all CMakefiles and MSBuild files added, but it may be useful if you want to
examine changes in a particular file.
We try to keep changes to an absolute minimum. Most of them are due to
incompatibilities between the gcc and cl compilers, and only a minor portion
is due to the differences between the Linux and Windows platforms.
## Maintainers
The repository is maintained by [@kkm000](https://github.com/kkm000) and
[@jtrmal](https://github.com/jtrmal).
Open an issue to let us know if you discover a problem with the port. We react
to them promptly. Be sure to include a problem description, error text id any,
and the compiler or Visual Studio version (and CMake version, if you use it).
Do not hesitate to ask questions. We will try to help you.
Since we do not (by the definition of port) extend the OpenFST library itself,
please contact its authors with questions and suggestions related to the
original library. If in doubt, contact both teams.
Also let us know if you have a related development that you believe should be
linked to from this file.
---
_Copyright (c) 2008-current Google Inc._
_Copyright (c) 2016-current SmartAction LLC (kkm)_
_Copyright (c) 2016-current Johns Hopkins University (J. Trmal)_
#!/bin/bash
# This is a port port maintainer's file, and is not part of OpenFST.
# Licensed under the same Apache 2.0 license (see the file COPYING),
# or just delete it if in legal doubt; you do not need it anyway.
# Copyright 2019 SmartAction LLC.
set -euo pipefail; shopt -s extglob
LF=$'\n'
say() { echo >&2 "$0: $@"; }
die() { echo >&2 "$0: error: $@"; exit 1; }
# This is Spar^H^H Windooows!
miss=(); for tool in gawk git grep gzip tar wget; do
command -v $tool >/dev/null || miss+=($tool)
done
test ${#miss[@]} -eq 0 || die "missing required program(s): ${miss[@]}"
unset miss
[[ "$#" == [12] ]] || {
echo >&2 -e "Usage: $0 <version> [<revision>=1]${LF} e.g.: $0 1.7.0 1"
exit 2; }
ver=$1
rev=${2:-1}
tag="orig/$ver.$rev"
url="http://www.openfst.org/twiki/bin/viewfile/FST/FstDownload?filename=openfst-${ver}.tar.gz;rev=${rev}"
grep -qP '^1(\.1?\d){3}$' <<<"$ver.$rev" ||
die "revision $ver.$rev does not look correct to me"
pfx="$(git rev-parse --show-prefix)" && test -z "$pfx" ||
die "must be in the root of the work tree"
# Must be on the 'original' branch, in sync with the main repo,
# and with no local changes, although we can ignore deletions,
# since we are deleting files before import anyway. We must be
# squeaky clean, lest stray random files be added. Also, ignore
# changes to this file to allow for debugging.
git fetch origin
git status --porcelain=2 --branch | gawk -v me=$0 >&2 '
$0 == "# branch.head original" { branch_ok = 1 }
$1$2 == "#branch.ab" { ab_bad = $4 != "-0" }
$1 == "#" { next }
$1$2 == "1.D" { next } # Deleted files are fine.
$1$9 == "1_import_release.sh" { next }
{ modf_bad=1; nextfile }
END {
me = me ": error: "
if (!branch_ok) print me "current branch must be \"original\""
if (ab_bad) print me "current branch is not in sync with remote"
if (modf_bad) print me "there are locally modified files"
exit !(branch_ok && !ab_bad && !modf_bad) }'
git rev-parse -q --verify "refs/tags/$tag" >/dev/null &&
die "tag $tag already exists"
say "Removing (almost) all files from worktree"
rm -rf -- !(.|..|.git|.gitignore|_import_release.sh)
say "Fetching and unpacking OpenFST v$ver r$rev${LF} ... from: $url"
wget -nv -O - -- "$url" | tar -xzf - --strip-components=1
test -f NEWS ||
die "file NEWS was not unpacked. Something went horribly wrong."
message="Import v$ver r$rev${LF}${LF}$url"
say "committing and tagging new version"
git add -A
git commit -m "$message"
git tag -a "$tag" -m "$message"
say "summary of changes to the previous version, and a NEWS snippet"
git --no-pager show --stat
echo
git --no-pager show --format='' --unified=1 -w -- NEWS
echo
say "tag ${tag} created for the imported version. Import complete."
@echo off
setlocal enableextensions
:: Locate winrar.exe
set winrar="%ProgramFiles%\winrar\winrar.exe"
if not exist %winrar% set winrar="%ProgramFiles(x86)%\winrar\winrar.exe"
if not exist %winrar% (
echo ERROR: Cannot find winrar.exe 1>&2
exit /b 1
)
:: Get head tag and make sure it is sane.
for /f %%i in ('git describe --long --dirty') do set longtag=%%i
set insane=0
if not %longtag:-dirty=%.==%longtag%. set insane=1
if %longtag:-0-g=%.==%longtag%. set insane=1
if %longtag:win/=%.==%longtag%. set insane=1
if %insane%==1 (
echo ERROR: Best HEAD description '%longtag%' is not at a clean tag on winport branch 1>&2
exit /b 1
)
:: Get short description now, strip "win/" for version only
for /f %%i in ('git describe') do set tag=%%i
set tag=%tag:win/=%
:: Create archive with a comment
set cmtfile=%TEMP%\openfst-package-comment.txt
del /q %cmtfile% 2>nul
echo OpenFST binaries for Windows x64, optimized build. >>%cmtfile%
echo Copyright 2005-2019 Google, Inc. (Original source). >>%cmtfile%
echo Copyright 2016-2019 SmartAction LLC (Windows port). >>%cmtfile%
echo Copyright 2016-2019 Johns Hopkins Uni (Windows port). >>%cmtfile%
echo.>>%cmtfile%
echo OpenFST home page: http://www.openfst.org/ >>%cmtfile%
echo Git Repository: https://github.com/kkm000/openfst/ >>%cmtfile%
echo Build tag: %longtag% >>%cmtfile%
set zipfile=openfst-bin-win-x64-%tag%.zip
del /q %zipfile% 2>nul
%winrar% a -ep -m5 -z%cmtfile% %zipfile% NEWS COPYING build_output\x64\Release\bin\*.exe
if errorlevel 1 (
echo "ERROR: Cannot create archive '%zipfile%' 1>&2
del /q %cmtfile% 2>nul
exit /b 1
)
echo SUCCESS: Created archive '%zipfile%' 1>&2
del /q %cmtfile% 2>nul
exit /b 0
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
[m4_warning([this file was generated for autoconf 2.69.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.15.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# _AM_AUTOCONF_VERSION(VERSION)
# -----------------------------
# aclocal traces this macro to find the Autoconf version.
# This is a private macro too. Using m4_define simplifies
# the logic in aclocal, which can simply ignore this definition.
m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.15.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# Copyright (C) 2011-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_AR([ACT-IF-FAIL])
# -------------------------
# Try to determine the archiver interface, and trigger the ar-lib wrapper
# if it is needed. If the detection of archiver interface fails, run
# ACT-IF-FAIL (default is to abort configure with a proper error message).
AC_DEFUN([AM_PROG_AR],
[AC_BEFORE([$0], [LT_INIT])dnl
AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([ar-lib])dnl
AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
: ${AR=ar}
AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
[AC_LANG_PUSH([C])
am_cv_ar_interface=ar
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
[am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
AC_TRY_EVAL([am_ar_try])
if test "$ac_status" -eq 0; then
am_cv_ar_interface=ar
else
am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
AC_TRY_EVAL([am_ar_try])
if test "$ac_status" -eq 0; then
am_cv_ar_interface=lib
else
am_cv_ar_interface=unknown
fi
fi
rm -f conftest.lib libconftest.a
])
AC_LANG_POP([C])])
case $am_cv_ar_interface in
ar)
;;
lib)
# Microsoft lib, so override with the ar-lib wrapper script.
# FIXME: It is wrong to rewrite AR.
# But if we don't then we get into trouble of one sort or another.
# A longer-term fix would be to have automake use am__AR in this case,
# and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
# similar.
AR="$am_aux_dir/ar-lib $AR"
;;
unknown)
m4_default([$1],
[AC_MSG_ERROR([could not determine $AR interface])])
;;
esac
AC_SUBST([AR])dnl
])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is '.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ([2.52])dnl
m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
[$1], [CXX], [depcc="$CXX" am_compiler_list=],
[$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
[$1], [UPC], [depcc="$UPC" am_compiler_list=],
[$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named 'D' -- because '-MD' means "put the output
# in D".
rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
am__universal=false
m4_case([$1], [CC],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac],
[CXX],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac])
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
# Solaris 10 /bin/sh.
echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# We check with '-c' and '-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle '-M -o', and we need to detect this. Also, some Intel
# versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
nosideeffect)
# After this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested.
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE([dependency-tracking], [dnl
AS_HELP_STRING(
[--enable-dependency-tracking],
[do not reject slow dependency extractors])
AS_HELP_STRING(
[--disable-dependency-tracking],
[speeds up one-time build])])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
am__nodep='_no'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
AC_SUBST([am__nodep])dnl
_AM_SUBST_NOTMAKE([am__nodep])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
shift
for mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each '.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
m4_define([AC_PROG_CC],
m4_defn([AC_PROG_CC])
[_AM_PROG_CC_C_O
])
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.65])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[AC_DIAGNOSE([obsolete],
[$0: two- and three-arguments forms are deprecated.])
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(
m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
[ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
AM_MISSING_PROG([AUTOCONF], [autoconf])
AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
AM_MISSING_PROG([AUTOHEADER], [autoheader])
AM_MISSING_PROG([MAKEINFO], [makeinfo])
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES([CC])],
[m4_define([AC_PROG_CC],
m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES([CXX])],
[m4_define([AC_PROG_CXX],
m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES([OBJC])],
[m4_define([AC_PROG_OBJC],
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
[_AM_DEPENDENCIES([OBJCXX])],
[m4_define([AC_PROG_OBJCXX],
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
AC_REQUIRE([AM_SILENT_RULES])dnl
dnl The testsuite driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
# POSIX will say in a future version that running "rm -f" with no argument
# is OK; and we want to be able to make that assumption in our Makefile
# recipes. So use an aggressive probe to check that the usage we want is
# actually supported "in the wild" to an acceptable degree.
# See automake bug#10828.
# To make any issue more visible, cause the running configure to be aborted
# by default if the 'rm' program in use doesn't match our expectations; the
# user can still override this though.
if rm -f && rm -fr && rm -rf; then : OK; else
cat >&2 <<'END'
Oops!
Your 'rm' program seems unable to run without file operands specified
on the command line, even when the '-f' option is present. This is contrary
to the behaviour of most rm programs out there, and not conforming with
the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
Please tell bug-automake@gnu.org about your system, including the value
of your $PATH and any error possibly output before this message. This
can help us improve future automake versions.
END
if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
echo 'Configuration will proceed anyway, since you have set the' >&2
echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
echo >&2
else
cat >&2 <<'END'
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: <http://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
to "yes", and re-run configure.
END
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
fi
dnl The trailing newline in this macro's definition is deliberate, for
dnl backward compatibility and to allow trailing 'dnl'-style comments
dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
*)
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it is modern enough.
# If it is, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
*)
MISSING="\${SHELL} $am_aux_dir/missing" ;;
esac
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
am_missing_run="$MISSING "
else
am_missing_run=
AC_MSG_WARN(['missing' script is too old or missing])
fi
])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# --------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
# _AM_SET_OPTIONS(OPTIONS)
# ------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_PROG_CC_C_O
# ---------------
# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
# to automatically call this.
AC_DEFUN([_AM_PROG_CC_C_O],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([compile])dnl
AC_LANG_PUSH([C])dnl
AC_CACHE_CHECK(
[whether $CC understands -c and -o together],
[am_cv_prog_cc_c_o],
[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
# Make sure it works both with $CC and with simple cc.
# Following AC_PROG_CC_C_O, we do the test twice because some
# compilers refuse to overwrite an existing .o file with -o,
# though they will create one.
am_cv_prog_cc_c_o=yes
for am_i in 1 2; do
if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
&& test -f conftest2.$ac_objext; then
: OK
else
am_cv_prog_cc_c_o=no
break
fi
done
rm -f core conftest*
unset am_i])
if test "$am_cv_prog_cc_c_o" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
# But if we don't then we get into trouble of one sort or another.
# A longer-term fix would be to have automake use am__CC in this case,
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
CC="$am_aux_dir/compile $CC"
fi
AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# ---------------------------------------------------------------------------
# Adds support for distributing Python modules and packages. To
# install modules, copy them to $(pythondir), using the python_PYTHON
# automake variable. To install a package with the same name as the
# automake package, install to $(pkgpythondir), or use the
# pkgpython_PYTHON automake variable.
#
# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
# locations to install python extension modules (shared libraries).
# Another macro is required to find the appropriate flags to compile
# extension modules.
#
# If your package is configured with a different prefix to python,
# users will have to add the install directory to the PYTHONPATH
# environment variable, or create a .pth file (see the python
# documentation for details).
#
# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
# cause an error if the version of python installed on the system
# doesn't meet the requirement. MINIMUM-VERSION should consist of
# numbers and dots only.
AC_DEFUN([AM_PATH_PYTHON],
[
dnl Find a Python interpreter. Python versions prior to 2.0 are not
dnl supported. (2.0 was released on October 16, 2000).
dnl FIXME: Remove the need to hard-code Python versions here.
m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
[python python2 python3 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 dnl
python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
AC_ARG_VAR([PYTHON], [the Python interpreter])
m4_if([$1],[],[
dnl No version check is needed.
# Find any Python interpreter.
if test -z "$PYTHON"; then
AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
fi
am_display_PYTHON=python
], [
dnl A version check is needed.
if test -n "$PYTHON"; then
# If the user set $PYTHON, use it and don't search something else.
AC_MSG_CHECKING([whether $PYTHON version is >= $1])
AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([Python interpreter is too old])])
am_display_PYTHON=$PYTHON
else
# Otherwise, try each interpreter until we find one that satisfies
# VERSION.
AC_CACHE_CHECK([for a Python interpreter with version >= $1],
[am_cv_pathless_PYTHON],[
for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
test "$am_cv_pathless_PYTHON" = none && break
AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
done])
# Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
if test "$am_cv_pathless_PYTHON" = none; then
PYTHON=:
else
AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
fi
am_display_PYTHON=$am_cv_pathless_PYTHON
fi
])
if test "$PYTHON" = :; then
dnl Run any user-specified action, or abort.
m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
else
dnl Query Python for its version number. Getting [:3] seems to be
dnl the best way to do this; it's what "site.py" does in the standard
dnl library.
AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
[am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
dnl Use the values of $prefix and $exec_prefix for the corresponding
dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
dnl distinct variables so they can be overridden if need be. However,
dnl general consensus is that you shouldn't need this ability.
AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
dnl At times (like when building shared libraries) you may want
dnl to know which OS platform Python thinks this is.
AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
[am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
# Just factor out some code duplication.
am_python_setup_sysconfig="\
import sys
# Prefer sysconfig over distutils.sysconfig, for better compatibility
# with python 3.x. See automake bug#10227.
try:
import sysconfig
except ImportError:
can_use_sysconfig = 0
else:
can_use_sysconfig = 1
# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
# <https://github.com/pypa/virtualenv/issues/118>
try:
from platform import python_implementation
if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7':
can_use_sysconfig = 0
except ImportError:
pass"
dnl Set up 4 directories:
dnl pythondir -- where to install python scripts. This is the
dnl site-packages directory, not the python standard library
dnl directory like in previous automake betas. This behavior
dnl is more consistent with lispdir.m4 for example.
dnl Query distutils for this directory.
AC_CACHE_CHECK([for $am_display_PYTHON script directory],
[am_cv_python_pythondir],
[if test "x$prefix" = xNONE
then
am_py_prefix=$ac_default_prefix
else
am_py_prefix=$prefix
fi
am_cv_python_pythondir=`$PYTHON -c "
$am_python_setup_sysconfig
if can_use_sysconfig:
sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
else:
from distutils import sysconfig
sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
sys.stdout.write(sitedir)"`
case $am_cv_python_pythondir in
$am_py_prefix*)
am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
;;
*)
case $am_py_prefix in
/usr|/System*) ;;
*)
am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
;;
esac
;;
esac
])
AC_SUBST([pythondir], [$am_cv_python_pythondir])
dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
dnl more consistent with the rest of automake.
AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
dnl pyexecdir -- directory for installing python extension modules
dnl (shared libraries)
dnl Query distutils for this directory.
AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
[am_cv_python_pyexecdir],
[if test "x$exec_prefix" = xNONE
then
am_py_exec_prefix=$am_py_prefix
else
am_py_exec_prefix=$exec_prefix
fi
am_cv_python_pyexecdir=`$PYTHON -c "
$am_python_setup_sysconfig
if can_use_sysconfig:
sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
else:
from distutils import sysconfig
sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
sys.stdout.write(sitedir)"`
case $am_cv_python_pyexecdir in
$am_py_exec_prefix*)
am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
;;
*)
case $am_py_exec_prefix in
/usr|/System*) ;;
*)
am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
;;
esac
;;
esac
])
AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
dnl Run any user-specified action.
$2
fi
])
# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
# ---------------------------------------------------------------------------
# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
# Run ACTION-IF-FALSE otherwise.
# This test uses sys.hexversion instead of the string equivalent (first
# word of sys.version), in order to cope with versions such as 2.2c1.
# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
AC_DEFUN([AM_PYTHON_CHECK_VERSION],
[prog="import sys
# split strings by '.' and convert to numeric. Append some zeros
# because we need at least 4 digits for the hex conversion.
# map returns an iterator in Python 3.0 and a list in 2.x
minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
minverhex = 0
# xrange is not present in Python 3.0 and range returns an iterator
for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
sys.exit(sys.hexversion < minverhex)"
AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_RUN_LOG(COMMAND)
# -------------------
# Run COMMAND, save the exit status in ac_status, and log it.
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
AC_DEFUN([AM_RUN_LOG],
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
(exit $ac_status); }])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
*[[\\\"\#\$\&\'\`$am_lf]]*)
AC_MSG_ERROR([unsafe absolute working directory name]);;
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
esac
# Do 'set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
am_has_slept=no
for am_try in 1 2; do
echo "timestamp, slept: $am_has_slept" > conftest.file
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t "$srcdir/configure" conftest.file`
fi
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
if test "$[2]" = conftest.file || test $am_try -eq 2; then
break
fi
# Just in case.
sleep 1
am_has_slept=yes
done
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT([yes])
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
if grep 'slept: no' conftest.file >/dev/null 2>&1; then
( sleep 1 ) &
am_sleep_pid=$!
fi
AC_CONFIG_COMMANDS_PRE(
[AC_MSG_CHECKING([that generated files are newer than configure])
if test -n "$am_sleep_pid"; then
# Hide warnings about reused PIDs.
wait $am_sleep_pid 2>/dev/null
fi
AC_MSG_RESULT([done])])
rm -f conftest.file
])
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_SILENT_RULES([DEFAULT])
# --------------------------
# Enable less verbose build rules; with the default set to DEFAULT
# ("yes" being less verbose, "no" or empty being verbose).
AC_DEFUN([AM_SILENT_RULES],
[AC_ARG_ENABLE([silent-rules], [dnl
AS_HELP_STRING(
[--enable-silent-rules],
[less verbose build output (undo: "make V=1")])
AS_HELP_STRING(
[--disable-silent-rules],
[verbose build output (undo: "make V=0")])dnl
])
case $enable_silent_rules in @%:@ (((
yes) AM_DEFAULT_VERBOSITY=0;;
no) AM_DEFAULT_VERBOSITY=1;;
*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
esac
dnl
dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
dnl do not support nested variable expansions.
dnl See automake bug#9928 and bug#10237.
am_make=${MAKE-make}
AC_CACHE_CHECK([whether $am_make supports nested variables],
[am_cv_make_support_nested_variables],
[if AS_ECHO([['TRUE=$(BAR$(V))
BAR0=false
BAR1=true
V=1
am__doit:
@$(TRUE)
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
am_cv_make_support_nested_variables=yes
else
am_cv_make_support_nested_variables=no
fi])
if test $am_cv_make_support_nested_variables = yes; then
dnl Using '$V' instead of '$(V)' breaks IRIX make.
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
else
AM_V=$AM_DEFAULT_VERBOSITY
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
fi
AC_SUBST([AM_V])dnl
AM_SUBST_NOTMAKE([AM_V])dnl
AC_SUBST([AM_DEFAULT_V])dnl
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
AM_BACKSLASH='\'
AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor 'install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in "make install-strip", and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using 'strip' when the user
# run "make install-strip". However 'strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the 'STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
# --------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of 'v7', 'ustar', or 'pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
#
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AC_SUBST([AMTAR], ['$${TAR-tar}'])
# We'll loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
m4_if([$1], [v7],
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
[m4_case([$1],
[ustar],
[# The POSIX 1988 'ustar' format is defined with fixed-size fields.
# There is notably a 21 bits limit for the UID and the GID. In fact,
# the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
# and bug#13588).
am_max_uid=2097151 # 2^21 - 1
am_max_gid=$am_max_uid
# The $UID and $GID variables are not portable, so we need to resort
# to the POSIX-mandated id(1) utility. Errors in the 'id' calls
# below are definitely unexpected, so allow the users to see them
# (that is, avoid stderr redirection).
am_uid=`id -u || echo unknown`
am_gid=`id -g || echo unknown`
AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
if test $am_uid -le $am_max_uid; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
_am_tools=none
fi
AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
if test $am_gid -le $am_max_gid; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
_am_tools=none
fi],
[pax],
[],
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Go ahead even if we have the value already cached. We do so because we
# need to set the values for the 'am__tar' and 'am__untar' variables.
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
for _am_tool in $_am_tools; do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar; do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works.
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar <conftest.tar])
AM_RUN_LOG([cat conftest.dir/file])
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([m4/ac_python_devel.m4])
m4_include([m4/libtool.m4])
m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])
m4_include([m4/ltversion.m4])
m4_include([m4/lt~obsolete.m4])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment