mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-30 12:27:29 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
d9c82b1e71
911 changed files with 212798 additions and 85131 deletions
|
|
@ -85,7 +85,7 @@ nsJSPrincipals::Destroy(JSPrincipals *jsprin)
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
||||||
// Defined here so one can do principals->dump() in the debugger
|
// Defined here so one can do principals->dump() in the debugger
|
||||||
JS_PUBLIC_API(void)
|
void
|
||||||
JSPrincipals::dump()
|
JSPrincipals::dump()
|
||||||
{
|
{
|
||||||
if (debugToken == nsJSPrincipals::DEBUG_TOKEN) {
|
if (debugToken == nsJSPrincipals::DEBUG_TOKEN) {
|
||||||
|
|
|
||||||
|
|
@ -810,6 +810,7 @@ sym.h
|
||||||
synch.h
|
synch.h
|
||||||
syncmgr.h
|
syncmgr.h
|
||||||
sys/atomic_op.h
|
sys/atomic_op.h
|
||||||
|
sys/auxv.h
|
||||||
sys/bitypes.h
|
sys/bitypes.h
|
||||||
sys/byteorder.h
|
sys/byteorder.h
|
||||||
syscall.h
|
syscall.h
|
||||||
|
|
|
||||||
|
|
@ -1161,31 +1161,38 @@ ModuleBuilder::initModule()
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ModuleBuilder::processImport(frontend::ParseNode* pn)
|
ModuleBuilder::processImport(frontend::BinaryNode* importNode)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isKind(PNK_IMPORT));
|
MOZ_ASSERT(importNode->isKind(PNK_IMPORT));
|
||||||
MOZ_ASSERT(pn->isArity(PN_BINARY));
|
|
||||||
MOZ_ASSERT(pn->pn_left->isKind(PNK_IMPORT_SPEC_LIST));
|
|
||||||
MOZ_ASSERT(pn->pn_right->isKind(PNK_STRING));
|
|
||||||
|
|
||||||
RootedAtom module(cx_, pn->pn_right->pn_atom);
|
ListNode* specList = &importNode->left()->as<ListNode>();
|
||||||
|
MOZ_ASSERT(specList->isKind(PNK_IMPORT_SPEC_LIST));
|
||||||
|
|
||||||
|
NameNode* moduleSpec = &importNode->right()->as<NameNode>();
|
||||||
|
MOZ_ASSERT(moduleSpec->isKind(PNK_STRING));
|
||||||
|
|
||||||
|
RootedAtom module(cx_, moduleSpec->atom());
|
||||||
if (!maybeAppendRequestedModule(module))
|
if (!maybeAppendRequestedModule(module))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (ParseNode* spec = pn->pn_left->pn_head; spec; spec = spec->pn_next) {
|
RootedAtom importName(cx_);
|
||||||
|
RootedAtom localName(cx_);
|
||||||
|
for (ParseNode* item : specList->contents()) {
|
||||||
|
BinaryNode* spec = &item->as<BinaryNode>();
|
||||||
MOZ_ASSERT(spec->isKind(PNK_IMPORT_SPEC));
|
MOZ_ASSERT(spec->isKind(PNK_IMPORT_SPEC));
|
||||||
MOZ_ASSERT(spec->pn_left->isArity(PN_NAME));
|
|
||||||
MOZ_ASSERT(spec->pn_right->isArity(PN_NAME));
|
|
||||||
|
|
||||||
RootedAtom importName(cx_, spec->pn_left->pn_atom);
|
NameNode* importNameNode = &spec->left()->as<NameNode>();
|
||||||
RootedAtom localName(cx_, spec->pn_right->pn_atom);
|
NameNode* localNameNode = &spec->right()->as<NameNode>();
|
||||||
|
|
||||||
|
importName = importNameNode->atom();
|
||||||
|
localName = localNameNode->atom();
|
||||||
|
|
||||||
if (!importedBoundNames_.append(localName))
|
if (!importedBoundNames_.append(localName))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint32_t line;
|
uint32_t line;
|
||||||
uint32_t column;
|
uint32_t column;
|
||||||
tokenStream_.srcCoords.lineNumAndColumnIndex(spec->pn_left->pn_pos.begin, &line, &column);
|
tokenStream_.srcCoords.lineNumAndColumnIndex(importNameNode->pn_pos.begin, &line, &column);
|
||||||
|
|
||||||
RootedImportEntryObject importEntry(cx_);
|
RootedImportEntryObject importEntry(cx_);
|
||||||
importEntry = ImportEntryObject::create(cx_, module, importName, localName, line, column);
|
importEntry = ImportEntryObject::create(cx_, module, importName, localName, line, column);
|
||||||
|
|
@ -1197,15 +1204,17 @@ ModuleBuilder::processImport(frontend::ParseNode* pn)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ModuleBuilder::processExport(frontend::ParseNode* pn)
|
ModuleBuilder::processExport(frontend::ParseNode* exportNode)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isKind(PNK_EXPORT) || pn->isKind(PNK_EXPORT_DEFAULT));
|
MOZ_ASSERT(exportNode->isKind(PNK_EXPORT) ||
|
||||||
MOZ_ASSERT(pn->getArity() == (pn->isKind(PNK_EXPORT) ? PN_UNARY : PN_BINARY));
|
exportNode->isKind(PNK_EXPORT_DEFAULT));
|
||||||
|
|
||||||
bool isDefault = pn->getKind() == PNK_EXPORT_DEFAULT;
|
bool isDefault = exportNode->isKind(PNK_EXPORT_DEFAULT);
|
||||||
ParseNode* kid = isDefault ? pn->pn_left : pn->pn_kid;
|
ParseNode* kid = isDefault
|
||||||
|
? exportNode->as<BinaryNode>().left()
|
||||||
|
: exportNode->as<UnaryNode>().kid();
|
||||||
|
|
||||||
if (isDefault && pn->pn_right) {
|
if (isDefault && exportNode->as<BinaryNode>().right()) {
|
||||||
// This is an export default containing an expression.
|
// This is an export default containing an expression.
|
||||||
RootedAtom localName(cx_, cx_->names().starDefaultStar);
|
RootedAtom localName(cx_, cx_->names().starDefaultStar);
|
||||||
RootedAtom exportName(cx_, cx_->names().default_);
|
RootedAtom exportName(cx_, cx_->names().default_);
|
||||||
|
|
@ -1213,21 +1222,28 @@ ModuleBuilder::processExport(frontend::ParseNode* pn)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (kid->getKind()) {
|
switch (kid->getKind()) {
|
||||||
case PNK_EXPORT_SPEC_LIST:
|
case PNK_EXPORT_SPEC_LIST: {
|
||||||
MOZ_ASSERT(!isDefault);
|
MOZ_ASSERT(!isDefault);
|
||||||
for (ParseNode* spec = kid->pn_head; spec; spec = spec->pn_next) {
|
RootedAtom localName(cx_);
|
||||||
|
RootedAtom exportName(cx_);
|
||||||
|
for (ParseNode* item : kid->as<ListNode>().contents()) {
|
||||||
|
BinaryNode* spec = &item->as<BinaryNode>();
|
||||||
MOZ_ASSERT(spec->isKind(PNK_EXPORT_SPEC));
|
MOZ_ASSERT(spec->isKind(PNK_EXPORT_SPEC));
|
||||||
RootedAtom localName(cx_, spec->pn_left->pn_atom);
|
|
||||||
RootedAtom exportName(cx_, spec->pn_right->pn_atom);
|
NameNode* localNameNode = &spec->left()->as<NameNode>();
|
||||||
|
NameNode* exportNameNode = &spec->right()->as<NameNode>();
|
||||||
|
localName = localNameNode->atom();
|
||||||
|
exportName = exportNameNode->atom();
|
||||||
if (!appendExportEntry(exportName, localName, spec))
|
if (!appendExportEntry(exportName, localName, spec))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case PNK_CLASS: {
|
case PNK_CLASS: {
|
||||||
const ClassNode& cls = kid->as<ClassNode>();
|
const ClassNode& cls = kid->as<ClassNode>();
|
||||||
MOZ_ASSERT(cls.names());
|
MOZ_ASSERT(cls.names());
|
||||||
RootedAtom localName(cx_, cls.names()->innerBinding()->pn_atom);
|
RootedAtom localName(cx_, cls.names()->innerBinding()->atom());
|
||||||
RootedAtom exportName(cx_, isDefault ? cx_->names().default_ : localName.get());
|
RootedAtom exportName(cx_, isDefault ? cx_->names().default_ : localName.get());
|
||||||
if (!appendExportEntry(exportName, localName))
|
if (!appendExportEntry(exportName, localName))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -1237,21 +1253,33 @@ ModuleBuilder::processExport(frontend::ParseNode* pn)
|
||||||
case PNK_VAR:
|
case PNK_VAR:
|
||||||
case PNK_CONST:
|
case PNK_CONST:
|
||||||
case PNK_LET: {
|
case PNK_LET: {
|
||||||
MOZ_ASSERT(kid->isArity(PN_LIST));
|
RootedAtom localName(cx_);
|
||||||
for (ParseNode* var = kid->pn_head; var; var = var->pn_next) {
|
RootedAtom exportName(cx_);
|
||||||
if (var->isKind(PNK_ASSIGN))
|
for (ParseNode* binding : kid->as<ListNode>().contents()) {
|
||||||
var = var->pn_left;
|
if (binding->isKind(PNK_ASSIGN))
|
||||||
MOZ_ASSERT(var->isKind(PNK_NAME));
|
binding = binding->as<AssignmentNode>().left();
|
||||||
RootedAtom localName(cx_, var->pn_atom);
|
else
|
||||||
RootedAtom exportName(cx_, isDefault ? cx_->names().default_ : localName.get());
|
MOZ_ASSERT(binding->isKind(PNK_NAME));
|
||||||
if (!appendExportEntry(exportName, localName))
|
|
||||||
return false;
|
if (binding->isKind(PNK_NAME)) {
|
||||||
|
localName = binding->as<NameNode>().atom();
|
||||||
|
exportName = isDefault ? cx_->names().default_ : localName.get();
|
||||||
|
if (!appendExportEntry(exportName, localName))
|
||||||
|
return false;
|
||||||
|
} else if (binding->isKind(PNK_ARRAY)) {
|
||||||
|
if (!processExportArrayBinding(&binding->as<ListNode>()))
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
MOZ_ASSERT(binding->isKind(PNK_OBJECT));
|
||||||
|
if (!processExportObjectBinding(&binding->as<ListNode>()))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case PNK_FUNCTION: {
|
case PNK_FUNCTION: {
|
||||||
RootedFunction func(cx_, kid->pn_funbox->function());
|
RootedFunction func(cx_, kid->as<FunctionNode>().funbox()->function());
|
||||||
MOZ_ASSERT(!func->isArrow());
|
MOZ_ASSERT(!func->isArrow());
|
||||||
RootedAtom localName(cx_, func->explicitName());
|
RootedAtom localName(cx_, func->explicitName());
|
||||||
RootedAtom exportName(cx_, isDefault ? cx_->names().default_ : localName.get());
|
RootedAtom exportName(cx_, isDefault ? cx_->names().default_ : localName.get());
|
||||||
|
|
@ -1269,27 +1297,101 @@ ModuleBuilder::processExport(frontend::ParseNode* pn)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ModuleBuilder::processExportFrom(frontend::ParseNode* pn)
|
ModuleBuilder::processExportBinding(frontend::ParseNode* binding)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isKind(PNK_EXPORT_FROM));
|
if (binding->isKind(PNK_NAME)) {
|
||||||
MOZ_ASSERT(pn->isArity(PN_BINARY));
|
RootedAtom name(cx_, binding->as<NameNode>().atom());
|
||||||
MOZ_ASSERT(pn->pn_left->isKind(PNK_EXPORT_SPEC_LIST));
|
return appendExportEntry(name, name);
|
||||||
MOZ_ASSERT(pn->pn_right->isKind(PNK_STRING));
|
}
|
||||||
|
|
||||||
RootedAtom module(cx_, pn->pn_right->pn_atom);
|
if (binding->isKind(PNK_ARRAY))
|
||||||
|
return processExportArrayBinding(&binding->as<ListNode>());
|
||||||
|
|
||||||
|
MOZ_ASSERT(binding->isKind(PNK_OBJECT));
|
||||||
|
return processExportObjectBinding(&binding->as<ListNode>());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ModuleBuilder::processExportArrayBinding(frontend::ListNode* array)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(array->isKind(PNK_ARRAY));
|
||||||
|
|
||||||
|
for (ParseNode* node : array->contents()) {
|
||||||
|
if (node->isKind(PNK_ELISION))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (node->isKind(PNK_SPREAD))
|
||||||
|
node = node->as<UnaryNode>().kid();
|
||||||
|
else if (node->isKind(PNK_ASSIGN))
|
||||||
|
node = node->as<AssignmentNode>().left();
|
||||||
|
|
||||||
|
if (!processExportBinding(node))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ModuleBuilder::processExportObjectBinding(frontend::ListNode* obj)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(obj->isKind(PNK_OBJECT));
|
||||||
|
|
||||||
|
for (ParseNode* node : obj->contents()) {
|
||||||
|
MOZ_ASSERT(node->isKind(PNK_MUTATEPROTO) ||
|
||||||
|
node->isKind(PNK_COLON) ||
|
||||||
|
node->isKind(PNK_SHORTHAND) ||
|
||||||
|
node->isKind(PNK_SPREAD));
|
||||||
|
|
||||||
|
ParseNode* target;
|
||||||
|
if (node->isKind(PNK_SPREAD)) {
|
||||||
|
target = node->as<UnaryNode>().kid();
|
||||||
|
} else {
|
||||||
|
if (node->isKind(PNK_MUTATEPROTO))
|
||||||
|
target = node->as<UnaryNode>().kid();
|
||||||
|
else
|
||||||
|
target = node->as<BinaryNode>().right();
|
||||||
|
|
||||||
|
if (target->isKind(PNK_ASSIGN))
|
||||||
|
target = target->as<AssignmentNode>().left();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!processExportBinding(target))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ModuleBuilder::processExportFrom(frontend::BinaryNode* exportNode)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(exportNode->isKind(PNK_EXPORT_FROM));
|
||||||
|
|
||||||
|
ListNode* specList = &exportNode->left()->as<ListNode>();
|
||||||
|
MOZ_ASSERT(specList->isKind(PNK_EXPORT_SPEC_LIST));
|
||||||
|
|
||||||
|
NameNode* moduleSpec = &exportNode->right()->as<NameNode>();
|
||||||
|
MOZ_ASSERT(moduleSpec->isKind(PNK_STRING));
|
||||||
|
|
||||||
|
RootedAtom module(cx_, moduleSpec->atom());
|
||||||
if (!maybeAppendRequestedModule(module))
|
if (!maybeAppendRequestedModule(module))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (ParseNode* spec = pn->pn_left->pn_head; spec; spec = spec->pn_next) {
|
RootedAtom bindingName(cx_);
|
||||||
|
RootedAtom exportName(cx_);
|
||||||
|
for (ParseNode* spec : specList->contents()) {
|
||||||
if (spec->isKind(PNK_EXPORT_SPEC)) {
|
if (spec->isKind(PNK_EXPORT_SPEC)) {
|
||||||
RootedAtom bindingName(cx_, spec->pn_left->pn_atom);
|
NameNode* localNameNode = &spec->as<BinaryNode>().left()->as<NameNode>();
|
||||||
RootedAtom exportName(cx_, spec->pn_right->pn_atom);
|
NameNode* exportNameNode = &spec->as<BinaryNode>().right()->as<NameNode>();
|
||||||
if (!appendExportFromEntry(exportName, module, bindingName, spec->pn_left))
|
bindingName = localNameNode->atom();
|
||||||
|
exportName = exportNameNode->atom();
|
||||||
|
if (!appendExportFromEntry(exportName, module, bindingName, localNameNode))
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
MOZ_ASSERT(spec->isKind(PNK_EXPORT_BATCH_SPEC));
|
MOZ_ASSERT(spec->isKind(PNK_EXPORT_BATCH_SPEC));
|
||||||
RootedAtom importName(cx_, cx_->names().star);
|
exportName = cx_->names().star;
|
||||||
if (!appendExportFromEntry(nullptr, module, importName, spec))
|
if (!appendExportFromEntry(nullptr, module, exportName, spec))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@ class ModuleEnvironmentObject;
|
||||||
class ModuleObject;
|
class ModuleObject;
|
||||||
|
|
||||||
namespace frontend {
|
namespace frontend {
|
||||||
|
class BinaryNode;
|
||||||
|
class ListNode;
|
||||||
class ParseNode;
|
class ParseNode;
|
||||||
class TokenStream;
|
class TokenStream;
|
||||||
} /* namespace frontend */
|
} /* namespace frontend */
|
||||||
|
|
@ -318,9 +320,9 @@ class MOZ_STACK_CLASS ModuleBuilder
|
||||||
explicit ModuleBuilder(ExclusiveContext* cx, HandleModuleObject module,
|
explicit ModuleBuilder(ExclusiveContext* cx, HandleModuleObject module,
|
||||||
const frontend::TokenStream& tokenStream);
|
const frontend::TokenStream& tokenStream);
|
||||||
|
|
||||||
bool processImport(frontend::ParseNode* pn);
|
bool processImport(frontend::BinaryNode* importNode);
|
||||||
bool processExport(frontend::ParseNode* pn);
|
bool processExport(frontend::ParseNode* exportNode);
|
||||||
bool processExportFrom(frontend::ParseNode* pn);
|
bool processExportFrom(frontend::BinaryNode* exportNode);
|
||||||
|
|
||||||
bool hasExportedName(JSAtom* name) const;
|
bool hasExportedName(JSAtom* name) const;
|
||||||
|
|
||||||
|
|
@ -352,6 +354,10 @@ class MOZ_STACK_CLASS ModuleBuilder
|
||||||
|
|
||||||
ImportEntryObject* importEntryFor(JSAtom* localName) const;
|
ImportEntryObject* importEntryFor(JSAtom* localName) const;
|
||||||
|
|
||||||
|
bool processExportBinding(frontend::ParseNode* pn);
|
||||||
|
bool processExportArrayBinding(frontend::ListNode* pn);
|
||||||
|
bool processExportObjectBinding(frontend::ListNode* pn);
|
||||||
|
|
||||||
bool appendExportEntry(HandleAtom exportName, HandleAtom localName,
|
bool appendExportEntry(HandleAtom exportName, HandleAtom localName,
|
||||||
frontend::ParseNode* node = nullptr);
|
frontend::ParseNode* node = nullptr);
|
||||||
bool appendExportFromEntry(HandleAtom exportName, HandleAtom moduleRequest,
|
bool appendExportFromEntry(HandleAtom exportName, HandleAtom moduleRequest,
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -413,7 +413,7 @@ BytecodeCompiler::compileModule()
|
||||||
Maybe<BytecodeEmitter> emitter;
|
Maybe<BytecodeEmitter> emitter;
|
||||||
if (!emplaceEmitter(emitter, &modulesc))
|
if (!emplaceEmitter(emitter, &modulesc))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
if (!emitter->emitScript(pn->pn_body))
|
if (!emitter->emitScript(pn->as<ModuleNode>().body()))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
if (!NameFunctions(cx, pn))
|
if (!NameFunctions(cx, pn))
|
||||||
|
|
@ -457,7 +457,7 @@ BytecodeCompiler::compileStandaloneFunction(MutableHandleFunction fun,
|
||||||
// function should have been parsed, we backup and reparse with the new set
|
// function should have been parsed, we backup and reparse with the new set
|
||||||
// of directives.
|
// of directives.
|
||||||
|
|
||||||
ParseNode* fn;
|
FunctionNode* fn;
|
||||||
do {
|
do {
|
||||||
Directives newDirectives = directives;
|
Directives newDirectives = directives;
|
||||||
fn = parser->standaloneFunction(fun, enclosingScope, parameterListEnd, generatorKind,
|
fn = parser->standaloneFunction(fun, enclosingScope, parameterListEnd, generatorKind,
|
||||||
|
|
@ -466,19 +466,20 @@ BytecodeCompiler::compileStandaloneFunction(MutableHandleFunction fun,
|
||||||
return false;
|
return false;
|
||||||
} while (!fn);
|
} while (!fn);
|
||||||
|
|
||||||
if (fn->pn_funbox->function()->isInterpreted()) {
|
FunctionBox* funbox = fn->funbox();
|
||||||
MOZ_ASSERT(fun == fn->pn_funbox->function());
|
if (funbox->function()->isInterpreted()) {
|
||||||
|
MOZ_ASSERT(fun == funbox->function());
|
||||||
|
|
||||||
if (!createScript(fn->pn_funbox->toStringStart, fn->pn_funbox->toStringEnd))
|
if (!createScript(funbox->toStringStart, funbox->toStringEnd))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Maybe<BytecodeEmitter> emitter;
|
Maybe<BytecodeEmitter> emitter;
|
||||||
if (!emplaceEmitter(emitter, fn->pn_funbox))
|
if (!emplaceEmitter(emitter, funbox))
|
||||||
return false;
|
return false;
|
||||||
if (!emitter->emitFunctionScript(fn->pn_body))
|
if (!emitter->emitFunctionScript(fn))
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
fun.set(fn->pn_funbox->function());
|
fun.set(funbox->function());
|
||||||
MOZ_ASSERT(IsAsmJSModule(fun));
|
MOZ_ASSERT(IsAsmJSModule(fun));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -673,12 +674,12 @@ frontend::CompileLazyFunction(JSContext* cx, Handle<LazyScript*> lazy, const cha
|
||||||
if (lazy->hasBeenCloned())
|
if (lazy->hasBeenCloned())
|
||||||
script->setHasBeenCloned();
|
script->setHasBeenCloned();
|
||||||
|
|
||||||
BytecodeEmitter bce(/* parent = */ nullptr, &parser, pn->pn_funbox, script, lazy,
|
BytecodeEmitter bce(/* parent = */ nullptr, &parser, pn->as<FunctionNode>().funbox(), script, lazy,
|
||||||
pn->pn_pos, BytecodeEmitter::LazyFunction);
|
pn->pn_pos, BytecodeEmitter::LazyFunction);
|
||||||
if (!bce.init())
|
if (!bce.init())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!bce.emitFunctionScript(pn->pn_body))
|
if (!bce.emitFunctionScript(&pn->as<FunctionNode>()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!NameFunctions(cx, pn))
|
if (!NameFunctions(cx, pn))
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -416,7 +416,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
MOZ_MUST_USE bool emitScript(ParseNode* body);
|
MOZ_MUST_USE bool emitScript(ParseNode* body);
|
||||||
|
|
||||||
// Emit function code for the tree rooted at body.
|
// Emit function code for the tree rooted at body.
|
||||||
MOZ_MUST_USE bool emitFunctionScript(ParseNode* body);
|
MOZ_MUST_USE bool emitFunctionScript(FunctionNode* funNode);
|
||||||
|
|
||||||
// If op is JOF_TYPESET (see the type barriers comment in TypeInference.h),
|
// If op is JOF_TYPESET (see the type barriers comment in TypeInference.h),
|
||||||
// reserve a type set to store its result.
|
// reserve a type set to store its result.
|
||||||
|
|
@ -465,11 +465,11 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitNumberOp(double dval);
|
MOZ_MUST_USE bool emitNumberOp(double dval);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitThisLiteral(ParseNode* pn);
|
MOZ_MUST_USE bool emitThisLiteral(ThisLiteral* pn);
|
||||||
MOZ_MUST_USE bool emitGetFunctionThis(ParseNode* pn);
|
MOZ_MUST_USE bool emitGetFunctionThis(ParseNode* pn);
|
||||||
MOZ_MUST_USE bool emitGetFunctionThis(const mozilla::Maybe<uint32_t>& offset);
|
MOZ_MUST_USE bool emitGetFunctionThis(const mozilla::Maybe<uint32_t>& offset);
|
||||||
MOZ_MUST_USE bool emitGetThisForSuperBase(ParseNode* pn);
|
MOZ_MUST_USE bool emitGetThisForSuperBase(UnaryNode* superBase);
|
||||||
MOZ_MUST_USE bool emitSetThis(ParseNode* pn);
|
MOZ_MUST_USE bool emitSetThis(BinaryNode* setThisNode);
|
||||||
MOZ_MUST_USE bool emitCheckDerivedClassConstructorReturn();
|
MOZ_MUST_USE bool emitCheckDerivedClassConstructorReturn();
|
||||||
|
|
||||||
// Handle jump opcodes and jump targets.
|
// Handle jump opcodes and jump targets.
|
||||||
|
|
@ -484,7 +484,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
MOZ_MUST_USE bool emitCall(JSOp op, uint16_t argc,
|
MOZ_MUST_USE bool emitCall(JSOp op, uint16_t argc,
|
||||||
const mozilla::Maybe<uint32_t>& sourceCoordOffset);
|
const mozilla::Maybe<uint32_t>& sourceCoordOffset);
|
||||||
MOZ_MUST_USE bool emitCall(JSOp op, uint16_t argc, ParseNode* pn = nullptr);
|
MOZ_MUST_USE bool emitCall(JSOp op, uint16_t argc, ParseNode* pn = nullptr);
|
||||||
MOZ_MUST_USE bool emitCallIncDec(ParseNode* incDec);
|
MOZ_MUST_USE bool emitCallIncDec(UnaryNode* incDec);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitLoopHead(ParseNode* nextpn, JumpTarget* top);
|
MOZ_MUST_USE bool emitLoopHead(ParseNode* nextpn, JumpTarget* top);
|
||||||
MOZ_MUST_USE bool emitLoopEntry(ParseNode* nextpn, JumpList entryJump);
|
MOZ_MUST_USE bool emitLoopEntry(ParseNode* nextpn, JumpList entryJump);
|
||||||
|
|
@ -498,9 +498,9 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
MOZ_MUST_USE bool emitAtomOp(JSAtom* atom, JSOp op);
|
MOZ_MUST_USE bool emitAtomOp(JSAtom* atom, JSOp op);
|
||||||
MOZ_MUST_USE bool emitAtomOp(uint32_t atomIndex, JSOp op);
|
MOZ_MUST_USE bool emitAtomOp(uint32_t atomIndex, JSOp op);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitArrayLiteral(ParseNode* pn);
|
MOZ_MUST_USE bool emitArrayLiteral(ListNode* array);
|
||||||
MOZ_MUST_USE bool emitArray(ParseNode* pn, uint32_t count, JSOp op);
|
MOZ_MUST_USE bool emitArray(ParseNode* arrayHead, uint32_t count, JSOp op);
|
||||||
MOZ_MUST_USE bool emitArrayComp(ParseNode* pn);
|
MOZ_MUST_USE bool emitArrayComp(ListNode* pn);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitInternedScopeOp(uint32_t index, JSOp op);
|
MOZ_MUST_USE bool emitInternedScopeOp(uint32_t index, JSOp op);
|
||||||
MOZ_MUST_USE bool emitInternedObjectOp(uint32_t index, JSOp op);
|
MOZ_MUST_USE bool emitInternedObjectOp(uint32_t index, JSOp op);
|
||||||
|
|
@ -508,14 +508,14 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
MOZ_MUST_USE bool emitObjectPairOp(ObjectBox* objbox1, ObjectBox* objbox2, JSOp op);
|
MOZ_MUST_USE bool emitObjectPairOp(ObjectBox* objbox1, ObjectBox* objbox2, JSOp op);
|
||||||
MOZ_MUST_USE bool emitRegExp(uint32_t index);
|
MOZ_MUST_USE bool emitRegExp(uint32_t index);
|
||||||
|
|
||||||
MOZ_NEVER_INLINE MOZ_MUST_USE bool emitFunction(ParseNode* pn, bool needsProto = false);
|
MOZ_NEVER_INLINE MOZ_MUST_USE bool emitFunction(FunctionNode* funNode, bool needsProto = false);
|
||||||
MOZ_NEVER_INLINE MOZ_MUST_USE bool emitObject(ParseNode* pn);
|
MOZ_NEVER_INLINE MOZ_MUST_USE bool emitObject(ListNode* objNode);
|
||||||
|
|
||||||
MOZ_MUST_USE bool replaceNewInitWithNewObject(JSObject* obj, ptrdiff_t offset);
|
MOZ_MUST_USE bool replaceNewInitWithNewObject(JSObject* obj, ptrdiff_t offset);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitHoistedFunctionsInList(ParseNode* pn);
|
MOZ_MUST_USE bool emitHoistedFunctionsInList(ListNode* stmtList);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitPropertyList(ParseNode* pn, MutableHandlePlainObject objp,
|
MOZ_MUST_USE bool emitPropertyList(ListNode* obj, MutableHandlePlainObject objp,
|
||||||
PropListType type);
|
PropListType type);
|
||||||
|
|
||||||
// To catch accidental misuse, emitUint16Operand/emit3 assert that they are
|
// To catch accidental misuse, emitUint16Operand/emit3 assert that they are
|
||||||
|
|
@ -536,10 +536,10 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitTDZCheckIfNeeded(JSAtom* name, const NameLocation& loc);
|
MOZ_MUST_USE bool emitTDZCheckIfNeeded(JSAtom* name, const NameLocation& loc);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitNameIncDec(ParseNode* incDec);
|
MOZ_MUST_USE bool emitNameIncDec(UnaryNode* incDec);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitDeclarationList(ParseNode* decls);
|
MOZ_MUST_USE bool emitDeclarationList(ListNode* declList);
|
||||||
MOZ_MUST_USE bool emitSingleDeclaration(ParseNode* decls, ParseNode* decl,
|
MOZ_MUST_USE bool emitSingleDeclaration(ParseNode* declList, ParseNode* decl,
|
||||||
ParseNode* initializer);
|
ParseNode* initializer);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitNewInit(JSProtoKey key);
|
MOZ_MUST_USE bool emitNewInit(JSProtoKey key);
|
||||||
|
|
@ -555,45 +555,44 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
}
|
}
|
||||||
MOZ_MUST_USE bool emitGetDotGeneratorInScope(EmitterScope& currentScope);
|
MOZ_MUST_USE bool emitGetDotGeneratorInScope(EmitterScope& currentScope);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitInitialYield(ParseNode* pn);
|
MOZ_MUST_USE bool emitInitialYield(UnaryNode* yieldNode);
|
||||||
MOZ_MUST_USE bool emitYield(ParseNode* pn);
|
MOZ_MUST_USE bool emitYield(UnaryNode* yieldNode);
|
||||||
MOZ_MUST_USE bool emitYieldOp(JSOp op);
|
MOZ_MUST_USE bool emitYieldOp(JSOp op);
|
||||||
MOZ_MUST_USE bool emitYieldStar(ParseNode* iter);
|
MOZ_MUST_USE bool emitYieldStar(ParseNode* iter);
|
||||||
MOZ_MUST_USE bool emitAwaitInInnermostScope() {
|
MOZ_MUST_USE bool emitAwaitInInnermostScope() {
|
||||||
return emitAwaitInScope(*innermostEmitterScope());
|
return emitAwaitInScope(*innermostEmitterScope());
|
||||||
}
|
}
|
||||||
MOZ_MUST_USE bool emitAwaitInInnermostScope(ParseNode* pn);
|
MOZ_MUST_USE bool emitAwaitInInnermostScope(UnaryNode* awaitNode);
|
||||||
MOZ_MUST_USE bool emitAwaitInScope(EmitterScope& currentScope);
|
MOZ_MUST_USE bool emitAwaitInScope(EmitterScope& currentScope);
|
||||||
MOZ_MUST_USE bool emitPropLHS(ParseNode* pn);
|
MOZ_MUST_USE bool emitPropLHS(PropertyAccess* prop);
|
||||||
MOZ_MUST_USE bool emitPropIncDec(ParseNode* pn);
|
MOZ_MUST_USE bool emitPropIncDec(UnaryNode* incDec);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitAsyncWrapperLambda(unsigned index, bool isArrow);
|
MOZ_MUST_USE bool emitAsyncWrapperLambda(unsigned index, bool isArrow);
|
||||||
MOZ_MUST_USE bool emitAsyncWrapper(unsigned index, bool needsHomeObject, bool isArrow,
|
MOZ_MUST_USE bool emitAsyncWrapper(unsigned index, bool needsHomeObject, bool isArrow,
|
||||||
bool isStarGenerator);
|
bool isStarGenerator);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitComputedPropertyName(ParseNode* computedPropName);
|
MOZ_MUST_USE bool emitComputedPropertyName(UnaryNode* computedPropName);
|
||||||
|
|
||||||
// Emit bytecode to put operands for a JSOP_GETELEM/CALLELEM/SETELEM/DELELEM
|
// Emit bytecode to put operands for a JSOP_GETELEM/CALLELEM/SETELEM/DELELEM
|
||||||
// opcode onto the stack in the right order. In the case of SETELEM, the
|
// opcode onto the stack in the right order. In the case of SETELEM, the
|
||||||
// value to be assigned must already be pushed.
|
// value to be assigned must already be pushed.
|
||||||
enum class EmitElemOption { Get, Set, Call, IncDec, CompoundAssign, Ref };
|
enum class EmitElemOption { Get, Set, Call, IncDec, CompoundAssign, Ref };
|
||||||
MOZ_MUST_USE bool emitElemOperands(ParseNode* pn, EmitElemOption opts);
|
MOZ_MUST_USE bool emitElemOperands(PropertyByValue* elem, EmitElemOption opts);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitElemObjAndKey(PropertyByValue* elem, bool isSuper, ElemOpEmitter& eoe);
|
MOZ_MUST_USE bool emitElemObjAndKey(PropertyByValue* elem, bool isSuper, ElemOpEmitter& eoe);
|
||||||
MOZ_MUST_USE bool emitElemOpBase(JSOp op);
|
MOZ_MUST_USE bool emitElemOpBase(JSOp op);
|
||||||
MOZ_MUST_USE bool emitElemOp(ParseNode* pn, JSOp op);
|
MOZ_MUST_USE bool emitElemIncDec(UnaryNode* incDec);
|
||||||
MOZ_MUST_USE bool emitElemIncDec(ParseNode* pn);
|
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitCatch(ParseNode* pn);
|
MOZ_MUST_USE bool emitCatch(TernaryNode* catchNode);
|
||||||
MOZ_MUST_USE bool emitIf(ParseNode* pn);
|
MOZ_MUST_USE bool emitIf(TernaryNode* ifNode);
|
||||||
MOZ_MUST_USE bool emitWith(ParseNode* pn);
|
MOZ_MUST_USE bool emitWith(BinaryNode* withNode);
|
||||||
|
|
||||||
MOZ_NEVER_INLINE MOZ_MUST_USE bool emitLabeledStatement(const LabeledStatement* pn);
|
MOZ_NEVER_INLINE MOZ_MUST_USE bool emitLabeledStatement(const LabeledStatement* pn);
|
||||||
MOZ_NEVER_INLINE MOZ_MUST_USE bool emitLexicalScope(ParseNode* pn);
|
MOZ_NEVER_INLINE MOZ_MUST_USE bool emitLexicalScope(LexicalScopeNode* lexicalScope);
|
||||||
MOZ_MUST_USE bool emitLexicalScopeBody(ParseNode* body,
|
MOZ_MUST_USE bool emitLexicalScopeBody(ParseNode* body,
|
||||||
EmitLineNumberNote emitLineNote = EMIT_LINENOTE);
|
EmitLineNumberNote emitLineNote = EMIT_LINENOTE);
|
||||||
MOZ_NEVER_INLINE MOZ_MUST_USE bool emitSwitch(ParseNode* pn);
|
MOZ_NEVER_INLINE MOZ_MUST_USE bool emitSwitch(SwitchStatement* switchStmt);
|
||||||
MOZ_NEVER_INLINE MOZ_MUST_USE bool emitTry(ParseNode* pn);
|
MOZ_NEVER_INLINE MOZ_MUST_USE bool emitTry(TryNode* tryNode);
|
||||||
|
|
||||||
enum DestructuringFlavor {
|
enum DestructuringFlavor {
|
||||||
// Destructuring into a declaration.
|
// Destructuring into a declaration.
|
||||||
|
|
@ -625,21 +624,18 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
|
|
||||||
// emitDestructuringObjRestExclusionSet emits the property exclusion set
|
// emitDestructuringObjRestExclusionSet emits the property exclusion set
|
||||||
// for the rest-property in an object pattern.
|
// for the rest-property in an object pattern.
|
||||||
MOZ_MUST_USE bool emitDestructuringObjRestExclusionSet(ParseNode* pattern);
|
MOZ_MUST_USE bool emitDestructuringObjRestExclusionSet(ListNode* pattern);
|
||||||
|
|
||||||
// emitDestructuringOps assumes the to-be-destructured value has been
|
// emitDestructuringOps assumes the to-be-destructured value has been
|
||||||
// pushed on the stack and emits code to destructure each part of a [] or
|
// pushed on the stack and emits code to destructure each part of a [] or
|
||||||
// {} lhs expression.
|
// {} lhs expression.
|
||||||
MOZ_MUST_USE bool emitDestructuringOps(ParseNode* pattern, DestructuringFlavor flav);
|
MOZ_MUST_USE bool emitDestructuringOps(ListNode* pattern, DestructuringFlavor flav);
|
||||||
MOZ_MUST_USE bool emitDestructuringOpsArray(ParseNode* pattern, DestructuringFlavor flav);
|
MOZ_MUST_USE bool emitDestructuringOpsArray(ListNode* pattern, DestructuringFlavor flav);
|
||||||
MOZ_MUST_USE bool emitDestructuringOpsObject(ParseNode* pattern, DestructuringFlavor flav);
|
MOZ_MUST_USE bool emitDestructuringOpsObject(ListNode* pattern, DestructuringFlavor flav);
|
||||||
|
|
||||||
typedef bool
|
typedef bool
|
||||||
(*DestructuringDeclEmitter)(BytecodeEmitter* bce, ParseNode* pn);
|
(*DestructuringDeclEmitter)(BytecodeEmitter* bce, ParseNode* pn);
|
||||||
|
|
||||||
template <typename NameEmitter>
|
|
||||||
MOZ_MUST_USE bool emitDestructuringDeclsWithEmitter(ParseNode* pattern, NameEmitter emitName);
|
|
||||||
|
|
||||||
// Throw a TypeError if the value atop the stack isn't convertible to an
|
// Throw a TypeError if the value atop the stack isn't convertible to an
|
||||||
// object, with no overall effect on the stack.
|
// object, with no overall effect on the stack.
|
||||||
MOZ_MUST_USE bool emitRequireObjectCoercible();
|
MOZ_MUST_USE bool emitRequireObjectCoercible();
|
||||||
|
|
@ -695,26 +691,26 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
MOZ_MUST_USE bool emitInitializer(ParseNode* initializer, ParseNode* pattern);
|
MOZ_MUST_USE bool emitInitializer(ParseNode* initializer, ParseNode* pattern);
|
||||||
MOZ_MUST_USE bool emitInitializerInBranch(ParseNode* initializer, ParseNode* pattern);
|
MOZ_MUST_USE bool emitInitializerInBranch(ParseNode* initializer, ParseNode* pattern);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitCallSiteObject(ParseNode* pn);
|
MOZ_MUST_USE bool emitCallSiteObject(CallSiteNode* callSiteObj);
|
||||||
MOZ_MUST_USE bool emitTemplateString(ParseNode* pn);
|
MOZ_MUST_USE bool emitTemplateString(ListNode* templateString);
|
||||||
MOZ_MUST_USE bool emitAssignment(ParseNode* lhs, JSOp compoundOp, ParseNode* rhs);
|
MOZ_MUST_USE bool emitAssignment(ParseNode* lhs, JSOp compoundOp, ParseNode* rhs);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitReturn(ParseNode* pn);
|
MOZ_MUST_USE bool emitReturn(UnaryNode* returnNode);
|
||||||
MOZ_MUST_USE bool emitStatement(ParseNode* pn);
|
MOZ_MUST_USE bool emitStatement(UnaryNode* exprStmt);
|
||||||
MOZ_MUST_USE bool emitStatementList(ParseNode* pn);
|
MOZ_MUST_USE bool emitStatementList(ListNode* stmtList);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitDeleteName(ParseNode* pn);
|
MOZ_MUST_USE bool emitDeleteName(UnaryNode* deleteNode);
|
||||||
MOZ_MUST_USE bool emitDeleteProperty(ParseNode* pn);
|
MOZ_MUST_USE bool emitDeleteProperty(UnaryNode* deleteNode);
|
||||||
MOZ_MUST_USE bool emitDeleteElement(ParseNode* pn);
|
MOZ_MUST_USE bool emitDeleteElement(UnaryNode* deleteNode);
|
||||||
MOZ_MUST_USE bool emitDeleteExpression(ParseNode* pn);
|
MOZ_MUST_USE bool emitDeleteExpression(UnaryNode* deleteNode);
|
||||||
|
|
||||||
// Optional methods which emit Optional Jump Target
|
// Optional methods which emit Optional Jump Target
|
||||||
MOZ_MUST_USE bool emitOptionalChain(ParseNode* optionalChain,
|
MOZ_MUST_USE bool emitOptionalChain(UnaryNode* optionalChain,
|
||||||
ValueUsage valueUsage);
|
ValueUsage valueUsage);
|
||||||
MOZ_MUST_USE bool emitCalleeAndThisForOptionalChain(ParseNode* optionalChain,
|
MOZ_MUST_USE bool emitCalleeAndThisForOptionalChain(UnaryNode* optionalChain,
|
||||||
ParseNode* callNode,
|
ParseNode* callNode,
|
||||||
CallOrNewEmitter& cone);
|
CallOrNewEmitter& cone);
|
||||||
MOZ_MUST_USE bool emitDeleteOptionalChain(ParseNode* deleteNode);
|
MOZ_MUST_USE bool emitDeleteOptionalChain(UnaryNode* deleteNode);
|
||||||
|
|
||||||
// Optional methods which emit a shortCircuit jump. They need to be called by
|
// Optional methods which emit a shortCircuit jump. They need to be called by
|
||||||
// a method which emits an Optional Jump Target, see below.
|
// a method which emits an Optional Jump Target, see below.
|
||||||
|
|
@ -724,7 +720,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
MOZ_MUST_USE bool emitOptionalElemExpression(PropertyByValueBase* elem,
|
MOZ_MUST_USE bool emitOptionalElemExpression(PropertyByValueBase* elem,
|
||||||
ElemOpEmitter& eoe, bool isSuper,
|
ElemOpEmitter& eoe, bool isSuper,
|
||||||
OptionalEmitter& oe);
|
OptionalEmitter& oe);
|
||||||
MOZ_MUST_USE bool emitOptionalCall(ParseNode* callNode,
|
MOZ_MUST_USE bool emitOptionalCall(BinaryNode* callNode,
|
||||||
OptionalEmitter& oe,
|
OptionalEmitter& oe,
|
||||||
ValueUsage valueUsage);
|
ValueUsage valueUsage);
|
||||||
MOZ_MUST_USE bool emitDeletePropertyInOptChain(PropertyAccessBase* propExpr,
|
MOZ_MUST_USE bool emitDeletePropertyInOptChain(PropertyAccessBase* propExpr,
|
||||||
|
|
@ -733,16 +729,16 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
OptionalEmitter& oe);
|
OptionalEmitter& oe);
|
||||||
|
|
||||||
// |op| must be JSOP_TYPEOF or JSOP_TYPEOFEXPR.
|
// |op| must be JSOP_TYPEOF or JSOP_TYPEOFEXPR.
|
||||||
MOZ_MUST_USE bool emitTypeof(ParseNode* node, JSOp op);
|
MOZ_MUST_USE bool emitTypeof(UnaryNode* typeofNode, JSOp op);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitUnary(ParseNode* pn);
|
MOZ_MUST_USE bool emitUnary(UnaryNode* unaryNode);
|
||||||
MOZ_MUST_USE bool emitRightAssociative(ParseNode* pn);
|
MOZ_MUST_USE bool emitRightAssociative(ListNode* node);
|
||||||
MOZ_MUST_USE bool emitLeftAssociative(ParseNode* pn);
|
MOZ_MUST_USE bool emitLeftAssociative(ListNode* node);
|
||||||
MOZ_MUST_USE bool emitLogical(ParseNode* pn);
|
MOZ_MUST_USE bool emitLogical(ListNode* node);
|
||||||
MOZ_MUST_USE bool emitSequenceExpr(ParseNode* pn,
|
MOZ_MUST_USE bool emitSequenceExpr(ListNode* node,
|
||||||
ValueUsage valueUsage = ValueUsage::WantValue);
|
ValueUsage valueUsage = ValueUsage::WantValue);
|
||||||
|
|
||||||
MOZ_NEVER_INLINE MOZ_MUST_USE bool emitIncOrDec(ParseNode* pn);
|
MOZ_NEVER_INLINE MOZ_MUST_USE bool emitIncOrDec(UnaryNode* incDec);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitConditionalExpression(ConditionalExpression& conditional,
|
MOZ_MUST_USE bool emitConditionalExpression(ConditionalExpression& conditional,
|
||||||
ValueUsage valueUsage = ValueUsage::WantValue);
|
ValueUsage valueUsage = ValueUsage::WantValue);
|
||||||
|
|
@ -751,11 +747,10 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
MOZ_MUST_USE bool emitOptimizeSpread(ParseNode* arg0, JumpList* jmp, bool* emitted);
|
MOZ_MUST_USE bool emitOptimizeSpread(ParseNode* arg0, JumpList* jmp, bool* emitted);
|
||||||
|
|
||||||
MOZ_MUST_USE ParseNode* getCoordNode(ParseNode* callNode, ParseNode* calleeNode,
|
MOZ_MUST_USE ParseNode* getCoordNode(ParseNode* callNode, ParseNode* calleeNode,
|
||||||
ParseNode* firstArgNode);
|
ListNode* argsList);
|
||||||
MOZ_MUST_USE bool emitArguments(ParseNode* firstArgNode, uint32_t argc,
|
MOZ_MUST_USE bool emitArguments(ListNode* argsList, bool isCall, bool isSpread,
|
||||||
bool isCall, bool isSpread,
|
|
||||||
CallOrNewEmitter& cone);
|
CallOrNewEmitter& cone);
|
||||||
MOZ_MUST_USE bool emitCallOrNew(ParseNode* pn,
|
MOZ_MUST_USE bool emitCallOrNew(BinaryNode* pn,
|
||||||
ValueUsage valueUsage = ValueUsage::WantValue);
|
ValueUsage valueUsage = ValueUsage::WantValue);
|
||||||
MOZ_MUST_USE bool emitCalleeAndThis(ParseNode* callNode,
|
MOZ_MUST_USE bool emitCalleeAndThis(ParseNode* callNode,
|
||||||
ParseNode* calleeNode,
|
ParseNode* calleeNode,
|
||||||
|
|
@ -765,31 +760,31 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
CallOrNewEmitter& cone,
|
CallOrNewEmitter& cone,
|
||||||
OptionalEmitter& oe);
|
OptionalEmitter& oe);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitSelfHostedCallFunction(ParseNode* pn);
|
MOZ_MUST_USE bool emitSelfHostedCallFunction(BinaryNode* callNode);
|
||||||
MOZ_MUST_USE bool emitSelfHostedResumeGenerator(ParseNode* pn);
|
MOZ_MUST_USE bool emitSelfHostedResumeGenerator(BinaryNode* callNode);
|
||||||
MOZ_MUST_USE bool emitSelfHostedForceInterpreter(ParseNode* pn);
|
MOZ_MUST_USE bool emitSelfHostedForceInterpreter(ParseNode* pn);
|
||||||
MOZ_MUST_USE bool emitSelfHostedAllowContentIter(ParseNode* pn);
|
MOZ_MUST_USE bool emitSelfHostedAllowContentIter(BinaryNode* callNode);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitComprehensionFor(ParseNode* compFor);
|
MOZ_MUST_USE bool emitComprehensionFor(ForNode* forNode);
|
||||||
MOZ_MUST_USE bool emitComprehensionForIn(ParseNode* pn);
|
MOZ_MUST_USE bool emitComprehensionForIn(ForNode* forNode);
|
||||||
MOZ_MUST_USE bool emitComprehensionForInOrOfVariables(ParseNode* pn, bool* lexicalScope);
|
MOZ_MUST_USE bool emitComprehensionForInOrOfVariables(ParseNode* pn, bool* lexicalScope);
|
||||||
MOZ_MUST_USE bool emitComprehensionForOf(ParseNode* pn);
|
MOZ_MUST_USE bool emitComprehensionForOf(ForNode* forNode);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitDo(ParseNode* pn);
|
MOZ_MUST_USE bool emitDo(BinaryNode* doNode);
|
||||||
MOZ_MUST_USE bool emitWhile(ParseNode* pn);
|
MOZ_MUST_USE bool emitWhile(BinaryNode* whileNode);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitFor(ParseNode* pn, EmitterScope* headLexicalEmitterScope = nullptr);
|
MOZ_MUST_USE bool emitFor(ForNode* forNode, EmitterScope* headLexicalEmitterScope = nullptr);
|
||||||
MOZ_MUST_USE bool emitCStyleFor(ParseNode* pn, EmitterScope* headLexicalEmitterScope);
|
MOZ_MUST_USE bool emitCStyleFor(ForNode* forNode, EmitterScope* headLexicalEmitterScope);
|
||||||
MOZ_MUST_USE bool emitForIn(ParseNode* pn, EmitterScope* headLexicalEmitterScope);
|
MOZ_MUST_USE bool emitForIn(ForNode* forNode, EmitterScope* headLexicalEmitterScope);
|
||||||
MOZ_MUST_USE bool emitForOf(ParseNode* pn, EmitterScope* headLexicalEmitterScope);
|
MOZ_MUST_USE bool emitForOf(ForNode* forNode, EmitterScope* headLexicalEmitterScope);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitInitializeForInOrOfTarget(ParseNode* forHead);
|
MOZ_MUST_USE bool emitInitializeForInOrOfTarget(TernaryNode* forHead);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitBreak(PropertyName* label);
|
MOZ_MUST_USE bool emitBreak(PropertyName* label);
|
||||||
MOZ_MUST_USE bool emitContinue(PropertyName* label);
|
MOZ_MUST_USE bool emitContinue(PropertyName* label);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitFunctionFormalParametersAndBody(ParseNode* pn);
|
MOZ_MUST_USE bool emitFunctionFormalParametersAndBody(ListNode* paramsBody);
|
||||||
MOZ_MUST_USE bool emitFunctionFormalParameters(ParseNode* pn);
|
MOZ_MUST_USE bool emitFunctionFormalParameters(ListNode* paramsBody);
|
||||||
MOZ_MUST_USE bool emitInitializeFunctionSpecialNames();
|
MOZ_MUST_USE bool emitInitializeFunctionSpecialNames();
|
||||||
MOZ_MUST_USE bool emitFunctionBody(ParseNode* pn);
|
MOZ_MUST_USE bool emitFunctionBody(ParseNode* pn);
|
||||||
MOZ_MUST_USE bool emitLexicalInitialization(ParseNode* pn);
|
MOZ_MUST_USE bool emitLexicalInitialization(ParseNode* pn);
|
||||||
|
|
@ -804,10 +799,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
// iteration count). The stack after iteration will look like |ARRAY INDEX|.
|
// iteration count). The stack after iteration will look like |ARRAY INDEX|.
|
||||||
MOZ_MUST_USE bool emitSpread(bool allowSelfHosted = false);
|
MOZ_MUST_USE bool emitSpread(bool allowSelfHosted = false);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitClass(ParseNode* pn);
|
MOZ_MUST_USE bool emitClass(ClassNode* classNode);
|
||||||
MOZ_MUST_USE bool emitSuperElemOperands(ParseNode* pn,
|
|
||||||
EmitElemOption opts = EmitElemOption::Get);
|
|
||||||
MOZ_MUST_USE bool emitSuperElemOp(ParseNode* pn, JSOp op, bool isCall = false);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class MOZ_RAII AutoCheckUnstableEmitterScope {
|
class MOZ_RAII AutoCheckUnstableEmitterScope {
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ ElemOpEmitter::prepareForKey()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isCall()) {
|
if (isCall()) {
|
||||||
|
// We need a second |this| that will be consumed during computation of
|
||||||
|
// the property value. (The original |this| is passed to the call.)
|
||||||
if (!bce_->emit1(JSOP_DUP)) { // [Super]
|
if (!bce_->emit1(JSOP_DUP)) { // [Super]
|
||||||
// // THIS THIS
|
// // THIS THIS
|
||||||
// // [Other]
|
// // [Other]
|
||||||
|
|
@ -60,6 +62,8 @@ ElemOpEmitter::emitGet()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(state_ == State::Key);
|
MOZ_ASSERT(state_ == State::Key);
|
||||||
|
|
||||||
|
// We need to convert the key to an object id first, so that we do not do
|
||||||
|
// it inside both the GETELEM and the SETELEM.
|
||||||
if (isIncDec() || isCompoundAssignment()) {
|
if (isIncDec() || isCompoundAssignment()) {
|
||||||
if (!bce_->emit1(JSOP_TOID)) { // [Super]
|
if (!bce_->emit1(JSOP_TOID)) { // [Super]
|
||||||
// // THIS KEY
|
// // THIS KEY
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -73,35 +73,39 @@ class NameResolver
|
||||||
*/
|
*/
|
||||||
bool nameExpression(ParseNode* n, bool* foundName) {
|
bool nameExpression(ParseNode* n, bool* foundName) {
|
||||||
switch (n->getKind()) {
|
switch (n->getKind()) {
|
||||||
case PNK_DOT:
|
case PNK_DOT: {
|
||||||
if (!nameExpression(n->expr(), foundName))
|
PropertyAccess* prop = &n->as<PropertyAccess>();
|
||||||
|
if (!nameExpression(&prop->expression(), foundName))
|
||||||
return false;
|
return false;
|
||||||
if (!*foundName)
|
if (!*foundName)
|
||||||
return true;
|
return true;
|
||||||
return appendPropertyReference(n->pn_atom);
|
return appendPropertyReference(prop->right()->as<NameNode>().atom());
|
||||||
|
}
|
||||||
|
|
||||||
case PNK_NAME:
|
case PNK_NAME:
|
||||||
*foundName = true;
|
*foundName = true;
|
||||||
return buf->append(n->pn_atom);
|
return buf->append(n->as<NameNode>().atom());
|
||||||
|
|
||||||
case PNK_THIS:
|
case PNK_THIS:
|
||||||
*foundName = true;
|
*foundName = true;
|
||||||
return buf->append("this");
|
return buf->append("this");
|
||||||
|
|
||||||
case PNK_ELEM:
|
case PNK_ELEM: {
|
||||||
if (!nameExpression(n->pn_left, foundName))
|
PropertyByValue* elem = &n->as<PropertyByValue>();
|
||||||
|
if (!nameExpression(&elem->expression(), foundName))
|
||||||
return false;
|
return false;
|
||||||
if (!*foundName)
|
if (!*foundName)
|
||||||
return true;
|
return true;
|
||||||
if (!buf->append('[') || !nameExpression(n->pn_right, foundName))
|
if (!buf->append('[') || !nameExpression(elem->right(), foundName))
|
||||||
return false;
|
return false;
|
||||||
if (!*foundName)
|
if (!*foundName)
|
||||||
return true;
|
return true;
|
||||||
return buf->append(']');
|
return buf->append(']');
|
||||||
|
}
|
||||||
|
|
||||||
case PNK_NUMBER:
|
case PNK_NUMBER:
|
||||||
*foundName = true;
|
*foundName = true;
|
||||||
return appendNumber(n->pn_dval);
|
return appendNumber(n->as<NumericLiteral>().value());
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* We're confused as to what to call this function. */
|
/* We're confused as to what to call this function. */
|
||||||
|
|
@ -128,7 +132,7 @@ class NameResolver
|
||||||
|
|
||||||
for (int pos = nparents - 1; pos >= 0; pos--) {
|
for (int pos = nparents - 1; pos >= 0; pos--) {
|
||||||
ParseNode* cur = parents[pos];
|
ParseNode* cur = parents[pos];
|
||||||
if (cur->isAssignment())
|
if (cur->is<AssignmentNode>())
|
||||||
return cur;
|
return cur;
|
||||||
|
|
||||||
switch (cur->getKind()) {
|
switch (cur->getKind()) {
|
||||||
|
|
@ -186,11 +190,9 @@ class NameResolver
|
||||||
* listed, then it is skipped. Otherwise an intelligent name is guessed to
|
* listed, then it is skipped. Otherwise an intelligent name is guessed to
|
||||||
* assign to the function's displayAtom field.
|
* assign to the function's displayAtom field.
|
||||||
*/
|
*/
|
||||||
bool resolveFun(ParseNode* pn, HandleAtom prefix, MutableHandleAtom retAtom) {
|
bool resolveFun(FunctionNode* funNode, HandleAtom prefix, MutableHandleAtom retAtom) {
|
||||||
MOZ_ASSERT(pn != nullptr);
|
MOZ_ASSERT(funNode != nullptr);
|
||||||
MOZ_ASSERT(pn->isKind(PNK_FUNCTION));
|
RootedFunction fun(cx, funNode->funbox()->function());
|
||||||
MOZ_ASSERT(pn->isArity(PN_CODE));
|
|
||||||
RootedFunction fun(cx, pn->pn_funbox->function());
|
|
||||||
|
|
||||||
StringBuffer buf(cx);
|
StringBuffer buf(cx);
|
||||||
this->buf = &buf;
|
this->buf = &buf;
|
||||||
|
|
@ -222,8 +224,8 @@ class NameResolver
|
||||||
|
|
||||||
/* If the function is assigned to something, then that is very relevant */
|
/* If the function is assigned to something, then that is very relevant */
|
||||||
if (assignment) {
|
if (assignment) {
|
||||||
if (assignment->isAssignment())
|
if (assignment->is<AssignmentNode>())
|
||||||
assignment = assignment->pn_left;
|
assignment = assignment->as<AssignmentNode>().left();
|
||||||
bool foundName = false;
|
bool foundName = false;
|
||||||
if (!nameExpression(assignment, &foundName))
|
if (!nameExpression(assignment, &foundName))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -240,12 +242,12 @@ class NameResolver
|
||||||
ParseNode* node = toName[pos];
|
ParseNode* node = toName[pos];
|
||||||
|
|
||||||
if (node->isKind(PNK_COLON) || node->isKind(PNK_SHORTHAND)) {
|
if (node->isKind(PNK_COLON) || node->isKind(PNK_SHORTHAND)) {
|
||||||
ParseNode* left = node->pn_left;
|
ParseNode* left = node->as<BinaryNode>().left();
|
||||||
if (left->isKind(PNK_OBJECT_PROPERTY_NAME) || left->isKind(PNK_STRING)) {
|
if (left->isKind(PNK_OBJECT_PROPERTY_NAME) || left->isKind(PNK_STRING)) {
|
||||||
if (!appendPropertyReference(left->pn_atom))
|
if (!appendPropertyReference(left->as<NameNode>().atom()))
|
||||||
return false;
|
return false;
|
||||||
} else if (left->isKind(PNK_NUMBER)) {
|
} else if (left->isKind(PNK_NUMBER)) {
|
||||||
if (!appendNumericPropertyReference(left->pn_dval))
|
if (!appendNumericPropertyReference(left->as<NumericLiteral>().value()))
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
MOZ_ASSERT(left->isKind(PNK_COMPUTED_NAME));
|
MOZ_ASSERT(left->isKind(PNK_COMPUTED_NAME));
|
||||||
|
|
@ -284,12 +286,12 @@ class NameResolver
|
||||||
* for new variables and then return an anonymous function using this scope.
|
* for new variables and then return an anonymous function using this scope.
|
||||||
*/
|
*/
|
||||||
bool isDirectCall(int pos, ParseNode* cur) {
|
bool isDirectCall(int pos, ParseNode* cur) {
|
||||||
return pos >= 0 && call(parents[pos]) && parents[pos]->pn_head == cur;
|
return pos >= 0 && call(parents[pos]) && parents[pos]->as<BinaryNode>().left() == cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool resolveTemplateLiteral(ParseNode* node, HandleAtom prefix) {
|
bool resolveTemplateLiteral(ListNode* node, HandleAtom prefix) {
|
||||||
MOZ_ASSERT(node->isKind(PNK_TEMPLATE_STRING_LIST));
|
MOZ_ASSERT(node->isKind(PNK_TEMPLATE_STRING_LIST));
|
||||||
ParseNode* element = node->pn_head;
|
ParseNode* element = node->head();
|
||||||
while (true) {
|
while (true) {
|
||||||
MOZ_ASSERT(element->isKind(PNK_TEMPLATE_STRING));
|
MOZ_ASSERT(element->isKind(PNK_TEMPLATE_STRING));
|
||||||
|
|
||||||
|
|
@ -304,29 +306,32 @@ class NameResolver
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool resolveTaggedTemplate(ParseNode* node, HandleAtom prefix) {
|
bool resolveTaggedTemplate(BinaryNode* taggedTemplate, HandleAtom prefix) {
|
||||||
MOZ_ASSERT(node->isKind(PNK_TAGGED_TEMPLATE));
|
MOZ_ASSERT(taggedTemplate->isKind(PNK_TAGGED_TEMPLATE));
|
||||||
|
|
||||||
ParseNode* element = node->pn_head;
|
ParseNode* tag = taggedTemplate->left();
|
||||||
|
|
||||||
// The list head is a leading expression, e.g. |tag| in |tag`foo`|,
|
// The leading expression, e.g. |tag| in |tag`foo`|,
|
||||||
// that might contain functions.
|
// that might contain functions.
|
||||||
if (!resolve(element, prefix))
|
if (!resolve(tag, prefix))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Next is the callsite object node. This node only contains
|
// The callsite object node is first. This node only contains
|
||||||
// internal strings or undefined and an array -- no user-controlled
|
// internal strings or undefined and an array -- no user-controlled
|
||||||
// expressions.
|
// expressions.
|
||||||
element = element->pn_next;
|
CallSiteNode* element =
|
||||||
|
&taggedTemplate->right()->as<ListNode>().head()->as<CallSiteNode>();
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(element->isKind(PNK_CALLSITEOBJ));
|
ListNode* rawNodes = &element->head()->as<ListNode>();
|
||||||
ParseNode* array = element->pn_head;
|
MOZ_ASSERT(rawNodes->isKind(PNK_ARRAY));
|
||||||
MOZ_ASSERT(array->isKind(PNK_ARRAY));
|
for (ParseNode* raw : rawNodes->contents()) {
|
||||||
for (ParseNode* kid = array->pn_head; kid; kid = kid->pn_next)
|
MOZ_ASSERT(raw->isKind(PNK_TEMPLATE_STRING));
|
||||||
MOZ_ASSERT(kid->isKind(PNK_TEMPLATE_STRING));
|
}
|
||||||
for (ParseNode* next = array->pn_next; next; next = next->pn_next)
|
for (ParseNode* cooked : element->contentsFrom(rawNodes->pn_next)) {
|
||||||
MOZ_ASSERT(next->isKind(PNK_TEMPLATE_STRING) || next->isKind(PNK_RAW_UNDEFINED));
|
MOZ_ASSERT(cooked->isKind(PNK_TEMPLATE_STRING) ||
|
||||||
|
cooked->isKind(PNK_RAW_UNDEFINED));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -353,10 +358,9 @@ class NameResolver
|
||||||
if (cur == nullptr)
|
if (cur == nullptr)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
MOZ_ASSERT((cur->isKind(PNK_FUNCTION) || cur->isKind(PNK_MODULE)) == cur->isArity(PN_CODE));
|
if (cur->is<FunctionNode>()) {
|
||||||
if (cur->isKind(PNK_FUNCTION)) {
|
|
||||||
RootedAtom prefix2(cx);
|
RootedAtom prefix2(cx);
|
||||||
if (!resolveFun(cur, prefix, &prefix2))
|
if (!resolveFun(&cur->as<FunctionNode>(), prefix, &prefix2))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -376,37 +380,55 @@ class NameResolver
|
||||||
// Nodes with no children that might require name resolution need no
|
// Nodes with no children that might require name resolution need no
|
||||||
// further work.
|
// further work.
|
||||||
case PNK_NOP:
|
case PNK_NOP:
|
||||||
case PNK_STRING:
|
|
||||||
case PNK_TEMPLATE_STRING:
|
|
||||||
case PNK_REGEXP:
|
|
||||||
case PNK_TRUE:
|
case PNK_TRUE:
|
||||||
case PNK_FALSE:
|
case PNK_FALSE:
|
||||||
case PNK_NULL:
|
case PNK_NULL:
|
||||||
case PNK_RAW_UNDEFINED:
|
case PNK_RAW_UNDEFINED:
|
||||||
case PNK_ELISION:
|
case PNK_ELISION:
|
||||||
case PNK_GENERATOR:
|
case PNK_GENERATOR:
|
||||||
case PNK_NUMBER:
|
|
||||||
case PNK_BREAK:
|
|
||||||
case PNK_CONTINUE:
|
|
||||||
case PNK_DEBUGGER:
|
|
||||||
case PNK_EXPORT_BATCH_SPEC:
|
case PNK_EXPORT_BATCH_SPEC:
|
||||||
case PNK_OBJECT_PROPERTY_NAME:
|
|
||||||
case PNK_POSHOLDER:
|
case PNK_POSHOLDER:
|
||||||
MOZ_ASSERT(cur->isArity(PN_NULLARY));
|
MOZ_ASSERT(cur->is<NullaryNode>());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PNK_DEBUGGER:
|
||||||
|
MOZ_ASSERT(cur->is<DebuggerStatement>());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PNK_BREAK:
|
||||||
|
MOZ_ASSERT(cur->is<BreakStatement>());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PNK_CONTINUE:
|
||||||
|
MOZ_ASSERT(cur->is<ContinueStatement>());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PNK_OBJECT_PROPERTY_NAME:
|
||||||
|
case PNK_STRING:
|
||||||
|
case PNK_TEMPLATE_STRING:
|
||||||
|
MOZ_ASSERT(cur->is<NameNode>());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PNK_REGEXP:
|
||||||
|
MOZ_ASSERT(cur->is<RegExpLiteral>());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PNK_NUMBER:
|
||||||
|
MOZ_ASSERT(cur->is<NumericLiteral>());
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
case PNK_TYPEOFNAME:
|
case PNK_TYPEOFNAME:
|
||||||
case PNK_SUPERBASE:
|
case PNK_SUPERBASE:
|
||||||
MOZ_ASSERT(cur->isArity(PN_UNARY));
|
MOZ_ASSERT(cur->as<UnaryNode>().kid()->isKind(PNK_NAME));
|
||||||
MOZ_ASSERT(cur->pn_kid->isKind(PNK_NAME));
|
MOZ_ASSERT(!cur->as<UnaryNode>().kid()->as<NameNode>().initializer());
|
||||||
MOZ_ASSERT(!cur->pn_kid->expr());
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PNK_NEWTARGET:
|
case PNK_NEWTARGET: {
|
||||||
MOZ_ASSERT(cur->isArity(PN_BINARY));
|
MOZ_ASSERT(cur->as<BinaryNode>().left()->isKind(PNK_POSHOLDER));
|
||||||
MOZ_ASSERT(cur->pn_left->isKind(PNK_POSHOLDER));
|
MOZ_ASSERT(cur->as<BinaryNode>().right()->isKind(PNK_POSHOLDER));
|
||||||
MOZ_ASSERT(cur->pn_right->isKind(PNK_POSHOLDER));
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Nodes with a single non-null child requiring name resolution.
|
// Nodes with a single non-null child requiring name resolution.
|
||||||
case PNK_TYPEOFEXPR:
|
case PNK_TYPEOFEXPR:
|
||||||
|
|
@ -429,16 +451,14 @@ class NameResolver
|
||||||
case PNK_SPREAD:
|
case PNK_SPREAD:
|
||||||
case PNK_MUTATEPROTO:
|
case PNK_MUTATEPROTO:
|
||||||
case PNK_EXPORT:
|
case PNK_EXPORT:
|
||||||
MOZ_ASSERT(cur->isArity(PN_UNARY));
|
if (!resolve(cur->as<UnaryNode>().kid(), prefix))
|
||||||
if (!resolve(cur->pn_kid, prefix))
|
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Nodes with a single nullable child.
|
// Nodes with a single nullable child.
|
||||||
case PNK_SEMI:
|
case PNK_SEMI:
|
||||||
case PNK_THIS:
|
case PNK_THIS:
|
||||||
MOZ_ASSERT(cur->isArity(PN_UNARY));
|
if (ParseNode* expr = cur->as<UnaryNode>().kid()) {
|
||||||
if (ParseNode* expr = cur->pn_kid) {
|
|
||||||
if (!resolve(expr, prefix))
|
if (!resolve(expr, prefix))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -466,64 +486,70 @@ class NameResolver
|
||||||
case PNK_FOR:
|
case PNK_FOR:
|
||||||
case PNK_COMPREHENSIONFOR:
|
case PNK_COMPREHENSIONFOR:
|
||||||
case PNK_CLASSMETHOD:
|
case PNK_CLASSMETHOD:
|
||||||
case PNK_SETTHIS:
|
case PNK_SETTHIS: {
|
||||||
MOZ_ASSERT(cur->isArity(PN_BINARY));
|
BinaryNode* node = &cur->as<BinaryNode>();
|
||||||
if (!resolve(cur->pn_left, prefix))
|
if (!resolve(node->left(), prefix)) {
|
||||||
return false;
|
return false;
|
||||||
if (!resolve(cur->pn_right, prefix))
|
}
|
||||||
|
if (!resolve(node->right(), prefix)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case PNK_ELEM: {
|
||||||
|
PropertyByValue* elem = &cur->as<PropertyByValue>();
|
||||||
|
if (!elem->isSuper() && !resolve(&elem->expression(), prefix))
|
||||||
|
return false;
|
||||||
|
if (!resolve(&elem->key(), prefix))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case PNK_ELEM:
|
case PNK_WITH: {
|
||||||
MOZ_ASSERT(cur->isArity(PN_BINARY));
|
BinaryNode* node = &cur->as<BinaryNode>();
|
||||||
if (!cur->as<PropertyByValue>().isSuper() && !resolve(cur->pn_left, prefix))
|
if (!resolve(node->left(), prefix))
|
||||||
return false;
|
return false;
|
||||||
if (!resolve(cur->pn_right, prefix))
|
if (!resolve(node->right(), prefix))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case PNK_WITH:
|
case PNK_CASE: {
|
||||||
MOZ_ASSERT(cur->isArity(PN_BINARY));
|
CaseClause* caseClause = &cur->as<CaseClause>();
|
||||||
if (!resolve(cur->pn_left, prefix))
|
if (ParseNode* caseExpr = caseClause->caseExpression()) {
|
||||||
return false;
|
|
||||||
if (!resolve(cur->pn_right, prefix))
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PNK_CASE:
|
|
||||||
MOZ_ASSERT(cur->isArity(PN_BINARY));
|
|
||||||
if (ParseNode* caseExpr = cur->pn_left) {
|
|
||||||
if (!resolve(caseExpr, prefix))
|
if (!resolve(caseExpr, prefix))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!resolve(cur->pn_right, prefix))
|
if (!resolve(caseClause->statementList(), prefix))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case PNK_INITIALYIELD:
|
case PNK_INITIALYIELD: {
|
||||||
MOZ_ASSERT(cur->pn_kid->isKind(PNK_ASSIGN) &&
|
#ifdef DEBUG
|
||||||
cur->pn_kid->pn_left->isKind(PNK_NAME) &&
|
AssignmentNode* assignNode = &cur->as<UnaryNode>().kid()->as<AssignmentNode>();
|
||||||
cur->pn_kid->pn_right->isKind(PNK_GENERATOR));
|
MOZ_ASSERT(assignNode->left()->isKind(PNK_NAME));
|
||||||
|
MOZ_ASSERT(assignNode->right()->isKind(PNK_GENERATOR));
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case PNK_YIELD_STAR:
|
case PNK_YIELD_STAR:
|
||||||
MOZ_ASSERT(cur->isArity(PN_UNARY));
|
if (!resolve(cur->as<UnaryNode>().kid(), prefix))
|
||||||
if (!resolve(cur->pn_kid, prefix))
|
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PNK_YIELD:
|
case PNK_YIELD:
|
||||||
case PNK_AWAIT:
|
case PNK_AWAIT:
|
||||||
MOZ_ASSERT(cur->isArity(PN_UNARY));
|
if (ParseNode* expr = cur->as<UnaryNode>().kid()) {
|
||||||
if (cur->pn_kid) {
|
if (!resolve(expr, prefix))
|
||||||
if (!resolve(cur->pn_kid, prefix))
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PNK_RETURN:
|
case PNK_RETURN:
|
||||||
MOZ_ASSERT(cur->isArity(PN_UNARY));
|
if (ParseNode* returnValue = cur->as<UnaryNode>().kid()) {
|
||||||
if (ParseNode* returnValue = cur->pn_kid) {
|
|
||||||
if (!resolve(returnValue, prefix))
|
if (!resolve(returnValue, prefix))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -531,27 +557,30 @@ class NameResolver
|
||||||
|
|
||||||
case PNK_IMPORT:
|
case PNK_IMPORT:
|
||||||
case PNK_EXPORT_FROM:
|
case PNK_EXPORT_FROM:
|
||||||
case PNK_EXPORT_DEFAULT:
|
case PNK_EXPORT_DEFAULT: {
|
||||||
|
BinaryNode* node = &cur->as<BinaryNode>();
|
||||||
MOZ_ASSERT(cur->isArity(PN_BINARY));
|
MOZ_ASSERT(cur->isArity(PN_BINARY));
|
||||||
// The left halves of these nodes don't contain any unconstrained
|
// The left halves of these nodes don't contain any unconstrained
|
||||||
// expressions, but it's very hard to assert this to safely rely on
|
// expressions, but it's very hard to assert this to safely rely on
|
||||||
// it. So recur anyway.
|
// it. So recur anyway.
|
||||||
if (!resolve(cur->pn_left, prefix))
|
if (!resolve(node->left(), prefix))
|
||||||
return false;
|
return false;
|
||||||
MOZ_ASSERT_IF(!cur->isKind(PNK_EXPORT_DEFAULT),
|
MOZ_ASSERT_IF(!node->isKind(PNK_EXPORT_DEFAULT),
|
||||||
cur->pn_right->isKind(PNK_STRING));
|
node->right()->isKind(PNK_STRING));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Ternary nodes with three expression children.
|
// Ternary nodes with three expression children.
|
||||||
case PNK_CONDITIONAL:
|
case PNK_CONDITIONAL: {
|
||||||
MOZ_ASSERT(cur->isArity(PN_TERNARY));
|
TernaryNode* condNode = &cur->as<TernaryNode>();
|
||||||
if (!resolve(cur->pn_kid1, prefix))
|
if (!resolve(condNode->kid1(), prefix))
|
||||||
return false;
|
return false;
|
||||||
if (!resolve(cur->pn_kid2, prefix))
|
if (!resolve(condNode->kid2(), prefix))
|
||||||
return false;
|
return false;
|
||||||
if (!resolve(cur->pn_kid3, prefix))
|
if (!resolve(condNode->kid3(), prefix))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// The first part of a for-in/of is the declaration in the loop (or
|
// The first part of a for-in/of is the declaration in the loop (or
|
||||||
// null if no declaration). The latter two parts are the location
|
// null if no declaration). The latter two parts are the location
|
||||||
|
|
@ -560,107 +589,116 @@ class NameResolver
|
||||||
// computed property names, and possibly through [deprecated!]
|
// computed property names, and possibly through [deprecated!]
|
||||||
// initializers) also contain functions to name.
|
// initializers) also contain functions to name.
|
||||||
case PNK_FORIN:
|
case PNK_FORIN:
|
||||||
case PNK_FOROF:
|
case PNK_FOROF: {
|
||||||
MOZ_ASSERT(cur->isArity(PN_TERNARY));
|
TernaryNode* forHead = &cur->as<TernaryNode>();
|
||||||
if (ParseNode* decl = cur->pn_kid1) {
|
if (ParseNode* decl = forHead->kid1()) {
|
||||||
if (!resolve(decl, prefix))
|
if (!resolve(decl, prefix))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!resolve(cur->pn_kid2, prefix))
|
MOZ_ASSERT(!forHead->kid2());
|
||||||
return false;
|
if (!resolve(forHead->kid3(), prefix))
|
||||||
if (!resolve(cur->pn_kid3, prefix))
|
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Every part of a for(;;) head may contain a function needing name
|
// Every part of a for(;;) head may contain a function needing name
|
||||||
// resolution.
|
// resolution.
|
||||||
case PNK_FORHEAD:
|
case PNK_FORHEAD: {
|
||||||
MOZ_ASSERT(cur->isArity(PN_TERNARY));
|
TernaryNode* forHead = &cur->as<TernaryNode>();
|
||||||
if (ParseNode* init = cur->pn_kid1) {
|
if (ParseNode* init = forHead->kid1()) {
|
||||||
if (!resolve(init, prefix))
|
if (!resolve(init, prefix))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (ParseNode* cond = cur->pn_kid2) {
|
if (ParseNode* cond = forHead->kid2()) {
|
||||||
if (!resolve(cond, prefix))
|
if (!resolve(cond, prefix))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (ParseNode* step = cur->pn_kid3) {
|
if (ParseNode* update = forHead->kid3()) {
|
||||||
if (!resolve(step, prefix))
|
if (!resolve(update, prefix))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// The first child of a class is a pair of names referring to it,
|
// The first child of a class is a pair of names referring to it,
|
||||||
// inside and outside the class. The second is the class's heritage,
|
// inside and outside the class. The second is the class's heritage,
|
||||||
// if any. The third is the class body.
|
// if any. The third is the class body.
|
||||||
case PNK_CLASS:
|
case PNK_CLASS: {
|
||||||
MOZ_ASSERT(cur->isArity(PN_TERNARY));
|
ClassNode* classNode = &cur->as<ClassNode>();
|
||||||
MOZ_ASSERT_IF(cur->pn_kid1, cur->pn_kid1->isKind(PNK_CLASSNAMES));
|
#ifdef DEBUG
|
||||||
MOZ_ASSERT_IF(cur->pn_kid1, cur->pn_kid1->isArity(PN_BINARY));
|
if (classNode->names()) {
|
||||||
MOZ_ASSERT_IF(cur->pn_kid1 && cur->pn_kid1->pn_left,
|
ClassNames* names = classNode->names();
|
||||||
cur->pn_kid1->pn_left->isKind(PNK_NAME));
|
if (NameNode* outerBinding = names->outerBinding()) {
|
||||||
MOZ_ASSERT_IF(cur->pn_kid1 && cur->pn_kid1->pn_left,
|
MOZ_ASSERT(outerBinding->isKind(PNK_NAME));
|
||||||
!cur->pn_kid1->pn_left->expr());
|
MOZ_ASSERT(!outerBinding->initializer());
|
||||||
MOZ_ASSERT_IF(cur->pn_kid1, cur->pn_kid1->pn_right->isKind(PNK_NAME));
|
}
|
||||||
MOZ_ASSERT_IF(cur->pn_kid1, !cur->pn_kid1->pn_right->expr());
|
|
||||||
if (cur->pn_kid2) {
|
NameNode* innerBinding = names->innerBinding();
|
||||||
if (!resolve(cur->pn_kid2, prefix))
|
MOZ_ASSERT(innerBinding->isKind(PNK_NAME));
|
||||||
|
MOZ_ASSERT(!innerBinding->initializer());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (ParseNode* heritage = classNode->heritage()) {
|
||||||
|
if (!resolve(heritage, prefix))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!resolve(cur->pn_kid3, prefix))
|
if (!resolve(classNode->methodList(), prefix))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// The condition and consequent are non-optional, but the alternative
|
// The condition and consequent are non-optional, but the alternative
|
||||||
// might be omitted.
|
// might be omitted.
|
||||||
case PNK_IF:
|
case PNK_IF: {
|
||||||
MOZ_ASSERT(cur->isArity(PN_TERNARY));
|
TernaryNode* ifNode = &cur->as<TernaryNode>();
|
||||||
if (!resolve(cur->pn_kid1, prefix))
|
if (!resolve(ifNode->kid1(), prefix))
|
||||||
return false;
|
return false;
|
||||||
if (!resolve(cur->pn_kid2, prefix))
|
if (!resolve(ifNode->kid2(), prefix))
|
||||||
return false;
|
return false;
|
||||||
if (cur->pn_kid3) {
|
if (ParseNode* alternative = ifNode->kid3()) {
|
||||||
if (!resolve(cur->pn_kid3, prefix))
|
if (!resolve(alternative, prefix))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// The statements in the try-block are mandatory. The catch-blocks
|
// The statements in the try-block are mandatory. The catch-blocks
|
||||||
// and finally block are optional (but at least one or the other must
|
// and finally block are optional (but at least one or the other must
|
||||||
// be present).
|
// be present).
|
||||||
case PNK_TRY:
|
case PNK_TRY: {
|
||||||
MOZ_ASSERT(cur->isArity(PN_TERNARY));
|
TryNode* tryNode = &cur->as<TryNode>();
|
||||||
if (!resolve(cur->pn_kid1, prefix))
|
if (!resolve(tryNode->body(), prefix))
|
||||||
return false;
|
return false;
|
||||||
MOZ_ASSERT(cur->pn_kid2 || cur->pn_kid3);
|
MOZ_ASSERT(tryNode->catchList() || tryNode->finallyBlock());
|
||||||
if (ParseNode* catchList = cur->pn_kid2) {
|
if (ListNode* catchList = tryNode->catchList()) {
|
||||||
MOZ_ASSERT(catchList->isKind(PNK_CATCHLIST));
|
|
||||||
if (!resolve(catchList, prefix))
|
if (!resolve(catchList, prefix))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (ParseNode* finallyBlock = cur->pn_kid3) {
|
if (ParseNode* finallyBlock = tryNode->finallyBlock()) {
|
||||||
if (!resolve(finallyBlock, prefix))
|
if (!resolve(finallyBlock, prefix))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// The first child, the catch-pattern, may contain functions via
|
// The first child, the catch-pattern, may contain functions via
|
||||||
// computed property names. The optional catch-conditions may
|
// computed property names. The optional catch-conditions may
|
||||||
// contain any expression. The catch statements, of course, may
|
// contain any expression. The catch statements, of course, may
|
||||||
// contain arbitrary expressions.
|
// contain arbitrary expressions.
|
||||||
case PNK_CATCH:
|
case PNK_CATCH: {
|
||||||
MOZ_ASSERT(cur->isArity(PN_TERNARY));
|
TernaryNode* catchNode = &cur->as<TernaryNode>();
|
||||||
if (cur->pn_kid1) {
|
if (ParseNode* patNode = catchNode->kid1()) {
|
||||||
if (!resolve(cur->pn_kid1, prefix))
|
if (!resolve(patNode, prefix))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (cur->pn_kid2) {
|
if (ParseNode* condNode = catchNode->kid2()) {
|
||||||
if (!resolve(cur->pn_kid2, prefix))
|
if (!resolve(condNode, prefix))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!resolve(cur->pn_kid3, prefix))
|
if (!resolve(catchNode->kid3(), prefix))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Nodes with arbitrary-expression children.
|
// Nodes with arbitrary-expression children.
|
||||||
case PNK_COALESCE:
|
case PNK_COALESCE:
|
||||||
|
|
@ -689,10 +727,6 @@ class NameResolver
|
||||||
case PNK_MOD:
|
case PNK_MOD:
|
||||||
case PNK_POW:
|
case PNK_POW:
|
||||||
case PNK_COMMA:
|
case PNK_COMMA:
|
||||||
case PNK_NEW:
|
|
||||||
case PNK_CALL:
|
|
||||||
case PNK_SUPERCALL:
|
|
||||||
case PNK_GENEXP:
|
|
||||||
case PNK_ARRAY:
|
case PNK_ARRAY:
|
||||||
case PNK_STATEMENTLIST:
|
case PNK_STATEMENTLIST:
|
||||||
case PNK_PARAMSBODY:
|
case PNK_PARAMSBODY:
|
||||||
|
|
@ -701,8 +735,7 @@ class NameResolver
|
||||||
case PNK_VAR:
|
case PNK_VAR:
|
||||||
case PNK_CONST:
|
case PNK_CONST:
|
||||||
case PNK_LET:
|
case PNK_LET:
|
||||||
MOZ_ASSERT(cur->isArity(PN_LIST));
|
for (ParseNode* element : cur->as<ListNode>().contents()) {
|
||||||
for (ParseNode* element = cur->pn_head; element; element = element->pn_next) {
|
|
||||||
if (!resolve(element, prefix))
|
if (!resolve(element, prefix))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -712,19 +745,19 @@ class NameResolver
|
||||||
// PNK_COMPREHENSIONFOR for comprehensions, PNK_LEXICALSCOPE for
|
// PNK_COMPREHENSIONFOR for comprehensions, PNK_LEXICALSCOPE for
|
||||||
// legacy comprehensions. Probably this should be a non-list
|
// legacy comprehensions. Probably this should be a non-list
|
||||||
// eventually.
|
// eventually.
|
||||||
case PNK_ARRAYCOMP:
|
case PNK_ARRAYCOMP: {
|
||||||
MOZ_ASSERT(cur->isArity(PN_LIST));
|
ListNode* literal = &cur->as<ListNode>();
|
||||||
MOZ_ASSERT(cur->pn_count == 1);
|
MOZ_ASSERT(literal->count() == 1);
|
||||||
MOZ_ASSERT(cur->pn_head->isKind(PNK_LEXICALSCOPE) ||
|
MOZ_ASSERT(literal->head()->isKind(PNK_LEXICALSCOPE) ||
|
||||||
cur->pn_head->isKind(PNK_COMPREHENSIONFOR));
|
literal->head()->isKind(PNK_COMPREHENSIONFOR));
|
||||||
if (!resolve(cur->pn_head, prefix))
|
if (!resolve(literal->head(), prefix))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case PNK_OBJECT:
|
case PNK_OBJECT:
|
||||||
case PNK_CLASSMETHODLIST:
|
case PNK_CLASSMETHODLIST:
|
||||||
MOZ_ASSERT(cur->isArity(PN_LIST));
|
for (ParseNode* element : cur->as<ListNode>().contents()) {
|
||||||
for (ParseNode* element = cur->pn_head; element; element = element->pn_next) {
|
|
||||||
if (!resolve(element, prefix))
|
if (!resolve(element, prefix))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -733,87 +766,115 @@ class NameResolver
|
||||||
// A template string list's contents alternate raw template string
|
// A template string list's contents alternate raw template string
|
||||||
// contents with expressions interpolated into the overall literal.
|
// contents with expressions interpolated into the overall literal.
|
||||||
case PNK_TEMPLATE_STRING_LIST:
|
case PNK_TEMPLATE_STRING_LIST:
|
||||||
MOZ_ASSERT(cur->isArity(PN_LIST));
|
if (!resolveTemplateLiteral(&cur->as<ListNode>(), prefix))
|
||||||
if (!resolveTemplateLiteral(cur, prefix))
|
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PNK_TAGGED_TEMPLATE:
|
case PNK_TAGGED_TEMPLATE:
|
||||||
MOZ_ASSERT(cur->isArity(PN_LIST));
|
if (!resolveTaggedTemplate(&cur->as<BinaryNode>(), prefix))
|
||||||
if (!resolveTaggedTemplate(cur, prefix))
|
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PNK_NEW:
|
||||||
|
case PNK_CALL:
|
||||||
|
case PNK_GENEXP:
|
||||||
|
case PNK_SUPERCALL: {
|
||||||
|
BinaryNode* callNode = &cur->as<BinaryNode>();
|
||||||
|
if (!resolve(callNode->left(), prefix))
|
||||||
|
return false;
|
||||||
|
if (!resolve(callNode->right(), prefix))
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handles the arguments for new/call/supercall, but does _not_ handle
|
||||||
|
// the Arguments node used by tagged template literals, since that is
|
||||||
|
// special-cased inside of resolveTaggedTemplate.
|
||||||
|
case PNK_ARGUMENTS:
|
||||||
|
for (ParseNode* element : cur->as<ListNode>().contents()) {
|
||||||
|
if (!resolve(element, prefix))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
// Import/export spec lists contain import/export specs containing
|
// Import/export spec lists contain import/export specs containing
|
||||||
// only pairs of names. Alternatively, an export spec lists may
|
// only pairs of names. Alternatively, an export spec lists may
|
||||||
// contain a single export batch specifier.
|
// contain a single export batch specifier.
|
||||||
case PNK_EXPORT_SPEC_LIST:
|
case PNK_EXPORT_SPEC_LIST:
|
||||||
case PNK_IMPORT_SPEC_LIST: {
|
case PNK_IMPORT_SPEC_LIST: {
|
||||||
MOZ_ASSERT(cur->isArity(PN_LIST));
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
bool isImport = cur->isKind(PNK_IMPORT_SPEC_LIST);
|
bool isImport = cur->isKind(PNK_IMPORT_SPEC_LIST);
|
||||||
ParseNode* item = cur->pn_head;
|
ListNode* list = &cur->as<ListNode>();
|
||||||
|
ParseNode* item = list->head();
|
||||||
if (!isImport && item && item->isKind(PNK_EXPORT_BATCH_SPEC)) {
|
if (!isImport && item && item->isKind(PNK_EXPORT_BATCH_SPEC)) {
|
||||||
MOZ_ASSERT(item->isArity(PN_NULLARY));
|
MOZ_ASSERT(item->is<NullaryNode>());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for (; item; item = item->pn_next) {
|
for (ParseNode* item : list->contents()) {
|
||||||
MOZ_ASSERT(item->isKind(isImport ? PNK_IMPORT_SPEC : PNK_EXPORT_SPEC));
|
BinaryNode* spec = &item->as<BinaryNode>();
|
||||||
MOZ_ASSERT(item->isArity(PN_BINARY));
|
MOZ_ASSERT(spec->isKind(isImport ? PNK_IMPORT_SPEC : PNK_EXPORT_SPEC));
|
||||||
MOZ_ASSERT(item->pn_left->isKind(PNK_NAME));
|
MOZ_ASSERT(spec->left()->isKind(PNK_NAME));
|
||||||
MOZ_ASSERT(!item->pn_left->expr());
|
MOZ_ASSERT(!spec->left()->as<NameNode>().initializer());
|
||||||
MOZ_ASSERT(item->pn_right->isKind(PNK_NAME));
|
MOZ_ASSERT(spec->right()->isKind(PNK_NAME));
|
||||||
MOZ_ASSERT(!item->pn_right->expr());
|
MOZ_ASSERT(!spec->right()->as<NameNode>().initializer());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case PNK_CATCHLIST: {
|
case PNK_CATCHLIST: {
|
||||||
MOZ_ASSERT(cur->isArity(PN_LIST));
|
ListNode* catchList = &cur->as<ListNode>();
|
||||||
for (ParseNode* catchNode = cur->pn_head; catchNode; catchNode = catchNode->pn_next) {
|
for (ParseNode* catchNode : catchList->contents()) {
|
||||||
MOZ_ASSERT(catchNode->isKind(PNK_LEXICALSCOPE));
|
LexicalScopeNode* catchScope = &catchNode->as<LexicalScopeNode>();
|
||||||
MOZ_ASSERT(catchNode->scopeBody()->isKind(PNK_CATCH));
|
MOZ_ASSERT(catchScope->scopeBody()->isKind(PNK_CATCH));
|
||||||
MOZ_ASSERT(catchNode->scopeBody()->isArity(PN_TERNARY));
|
MOZ_ASSERT(catchScope->scopeBody()->isArity(PN_TERNARY));
|
||||||
if (!resolve(catchNode->scopeBody(), prefix))
|
if (!resolve(catchScope->scopeBody(), prefix))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case PNK_DOT:
|
case PNK_DOT: {
|
||||||
MOZ_ASSERT(cur->isArity(PN_NAME));
|
|
||||||
|
|
||||||
// Super prop nodes do not have a meaningful LHS
|
// Super prop nodes do not have a meaningful LHS
|
||||||
if (cur->as<PropertyAccess>().isSuper())
|
PropertyAccess* prop = &cur->as<PropertyAccess>();
|
||||||
|
if (prop->isSuper()) {
|
||||||
break;
|
break;
|
||||||
if (!resolve(cur->expr(), prefix))
|
}
|
||||||
|
if (!resolve(&prop->expression(), prefix)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case PNK_LABEL:
|
case PNK_LABEL:
|
||||||
MOZ_ASSERT(cur->isArity(PN_NAME));
|
if (!resolve(cur->as<LabeledStatement>().statement(), prefix))
|
||||||
if (!resolve(cur->expr(), prefix))
|
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PNK_NAME:
|
case PNK_NAME:
|
||||||
MOZ_ASSERT(cur->isArity(PN_NAME));
|
if (ParseNode* init = cur->as<NameNode>().initializer()) {
|
||||||
if (!resolve(cur->expr(), prefix))
|
if (!resolve(init, prefix))
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PNK_LEXICALSCOPE:
|
case PNK_LEXICALSCOPE:
|
||||||
MOZ_ASSERT(cur->isArity(PN_SCOPE));
|
if (!resolve(cur->as<LexicalScopeNode>().scopeBody(), prefix))
|
||||||
if (!resolve(cur->scopeBody(), prefix))
|
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PNK_FUNCTION:
|
case PNK_FUNCTION:
|
||||||
|
if (ParseNode* body = cur->as<FunctionNode>().body()) {
|
||||||
|
if (!resolve(body, prefix))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case PNK_MODULE:
|
case PNK_MODULE:
|
||||||
MOZ_ASSERT(cur->isArity(PN_CODE));
|
if (ParseNode* body = cur->as<ModuleNode>().body()) {
|
||||||
if (!resolve(cur->pn_body, prefix))
|
if (!resolve(body, prefix))
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Kinds that should be handled by parent node resolution.
|
// Kinds that should be handled by parent node resolution.
|
||||||
|
|
@ -822,6 +883,7 @@ class NameResolver
|
||||||
case PNK_EXPORT_SPEC: // by PNK_EXPORT_SPEC_LIST
|
case PNK_EXPORT_SPEC: // by PNK_EXPORT_SPEC_LIST
|
||||||
case PNK_CALLSITEOBJ: // by PNK_TAGGED_TEMPLATE
|
case PNK_CALLSITEOBJ: // by PNK_TAGGED_TEMPLATE
|
||||||
case PNK_CLASSNAMES: // by PNK_CLASS
|
case PNK_CLASSNAMES: // by PNK_CLASS
|
||||||
|
case PNK_PROPERTYNAME: // by PNK_DOT
|
||||||
MOZ_CRASH("should have been handled by a parent node");
|
MOZ_CRASH("should have been handled by a parent node");
|
||||||
|
|
||||||
case PNK_LIMIT: // invalid sentinel value
|
case PNK_LIMIT: // invalid sentinel value
|
||||||
|
|
|
||||||
|
|
@ -16,18 +16,12 @@ namespace frontend {
|
||||||
inline PropertyName*
|
inline PropertyName*
|
||||||
ParseNode::name() const
|
ParseNode::name() const
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(isKind(PNK_FUNCTION) || isKind(PNK_NAME));
|
JSAtom* atom = is<FunctionNode>()
|
||||||
JSAtom* atom = isKind(PNK_FUNCTION) ? pn_funbox->function()->explicitName() : pn_atom;
|
? as<FunctionNode>().funbox()->function()->explicitName()
|
||||||
|
: as<NameNode>().atom();
|
||||||
return atom->asPropertyName();
|
return atom->asPropertyName();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline JSAtom*
|
|
||||||
ParseNode::atom() const
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(isKind(PNK_STRING));
|
|
||||||
return pn_atom;
|
|
||||||
}
|
|
||||||
|
|
||||||
} /* namespace frontend */
|
} /* namespace frontend */
|
||||||
} /* namespace js */
|
} /* namespace js */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,26 +17,24 @@ using mozilla::IsFinite;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
void
|
void
|
||||||
ParseNode::checkListConsistency()
|
ListNode::checkConsistency() const
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(isArity(PN_LIST));
|
ParseNode* const* tailNode;
|
||||||
ParseNode** tail;
|
uint32_t actualCount = 0;
|
||||||
uint32_t count = 0;
|
if (const ParseNode* last = head()) {
|
||||||
if (pn_head) {
|
const ParseNode* pn = last;
|
||||||
ParseNode* last = pn_head;
|
|
||||||
ParseNode* pn = last;
|
|
||||||
while (pn) {
|
while (pn) {
|
||||||
last = pn;
|
last = pn;
|
||||||
pn = pn->pn_next;
|
pn = pn->pn_next;
|
||||||
count++;
|
actualCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
tail = &last->pn_next;
|
tailNode = &last->pn_next;
|
||||||
} else {
|
} else {
|
||||||
tail = &pn_head;
|
tailNode = &pn_u.list.head;
|
||||||
}
|
}
|
||||||
MOZ_ASSERT(pn_tail == tail);
|
MOZ_ASSERT(tail() == tailNode);
|
||||||
MOZ_ASSERT(pn_count == count);
|
MOZ_ASSERT(count() == actualCount);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -76,10 +74,10 @@ class NodeStack {
|
||||||
top = pn;
|
top = pn;
|
||||||
}
|
}
|
||||||
/* Push the children of the PN_LIST node |pn| on the stack. */
|
/* Push the children of the PN_LIST node |pn| on the stack. */
|
||||||
void pushList(ParseNode* pn) {
|
void pushList(ListNode* pn) {
|
||||||
/* This clobbers pn->pn_head if the list is empty; should be okay. */
|
/* This clobbers pn->pn_head if the list is empty; should be okay. */
|
||||||
*pn->pn_tail = top;
|
pn->unsafeSetTail(top);
|
||||||
top = pn->pn_head;
|
top = pn->head();
|
||||||
}
|
}
|
||||||
ParseNode* pop() {
|
ParseNode* pop() {
|
||||||
MOZ_ASSERT(!empty());
|
MOZ_ASSERT(!empty());
|
||||||
|
|
@ -96,10 +94,8 @@ class NodeStack {
|
||||||
enum class PushResult { Recyclable, CleanUpLater };
|
enum class PushResult { Recyclable, CleanUpLater };
|
||||||
|
|
||||||
static PushResult
|
static PushResult
|
||||||
PushCodeNodeChildren(ParseNode* node, NodeStack* stack)
|
PushFunctionNodeChildren(FunctionNode* node, NodeStack* stack)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(node->isArity(PN_CODE));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Function nodes are linked into the function box tree, and may appear
|
* Function nodes are linked into the function box tree, and may appear
|
||||||
* on method lists. Both of those lists are singly-linked, so trying to
|
* on method lists. Both of those lists are singly-linked, so trying to
|
||||||
|
|
@ -110,37 +106,42 @@ PushCodeNodeChildren(ParseNode* node, NodeStack* stack)
|
||||||
*
|
*
|
||||||
* In fact, we can't recycle the parse node yet, either: it may appear
|
* In fact, we can't recycle the parse node yet, either: it may appear
|
||||||
* on a method list, and reusing the node would corrupt that. Instead,
|
* on a method list, and reusing the node would corrupt that. Instead,
|
||||||
* we clear its pn_funbox pointer to mark it as deleted;
|
* we clear its funbox pointer to mark it as deleted;
|
||||||
* CleanFunctionList recycles it as well.
|
* CleanFunctionList recycles it as well.
|
||||||
*
|
*
|
||||||
* We do recycle the nodes around it, though, so we must clear pointers
|
* We do recycle the nodes around it, though, so we must clear pointers
|
||||||
* to them to avoid leaving dangling references where someone can find
|
* to them to avoid leaving dangling references where someone can find
|
||||||
* them.
|
* them.
|
||||||
*/
|
*/
|
||||||
node->pn_funbox = nullptr;
|
node->setFunbox(nullptr);
|
||||||
if (node->pn_body)
|
if (node->body())
|
||||||
stack->push(node->pn_body);
|
stack->push(node->body());
|
||||||
node->pn_body = nullptr;
|
node->setBody(nullptr);
|
||||||
|
|
||||||
return PushResult::CleanUpLater;
|
return PushResult::CleanUpLater;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PushResult
|
static PushResult
|
||||||
PushNameNodeChildren(ParseNode* node, NodeStack* stack)
|
PushModuleNodeChildren(ModuleNode* node, NodeStack* stack)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(node->isArity(PN_NAME));
|
stack->push(node->body());
|
||||||
|
node->setBody(nullptr);
|
||||||
|
|
||||||
if (node->pn_expr)
|
return PushResult::CleanUpLater;
|
||||||
stack->push(node->pn_expr);
|
}
|
||||||
node->pn_expr = nullptr;
|
|
||||||
|
static PushResult
|
||||||
|
PushNameNodeChildren(NameNode* node, NodeStack* stack)
|
||||||
|
{
|
||||||
|
if (node->initializer())
|
||||||
|
stack->push(node->initializer());
|
||||||
|
node->setInitializer(nullptr);
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PushResult
|
static PushResult
|
||||||
PushScopeNodeChildren(ParseNode* node, NodeStack* stack)
|
PushScopeNodeChildren(LexicalScopeNode* node, NodeStack* stack)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(node->isArity(PN_SCOPE));
|
|
||||||
|
|
||||||
if (node->scopeBody())
|
if (node->scopeBody())
|
||||||
stack->push(node->scopeBody());
|
stack->push(node->scopeBody());
|
||||||
node->setScopeBody(nullptr);
|
node->setScopeBody(nullptr);
|
||||||
|
|
@ -148,10 +149,9 @@ PushScopeNodeChildren(ParseNode* node, NodeStack* stack)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PushResult
|
static PushResult
|
||||||
PushListNodeChildren(ParseNode* node, NodeStack* stack)
|
PushListNodeChildren(ListNode* node, NodeStack* stack)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(node->isArity(PN_LIST));
|
node->checkConsistency();
|
||||||
node->checkListConsistency();
|
|
||||||
|
|
||||||
stack->pushList(node);
|
stack->pushList(node);
|
||||||
|
|
||||||
|
|
@ -159,11 +159,9 @@ PushListNodeChildren(ParseNode* node, NodeStack* stack)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PushResult
|
static PushResult
|
||||||
PushUnaryNodeChild(ParseNode* node, NodeStack* stack)
|
PushUnaryNodeChild(UnaryNode* node, NodeStack* stack)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(node->isArity(PN_UNARY));
|
stack->push(node->kid());
|
||||||
|
|
||||||
stack->push(node->pn_kid);
|
|
||||||
|
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
@ -183,23 +181,41 @@ PushNodeChildren(ParseNode* pn, NodeStack* stack)
|
||||||
// Trivial nodes that refer to no nodes, are referred to by nothing
|
// Trivial nodes that refer to no nodes, are referred to by nothing
|
||||||
// but their parents, are never used, and are never a definition.
|
// but their parents, are never used, and are never a definition.
|
||||||
case PNK_NOP:
|
case PNK_NOP:
|
||||||
case PNK_STRING:
|
|
||||||
case PNK_TEMPLATE_STRING:
|
|
||||||
case PNK_REGEXP:
|
|
||||||
case PNK_TRUE:
|
case PNK_TRUE:
|
||||||
case PNK_FALSE:
|
case PNK_FALSE:
|
||||||
case PNK_NULL:
|
case PNK_NULL:
|
||||||
case PNK_RAW_UNDEFINED:
|
case PNK_RAW_UNDEFINED:
|
||||||
case PNK_ELISION:
|
case PNK_ELISION:
|
||||||
case PNK_GENERATOR:
|
case PNK_GENERATOR:
|
||||||
case PNK_NUMBER:
|
|
||||||
case PNK_BREAK:
|
|
||||||
case PNK_CONTINUE:
|
|
||||||
case PNK_DEBUGGER:
|
|
||||||
case PNK_EXPORT_BATCH_SPEC:
|
case PNK_EXPORT_BATCH_SPEC:
|
||||||
case PNK_OBJECT_PROPERTY_NAME:
|
|
||||||
case PNK_POSHOLDER:
|
case PNK_POSHOLDER:
|
||||||
MOZ_ASSERT(pn->isArity(PN_NULLARY));
|
MOZ_ASSERT(pn->is<NullaryNode>());
|
||||||
|
return PushResult::Recyclable;
|
||||||
|
|
||||||
|
case PNK_DEBUGGER:
|
||||||
|
MOZ_ASSERT(pn->is<DebuggerStatement>());
|
||||||
|
return PushResult::Recyclable;
|
||||||
|
|
||||||
|
case PNK_BREAK:
|
||||||
|
MOZ_ASSERT(pn->is<BreakStatement>());
|
||||||
|
return PushResult::Recyclable;
|
||||||
|
|
||||||
|
case PNK_CONTINUE:
|
||||||
|
MOZ_ASSERT(pn->is<ContinueStatement>());
|
||||||
|
return PushResult::Recyclable;
|
||||||
|
|
||||||
|
case PNK_OBJECT_PROPERTY_NAME:
|
||||||
|
case PNK_STRING:
|
||||||
|
case PNK_TEMPLATE_STRING:
|
||||||
|
MOZ_ASSERT(pn->is<NameNode>());
|
||||||
|
return PushResult::Recyclable;
|
||||||
|
|
||||||
|
case PNK_REGEXP:
|
||||||
|
MOZ_ASSERT(pn->is<RegExpLiteral>());
|
||||||
|
return PushResult::Recyclable;
|
||||||
|
|
||||||
|
case PNK_NUMBER:
|
||||||
|
MOZ_ASSERT(pn->is<NumericLiteral>());
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
|
|
||||||
// Nodes with a single non-null child.
|
// Nodes with a single non-null child.
|
||||||
|
|
@ -225,16 +241,16 @@ PushNodeChildren(ParseNode* pn, NodeStack* stack)
|
||||||
case PNK_MUTATEPROTO:
|
case PNK_MUTATEPROTO:
|
||||||
case PNK_EXPORT:
|
case PNK_EXPORT:
|
||||||
case PNK_SUPERBASE:
|
case PNK_SUPERBASE:
|
||||||
return PushUnaryNodeChild(pn, stack);
|
return PushUnaryNodeChild(&pn->as<UnaryNode>(), stack);
|
||||||
|
|
||||||
// Nodes with a single nullable child.
|
// Nodes with a single nullable child.
|
||||||
case PNK_OPTCHAIN:
|
case PNK_OPTCHAIN:
|
||||||
case PNK_DELETEOPTCHAIN:
|
case PNK_DELETEOPTCHAIN:
|
||||||
case PNK_THIS:
|
case PNK_THIS:
|
||||||
case PNK_SEMI: {
|
case PNK_SEMI: {
|
||||||
MOZ_ASSERT(pn->isArity(PN_UNARY));
|
UnaryNode* un = &pn->as<UnaryNode>();
|
||||||
if (pn->pn_kid)
|
if (un->kid())
|
||||||
stack->push(pn->pn_kid);
|
stack->push(un->kid());
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -264,15 +280,23 @@ PushNodeChildren(ParseNode* pn, NodeStack* stack)
|
||||||
case PNK_DOWHILE:
|
case PNK_DOWHILE:
|
||||||
case PNK_WHILE:
|
case PNK_WHILE:
|
||||||
case PNK_SWITCH:
|
case PNK_SWITCH:
|
||||||
|
case PNK_NEW:
|
||||||
|
case PNK_OPTDOT:
|
||||||
|
case PNK_DOT:
|
||||||
|
case PNK_OPTCALL:
|
||||||
|
case PNK_CALL:
|
||||||
|
case PNK_SUPERCALL:
|
||||||
|
case PNK_TAGGED_TEMPLATE:
|
||||||
|
case PNK_GENEXP:
|
||||||
case PNK_CLASSMETHOD:
|
case PNK_CLASSMETHOD:
|
||||||
case PNK_NEWTARGET:
|
case PNK_NEWTARGET:
|
||||||
case PNK_SETTHIS:
|
case PNK_SETTHIS:
|
||||||
case PNK_FOR:
|
case PNK_FOR:
|
||||||
case PNK_COMPREHENSIONFOR:
|
case PNK_COMPREHENSIONFOR:
|
||||||
case PNK_WITH: {
|
case PNK_WITH: {
|
||||||
MOZ_ASSERT(pn->isArity(PN_BINARY));
|
BinaryNode* bn = &pn->as<BinaryNode>();
|
||||||
stack->push(pn->pn_left);
|
stack->push(bn->left());
|
||||||
stack->push(pn->pn_right);
|
stack->push(bn->right());
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -281,21 +305,24 @@ PushNodeChildren(ParseNode* pn, NodeStack* stack)
|
||||||
// So both are binary nodes with a possibly-null pn_left.
|
// So both are binary nodes with a possibly-null pn_left.
|
||||||
case PNK_CASE:
|
case PNK_CASE:
|
||||||
case PNK_CLASSNAMES: {
|
case PNK_CLASSNAMES: {
|
||||||
MOZ_ASSERT(pn->isArity(PN_BINARY));
|
BinaryNode* bn = &pn->as<BinaryNode>();
|
||||||
if (pn->pn_left)
|
if (bn->left())
|
||||||
stack->push(pn->pn_left);
|
stack->push(bn->left());
|
||||||
stack->push(pn->pn_right);
|
stack->push(bn->right());
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The child is an assignment of a PNK_GENERATOR node to the
|
// The child is an assignment of a PNK_GENERATOR node to the
|
||||||
// '.generator' local, for a synthesized, prepended initial yield.
|
// '.generator' local, for a synthesized, prepended initial yield.
|
||||||
case PNK_INITIALYIELD: {
|
case PNK_INITIALYIELD: {
|
||||||
MOZ_ASSERT(pn->isArity(PN_UNARY));
|
UnaryNode* un = &pn->as<UnaryNode>();
|
||||||
MOZ_ASSERT(pn->pn_kid->isKind(PNK_ASSIGN) &&
|
#ifdef DEBUG
|
||||||
pn->pn_kid->pn_left->isKind(PNK_NAME) &&
|
MOZ_ASSERT(un->kid()->isKind(PNK_ASSIGN));
|
||||||
pn->pn_kid->pn_right->isKind(PNK_GENERATOR));
|
BinaryNode* bn = &un->kid()->as<BinaryNode>();
|
||||||
stack->push(pn->pn_kid);
|
MOZ_ASSERT(bn->left()->isKind(PNK_NAME) &&
|
||||||
|
bn->right()->isKind(PNK_GENERATOR));
|
||||||
|
#endif
|
||||||
|
stack->push(un->kid());
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -303,18 +330,18 @@ PushNodeChildren(ParseNode* pn, NodeStack* stack)
|
||||||
case PNK_YIELD_STAR:
|
case PNK_YIELD_STAR:
|
||||||
case PNK_YIELD:
|
case PNK_YIELD:
|
||||||
case PNK_AWAIT: {
|
case PNK_AWAIT: {
|
||||||
MOZ_ASSERT(pn->isArity(PN_UNARY));
|
UnaryNode* un = &pn->as<UnaryNode>();
|
||||||
if (pn->pn_kid)
|
if (un->kid())
|
||||||
stack->push(pn->pn_kid);
|
stack->push(un->kid());
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A return node's child is what you'd expect: the return expression,
|
// A return node's child is what you'd expect: the return expression,
|
||||||
// if any.
|
// if any.
|
||||||
case PNK_RETURN: {
|
case PNK_RETURN: {
|
||||||
MOZ_ASSERT(pn->isArity(PN_UNARY));
|
UnaryNode* un = &pn->as<UnaryNode>();
|
||||||
if (pn->pn_kid)
|
if (un->kid())
|
||||||
stack->push(pn->pn_kid);
|
stack->push(un->kid());
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -322,31 +349,31 @@ PushNodeChildren(ParseNode* pn, NodeStack* stack)
|
||||||
// and a module string on the right.
|
// and a module string on the right.
|
||||||
case PNK_IMPORT:
|
case PNK_IMPORT:
|
||||||
case PNK_EXPORT_FROM: {
|
case PNK_EXPORT_FROM: {
|
||||||
MOZ_ASSERT(pn->isArity(PN_BINARY));
|
BinaryNode* bn = &pn->as<BinaryNode>();
|
||||||
MOZ_ASSERT_IF(pn->isKind(PNK_IMPORT), pn->pn_left->isKind(PNK_IMPORT_SPEC_LIST));
|
MOZ_ASSERT_IF(pn->isKind(PNK_IMPORT), bn->left()->isKind(PNK_IMPORT_SPEC_LIST));
|
||||||
MOZ_ASSERT_IF(pn->isKind(PNK_EXPORT_FROM), pn->pn_left->isKind(PNK_EXPORT_SPEC_LIST));
|
MOZ_ASSERT_IF(pn->isKind(PNK_EXPORT_FROM), bn->left()->isKind(PNK_EXPORT_SPEC_LIST));
|
||||||
MOZ_ASSERT(pn->pn_left->isArity(PN_LIST));
|
MOZ_ASSERT(bn->left()->isArity(PN_LIST));
|
||||||
MOZ_ASSERT(pn->pn_right->isKind(PNK_STRING));
|
MOZ_ASSERT(bn->right()->isKind(PNK_STRING));
|
||||||
stack->pushList(pn->pn_left);
|
stack->pushList(&bn->left()->as<ListNode>());
|
||||||
stack->push(pn->pn_right);
|
stack->push(bn->right());
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
||||||
case PNK_EXPORT_DEFAULT: {
|
case PNK_EXPORT_DEFAULT: {
|
||||||
MOZ_ASSERT(pn->isArity(PN_BINARY));
|
BinaryNode* bn = &pn->as<BinaryNode>();
|
||||||
MOZ_ASSERT_IF(pn->pn_right, pn->pn_right->isKind(PNK_NAME));
|
MOZ_ASSERT_IF(bn->right(), bn->right()->isKind(PNK_NAME));
|
||||||
stack->push(pn->pn_left);
|
stack->push(bn->left());
|
||||||
if (pn->pn_right)
|
if (bn->right())
|
||||||
stack->push(pn->pn_right);
|
stack->push(bn->right());
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ternary nodes with all children non-null.
|
// Ternary nodes with all children non-null.
|
||||||
case PNK_CONDITIONAL: {
|
case PNK_CONDITIONAL: {
|
||||||
MOZ_ASSERT(pn->isArity(PN_TERNARY));
|
TernaryNode* tn = &pn->as<TernaryNode>();
|
||||||
stack->push(pn->pn_kid1);
|
stack->push(tn->kid1());
|
||||||
stack->push(pn->pn_kid2);
|
stack->push(tn->kid2());
|
||||||
stack->push(pn->pn_kid3);
|
stack->push(tn->kid3());
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -357,57 +384,57 @@ PushNodeChildren(ParseNode* pn, NodeStack* stack)
|
||||||
// p|, the second child is null, and the third child is |obj|.
|
// p|, the second child is null, and the third child is |obj|.
|
||||||
case PNK_FORIN:
|
case PNK_FORIN:
|
||||||
case PNK_FOROF: {
|
case PNK_FOROF: {
|
||||||
MOZ_ASSERT(pn->isArity(PN_TERNARY));
|
TernaryNode* tn = &pn->as<TernaryNode>();
|
||||||
MOZ_ASSERT(!pn->pn_kid2);
|
MOZ_ASSERT(!tn->kid2());
|
||||||
stack->push(pn->pn_kid1);
|
stack->push(tn->kid1());
|
||||||
stack->push(pn->pn_kid3);
|
stack->push(tn->kid3());
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// for (;;) nodes have one child per optional component of the loop head.
|
// for (;;) nodes have one child per optional component of the loop head.
|
||||||
case PNK_FORHEAD: {
|
case PNK_FORHEAD: {
|
||||||
MOZ_ASSERT(pn->isArity(PN_TERNARY));
|
TernaryNode* tn = &pn->as<TernaryNode>();
|
||||||
if (pn->pn_kid1)
|
if (tn->kid1())
|
||||||
stack->push(pn->pn_kid1);
|
stack->push(tn->kid1());
|
||||||
if (pn->pn_kid2)
|
if (tn->kid2())
|
||||||
stack->push(pn->pn_kid2);
|
stack->push(tn->kid2());
|
||||||
if (pn->pn_kid3)
|
if (tn->kid3())
|
||||||
stack->push(pn->pn_kid3);
|
stack->push(tn->kid3());
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// classes might have an optional node for the heritage, as well as the names
|
// classes might have an optional node for the heritage, as well as the names
|
||||||
case PNK_CLASS: {
|
case PNK_CLASS: {
|
||||||
MOZ_ASSERT(pn->isArity(PN_TERNARY));
|
TernaryNode* tn = &pn->as<TernaryNode>();
|
||||||
if (pn->pn_kid1)
|
if (tn->kid1())
|
||||||
stack->push(pn->pn_kid1);
|
stack->push(tn->kid1());
|
||||||
if (pn->pn_kid2)
|
if (tn->kid2())
|
||||||
stack->push(pn->pn_kid2);
|
stack->push(tn->kid2());
|
||||||
stack->push(pn->pn_kid3);
|
stack->push(tn->kid3());
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if-statement nodes have condition and consequent children and a
|
// if-statement nodes have condition and consequent children and a
|
||||||
// possibly-null alternative.
|
// possibly-null alternative.
|
||||||
case PNK_IF: {
|
case PNK_IF: {
|
||||||
MOZ_ASSERT(pn->isArity(PN_TERNARY));
|
TernaryNode* tn = &pn->as<TernaryNode>();
|
||||||
stack->push(pn->pn_kid1);
|
stack->push(tn->kid1());
|
||||||
stack->push(pn->pn_kid2);
|
stack->push(tn->kid2());
|
||||||
if (pn->pn_kid3)
|
if (tn->kid3())
|
||||||
stack->push(pn->pn_kid3);
|
stack->push(tn->kid3());
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// try-statements have statements to execute, and one or both of a
|
// try-statements have statements to execute, and one or both of a
|
||||||
// catch-list and a finally-block.
|
// catch-list and a finally-block.
|
||||||
case PNK_TRY: {
|
case PNK_TRY: {
|
||||||
MOZ_ASSERT(pn->isArity(PN_TERNARY));
|
TernaryNode* tn = &pn->as<TernaryNode>();
|
||||||
MOZ_ASSERT(pn->pn_kid2 || pn->pn_kid3);
|
MOZ_ASSERT(tn->kid2() || tn->kid3());
|
||||||
stack->push(pn->pn_kid1);
|
stack->push(tn->kid1());
|
||||||
if (pn->pn_kid2)
|
if (tn->kid2())
|
||||||
stack->push(pn->pn_kid2);
|
stack->push(tn->kid2());
|
||||||
if (pn->pn_kid3)
|
if (tn->kid3())
|
||||||
stack->push(pn->pn_kid3);
|
stack->push(tn->kid3());
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -416,12 +443,12 @@ PushNodeChildren(ParseNode* pn, NodeStack* stack)
|
||||||
// |<cond>| in SpiderMonkey's |catch (e if <cond>)| extension), and
|
// |<cond>| in SpiderMonkey's |catch (e if <cond>)| extension), and
|
||||||
// third kid as the statements in the catch block.
|
// third kid as the statements in the catch block.
|
||||||
case PNK_CATCH: {
|
case PNK_CATCH: {
|
||||||
MOZ_ASSERT(pn->isArity(PN_TERNARY));
|
TernaryNode* tn = &pn->as<TernaryNode>();
|
||||||
if (pn->pn_kid1)
|
if (tn->kid1())
|
||||||
stack->push(pn->pn_kid1);
|
stack->push(tn->kid1());
|
||||||
if (pn->pn_kid2)
|
if (tn->kid2())
|
||||||
stack->push(pn->pn_kid2);
|
stack->push(tn->kid2());
|
||||||
stack->push(pn->pn_kid3);
|
stack->push(tn->kid3());
|
||||||
return PushResult::Recyclable;
|
return PushResult::Recyclable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -452,53 +479,45 @@ PushNodeChildren(ParseNode* pn, NodeStack* stack)
|
||||||
case PNK_MOD:
|
case PNK_MOD:
|
||||||
case PNK_POW:
|
case PNK_POW:
|
||||||
case PNK_COMMA:
|
case PNK_COMMA:
|
||||||
case PNK_NEW:
|
|
||||||
case PNK_OPTCALL:
|
|
||||||
case PNK_CALL:
|
|
||||||
case PNK_SUPERCALL:
|
|
||||||
case PNK_GENEXP:
|
|
||||||
case PNK_ARRAY:
|
case PNK_ARRAY:
|
||||||
case PNK_OBJECT:
|
case PNK_OBJECT:
|
||||||
case PNK_TEMPLATE_STRING_LIST:
|
case PNK_TEMPLATE_STRING_LIST:
|
||||||
case PNK_TAGGED_TEMPLATE:
|
|
||||||
case PNK_CALLSITEOBJ:
|
case PNK_CALLSITEOBJ:
|
||||||
case PNK_VAR:
|
case PNK_VAR:
|
||||||
case PNK_CONST:
|
case PNK_CONST:
|
||||||
case PNK_LET:
|
case PNK_LET:
|
||||||
|
case PNK_ARGUMENTS:
|
||||||
case PNK_CATCHLIST:
|
case PNK_CATCHLIST:
|
||||||
case PNK_STATEMENTLIST:
|
case PNK_STATEMENTLIST:
|
||||||
case PNK_IMPORT_SPEC_LIST:
|
case PNK_IMPORT_SPEC_LIST:
|
||||||
case PNK_EXPORT_SPEC_LIST:
|
case PNK_EXPORT_SPEC_LIST:
|
||||||
case PNK_PARAMSBODY:
|
case PNK_PARAMSBODY:
|
||||||
case PNK_CLASSMETHODLIST:
|
case PNK_CLASSMETHODLIST:
|
||||||
return PushListNodeChildren(pn, stack);
|
return PushListNodeChildren(&pn->as<ListNode>(), stack);
|
||||||
|
|
||||||
// Array comprehension nodes are lists with a single child:
|
// Array comprehension nodes are lists with a single child:
|
||||||
// PNK_COMPREHENSIONFOR for comprehensions, PNK_LEXICALSCOPE for legacy
|
// PNK_COMPREHENSIONFOR for comprehensions, PNK_LEXICALSCOPE for legacy
|
||||||
// comprehensions. Probably this should be a non-list eventually.
|
// comprehensions. Probably this should be a non-list eventually.
|
||||||
case PNK_ARRAYCOMP: {
|
case PNK_ARRAYCOMP: {
|
||||||
#ifdef DEBUG
|
ListNode* literal = &pn->as<ListNode>();
|
||||||
MOZ_ASSERT(pn->isKind(PNK_ARRAYCOMP));
|
MOZ_ASSERT(literal->count() == 1);
|
||||||
MOZ_ASSERT(pn->isArity(PN_LIST));
|
MOZ_ASSERT(literal->head()->isKind(PNK_LEXICALSCOPE) ||
|
||||||
MOZ_ASSERT(pn->pn_count == 1);
|
literal->head()->isKind(PNK_COMPREHENSIONFOR));
|
||||||
MOZ_ASSERT(pn->pn_head->isKind(PNK_LEXICALSCOPE) ||
|
return PushListNodeChildren(literal, stack);
|
||||||
pn->pn_head->isKind(PNK_COMPREHENSIONFOR));
|
|
||||||
#endif
|
|
||||||
return PushListNodeChildren(pn, stack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case PNK_LABEL:
|
case PNK_LABEL:
|
||||||
case PNK_OPTDOT:
|
|
||||||
case PNK_DOT:
|
|
||||||
case PNK_NAME:
|
case PNK_NAME:
|
||||||
return PushNameNodeChildren(pn, stack);
|
case PNK_PROPERTYNAME:
|
||||||
|
return PushNameNodeChildren(&pn->as<NameNode>(), stack);
|
||||||
|
|
||||||
case PNK_LEXICALSCOPE:
|
case PNK_LEXICALSCOPE:
|
||||||
return PushScopeNodeChildren(pn, stack);
|
return PushScopeNodeChildren(&pn->as<LexicalScopeNode>(), stack);
|
||||||
|
|
||||||
case PNK_FUNCTION:
|
case PNK_FUNCTION:
|
||||||
|
return PushFunctionNodeChildren(&pn->as<FunctionNode>(), stack);
|
||||||
case PNK_MODULE:
|
case PNK_MODULE:
|
||||||
return PushCodeNodeChildren(pn, stack);
|
return PushModuleNodeChildren(&pn->as<ModuleNode>(), stack);
|
||||||
|
|
||||||
case PNK_LIMIT: // invalid sentinel value
|
case PNK_LIMIT: // invalid sentinel value
|
||||||
MOZ_CRASH("invalid node kind");
|
MOZ_CRASH("invalid node kind");
|
||||||
|
|
@ -612,7 +631,7 @@ ParseNode::appendOrCreateList(ParseNodeKind kind, JSOp op, ParseNode* left, Pars
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ParseNode* list = handler->new_<ListNode>(kind, op, left);
|
ListNode* list = handler->new_<ListNode>(kind, op, left);
|
||||||
if (!list)
|
if (!list)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
|
@ -657,34 +676,43 @@ ParseNode::dump(int indent)
|
||||||
{
|
{
|
||||||
switch (pn_arity) {
|
switch (pn_arity) {
|
||||||
case PN_NULLARY:
|
case PN_NULLARY:
|
||||||
((NullaryNode*) this)->dump();
|
as<NullaryNode>().dump();
|
||||||
break;
|
return;
|
||||||
case PN_UNARY:
|
case PN_UNARY:
|
||||||
((UnaryNode*) this)->dump(indent);
|
as<UnaryNode>().dump(indent);
|
||||||
break;
|
return;
|
||||||
case PN_BINARY:
|
case PN_BINARY:
|
||||||
((BinaryNode*) this)->dump(indent);
|
as<BinaryNode>().dump(indent);
|
||||||
break;
|
return;
|
||||||
case PN_TERNARY:
|
case PN_TERNARY:
|
||||||
((TernaryNode*) this)->dump(indent);
|
as<TernaryNode>().dump(indent);
|
||||||
break;
|
return;
|
||||||
case PN_CODE:
|
case PN_FUNCTION:
|
||||||
((CodeNode*) this)->dump(indent);
|
as<FunctionNode>().dump(indent);
|
||||||
break;
|
return;
|
||||||
|
case PN_MODULE:
|
||||||
|
as<ModuleNode>().dump(indent);
|
||||||
case PN_LIST:
|
case PN_LIST:
|
||||||
((ListNode*) this)->dump(indent);
|
as<ListNode>().dump(indent);
|
||||||
break;
|
return;
|
||||||
case PN_NAME:
|
case PN_NAME:
|
||||||
((NameNode*) this)->dump(indent);
|
as<NameNode>().dump(indent);
|
||||||
break;
|
return;
|
||||||
|
case PN_NUMBER:
|
||||||
|
as<NumericLiteral>().dump(indent);
|
||||||
|
return;
|
||||||
|
case PN_REGEXP:
|
||||||
|
as<RegExpLiteral>().dump(indent);
|
||||||
|
return;
|
||||||
|
case PN_LOOP:
|
||||||
|
as<LoopControlStatement>().dump(indent);
|
||||||
|
return;
|
||||||
case PN_SCOPE:
|
case PN_SCOPE:
|
||||||
((LexicalScopeNode*) this)->dump(indent);
|
as<LexicalScopeNode>().dump(indent);
|
||||||
break;
|
return;
|
||||||
default:
|
|
||||||
fprintf(stderr, "#<BAD NODE %p, kind=%u, arity=%u>",
|
|
||||||
(void*) this, unsigned(getKind()), unsigned(pn_arity));
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
fprintf(stderr, "#<BAD NODE %p, kind=%u, arity=%u>",
|
||||||
|
(void*) this, unsigned(getKind()), unsigned(pn_arity));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -696,46 +724,78 @@ NullaryNode::dump()
|
||||||
case PNK_NULL: fprintf(stderr, "#null"); break;
|
case PNK_NULL: fprintf(stderr, "#null"); break;
|
||||||
case PNK_RAW_UNDEFINED: fprintf(stderr, "#undefined"); break;
|
case PNK_RAW_UNDEFINED: fprintf(stderr, "#undefined"); break;
|
||||||
|
|
||||||
case PNK_NUMBER: {
|
|
||||||
ToCStringBuf cbuf;
|
|
||||||
const char* cstr = NumberToCString(nullptr, &cbuf, pn_dval);
|
|
||||||
if (!IsFinite(pn_dval))
|
|
||||||
fputc('#', stderr);
|
|
||||||
if (cstr)
|
|
||||||
fprintf(stderr, "%s", cstr);
|
|
||||||
else
|
|
||||||
fprintf(stderr, "%g", pn_dval);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case PNK_STRING:
|
|
||||||
pn_atom->dumpCharsNoNewline();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "(%s)", parseNodeNames[getKind()]);
|
fprintf(stderr, "(%s)", parseNodeNames[getKind()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
NumericLiteral::dump(int indent)
|
||||||
|
{
|
||||||
|
ToCStringBuf cbuf;
|
||||||
|
const char* cstr = NumberToCString(nullptr, &cbuf, value());
|
||||||
|
if (!IsFinite(value())) {
|
||||||
|
fprintf(stderr, "#");
|
||||||
|
}
|
||||||
|
if (cstr) {
|
||||||
|
fprintf(stderr, "%s", cstr);
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "%g", value());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
RegExpLiteral::dump(int indent)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "(%s)", parseNodeNames[size_t(getKind())]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LoopControlStatement::dump(int indent)
|
||||||
|
{
|
||||||
|
const char* name = parseNodeNames[size_t(getKind())];
|
||||||
|
fprintf(stderr, "(%s", name);
|
||||||
|
if (label()) {
|
||||||
|
fprintf(stderr, " ");
|
||||||
|
label()->dumpCharsNoNewline();
|
||||||
|
}
|
||||||
|
fprintf(stderr, ")");
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
UnaryNode::dump(int indent)
|
UnaryNode::dump(int indent)
|
||||||
{
|
{
|
||||||
const char* name = parseNodeNames[getKind()];
|
const char* name = parseNodeNames[getKind()];
|
||||||
fprintf(stderr, "(%s ", name);
|
fprintf(stderr, "(%s ", name);
|
||||||
indent += strlen(name) + 2;
|
indent += strlen(name) + 2;
|
||||||
DumpParseTree(pn_kid, indent);
|
DumpParseTree(kid(), indent);
|
||||||
fprintf(stderr, ")");
|
fprintf(stderr, ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BinaryNode::dump(int indent)
|
BinaryNode::dump(int indent)
|
||||||
{
|
{
|
||||||
|
if (isKind(PNK_DOT)) {
|
||||||
|
fprintf(stderr, "(.");
|
||||||
|
|
||||||
|
DumpParseTree(right(), indent + 2);
|
||||||
|
|
||||||
|
fprintf(stderr, " ");
|
||||||
|
if (as<PropertyAccess>().isSuper())
|
||||||
|
fprintf(stderr, "super");
|
||||||
|
else
|
||||||
|
DumpParseTree(left(), indent + 2);
|
||||||
|
|
||||||
|
fprintf(stderr, ")");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const char* name = parseNodeNames[getKind()];
|
const char* name = parseNodeNames[getKind()];
|
||||||
fprintf(stderr, "(%s ", name);
|
fprintf(stderr, "(%s ", name);
|
||||||
indent += strlen(name) + 2;
|
indent += strlen(name) + 2;
|
||||||
DumpParseTree(pn_left, indent);
|
DumpParseTree(left(), indent);
|
||||||
IndentNewLine(indent);
|
IndentNewLine(indent);
|
||||||
DumpParseTree(pn_right, indent);
|
DumpParseTree(right(), indent);
|
||||||
fprintf(stderr, ")");
|
fprintf(stderr, ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -745,21 +805,31 @@ TernaryNode::dump(int indent)
|
||||||
const char* name = parseNodeNames[getKind()];
|
const char* name = parseNodeNames[getKind()];
|
||||||
fprintf(stderr, "(%s ", name);
|
fprintf(stderr, "(%s ", name);
|
||||||
indent += strlen(name) + 2;
|
indent += strlen(name) + 2;
|
||||||
DumpParseTree(pn_kid1, indent);
|
DumpParseTree(kid1(), indent);
|
||||||
IndentNewLine(indent);
|
IndentNewLine(indent);
|
||||||
DumpParseTree(pn_kid2, indent);
|
DumpParseTree(kid2(), indent);
|
||||||
IndentNewLine(indent);
|
IndentNewLine(indent);
|
||||||
DumpParseTree(pn_kid3, indent);
|
DumpParseTree(kid3(), indent);
|
||||||
fprintf(stderr, ")");
|
fprintf(stderr, ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CodeNode::dump(int indent)
|
FunctionNode::dump(int indent)
|
||||||
{
|
{
|
||||||
const char* name = parseNodeNames[getKind()];
|
const char* name = parseNodeNames[getKind()];
|
||||||
fprintf(stderr, "(%s ", name);
|
fprintf(stderr, "(%s ", name);
|
||||||
indent += strlen(name) + 2;
|
indent += strlen(name) + 2;
|
||||||
DumpParseTree(pn_body, indent);
|
DumpParseTree(body(), indent);
|
||||||
|
fprintf(stderr, ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ModuleNode::dump(int indent)
|
||||||
|
{
|
||||||
|
const char* name = parseNodeNames[getKind()];
|
||||||
|
fprintf(stderr, "(%s ", name);
|
||||||
|
indent += strlen(name) + 2;
|
||||||
|
DumpParseTree(body(), indent);
|
||||||
fprintf(stderr, ")");
|
fprintf(stderr, ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -768,14 +838,12 @@ ListNode::dump(int indent)
|
||||||
{
|
{
|
||||||
const char* name = parseNodeNames[getKind()];
|
const char* name = parseNodeNames[getKind()];
|
||||||
fprintf(stderr, "(%s [", name);
|
fprintf(stderr, "(%s [", name);
|
||||||
if (pn_head != nullptr) {
|
if (ParseNode* listHead = head()) {
|
||||||
indent += strlen(name) + 3;
|
indent += strlen(name) + 3;
|
||||||
DumpParseTree(pn_head, indent);
|
DumpParseTree(listHead, indent);
|
||||||
ParseNode* pn = pn_head->pn_next;
|
for (ParseNode* item : contentsFrom(listHead->pn_next)) {
|
||||||
while (pn != nullptr) {
|
|
||||||
IndentNewLine(indent);
|
IndentNewLine(indent);
|
||||||
DumpParseTree(pn, indent);
|
DumpParseTree(item, indent);
|
||||||
pn = pn->pn_next;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf(stderr, "])");
|
fprintf(stderr, "])");
|
||||||
|
|
@ -802,41 +870,53 @@ DumpName(const CharT* s, size_t len)
|
||||||
void
|
void
|
||||||
NameNode::dump(int indent)
|
NameNode::dump(int indent)
|
||||||
{
|
{
|
||||||
if (isKind(PNK_NAME) || isKind(PNK_DOT)) {
|
switch (getKind()) {
|
||||||
if (isKind(PNK_DOT))
|
case PNK_STRING:
|
||||||
fprintf(stderr, "(.");
|
case PNK_TEMPLATE_STRING:
|
||||||
|
case PNK_OBJECT_PROPERTY_NAME: {
|
||||||
|
atom()->dumpCharsNoNewline();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!pn_atom) {
|
case PNK_NAME:
|
||||||
|
case PNK_PROPERTYNAME: {
|
||||||
|
if (!atom()) {
|
||||||
fprintf(stderr, "#<null name>");
|
fprintf(stderr, "#<null name>");
|
||||||
} else if (getOp() == JSOP_GETARG && pn_atom->length() == 0) {
|
} else if (getOp() == JSOP_GETARG && atom()->length() == 0) {
|
||||||
// Dump destructuring parameter.
|
// Dump destructuring parameter.
|
||||||
fprintf(stderr, "(#<zero-length name> ");
|
static const char ZeroLengthPrefix[] = "(#<zero-length name> ";
|
||||||
DumpParseTree(expr(), indent + 21);
|
fprintf(stderr, ZeroLengthPrefix);
|
||||||
|
DumpParseTree(initializer(), indent + strlen(ZeroLengthPrefix));
|
||||||
fputc(')', stderr);
|
fputc(')', stderr);
|
||||||
} else {
|
} else {
|
||||||
JS::AutoCheckCannotGC nogc;
|
JS::AutoCheckCannotGC nogc;
|
||||||
if (pn_atom->hasLatin1Chars())
|
if (atom()->hasLatin1Chars())
|
||||||
DumpName(pn_atom->latin1Chars(nogc), pn_atom->length());
|
DumpName(atom()->latin1Chars(nogc), atom()->length());
|
||||||
else
|
else
|
||||||
DumpName(pn_atom->twoByteChars(nogc), pn_atom->length());
|
DumpName(atom()->twoByteChars(nogc), atom()->length());
|
||||||
}
|
|
||||||
|
|
||||||
if (isKind(PNK_DOT)) {
|
|
||||||
fputc(' ', stderr);
|
|
||||||
if (as<PropertyAccess>().isSuper())
|
|
||||||
fprintf(stderr, "super");
|
|
||||||
else
|
|
||||||
DumpParseTree(expr(), indent + 2);
|
|
||||||
fputc(')', stderr);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* name = parseNodeNames[getKind()];
|
case PNK_LABEL: {
|
||||||
fprintf(stderr, "(%s ", name);
|
const char* name = parseNodeNames[getKind()];
|
||||||
indent += strlen(name) + 2;
|
fprintf(stderr, "(%s ", name);
|
||||||
DumpParseTree(expr(), indent);
|
atom()->dumpCharsNoNewline();
|
||||||
fprintf(stderr, ")");
|
indent += strlen(name) + atom()->length() + 2;
|
||||||
|
DumpParseTree(initializer(), indent);
|
||||||
|
fprintf(stderr, ")");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
default: {
|
||||||
|
const char* name = parseNodeNames[getKind()];
|
||||||
|
fprintf(stderr, "(%s ", name);
|
||||||
|
indent += strlen(name) + 2;
|
||||||
|
DumpParseTree(initializer(), indent);
|
||||||
|
fprintf(stderr, ")");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -921,7 +1001,8 @@ js::frontend::IsAnonymousFunctionDefinition(ParseNode* pn)
|
||||||
// 14.1.12 (FunctionExpression).
|
// 14.1.12 (FunctionExpression).
|
||||||
// 14.4.8 (GeneratorExpression).
|
// 14.4.8 (GeneratorExpression).
|
||||||
// 14.6.8 (AsyncFunctionExpression)
|
// 14.6.8 (AsyncFunctionExpression)
|
||||||
if (pn->isKind(PNK_FUNCTION) && !pn->pn_funbox->function()->explicitName())
|
if (pn->is<FunctionNode>() &&
|
||||||
|
!pn->as<FunctionNode>().funbox()->function()->explicitName())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// 14.5.8 (ClassExpression)
|
// 14.5.8 (ClassExpression)
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -903,6 +903,11 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
private:
|
private:
|
||||||
using Node = typename ParseHandler::Node;
|
using Node = typename ParseHandler::Node;
|
||||||
|
|
||||||
|
#define DECLARE_TYPE(typeName, longTypeName, asMethodName) \
|
||||||
|
using longTypeName = typename ParseHandler::longTypeName;
|
||||||
|
FOR_EACH_PARSENODE_SUBCLASS(DECLARE_TYPE)
|
||||||
|
#undef DECLARE_TYPE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A class for temporarily stashing errors while parsing continues.
|
* A class for temporarily stashing errors while parsing continues.
|
||||||
*
|
*
|
||||||
|
|
@ -1073,14 +1078,14 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
/*
|
/*
|
||||||
* Parse a top-level JS script.
|
* Parse a top-level JS script.
|
||||||
*/
|
*/
|
||||||
Node parse();
|
ListNodeType parse();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocate a new parsed object or function container from
|
* Allocate a new parsed object or function container from
|
||||||
* cx->tempLifoAlloc.
|
* cx->tempLifoAlloc.
|
||||||
*/
|
*/
|
||||||
ObjectBox* newObjectBox(JSObject* obj);
|
ObjectBox* newObjectBox(JSObject* obj);
|
||||||
FunctionBox* newFunctionBox(Node fn, JSFunction* fun, uint32_t toStringStart,
|
FunctionBox* newFunctionBox(FunctionNodeType funNode, JSFunction* fun, uint32_t toStringStart,
|
||||||
Directives directives,
|
Directives directives,
|
||||||
GeneratorKind generatorKind, FunctionAsyncKind asyncKind,
|
GeneratorKind generatorKind, FunctionAsyncKind asyncKind,
|
||||||
bool tryAnnexB);
|
bool tryAnnexB);
|
||||||
|
|
@ -1100,18 +1105,18 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
|
|
||||||
JSAtom* stopStringCompression();
|
JSAtom* stopStringCompression();
|
||||||
|
|
||||||
Node stringLiteral();
|
NameNodeType stringLiteral();
|
||||||
Node noSubstitutionTaggedTemplate();
|
Node noSubstitutionTaggedTemplate();
|
||||||
Node noSubstitutionUntaggedTemplate();
|
NameNodeType noSubstitutionUntaggedTemplate();
|
||||||
Node templateLiteral(YieldHandling yieldHandling);
|
ListNodeType templateLiteral(YieldHandling yieldHandling);
|
||||||
bool taggedTemplate(YieldHandling yieldHandling, Node nodeList, TokenKind tt);
|
bool taggedTemplate(YieldHandling yieldHandling, ListNodeType tagArgsList, TokenKind tt);
|
||||||
bool appendToCallSiteObj(Node callSiteObj);
|
bool appendToCallSiteObj(CallSiteNodeType callSiteObj);
|
||||||
bool addExprAndGetNextTemplStrToken(YieldHandling yieldHandling, Node nodeList,
|
bool addExprAndGetNextTemplStrToken(YieldHandling yieldHandling, ListNodeType nodeList,
|
||||||
TokenKind* ttp);
|
TokenKind* ttp);
|
||||||
bool checkStatementsEOF();
|
bool checkStatementsEOF();
|
||||||
|
|
||||||
inline Node newName(PropertyName* name);
|
inline NameNodeType newName(PropertyName* name);
|
||||||
inline Node newName(PropertyName* name, TokenPos pos);
|
inline NameNodeType newName(PropertyName* name, TokenPos pos);
|
||||||
|
|
||||||
inline bool abortIfSyntaxParser();
|
inline bool abortIfSyntaxParser();
|
||||||
|
|
||||||
|
|
@ -1120,36 +1125,36 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
Node statement(YieldHandling yieldHandling);
|
Node statement(YieldHandling yieldHandling);
|
||||||
Node statementListItem(YieldHandling yieldHandling, bool canHaveDirectives = false);
|
Node statementListItem(YieldHandling yieldHandling, bool canHaveDirectives = false);
|
||||||
|
|
||||||
bool maybeParseDirective(Node list, Node pn, bool* cont);
|
bool maybeParseDirective(ListNodeType list, Node pn, bool* cont);
|
||||||
|
|
||||||
// Parse the body of an eval.
|
// Parse the body of an eval.
|
||||||
//
|
//
|
||||||
// Eval scripts are distinguished from global scripts in that in ES6, per
|
// Eval scripts are distinguished from global scripts in that in ES6, per
|
||||||
// 18.2.1.1 steps 9 and 10, all eval scripts are executed under a fresh
|
// 18.2.1.1 steps 9 and 10, all eval scripts are executed under a fresh
|
||||||
// lexical scope.
|
// lexical scope.
|
||||||
Node evalBody(EvalSharedContext* evalsc);
|
LexicalScopeNodeType evalBody(EvalSharedContext* evalsc);
|
||||||
|
|
||||||
// Parse the body of a global script.
|
// Parse the body of a global script.
|
||||||
Node globalBody(GlobalSharedContext* globalsc);
|
ListNodeType globalBody(GlobalSharedContext* globalsc);
|
||||||
|
|
||||||
// Parse a module.
|
// Parse a module.
|
||||||
Node moduleBody(ModuleSharedContext* modulesc);
|
ModuleNodeType moduleBody(ModuleSharedContext* modulesc);
|
||||||
|
|
||||||
// Parse a function, used for the Function, GeneratorFunction, and
|
// Parse a function, used for the Function, GeneratorFunction, and
|
||||||
// AsyncFunction constructors.
|
// AsyncFunction constructors.
|
||||||
Node standaloneFunction(HandleFunction fun, HandleScope enclosingScope,
|
FunctionNodeType standaloneFunction(HandleFunction fun, HandleScope enclosingScope,
|
||||||
mozilla::Maybe<uint32_t> parameterListEnd,
|
mozilla::Maybe<uint32_t> parameterListEnd,
|
||||||
GeneratorKind generatorKind, FunctionAsyncKind asyncKind,
|
GeneratorKind generatorKind, FunctionAsyncKind asyncKind,
|
||||||
Directives inheritedDirectives, Directives* newDirectives);
|
Directives inheritedDirectives, Directives* newDirectives);
|
||||||
|
|
||||||
// Parse a function, given only its arguments and body. Used for lazily
|
// Parse a function, given only its arguments and body. Used for lazily
|
||||||
// parsed functions.
|
// parsed functions.
|
||||||
Node standaloneLazyFunction(HandleFunction fun, bool strict,
|
FunctionNodeType standaloneLazyFunction(HandleFunction fun, bool strict,
|
||||||
GeneratorKind generatorKind, FunctionAsyncKind asyncKind);
|
GeneratorKind generatorKind, FunctionAsyncKind asyncKind);
|
||||||
|
|
||||||
// Parse an inner function given an enclosing ParseContext and a
|
// Parse an inner function given an enclosing ParseContext and a
|
||||||
// FunctionBox for the inner function.
|
// FunctionBox for the inner function.
|
||||||
bool innerFunction(Node pn, ParseContext* outerpc, FunctionBox* funbox, uint32_t toStringStart,
|
bool innerFunction(FunctionNodeType funNode, ParseContext* outerpc, FunctionBox* funbox, uint32_t toStringStart,
|
||||||
InHandling inHandling, YieldHandling yieldHandling,
|
InHandling inHandling, YieldHandling yieldHandling,
|
||||||
FunctionSyntaxKind kind,
|
FunctionSyntaxKind kind,
|
||||||
Directives inheritedDirectives, Directives* newDirectives);
|
Directives inheritedDirectives, Directives* newDirectives);
|
||||||
|
|
@ -1157,7 +1162,7 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
// Parse a function's formal parameters and its body assuming its function
|
// Parse a function's formal parameters and its body assuming its function
|
||||||
// ParseContext is already on the stack.
|
// ParseContext is already on the stack.
|
||||||
bool functionFormalParametersAndBody(InHandling inHandling, YieldHandling yieldHandling,
|
bool functionFormalParametersAndBody(InHandling inHandling, YieldHandling yieldHandling,
|
||||||
Node pn, FunctionSyntaxKind kind,
|
FunctionNodeType funNode, FunctionSyntaxKind kind,
|
||||||
mozilla::Maybe<uint32_t> parameterListEnd = mozilla::Nothing(),
|
mozilla::Maybe<uint32_t> parameterListEnd = mozilla::Nothing(),
|
||||||
bool isStandaloneFunction = false);
|
bool isStandaloneFunction = false);
|
||||||
|
|
||||||
|
|
@ -1183,18 +1188,18 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
* Some parsers have two versions: an always-inlined version (with an 'i'
|
* Some parsers have two versions: an always-inlined version (with an 'i'
|
||||||
* suffix) and a never-inlined version (with an 'n' suffix).
|
* suffix) and a never-inlined version (with an 'n' suffix).
|
||||||
*/
|
*/
|
||||||
Node functionStmt(uint32_t toStringStart,
|
FunctionNodeType functionStmt(uint32_t toStringStart,
|
||||||
YieldHandling yieldHandling, DefaultHandling defaultHandling,
|
YieldHandling yieldHandling, DefaultHandling defaultHandling,
|
||||||
FunctionAsyncKind asyncKind = SyncFunction);
|
FunctionAsyncKind asyncKind = SyncFunction);
|
||||||
Node functionExpr(uint32_t toStringStart, InvokedPrediction invoked = PredictUninvoked,
|
FunctionNodeType functionExpr(uint32_t toStringStart, InvokedPrediction invoked = PredictUninvoked,
|
||||||
FunctionAsyncKind asyncKind = SyncFunction);
|
FunctionAsyncKind asyncKind = SyncFunction);
|
||||||
|
|
||||||
Node statementList(YieldHandling yieldHandling);
|
ListNodeType statementList(YieldHandling yieldHandling);
|
||||||
|
|
||||||
Node blockStatement(YieldHandling yieldHandling,
|
LexicalScopeNodeType blockStatement(YieldHandling yieldHandling,
|
||||||
unsigned errorNumber = JSMSG_CURLY_IN_COMPOUND);
|
unsigned errorNumber = JSMSG_CURLY_IN_COMPOUND);
|
||||||
Node doWhileStatement(YieldHandling yieldHandling);
|
BinaryNodeType doWhileStatement(YieldHandling yieldHandling);
|
||||||
Node whileStatement(YieldHandling yieldHandling);
|
BinaryNodeType whileStatement(YieldHandling yieldHandling);
|
||||||
|
|
||||||
Node forStatement(YieldHandling yieldHandling);
|
Node forStatement(YieldHandling yieldHandling);
|
||||||
bool forHeadStart(YieldHandling yieldHandling,
|
bool forHeadStart(YieldHandling yieldHandling,
|
||||||
|
|
@ -1205,22 +1210,22 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
Node* forInOrOfExpression);
|
Node* forInOrOfExpression);
|
||||||
Node expressionAfterForInOrOf(ParseNodeKind forHeadKind, YieldHandling yieldHandling);
|
Node expressionAfterForInOrOf(ParseNodeKind forHeadKind, YieldHandling yieldHandling);
|
||||||
|
|
||||||
Node switchStatement(YieldHandling yieldHandling);
|
SwitchStatementType switchStatement(YieldHandling yieldHandling);
|
||||||
Node continueStatement(YieldHandling yieldHandling);
|
ContinueStatementType continueStatement(YieldHandling yieldHandling);
|
||||||
Node breakStatement(YieldHandling yieldHandling);
|
BreakStatementType breakStatement(YieldHandling yieldHandling);
|
||||||
Node returnStatement(YieldHandling yieldHandling);
|
UnaryNodeType returnStatement(YieldHandling yieldHandling);
|
||||||
Node withStatement(YieldHandling yieldHandling);
|
BinaryNodeType withStatement(YieldHandling yieldHandling);
|
||||||
Node throwStatement(YieldHandling yieldHandling);
|
UnaryNodeType throwStatement(YieldHandling yieldHandling);
|
||||||
Node tryStatement(YieldHandling yieldHandling);
|
TernaryNodeType tryStatement(YieldHandling yieldHandling);
|
||||||
Node catchBlockStatement(YieldHandling yieldHandling, ParseContext::Scope& catchParamScope);
|
LexicalScopeNodeType catchBlockStatement(YieldHandling yieldHandling, ParseContext::Scope& catchParamScope);
|
||||||
Node debuggerStatement();
|
DebuggerStatementType debuggerStatement();
|
||||||
|
|
||||||
Node variableStatement(YieldHandling yieldHandling);
|
Node variableStatement(YieldHandling yieldHandling);
|
||||||
|
|
||||||
Node labeledStatement(YieldHandling yieldHandling);
|
LabeledStatementType labeledStatement(YieldHandling yieldHandling);
|
||||||
Node labeledItem(YieldHandling yieldHandling);
|
Node labeledItem(YieldHandling yieldHandling);
|
||||||
|
|
||||||
Node ifStatement(YieldHandling yieldHandling);
|
TernaryNodeType ifStatement(YieldHandling yieldHandling);
|
||||||
Node consequentOrAlternative(YieldHandling yieldHandling);
|
Node consequentOrAlternative(YieldHandling yieldHandling);
|
||||||
|
|
||||||
// While on a |let| TOK_NAME token, examine |next|. Indicate whether
|
// While on a |let| TOK_NAME token, examine |next|. Indicate whether
|
||||||
|
|
@ -1228,29 +1233,29 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
// continues a LexicalDeclaration.
|
// continues a LexicalDeclaration.
|
||||||
bool nextTokenContinuesLetDeclaration(TokenKind next, YieldHandling yieldHandling);
|
bool nextTokenContinuesLetDeclaration(TokenKind next, YieldHandling yieldHandling);
|
||||||
|
|
||||||
Node lexicalDeclaration(YieldHandling yieldHandling, DeclarationKind kind);
|
ListNodeType lexicalDeclaration(YieldHandling yieldHandling, DeclarationKind kind);
|
||||||
|
|
||||||
Node importDeclaration();
|
inline BinaryNodeType importDeclaration();
|
||||||
|
|
||||||
bool processExport(Node node);
|
bool processExport(Node node);
|
||||||
bool processExportFrom(Node node);
|
bool processExportFrom(BinaryNodeType node);
|
||||||
|
|
||||||
Node exportFrom(uint32_t begin, Node specList);
|
BinaryNodeType exportFrom(uint32_t begin, Node specList);
|
||||||
Node exportBatch(uint32_t begin);
|
BinaryNodeType exportBatch(uint32_t begin);
|
||||||
bool checkLocalExportNames(Node node);
|
bool checkLocalExportNames(ListNodeType node);
|
||||||
Node exportClause(uint32_t begin);
|
Node exportClause(uint32_t begin);
|
||||||
Node exportFunctionDeclaration(uint32_t begin);
|
UnaryNodeType exportFunctionDeclaration(uint32_t begin);
|
||||||
Node exportVariableStatement(uint32_t begin);
|
UnaryNodeType exportVariableStatement(uint32_t begin);
|
||||||
Node exportClassDeclaration(uint32_t begin);
|
UnaryNodeType exportClassDeclaration(uint32_t begin);
|
||||||
Node exportLexicalDeclaration(uint32_t begin, DeclarationKind kind);
|
UnaryNodeType exportLexicalDeclaration(uint32_t begin, DeclarationKind kind);
|
||||||
Node exportDefaultFunctionDeclaration(uint32_t begin,
|
BinaryNodeType exportDefaultFunctionDeclaration(uint32_t begin,
|
||||||
FunctionAsyncKind asyncKind = SyncFunction);
|
FunctionAsyncKind asyncKind = SyncFunction);
|
||||||
Node exportDefaultClassDeclaration(uint32_t begin);
|
BinaryNodeType exportDefaultClassDeclaration(uint32_t begin);
|
||||||
Node exportDefaultAssignExpr(uint32_t begin);
|
BinaryNodeType exportDefaultAssignExpr(uint32_t begin);
|
||||||
Node exportDefault(uint32_t begin);
|
BinaryNodeType exportDefault(uint32_t begin);
|
||||||
|
|
||||||
Node exportDeclaration();
|
Node exportDeclaration();
|
||||||
Node expressionStatement(YieldHandling yieldHandling,
|
UnaryNodeType expressionStatement(YieldHandling yieldHandling,
|
||||||
InvokedPrediction invoked = PredictUninvoked);
|
InvokedPrediction invoked = PredictUninvoked);
|
||||||
|
|
||||||
// Declaration parsing. The main entrypoint is Parser::declarationList,
|
// Declaration parsing. The main entrypoint is Parser::declarationList,
|
||||||
|
|
@ -1273,10 +1278,10 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
// Otherwise, for for-in/of loops, the next token is the ')' ending the
|
// Otherwise, for for-in/of loops, the next token is the ')' ending the
|
||||||
// loop-head. Additionally, the expression that the loop iterates over was
|
// loop-head. Additionally, the expression that the loop iterates over was
|
||||||
// parsed into |*forInOrOfExpression|.
|
// parsed into |*forInOrOfExpression|.
|
||||||
Node declarationList(YieldHandling yieldHandling,
|
ListNodeType declarationList(YieldHandling yieldHandling,
|
||||||
ParseNodeKind kind,
|
ParseNodeKind kind,
|
||||||
ParseNodeKind* forHeadKind = nullptr,
|
ParseNodeKind* forHeadKind = nullptr,
|
||||||
Node* forInOrOfExpression = nullptr);
|
Node* forInOrOfExpression = nullptr);
|
||||||
|
|
||||||
// The items in a declaration list are either patterns or names, with or
|
// The items in a declaration list are either patterns or names, with or
|
||||||
// without initializers. These two methods parse a single pattern/name and
|
// without initializers. These two methods parse a single pattern/name and
|
||||||
|
|
@ -1290,16 +1295,16 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
Node declarationPattern(Node decl, DeclarationKind declKind, TokenKind tt,
|
Node declarationPattern(Node decl, DeclarationKind declKind, TokenKind tt,
|
||||||
bool initialDeclaration, YieldHandling yieldHandling,
|
bool initialDeclaration, YieldHandling yieldHandling,
|
||||||
ParseNodeKind* forHeadKind, Node* forInOrOfExpression);
|
ParseNodeKind* forHeadKind, Node* forInOrOfExpression);
|
||||||
Node declarationName(Node decl, DeclarationKind declKind, TokenKind tt,
|
NameNodeType declarationName(Node decl, DeclarationKind declKind, TokenKind tt,
|
||||||
bool initialDeclaration, YieldHandling yieldHandling,
|
bool initialDeclaration, YieldHandling yieldHandling,
|
||||||
ParseNodeKind* forHeadKind, Node* forInOrOfExpression);
|
ParseNodeKind* forHeadKind, Node* forInOrOfExpression);
|
||||||
|
|
||||||
// Having parsed a name (not found in a destructuring pattern) declared by
|
// Having parsed a name (not found in a destructuring pattern) declared by
|
||||||
// a declaration, with the current token being the '=' separating the name
|
// a declaration, with the current token being the '=' separating the name
|
||||||
// from its initializer, parse and bind that initializer -- and possibly
|
// from its initializer, parse and bind that initializer -- and possibly
|
||||||
// consume trailing in/of and subsequent expression, if so directed by
|
// consume trailing in/of and subsequent expression, if so directed by
|
||||||
// |forHeadKind|.
|
// |forHeadKind|.
|
||||||
bool initializerInNameDeclaration(Node decl, Node binding, Handle<PropertyName*> name,
|
bool initializerInNameDeclaration(Node decl, NameNodeType binding, Handle<PropertyName*> name,
|
||||||
DeclarationKind declKind, bool initialDeclaration,
|
DeclarationKind declKind, bool initialDeclaration,
|
||||||
YieldHandling yieldHandling, ParseNodeKind* forHeadKind,
|
YieldHandling yieldHandling, ParseNodeKind* forHeadKind,
|
||||||
Node* forInOrOfExpression);
|
Node* forInOrOfExpression);
|
||||||
|
|
@ -1311,7 +1316,7 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
TripledotHandling tripledotHandling, PossibleError* possibleError = nullptr,
|
TripledotHandling tripledotHandling, PossibleError* possibleError = nullptr,
|
||||||
InvokedPrediction invoked = PredictUninvoked);
|
InvokedPrediction invoked = PredictUninvoked);
|
||||||
Node assignExprWithoutYieldOrAwait(YieldHandling yieldHandling);
|
Node assignExprWithoutYieldOrAwait(YieldHandling yieldHandling);
|
||||||
Node yieldExpression(InHandling inHandling);
|
UnaryNodeType yieldExpression(InHandling inHandling);
|
||||||
Node condExpr1(InHandling inHandling, YieldHandling yieldHandling,
|
Node condExpr1(InHandling inHandling, YieldHandling yieldHandling,
|
||||||
TripledotHandling tripledotHandling,
|
TripledotHandling tripledotHandling,
|
||||||
PossibleError* possibleError,
|
PossibleError* possibleError,
|
||||||
|
|
@ -1338,30 +1343,30 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
Node exprInParens(InHandling inHandling, YieldHandling yieldHandling,
|
Node exprInParens(InHandling inHandling, YieldHandling yieldHandling,
|
||||||
TripledotHandling tripledotHandling, PossibleError* possibleError = nullptr);
|
TripledotHandling tripledotHandling, PossibleError* possibleError = nullptr);
|
||||||
|
|
||||||
bool tryNewTarget(Node& newTarget);
|
bool tryNewTarget(BinaryNodeType* newTarget);
|
||||||
bool checkAndMarkSuperScope();
|
bool checkAndMarkSuperScope();
|
||||||
|
|
||||||
Node methodDefinition(uint32_t toStringStart, PropertyType propType, HandleAtom funName);
|
FunctionNodeType methodDefinition(uint32_t toStringStart, PropertyType propType, HandleAtom funName);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Additional JS parsers.
|
* Additional JS parsers.
|
||||||
*/
|
*/
|
||||||
bool functionArguments(YieldHandling yieldHandling, FunctionSyntaxKind kind,
|
bool functionArguments(YieldHandling yieldHandling, FunctionSyntaxKind kind,
|
||||||
Node funcpn);
|
FunctionNodeType funNode);
|
||||||
|
|
||||||
Node functionDefinition(uint32_t toStringStart, Node pn,
|
FunctionNodeType functionDefinition(uint32_t toStringStart, FunctionNodeType funNode,
|
||||||
InHandling inHandling, YieldHandling yieldHandling, HandleAtom name,
|
InHandling inHandling, YieldHandling yieldHandling, HandleAtom name,
|
||||||
FunctionSyntaxKind kind,
|
FunctionSyntaxKind kind,
|
||||||
GeneratorKind generatorKind, FunctionAsyncKind asyncKind,
|
GeneratorKind generatorKind, FunctionAsyncKind asyncKind,
|
||||||
bool tryAnnexB = false);
|
bool tryAnnexB = false);
|
||||||
|
|
||||||
// Parse a function body. Pass StatementListBody if the body is a list of
|
// Parse a function body. Pass StatementListBody if the body is a list of
|
||||||
// statements; pass ExpressionBody if the body is a single expression.
|
// statements; pass ExpressionBody if the body is a single expression.
|
||||||
enum FunctionBodyType { StatementListBody, ExpressionBody };
|
enum FunctionBodyType { StatementListBody, ExpressionBody };
|
||||||
Node functionBody(InHandling inHandling, YieldHandling yieldHandling, FunctionSyntaxKind kind,
|
LexicalScopeNodeType functionBody(InHandling inHandling, YieldHandling yieldHandling,
|
||||||
FunctionBodyType type);
|
FunctionSyntaxKind kind, FunctionBodyType type);
|
||||||
|
|
||||||
Node unaryOpExpr(YieldHandling yieldHandling, ParseNodeKind kind, JSOp op, uint32_t begin);
|
UnaryNodeType unaryOpExpr(YieldHandling yieldHandling, ParseNodeKind kind, JSOp op, uint32_t begin);
|
||||||
|
|
||||||
Node condition(InHandling inHandling, YieldHandling yieldHandling);
|
Node condition(InHandling inHandling, YieldHandling yieldHandling);
|
||||||
|
|
||||||
|
|
@ -1371,27 +1376,30 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
Node comprehensionIf(GeneratorKind comprehensionKind);
|
Node comprehensionIf(GeneratorKind comprehensionKind);
|
||||||
Node comprehensionTail(GeneratorKind comprehensionKind);
|
Node comprehensionTail(GeneratorKind comprehensionKind);
|
||||||
Node comprehension(GeneratorKind comprehensionKind);
|
Node comprehension(GeneratorKind comprehensionKind);
|
||||||
Node arrayComprehension(uint32_t begin);
|
ListNodeType arrayComprehension(uint32_t begin);
|
||||||
Node generatorComprehension(uint32_t begin);
|
Node generatorComprehension(uint32_t begin);
|
||||||
|
|
||||||
bool argumentList(YieldHandling yieldHandling, Node listNode, bool* isSpread,
|
ListNodeType argumentList(YieldHandling yieldHandling, bool* isSpread,
|
||||||
PossibleError* possibleError = nullptr);
|
PossibleError* possibleError = nullptr);
|
||||||
Node destructuringDeclaration(DeclarationKind kind, YieldHandling yieldHandling,
|
Node destructuringDeclaration(DeclarationKind kind, YieldHandling yieldHandling,
|
||||||
TokenKind tt);
|
TokenKind tt);
|
||||||
Node destructuringDeclarationWithoutYieldOrAwait(DeclarationKind kind, YieldHandling yieldHandling,
|
Node destructuringDeclarationWithoutYieldOrAwait(DeclarationKind kind, YieldHandling yieldHandling,
|
||||||
TokenKind tt);
|
TokenKind tt);
|
||||||
|
|
||||||
bool namedImportsOrNamespaceImport(TokenKind tt, Node importSpecSet);
|
bool namedImportsOrNamespaceImport(TokenKind tt, ListNodeType importSpecSet);
|
||||||
bool checkExportedName(JSAtom* exportName);
|
bool checkExportedName(JSAtom* exportName);
|
||||||
|
bool checkExportedNamesForArrayBinding(ListNodeType array);
|
||||||
|
bool checkExportedNamesForObjectBinding(ListNodeType obj);
|
||||||
bool checkExportedNamesForDeclaration(Node node);
|
bool checkExportedNamesForDeclaration(Node node);
|
||||||
|
bool checkExportedNamesForDeclarationList(ListNodeType node);
|
||||||
|
|
||||||
bool checkExportedNameForClause(Node node);
|
bool checkExportedNameForClause(NameNodeType funNode);
|
||||||
bool checkExportedNameForFunction(Node node);
|
bool checkExportedNameForFunction(FunctionNodeType funNode);
|
||||||
bool checkExportedNameForClass(Node node);
|
bool checkExportedNameForClass(ClassNodeType classNode);
|
||||||
|
|
||||||
enum ClassContext { ClassStatement, ClassExpression };
|
enum ClassContext { ClassStatement, ClassExpression };
|
||||||
Node classDefinition(YieldHandling yieldHandling, ClassContext classContext,
|
ClassNodeType classDefinition(YieldHandling yieldHandling, ClassContext classContext,
|
||||||
DefaultHandling defaultHandling);
|
DefaultHandling defaultHandling);
|
||||||
|
|
||||||
bool checkLabelOrIdentifierReference(HandlePropertyName ident,
|
bool checkLabelOrIdentifierReference(HandlePropertyName ident,
|
||||||
uint32_t offset,
|
uint32_t offset,
|
||||||
|
|
@ -1419,7 +1427,7 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
return bindingIdentifier(YieldIsName);
|
return bindingIdentifier(YieldIsName);
|
||||||
}
|
}
|
||||||
|
|
||||||
Node identifierReference(Handle<PropertyName*> name);
|
NameNodeType identifierReference(Handle<PropertyName*> name);
|
||||||
|
|
||||||
bool matchLabel(YieldHandling yieldHandling, MutableHandle<PropertyName*> label);
|
bool matchLabel(YieldHandling yieldHandling, MutableHandle<PropertyName*> label);
|
||||||
|
|
||||||
|
|
@ -1436,19 +1444,19 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
bool hasUsedFunctionSpecialName(HandlePropertyName name);
|
bool hasUsedFunctionSpecialName(HandlePropertyName name);
|
||||||
bool declareFunctionArgumentsObject();
|
bool declareFunctionArgumentsObject();
|
||||||
bool declareFunctionThis();
|
bool declareFunctionThis();
|
||||||
Node newInternalDotName(HandlePropertyName name);
|
NameNodeType newInternalDotName(HandlePropertyName name);
|
||||||
Node newThisName();
|
NameNodeType newThisName();
|
||||||
Node newDotGeneratorName();
|
NameNodeType newDotGeneratorName();
|
||||||
bool declareDotGeneratorName();
|
bool declareDotGeneratorName();
|
||||||
|
|
||||||
bool skipLazyInnerFunction(Node pn, uint32_t toStringStart, FunctionSyntaxKind kind,
|
bool skipLazyInnerFunction(FunctionNodeType funNode, uint32_t toStringStart, FunctionSyntaxKind kind,
|
||||||
bool tryAnnexB);
|
bool tryAnnexB);
|
||||||
bool innerFunction(Node pn, ParseContext* outerpc, HandleFunction fun, uint32_t toStringStart,
|
bool innerFunction(FunctionNodeType funNode, ParseContext* outerpc, HandleFunction fun, uint32_t toStringStart,
|
||||||
InHandling inHandling, YieldHandling yieldHandling,
|
InHandling inHandling, YieldHandling yieldHandling,
|
||||||
FunctionSyntaxKind kind,
|
FunctionSyntaxKind kind,
|
||||||
GeneratorKind generatorKind, FunctionAsyncKind asyncKind, bool tryAnnexB,
|
GeneratorKind generatorKind, FunctionAsyncKind asyncKind, bool tryAnnexB,
|
||||||
Directives inheritedDirectives, Directives* newDirectives);
|
Directives inheritedDirectives, Directives* newDirectives);
|
||||||
bool trySyntaxParseInnerFunction(Node pn, HandleFunction fun, uint32_t toStringStart,
|
bool trySyntaxParseInnerFunction(FunctionNodeType funNode, HandleFunction fun, uint32_t toStringStart,
|
||||||
InHandling inHandling, YieldHandling yieldHandling,
|
InHandling inHandling, YieldHandling yieldHandling,
|
||||||
FunctionSyntaxKind kind,
|
FunctionSyntaxKind kind,
|
||||||
GeneratorKind generatorKind, FunctionAsyncKind asyncKind,
|
GeneratorKind generatorKind, FunctionAsyncKind asyncKind,
|
||||||
|
|
@ -1481,9 +1489,9 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
|
|
||||||
void reportRedeclaration(HandlePropertyName name, DeclarationKind prevKind, TokenPos pos,
|
void reportRedeclaration(HandlePropertyName name, DeclarationKind prevKind, TokenPos pos,
|
||||||
uint32_t prevPos);
|
uint32_t prevPos);
|
||||||
bool notePositionalFormalParameter(Node fn, HandlePropertyName name, uint32_t beginPos,
|
bool notePositionalFormalParameter(FunctionNodeType funNode, HandlePropertyName name, uint32_t beginPos,
|
||||||
bool disallowDuplicateParams, bool* duplicatedParam);
|
bool disallowDuplicateParams, bool* duplicatedParam);
|
||||||
bool noteDestructuredPositionalFormalParameter(Node fn, Node destruct);
|
bool noteDestructuredPositionalFormalParameter(FunctionNodeType funNode, Node destruct);
|
||||||
mozilla::Maybe<DeclarationKind> isVarRedeclaredInEval(HandlePropertyName name,
|
mozilla::Maybe<DeclarationKind> isVarRedeclaredInEval(HandlePropertyName name,
|
||||||
DeclarationKind kind);
|
DeclarationKind kind);
|
||||||
bool tryDeclareVar(HandlePropertyName name, DeclarationKind kind, uint32_t beginPos,
|
bool tryDeclareVar(HandlePropertyName name, DeclarationKind kind, uint32_t beginPos,
|
||||||
|
|
@ -1506,39 +1514,39 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
||||||
bool hasParameterExprs);
|
bool hasParameterExprs);
|
||||||
mozilla::Maybe<VarScope::Data*> newVarScopeData(ParseContext::Scope& scope);
|
mozilla::Maybe<VarScope::Data*> newVarScopeData(ParseContext::Scope& scope);
|
||||||
mozilla::Maybe<LexicalScope::Data*> newLexicalScopeData(ParseContext::Scope& scope);
|
mozilla::Maybe<LexicalScope::Data*> newLexicalScopeData(ParseContext::Scope& scope);
|
||||||
Node finishLexicalScope(ParseContext::Scope& scope, Node body);
|
LexicalScopeNodeType finishLexicalScope(ParseContext::Scope& scope, Node body);
|
||||||
|
|
||||||
Node propertyName(YieldHandling yieldHandling,
|
Node propertyName(YieldHandling yieldHandling,
|
||||||
const mozilla::Maybe<DeclarationKind>& maybeDecl, Node propList,
|
const mozilla::Maybe<DeclarationKind>& maybeDecl, ListNodeType propList,
|
||||||
PropertyType* propType, MutableHandleAtom propAtom);
|
PropertyType* propType, MutableHandleAtom propAtom);
|
||||||
Node computedPropertyName(YieldHandling yieldHandling,
|
UnaryNodeType computedPropertyName(YieldHandling yieldHandling,
|
||||||
const mozilla::Maybe<DeclarationKind>& maybeDecl, Node literal);
|
const mozilla::Maybe<DeclarationKind>& maybeDecl, ListNodeType literal);
|
||||||
Node arrayInitializer(YieldHandling yieldHandling, PossibleError* possibleError);
|
ListNodeType arrayInitializer(YieldHandling yieldHandling, PossibleError* possibleError);
|
||||||
Node newRegExp();
|
RegExpLiteralType newRegExp();
|
||||||
|
|
||||||
Node objectLiteral(YieldHandling yieldHandling, PossibleError* possibleError);
|
ListNodeType objectLiteral(YieldHandling yieldHandling, PossibleError* possibleError);
|
||||||
|
|
||||||
Node bindingInitializer(Node lhs, DeclarationKind kind, YieldHandling yieldHandling);
|
BinaryNodeType bindingInitializer(Node lhs, DeclarationKind kind, YieldHandling yieldHandling);
|
||||||
Node bindingIdentifier(DeclarationKind kind, YieldHandling yieldHandling);
|
NameNodeType bindingIdentifier(DeclarationKind kind, YieldHandling yieldHandling);
|
||||||
Node bindingIdentifierOrPattern(DeclarationKind kind, YieldHandling yieldHandling,
|
Node bindingIdentifierOrPattern(DeclarationKind kind, YieldHandling yieldHandling,
|
||||||
TokenKind tt);
|
TokenKind tt);
|
||||||
Node objectBindingPattern(DeclarationKind kind, YieldHandling yieldHandling);
|
ListNodeType objectBindingPattern(DeclarationKind kind, YieldHandling yieldHandling);
|
||||||
Node arrayBindingPattern(DeclarationKind kind, YieldHandling yieldHandling);
|
ListNodeType arrayBindingPattern(DeclarationKind kind, YieldHandling yieldHandling);
|
||||||
|
|
||||||
void checkDestructuringAssignmentTarget(Node expr, TokenPos exprPos,
|
void checkDestructuringAssignmentTarget(Node expr, TokenPos exprPos,
|
||||||
PossibleError* possibleError);
|
PossibleError* possibleError);
|
||||||
void checkDestructuringAssignmentElement(Node expr, TokenPos exprPos,
|
void checkDestructuringAssignmentElement(Node expr, TokenPos exprPos,
|
||||||
PossibleError* possibleError);
|
PossibleError* possibleError);
|
||||||
|
|
||||||
Node newNumber(const Token& tok) {
|
NumericLiteralType newNumber(const Token& tok) {
|
||||||
return handler.newNumber(tok.number(), tok.decimalPoint(), tok.pos);
|
return handler.newNumber(tok.number(), tok.decimalPoint(), tok.pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Node null() { return ParseHandler::null(); }
|
static typename ParseHandler::NullNode null() { return ParseHandler::null(); }
|
||||||
|
|
||||||
JSAtom* prefixAccessorName(PropertyType propType, HandleAtom propAtom);
|
JSAtom* prefixAccessorName(PropertyType propType, HandleAtom propAtom);
|
||||||
|
|
||||||
bool asmJS(Node list);
|
bool asmJS(ListNodeType list);
|
||||||
|
|
||||||
enum class OptionalKind {
|
enum class OptionalKind {
|
||||||
NonOptional = 0,
|
NonOptional = 0,
|
||||||
|
|
|
||||||
|
|
@ -395,7 +395,7 @@ class FunctionBox : public ObjectBox, public SharedContext
|
||||||
void initWithEnclosingScope(Scope* enclosingScope);
|
void initWithEnclosingScope(Scope* enclosingScope);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ParseNode* functionNode; /* back pointer used by asm.js for error messages */
|
FunctionNode* functionNode; /* back pointer used by asm.js for error messages */
|
||||||
uint32_t bufStart;
|
uint32_t bufStart;
|
||||||
uint32_t bufEnd;
|
uint32_t bufEnd;
|
||||||
uint32_t startLine;
|
uint32_t startLine;
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,13 @@ class SyntaxParseHandler
|
||||||
NodeSuperBase
|
NodeSuperBase
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define DECLARE_TYPE(typeName, longTypeName, asMethodName) \
|
||||||
|
using longTypeName = Node;
|
||||||
|
FOR_EACH_PARSENODE_SUBCLASS(DECLARE_TYPE)
|
||||||
|
#undef DECLARE_TYPE
|
||||||
|
|
||||||
|
using NullNode = Node;
|
||||||
|
|
||||||
bool isPropertyAccess(Node node) {
|
bool isPropertyAccess(Node node) {
|
||||||
return node == NodeDottedProperty || node == NodeElement;
|
return node == NodeDottedProperty || node == NodeElement;
|
||||||
}
|
}
|
||||||
|
|
@ -183,14 +190,21 @@ class SyntaxParseHandler
|
||||||
tokenStream(tokenStream)
|
tokenStream(tokenStream)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
static Node null() { return NodeFailure; }
|
static NullNode null() { return NodeFailure; }
|
||||||
|
|
||||||
|
#define DECLARE_AS(typeName, longTypeName, asMethodName) \
|
||||||
|
static longTypeName asMethodName(Node node) { \
|
||||||
|
return node; \
|
||||||
|
}
|
||||||
|
FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
||||||
|
#undef DECLARE_AS
|
||||||
|
|
||||||
void prepareNodeForMutation(Node node) {}
|
void prepareNodeForMutation(Node node) {}
|
||||||
void freeTree(Node node) {}
|
void freeTree(Node node) {}
|
||||||
|
|
||||||
void trace(JSTracer* trc) {}
|
void trace(JSTracer* trc) {}
|
||||||
|
|
||||||
Node newName(PropertyName* name, const TokenPos& pos, ExclusiveContext* cx) {
|
NameNodeType newName(PropertyName* name, const TokenPos& pos, ExclusiveContext* cx) {
|
||||||
lastAtom = name;
|
lastAtom = name;
|
||||||
if (name == cx->names().arguments)
|
if (name == cx->names().arguments)
|
||||||
return NodeUnparenthesizedArgumentsName;
|
return NodeUnparenthesizedArgumentsName;
|
||||||
|
|
@ -201,65 +215,67 @@ class SyntaxParseHandler
|
||||||
return NodeUnparenthesizedName;
|
return NodeUnparenthesizedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newComputedName(Node expr, uint32_t start, uint32_t end) {
|
UnaryNodeType newComputedName(Node expr, uint32_t start, uint32_t end) {
|
||||||
return NodeGeneric;
|
return NodeGeneric;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newObjectLiteralPropertyName(JSAtom* atom, const TokenPos& pos) {
|
NameNodeType newObjectLiteralPropertyName(JSAtom* atom, const TokenPos& pos) {
|
||||||
return NodeUnparenthesizedName;
|
return NodeUnparenthesizedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newNumber(double value, DecimalPoint decimalPoint, const TokenPos& pos) { return NodeGeneric; }
|
NumericLiteralType newNumber(double value, DecimalPoint decimalPoint, const TokenPos& pos) { return NodeGeneric; }
|
||||||
Node newBooleanLiteral(bool cond, const TokenPos& pos) { return NodeGeneric; }
|
BooleanLiteralType newBooleanLiteral(bool cond, const TokenPos& pos) { return NodeGeneric; }
|
||||||
|
|
||||||
Node newStringLiteral(JSAtom* atom, const TokenPos& pos) {
|
NameNodeType newStringLiteral(JSAtom* atom, const TokenPos& pos) {
|
||||||
lastAtom = atom;
|
lastAtom = atom;
|
||||||
lastStringPos = pos;
|
lastStringPos = pos;
|
||||||
return NodeUnparenthesizedString;
|
return NodeUnparenthesizedString;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newTemplateStringLiteral(JSAtom* atom, const TokenPos& pos) {
|
NameNodeType newTemplateStringLiteral(JSAtom* atom, const TokenPos& pos) {
|
||||||
return NodeGeneric;
|
return NodeGeneric;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newCallSiteObject(uint32_t begin) {
|
CallSiteNodeType newCallSiteObject(uint32_t begin) {
|
||||||
return NodeGeneric;
|
return NodeGeneric;
|
||||||
}
|
}
|
||||||
|
|
||||||
void addToCallSiteObject(Node callSiteObj, Node rawNode, Node cookedNode) {}
|
void addToCallSiteObject(CallSiteNodeType callSiteObj, Node rawNode, Node cookedNode) {}
|
||||||
|
|
||||||
Node newThisLiteral(const TokenPos& pos, Node thisName) { return NodeGeneric; }
|
UnaryNodeType newThisLiteral(const TokenPos& pos, Node thisName) { return NodeGeneric; }
|
||||||
Node newNullLiteral(const TokenPos& pos) { return NodeGeneric; }
|
NullLiteralType newNullLiteral(const TokenPos& pos) { return NodeGeneric; }
|
||||||
Node newRawUndefinedLiteral(const TokenPos& pos) { return NodeGeneric; }
|
RawUndefinedLiteralType newRawUndefinedLiteral(const TokenPos& pos) { return NodeGeneric; }
|
||||||
|
|
||||||
template <class Boxer>
|
template <class Boxer>
|
||||||
Node newRegExp(RegExpObject* reobj, const TokenPos& pos, Boxer& boxer) { return NodeGeneric; }
|
RegExpLiteralType newRegExp(RegExpObject* reobj, const TokenPos& pos, Boxer& boxer) { return NodeGeneric; }
|
||||||
|
|
||||||
Node newConditional(Node cond, Node thenExpr, Node elseExpr) { return NodeGeneric; }
|
ConditionalExpressionType newConditional(Node cond, Node thenExpr, Node elseExpr) {
|
||||||
|
return NodeGeneric;
|
||||||
|
}
|
||||||
|
|
||||||
Node newElision() { return NodeGeneric; }
|
Node newElision() { return NodeGeneric; }
|
||||||
|
|
||||||
Node newDelete(uint32_t begin, Node expr) {
|
UnaryNodeType newDelete(uint32_t begin, Node expr) {
|
||||||
return NodeUnparenthesizedUnary;
|
return NodeUnparenthesizedUnary;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newTypeof(uint32_t begin, Node kid) {
|
UnaryNodeType newTypeof(uint32_t begin, Node kid) {
|
||||||
return NodeUnparenthesizedUnary;
|
return NodeUnparenthesizedUnary;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newNullary(ParseNodeKind kind, JSOp op, const TokenPos& pos) {
|
NullaryNodeType newNullary(ParseNodeKind kind, JSOp op, const TokenPos& pos) {
|
||||||
return NodeGeneric;
|
return NodeGeneric;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newUnary(ParseNodeKind kind, JSOp op, uint32_t begin, Node kid) {
|
UnaryNodeType newUnary(ParseNodeKind kind, JSOp op, uint32_t begin, Node kid) {
|
||||||
return NodeUnparenthesizedUnary;
|
return NodeUnparenthesizedUnary;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newUpdate(ParseNodeKind kind, uint32_t begin, Node kid) {
|
UnaryNodeType newUpdate(ParseNodeKind kind, uint32_t begin, Node kid) {
|
||||||
return NodeGeneric;
|
return NodeGeneric;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newSpread(uint32_t begin, Node kid) {
|
UnaryNodeType newSpread(uint32_t begin, Node kid) {
|
||||||
return NodeGeneric;
|
return NodeGeneric;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -283,112 +299,127 @@ class SyntaxParseHandler
|
||||||
|
|
||||||
// Expressions
|
// Expressions
|
||||||
|
|
||||||
Node newArrayComprehension(Node body, const TokenPos& pos) { return NodeGeneric; }
|
ListNodeType newArrayLiteral(uint32_t begin) { return NodeUnparenthesizedArray; }
|
||||||
Node newArrayLiteral(uint32_t begin) { return NodeUnparenthesizedArray; }
|
MOZ_MUST_USE bool addElision(ListNodeType literal, const TokenPos& pos) { return true; }
|
||||||
MOZ_MUST_USE bool addElision(Node literal, const TokenPos& pos) { return true; }
|
MOZ_MUST_USE bool addSpreadElement(ListNodeType literal, uint32_t begin, Node inner) { return true; }
|
||||||
MOZ_MUST_USE bool addSpreadElement(Node literal, uint32_t begin, Node inner) { return true; }
|
void addArrayElement(ListNodeType literal, Node element) { }
|
||||||
void addArrayElement(Node literal, Node element) { }
|
|
||||||
|
|
||||||
Node newCall() { return NodeFunctionCall; }
|
BinaryNodeType newCall(Node callee, Node args) { return NodeFunctionCall; }
|
||||||
Node newOptionalCall() { return NodeOptionalFunctionCall; }
|
BinaryNodeType newOptionalCall(Node callee, Node args) { return NodeOptionalFunctionCall; }
|
||||||
Node newTaggedTemplate() { return NodeGeneric; }
|
ListNodeType newArguments(const TokenPos& pos) { return NodeGeneric; }
|
||||||
|
BinaryNodeType newSuperCall(Node callee, Node args) { return NodeGeneric; }
|
||||||
|
BinaryNodeType newTaggedTemplate(Node callee, Node args) { return NodeGeneric; }
|
||||||
|
Node newGenExp(Node callee, Node args) { return NodeGeneric; }
|
||||||
|
|
||||||
Node newObjectLiteral(uint32_t begin) { return NodeUnparenthesizedObject; }
|
ListNodeType newObjectLiteral(uint32_t begin) { return NodeUnparenthesizedObject; }
|
||||||
Node newClassMethodList(uint32_t begin) { return NodeGeneric; }
|
ListNodeType newClassMethodList(uint32_t begin) { return NodeGeneric; }
|
||||||
Node newClassNames(Node outer, Node inner, const TokenPos& pos) { return NodeGeneric; }
|
ClassNamesType newClassNames(Node outer, Node inner, const TokenPos& pos) { return NodeGeneric; }
|
||||||
Node newClass(Node name, Node heritage, Node methodBlock, const TokenPos& pos) { return NodeGeneric; }
|
ClassNodeType newClass(Node name, Node heritage, Node methodBlock, const TokenPos& pos) { return NodeGeneric; }
|
||||||
|
|
||||||
Node newNewTarget(Node newHolder, Node targetHolder) { return NodeGeneric; }
|
LexicalScopeNodeType newLexicalScope(Node body) {
|
||||||
Node newPosHolder(const TokenPos& pos) { return NodeGeneric; }
|
return NodeLexicalDeclaration;
|
||||||
Node newSuperBase(Node thisName, const TokenPos& pos) { return NodeSuperBase; }
|
}
|
||||||
|
|
||||||
MOZ_MUST_USE bool addPrototypeMutation(Node literal, uint32_t begin, Node expr) { return true; }
|
BinaryNodeType newNewTarget(NullaryNodeType newHolder, NullaryNodeType targetHolder) {
|
||||||
MOZ_MUST_USE bool addPropertyDefinition(Node literal, Node name, Node expr) { return true; }
|
return NodeGeneric;
|
||||||
MOZ_MUST_USE bool addShorthand(Node literal, Node name, Node expr) { return true; }
|
}
|
||||||
MOZ_MUST_USE bool addSpreadProperty(Node literal, uint32_t begin, Node inner) { return true; }
|
NullaryNodeType newPosHolder(const TokenPos& pos) { return NodeGeneric; }
|
||||||
MOZ_MUST_USE bool addObjectMethodDefinition(Node literal, Node name, Node fn, JSOp op) { return true; }
|
UnaryNodeType newSuperBase(Node thisName, const TokenPos& pos) { return NodeSuperBase; }
|
||||||
MOZ_MUST_USE bool addClassMethodDefinition(Node literal, Node name, Node fn, JSOp op, bool isStatic) { return true; }
|
|
||||||
Node newYieldExpression(uint32_t begin, Node value) { return NodeGeneric; }
|
MOZ_MUST_USE bool addPrototypeMutation(ListNodeType literal, uint32_t begin, Node expr) { return true; }
|
||||||
Node newYieldStarExpression(uint32_t begin, Node value) { return NodeGeneric; }
|
MOZ_MUST_USE bool addPropertyDefinition(ListNodeType literal, Node name, Node expr) { return true; }
|
||||||
Node newAwaitExpression(uint32_t begin, Node value) { return NodeGeneric; }
|
MOZ_MUST_USE bool addShorthand(ListNodeType literal, NameNodeType name, NameNodeType expr) { return true; }
|
||||||
|
MOZ_MUST_USE bool addSpreadProperty(ListNodeType literal, uint32_t begin, Node inner) { return true; }
|
||||||
|
MOZ_MUST_USE bool addObjectMethodDefinition(ListNodeType literal, Node name, FunctionNodeType funNode, JSOp op) { return true; }
|
||||||
|
MOZ_MUST_USE bool addClassMethodDefinition(ListNodeType literal, Node name, FunctionNodeType funNode, JSOp op, bool isStatic) { return true; }
|
||||||
|
UnaryNodeType newYieldExpression(uint32_t begin, Node value) { return NodeGeneric; }
|
||||||
|
UnaryNodeType newYieldStarExpression(uint32_t begin, Node value) { return NodeGeneric; }
|
||||||
|
UnaryNodeType newAwaitExpression(uint32_t begin, Node value) { return NodeGeneric; }
|
||||||
Node newOptionalChain(uint32_t begin, Node value) { return NodeGeneric; }
|
Node newOptionalChain(uint32_t begin, Node value) { return NodeGeneric; }
|
||||||
|
|
||||||
// Statements
|
// Statements
|
||||||
|
|
||||||
Node newStatementList(const TokenPos& pos) { return NodeGeneric; }
|
ListNodeType newStatementList(const TokenPos& pos) { return NodeGeneric; }
|
||||||
void addStatementToList(Node list, Node stmt) {}
|
void addStatementToList(ListNodeType list, Node stmt) {}
|
||||||
void addCaseStatementToList(Node list, Node stmt) {}
|
void addCaseStatementToList(ListNodeType list, CaseClauseType caseClause) {}
|
||||||
MOZ_MUST_USE bool prependInitialYield(Node stmtList, Node gen) { return true; }
|
MOZ_MUST_USE bool prependInitialYield(ListNodeType stmtList, Node genName) { return true; }
|
||||||
Node newEmptyStatement(const TokenPos& pos) { return NodeEmptyStatement; }
|
UnaryNodeType newEmptyStatement(const TokenPos& pos) { return NodeEmptyStatement; }
|
||||||
|
|
||||||
Node newExportDeclaration(Node kid, const TokenPos& pos) {
|
UnaryNodeType newExportDeclaration(Node kid, const TokenPos& pos) {
|
||||||
return NodeGeneric;
|
return NodeGeneric;
|
||||||
}
|
}
|
||||||
Node newExportFromDeclaration(uint32_t begin, Node exportSpecSet, Node moduleSpec) {
|
BinaryNodeType newExportFromDeclaration(uint32_t begin, Node exportSpecSet, Node moduleSpec) {
|
||||||
return NodeGeneric;
|
return NodeGeneric;
|
||||||
}
|
}
|
||||||
Node newExportDefaultDeclaration(Node kid, Node maybeBinding, const TokenPos& pos) {
|
BinaryNodeType newExportDefaultDeclaration(Node kid, Node maybeBinding, const TokenPos& pos) {
|
||||||
return NodeGeneric;
|
return NodeGeneric;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newSetThis(Node thisName, Node value) { return value; }
|
BinaryNodeType newSetThis(Node thisName, Node value) { return value; }
|
||||||
|
|
||||||
Node newExprStatement(Node expr, uint32_t end) {
|
UnaryNodeType newExprStatement(Node expr, uint32_t end) {
|
||||||
return expr == NodeUnparenthesizedString ? NodeStringExprStatement : NodeGeneric;
|
return expr == NodeUnparenthesizedString ? NodeStringExprStatement : NodeGeneric;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newIfStatement(uint32_t begin, Node cond, Node then, Node else_) { return NodeGeneric; }
|
TernaryNodeType newIfStatement(uint32_t begin, Node cond, Node thenBranch, Node elseBranch) {
|
||||||
Node newDoWhileStatement(Node body, Node cond, const TokenPos& pos) { return NodeGeneric; }
|
return NodeGeneric;
|
||||||
Node newWhileStatement(uint32_t begin, Node cond, Node body) { return NodeGeneric; }
|
}
|
||||||
Node newSwitchStatement(uint32_t begin, Node discriminant, Node caseList) { return NodeGeneric; }
|
BinaryNodeType newDoWhileStatement(Node body, Node cond, const TokenPos& pos) { return NodeGeneric; }
|
||||||
Node newCaseOrDefault(uint32_t begin, Node expr, Node body) { return NodeGeneric; }
|
BinaryNodeType newWhileStatement(uint32_t begin, Node cond, Node body) { return NodeGeneric; }
|
||||||
Node newContinueStatement(PropertyName* label, const TokenPos& pos) { return NodeGeneric; }
|
SwitchStatementType newSwitchStatement(uint32_t begin, Node discriminant,
|
||||||
Node newBreakStatement(PropertyName* label, const TokenPos& pos) { return NodeBreak; }
|
LexicalScopeNodeType lexicalForCaseList, bool hasDefault)
|
||||||
Node newReturnStatement(Node expr, const TokenPos& pos) { return NodeReturn; }
|
{
|
||||||
Node newWithStatement(uint32_t begin, Node expr, Node body) { return NodeGeneric; }
|
return NodeGeneric;
|
||||||
|
}
|
||||||
|
CaseClauseType newCaseOrDefault(uint32_t begin, Node expr, Node body) { return NodeGeneric; }
|
||||||
|
ContinueStatementType newContinueStatement(PropertyName* label, const TokenPos& pos) { return NodeGeneric; }
|
||||||
|
BreakStatementType newBreakStatement(PropertyName* label, const TokenPos& pos) { return NodeBreak; }
|
||||||
|
UnaryNodeType newReturnStatement(Node expr, const TokenPos& pos) { return NodeReturn; }
|
||||||
|
BinaryNodeType newWithStatement(uint32_t begin, Node expr, Node body) { return NodeGeneric; }
|
||||||
|
|
||||||
Node newLabeledStatement(PropertyName* label, Node stmt, uint32_t begin) {
|
LabeledStatementType newLabeledStatement(PropertyName* label, Node stmt, uint32_t begin) {
|
||||||
return NodeGeneric;
|
return NodeGeneric;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newThrowStatement(Node expr, const TokenPos& pos) { return NodeThrow; }
|
UnaryNodeType newThrowStatement(Node expr, const TokenPos& pos) { return NodeThrow; }
|
||||||
Node newTryStatement(uint32_t begin, Node body, Node catchList, Node finallyBlock) {
|
Node newTryStatement(uint32_t begin, Node body, ListNodeType catchList, Node finallyBlock) {
|
||||||
return NodeGeneric;
|
return NodeGeneric;
|
||||||
}
|
}
|
||||||
Node newDebuggerStatement(const TokenPos& pos) { return NodeGeneric; }
|
DebuggerStatementType newDebuggerStatement(const TokenPos& pos) { return NodeGeneric; }
|
||||||
|
|
||||||
Node newPropertyAccess(Node pn, PropertyName* name, uint32_t end) {
|
NameNodeType newPropertyName(PropertyName* name, const TokenPos& pos) {
|
||||||
lastAtom = name;
|
lastAtom = name;
|
||||||
|
return NodeGeneric;
|
||||||
|
}
|
||||||
|
|
||||||
|
PropertyAccessType newPropertyAccess(Node expr, NameNodeType key) {
|
||||||
return NodeDottedProperty;
|
return NodeDottedProperty;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newOptionalPropertyAccess(Node pn, PropertyName* name, uint32_t end) {
|
Node newOptionalPropertyAccess(Node expr, NameNodeType key) {
|
||||||
lastAtom = name;
|
|
||||||
return NodeOptionalDottedProperty;
|
return NodeOptionalDottedProperty;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newPropertyByValue(Node pn, Node kid, uint32_t end) { return NodeElement; }
|
PropertyByValueType newPropertyByValue(Node lhs, Node index, uint32_t end) { return NodeElement; }
|
||||||
|
|
||||||
Node newOptionalPropertyByValue(Node pn, Node kid, uint32_t end) { return NodeOptionalElement; }
|
Node newOptionalPropertyByValue(Node pn, Node kid, uint32_t end) { return NodeOptionalElement; }
|
||||||
|
|
||||||
MOZ_MUST_USE bool addCatchBlock(Node catchList, Node letBlock, Node catchName,
|
MOZ_MUST_USE bool addCatchBlock(ListNodeType catchList, LexicalScopeNodeType lexicalScope,
|
||||||
Node catchGuard, Node catchBody) { return true; }
|
Node catchBinding, Node catchGuard, Node catchBody) { return true; }
|
||||||
|
|
||||||
MOZ_MUST_USE bool setLastFunctionFormalParameterDefault(Node funcpn, Node pn) { return true; }
|
MOZ_MUST_USE bool setLastFunctionFormalParameterDefault(FunctionNodeType funNode, Node pn) { return true; }
|
||||||
|
|
||||||
void checkAndSetIsDirectRHSAnonFunction(Node pn) {}
|
void checkAndSetIsDirectRHSAnonFunction(Node pn) {}
|
||||||
|
|
||||||
Node newFunctionStatement() { return NodeFunctionDefinition; }
|
FunctionNodeType newFunction(FunctionSyntaxKind syntaxKind) { return NodeFunctionDefinition; }
|
||||||
Node newFunctionExpression() { return NodeFunctionDefinition; }
|
|
||||||
Node newArrowFunction() { return NodeFunctionDefinition; }
|
|
||||||
|
|
||||||
bool setComprehensionLambdaBody(Node pn, Node body) { return true; }
|
bool setComprehensionLambdaBody(FunctionNodeType funNode, ListNodeType body) { return true; }
|
||||||
void setFunctionFormalParametersAndBody(Node pn, Node kid) {}
|
void setFunctionFormalParametersAndBody(FunctionNodeType funNode, ListNodeType paramsBody) {}
|
||||||
void setFunctionBody(Node pn, Node kid) {}
|
void setFunctionBody(FunctionNodeType funNode, LexicalScopeNodeType body) {}
|
||||||
void setFunctionBox(Node pn, FunctionBox* funbox) {}
|
void setFunctionBox(FunctionNodeType funNode, FunctionBox* funbox) {}
|
||||||
void addFunctionFormalParameter(Node pn, Node argpn) {}
|
void addFunctionFormalParameter(FunctionNodeType funNode, Node argpn) {}
|
||||||
|
|
||||||
Node newForStatement(uint32_t begin, Node forHead, Node body, unsigned iflags) {
|
ForNodeType newForStatement(uint32_t begin, TernaryNodeType forHead, Node body, unsigned iflags) {
|
||||||
return NodeGeneric;
|
return NodeGeneric;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -404,15 +435,15 @@ class SyntaxParseHandler
|
||||||
return NodeGeneric;
|
return NodeGeneric;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newForHead(Node init, Node test, Node update, const TokenPos& pos) {
|
TernaryNodeType newForHead(Node init, Node test, Node update, const TokenPos& pos) {
|
||||||
return NodeGeneric;
|
return NodeGeneric;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newForInOrOfHead(ParseNodeKind kind, Node target, Node iteratedExpr, const TokenPos& pos) {
|
TernaryNodeType newForInOrOfHead(ParseNodeKind kind, Node target, Node iteratedExpr, const TokenPos& pos) {
|
||||||
return NodeGeneric;
|
return NodeGeneric;
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_MUST_USE bool finishInitializerAssignment(Node pn, Node init) { return true; }
|
MOZ_MUST_USE bool finishInitializerAssignment(NameNodeType nameNode, Node init) { return true; }
|
||||||
|
|
||||||
void setBeginPosition(Node pn, Node oth) {}
|
void setBeginPosition(Node pn, Node oth) {}
|
||||||
void setBeginPosition(Node pn, uint32_t begin) {}
|
void setBeginPosition(Node pn, uint32_t begin) {}
|
||||||
|
|
@ -425,26 +456,26 @@ class SyntaxParseHandler
|
||||||
return tokenStream.currentToken().pos;
|
return tokenStream.currentToken().pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newList(ParseNodeKind kind, JSOp op = JSOP_NOP) {
|
ListNodeType newList(ParseNodeKind kind, JSOp op = JSOP_NOP) {
|
||||||
MOZ_ASSERT(kind != PNK_VAR);
|
MOZ_ASSERT(kind != PNK_VAR);
|
||||||
MOZ_ASSERT(kind != PNK_LET);
|
MOZ_ASSERT(kind != PNK_LET);
|
||||||
MOZ_ASSERT(kind != PNK_CONST);
|
MOZ_ASSERT(kind != PNK_CONST);
|
||||||
return NodeGeneric;
|
return NodeGeneric;
|
||||||
}
|
}
|
||||||
Node newList(ParseNodeKind kind, uint32_t begin, JSOp op = JSOP_NOP) {
|
ListNodeType newList(ParseNodeKind kind, uint32_t begin, JSOp op = JSOP_NOP) {
|
||||||
return newList(kind, op);
|
return newList(kind, op);
|
||||||
}
|
}
|
||||||
Node newList(ParseNodeKind kind, Node kid, JSOp op = JSOP_NOP) {
|
ListNodeType newList(ParseNodeKind kind, Node kid, JSOp op = JSOP_NOP) {
|
||||||
return newList(kind, op);
|
return newList(kind, op);
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newDeclarationList(ParseNodeKind kind, JSOp op = JSOP_NOP) {
|
ListNodeType newDeclarationList(ParseNodeKind kind, JSOp op = JSOP_NOP) {
|
||||||
if (kind == PNK_VAR)
|
if (kind == PNK_VAR)
|
||||||
return NodeVarDeclaration;
|
return NodeVarDeclaration;
|
||||||
MOZ_ASSERT(kind == PNK_LET || kind == PNK_CONST);
|
MOZ_ASSERT(kind == PNK_LET || kind == PNK_CONST);
|
||||||
return NodeLexicalDeclaration;
|
return NodeLexicalDeclaration;
|
||||||
}
|
}
|
||||||
Node newDeclarationList(ParseNodeKind kind, Node kid, JSOp op = JSOP_NOP) {
|
ListNodeType newDeclarationList(ParseNodeKind kind, Node kid, JSOp op = JSOP_NOP) {
|
||||||
return newDeclarationList(kind, op);
|
return newDeclarationList(kind, op);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -452,7 +483,7 @@ class SyntaxParseHandler
|
||||||
return node == NodeVarDeclaration || node == NodeLexicalDeclaration;
|
return node == NodeVarDeclaration || node == NodeLexicalDeclaration;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node singleBindingFromDeclaration(Node decl) {
|
Node singleBindingFromDeclaration(ListNodeType decl) {
|
||||||
MOZ_ASSERT(isDeclarationList(decl));
|
MOZ_ASSERT(isDeclarationList(decl));
|
||||||
|
|
||||||
// This is, unfortunately, very dodgy. Obviously NodeVarDeclaration
|
// This is, unfortunately, very dodgy. Obviously NodeVarDeclaration
|
||||||
|
|
@ -476,11 +507,11 @@ class SyntaxParseHandler
|
||||||
return newList(PNK_CATCHLIST, JSOP_NOP);
|
return newList(PNK_CATCHLIST, JSOP_NOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newCommaExpressionList(Node kid) {
|
ListNodeType newCommaExpressionList(Node kid) {
|
||||||
return NodeUnparenthesizedCommaExpr;
|
return NodeUnparenthesizedCommaExpr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void addList(Node list, Node kid) {
|
void addList(ListNodeType list, Node kid) {
|
||||||
MOZ_ASSERT(list == NodeGeneric ||
|
MOZ_ASSERT(list == NodeGeneric ||
|
||||||
list == NodeUnparenthesizedArray ||
|
list == NodeUnparenthesizedArray ||
|
||||||
list == NodeUnparenthesizedObject ||
|
list == NodeUnparenthesizedObject ||
|
||||||
|
|
@ -491,7 +522,12 @@ class SyntaxParseHandler
|
||||||
list == NodeOptionalFunctionCall);
|
list == NodeOptionalFunctionCall);
|
||||||
}
|
}
|
||||||
|
|
||||||
Node newAssignment(ParseNodeKind kind, Node lhs, Node rhs, JSOp op) {
|
|
||||||
|
BinaryNodeType newNewExpression(uint32_t begin, Node ctor, Node args) {
|
||||||
|
return NodeGeneric;
|
||||||
|
}
|
||||||
|
|
||||||
|
AssignmentNodeType newAssignment(ParseNodeKind kind, Node lhs, Node rhs, JSOp op) {
|
||||||
if (kind == PNK_ASSIGN)
|
if (kind == PNK_ASSIGN)
|
||||||
return NodeUnparenthesizedAssignment;
|
return NodeUnparenthesizedAssignment;
|
||||||
return newBinary(kind, lhs, rhs, op);
|
return newBinary(kind, lhs, rhs, op);
|
||||||
|
|
@ -525,7 +561,7 @@ class SyntaxParseHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
void setOp(Node pn, JSOp op) {}
|
void setOp(Node pn, JSOp op) {}
|
||||||
void setListFlag(Node pn, unsigned flag) {}
|
void setListHasNonConstInitializer(ListNodeType literal) {}
|
||||||
MOZ_MUST_USE Node parenthesize(Node node) {
|
MOZ_MUST_USE Node parenthesize(Node node) {
|
||||||
// A number of nodes have different behavior upon parenthesization, but
|
// A number of nodes have different behavior upon parenthesization, but
|
||||||
// only in some circumstances. Convert these nodes to special
|
// only in some circumstances. Convert these nodes to special
|
||||||
|
|
@ -556,10 +592,11 @@ class SyntaxParseHandler
|
||||||
// to the unparenthesized form: return |node| unchanged.
|
// to the unparenthesized form: return |node| unchanged.
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
MOZ_MUST_USE Node setLikelyIIFE(Node pn) {
|
template <typename NodeType>
|
||||||
return pn; // Remain in syntax-parse mode.
|
MOZ_MUST_USE NodeType setLikelyIIFE(NodeType node) {
|
||||||
|
return node; // Remain in syntax-parse mode.
|
||||||
}
|
}
|
||||||
void setInDirectivePrologue(Node pn) {}
|
void setInDirectivePrologue(UnaryNodeType exprStmt) {}
|
||||||
|
|
||||||
bool isConstant(Node pn) { return false; }
|
bool isConstant(Node pn) { return false; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1330,7 +1330,7 @@ ExpressionDecompiler::decompilePC(jsbytecode* pc)
|
||||||
write("]");
|
write("]");
|
||||||
case JSOP_GETELEM_SUPER:
|
case JSOP_GETELEM_SUPER:
|
||||||
return write("super[") &&
|
return write("super[") &&
|
||||||
decompilePCForStackOperand(pc, -3) &&
|
decompilePCForStackOperand(pc, -2) &&
|
||||||
write("]");
|
write("]");
|
||||||
case JSOP_NULL:
|
case JSOP_NULL:
|
||||||
return write(js_null_str);
|
return write(js_null_str);
|
||||||
|
|
|
||||||
|
|
@ -2853,9 +2853,9 @@ END_CASE(JSOP_GETELEM)
|
||||||
|
|
||||||
CASE(JSOP_GETELEM_SUPER)
|
CASE(JSOP_GETELEM_SUPER)
|
||||||
{
|
{
|
||||||
HandleValue rval = REGS.stackHandleAt(-3);
|
|
||||||
ReservedRooted<JSObject*> receiver(&rootObject0);
|
ReservedRooted<JSObject*> receiver(&rootObject0);
|
||||||
FETCH_OBJECT(cx, -2, receiver);
|
FETCH_OBJECT(cx, -3, receiver);
|
||||||
|
HandleValue rval = REGS.stackHandleAt(-2);
|
||||||
ReservedRooted<JSObject*> obj(&rootObject1, ®S.sp[-1].toObject());
|
ReservedRooted<JSObject*> obj(&rootObject1, ®S.sp[-1].toObject());
|
||||||
|
|
||||||
MutableHandleValue res = REGS.stackHandleAt(-3);
|
MutableHandleValue res = REGS.stackHandleAt(-3);
|
||||||
|
|
@ -2897,9 +2897,9 @@ CASE(JSOP_STRICTSETELEM_SUPER)
|
||||||
static_assert(JSOP_SETELEM_SUPER_LENGTH == JSOP_STRICTSETELEM_SUPER_LENGTH,
|
static_assert(JSOP_SETELEM_SUPER_LENGTH == JSOP_STRICTSETELEM_SUPER_LENGTH,
|
||||||
"setelem-super and strictsetelem-super must be the same size");
|
"setelem-super and strictsetelem-super must be the same size");
|
||||||
|
|
||||||
|
ReservedRooted<Value> receiver(&rootValue0, REGS.sp[-4]);
|
||||||
ReservedRooted<jsid> id(&rootId0);
|
ReservedRooted<jsid> id(&rootId0);
|
||||||
FETCH_ELEMENT_ID(-4, id);
|
FETCH_ELEMENT_ID(-3, id);
|
||||||
ReservedRooted<Value> receiver(&rootValue0, REGS.sp[-3]);
|
|
||||||
ReservedRooted<JSObject*> obj(&rootObject1, ®S.sp[-2].toObject());
|
ReservedRooted<JSObject*> obj(&rootObject1, ®S.sp[-2].toObject());
|
||||||
HandleValue value = REGS.stackHandleAt(-1);
|
HandleValue value = REGS.stackHandleAt(-1);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -535,7 +535,7 @@
|
||||||
macro(JSOP_GETELEM, 55, "getelem", NULL, 1, 2, 1, JOF_BYTE |JOF_ELEM|JOF_TYPESET|JOF_LEFTASSOC) \
|
macro(JSOP_GETELEM, 55, "getelem", NULL, 1, 2, 1, JOF_BYTE |JOF_ELEM|JOF_TYPESET|JOF_LEFTASSOC) \
|
||||||
/*
|
/*
|
||||||
* Pops the top three values on the stack as 'val', 'propval' and 'obj',
|
* Pops the top three values on the stack as 'val', 'propval' and 'obj',
|
||||||
* sets 'propval' property of 'obj' as 'val', pushes 'obj' onto the
|
* sets 'propval' property of 'obj' as 'val', pushes 'val' onto the
|
||||||
* stack.
|
* stack.
|
||||||
* Category: Literals
|
* Category: Literals
|
||||||
* Type: Object
|
* Type: Object
|
||||||
|
|
@ -545,7 +545,7 @@
|
||||||
macro(JSOP_SETELEM, 56, "setelem", NULL, 1, 3, 1, JOF_BYTE |JOF_ELEM|JOF_SET|JOF_DETECTING|JOF_CHECKSLOPPY) \
|
macro(JSOP_SETELEM, 56, "setelem", NULL, 1, 3, 1, JOF_BYTE |JOF_ELEM|JOF_SET|JOF_DETECTING|JOF_CHECKSLOPPY) \
|
||||||
/*
|
/*
|
||||||
* Pops the top three values on the stack as 'val', 'propval' and 'obj',
|
* Pops the top three values on the stack as 'val', 'propval' and 'obj',
|
||||||
* sets 'propval' property of 'obj' as 'val', pushes 'obj' onto the
|
* sets 'propval' property of 'obj' as 'val', pushes 'val' onto the
|
||||||
* stack. Throws a TypeError if the set fails, per strict mode
|
* stack. Throws a TypeError if the set fails, per strict mode
|
||||||
* semantics.
|
* semantics.
|
||||||
* Category: Literals
|
* Category: Literals
|
||||||
|
|
@ -1277,7 +1277,7 @@
|
||||||
* Category: Literals
|
* Category: Literals
|
||||||
* Type: Object
|
* Type: Object
|
||||||
* Operands:
|
* Operands:
|
||||||
* Stack: receiver, obj, propval => obj[propval]
|
* Stack: receiver, propval, obj => obj[propval]
|
||||||
*/ \
|
*/ \
|
||||||
macro(JSOP_GETELEM_SUPER, 125, "getelem-super", NULL, 1, 3, 1, JOF_BYTE |JOF_ELEM|JOF_LEFTASSOC) \
|
macro(JSOP_GETELEM_SUPER, 125, "getelem-super", NULL, 1, 3, 1, JOF_BYTE |JOF_ELEM|JOF_LEFTASSOC) \
|
||||||
/*
|
/*
|
||||||
|
|
@ -1637,7 +1637,7 @@
|
||||||
* Category: Literals
|
* Category: Literals
|
||||||
* Type: Object
|
* Type: Object
|
||||||
* Operands:
|
* Operands:
|
||||||
* Stack: propval, receiver, obj, val => val
|
* Stack: receiver, propval, obj, val => val
|
||||||
*/ \
|
*/ \
|
||||||
macro(JSOP_SETELEM_SUPER, 158, "setelem-super", NULL, 1, 4, 1, JOF_BYTE |JOF_ELEM|JOF_SET|JOF_DETECTING|JOF_CHECKSLOPPY) \
|
macro(JSOP_SETELEM_SUPER, 158, "setelem-super", NULL, 1, 4, 1, JOF_BYTE |JOF_ELEM|JOF_SET|JOF_DETECTING|JOF_CHECKSLOPPY) \
|
||||||
/*
|
/*
|
||||||
|
|
@ -1646,7 +1646,7 @@
|
||||||
* Category: Literals
|
* Category: Literals
|
||||||
* Type: Object
|
* Type: Object
|
||||||
* Operands:
|
* Operands:
|
||||||
* Stack: propval, receiver, obj, val => val
|
* Stack: receiver, propval, obj, val => val
|
||||||
*/ \
|
*/ \
|
||||||
macro(JSOP_STRICTSETELEM_SUPER, 159, "strict-setelem-super", NULL, 1, 4, 1, JOF_BYTE |JOF_ELEM|JOF_SET|JOF_DETECTING|JOF_CHECKSTRICT) \
|
macro(JSOP_STRICTSETELEM_SUPER, 159, "strict-setelem-super", NULL, 1, 4, 1, JOF_BYTE |JOF_ELEM|JOF_SET|JOF_DETECTING|JOF_CHECKSTRICT) \
|
||||||
\
|
\
|
||||||
|
|
|
||||||
|
|
@ -401,22 +401,19 @@ NextNode(ParseNode* pn)
|
||||||
static inline ParseNode*
|
static inline ParseNode*
|
||||||
UnaryKid(ParseNode* pn)
|
UnaryKid(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isArity(PN_UNARY));
|
return pn->as<UnaryNode>().kid();
|
||||||
return pn->pn_kid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ParseNode*
|
static inline ParseNode*
|
||||||
BinaryRight(ParseNode* pn)
|
BinaryRight(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isArity(PN_BINARY));
|
return pn->as<BinaryNode>().right();
|
||||||
return pn->pn_right;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ParseNode*
|
static inline ParseNode*
|
||||||
BinaryLeft(ParseNode* pn)
|
BinaryLeft(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isArity(PN_BINARY));
|
return pn->as<BinaryNode>().left();
|
||||||
return pn->pn_left;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ParseNode*
|
static inline ParseNode*
|
||||||
|
|
@ -429,58 +426,52 @@ ReturnExpr(ParseNode* pn)
|
||||||
static inline ParseNode*
|
static inline ParseNode*
|
||||||
TernaryKid1(ParseNode* pn)
|
TernaryKid1(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isArity(PN_TERNARY));
|
return pn->as<TernaryNode>().kid1();
|
||||||
return pn->pn_kid1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ParseNode*
|
static inline ParseNode*
|
||||||
TernaryKid2(ParseNode* pn)
|
TernaryKid2(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isArity(PN_TERNARY));
|
return pn->as<TernaryNode>().kid2();
|
||||||
return pn->pn_kid2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ParseNode*
|
static inline ParseNode*
|
||||||
TernaryKid3(ParseNode* pn)
|
TernaryKid3(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isArity(PN_TERNARY));
|
return pn->as<TernaryNode>().kid3();
|
||||||
return pn->pn_kid3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ParseNode*
|
static inline ParseNode*
|
||||||
ListHead(ParseNode* pn)
|
ListHead(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isArity(PN_LIST));
|
return pn->as<ListNode>().head();
|
||||||
return pn->pn_head;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned
|
static inline unsigned
|
||||||
ListLength(ParseNode* pn)
|
ListLength(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isArity(PN_LIST));
|
return pn->as<ListNode>().count();
|
||||||
return pn->pn_count;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ParseNode*
|
static inline ParseNode*
|
||||||
CallCallee(ParseNode* pn)
|
CallCallee(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isKind(PNK_CALL));
|
MOZ_ASSERT(pn->isKind(PNK_CALL));
|
||||||
return ListHead(pn);
|
return BinaryLeft(pn);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned
|
static inline unsigned
|
||||||
CallArgListLength(ParseNode* pn)
|
CallArgListLength(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isKind(PNK_CALL));
|
MOZ_ASSERT(pn->isKind(PNK_CALL));
|
||||||
MOZ_ASSERT(ListLength(pn) >= 1);
|
return ListLength(BinaryRight(pn));
|
||||||
return ListLength(pn) - 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ParseNode*
|
static inline ParseNode*
|
||||||
CallArgList(ParseNode* pn)
|
CallArgList(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isKind(PNK_CALL));
|
MOZ_ASSERT(pn->isKind(PNK_CALL));
|
||||||
return NextNode(ListHead(pn));
|
return ListHead(BinaryRight(pn));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ParseNode*
|
static inline ParseNode*
|
||||||
|
|
@ -512,8 +503,7 @@ static inline ParseNode*
|
||||||
BinaryOpLeft(ParseNode* pn)
|
BinaryOpLeft(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isBinaryOperation());
|
MOZ_ASSERT(pn->isBinaryOperation());
|
||||||
MOZ_ASSERT(pn->isArity(PN_LIST));
|
MOZ_ASSERT(pn->as<ListNode>().count() == 2);
|
||||||
MOZ_ASSERT(pn->pn_count == 2);
|
|
||||||
return ListHead(pn);
|
return ListHead(pn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -521,8 +511,7 @@ static inline ParseNode*
|
||||||
BinaryOpRight(ParseNode* pn)
|
BinaryOpRight(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isBinaryOperation());
|
MOZ_ASSERT(pn->isBinaryOperation());
|
||||||
MOZ_ASSERT(pn->isArity(PN_LIST));
|
MOZ_ASSERT(pn->as<ListNode>().count() == 2);
|
||||||
MOZ_ASSERT(pn->pn_count == 2);
|
|
||||||
return NextNode(ListHead(pn));
|
return NextNode(ListHead(pn));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -609,7 +598,6 @@ static inline PropertyName*
|
||||||
LoopControlMaybeLabel(ParseNode* pn)
|
LoopControlMaybeLabel(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isKind(PNK_BREAK) || pn->isKind(PNK_CONTINUE));
|
MOZ_ASSERT(pn->isKind(PNK_BREAK) || pn->isKind(PNK_CONTINUE));
|
||||||
MOZ_ASSERT(pn->isArity(PN_NULLARY));
|
|
||||||
return pn->as<LoopControlStatement>().label();
|
return pn->as<LoopControlStatement>().label();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -628,69 +616,59 @@ LabeledStatementStatement(ParseNode* pn)
|
||||||
static double
|
static double
|
||||||
NumberNodeValue(ParseNode* pn)
|
NumberNodeValue(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isKind(PNK_NUMBER));
|
return pn->as<NumericLiteral>().value();
|
||||||
return pn->pn_dval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
NumberNodeHasFrac(ParseNode* pn)
|
NumberNodeHasFrac(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isKind(PNK_NUMBER));
|
return pn->as<NumericLiteral>().decimalPoint() == HasDecimal;
|
||||||
return pn->pn_u.number.decimalPoint == HasDecimal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static ParseNode*
|
static ParseNode*
|
||||||
DotBase(ParseNode* pn)
|
DotBase(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isKind(PNK_DOT));
|
return &pn->as<PropertyAccess>().expression();
|
||||||
MOZ_ASSERT(pn->isArity(PN_NAME));
|
|
||||||
return pn->expr();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PropertyName*
|
static PropertyName*
|
||||||
DotMember(ParseNode* pn)
|
DotMember(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isKind(PNK_DOT));
|
return &pn->as<PropertyAccess>().name();
|
||||||
MOZ_ASSERT(pn->isArity(PN_NAME));
|
|
||||||
return pn->pn_atom->asPropertyName();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static ParseNode*
|
static ParseNode*
|
||||||
ElemBase(ParseNode* pn)
|
ElemBase(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isKind(PNK_ELEM));
|
return &pn->as<PropertyByValueBase>().expression();
|
||||||
return BinaryLeft(pn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static ParseNode*
|
static ParseNode*
|
||||||
ElemIndex(ParseNode* pn)
|
ElemIndex(ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(pn->isKind(PNK_ELEM));
|
return &pn->as<PropertyByValueBase>().key();
|
||||||
return BinaryRight(pn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline JSFunction*
|
static inline JSFunction*
|
||||||
FunctionObject(ParseNode* fn)
|
FunctionObject(FunctionNode* funNode)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(fn->isKind(PNK_FUNCTION));
|
MOZ_ASSERT(funNode->isKind(PNK_FUNCTION));
|
||||||
MOZ_ASSERT(fn->isArity(PN_CODE));
|
return funNode->funbox()->function();
|
||||||
return fn->pn_funbox->function();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline PropertyName*
|
static inline PropertyName*
|
||||||
FunctionName(ParseNode* fn)
|
FunctionName(FunctionNode* funNode)
|
||||||
{
|
{
|
||||||
if (JSAtom* name = FunctionObject(fn)->explicitName())
|
if (JSAtom* name = FunctionObject(funNode)->explicitName())
|
||||||
return name->asPropertyName();
|
return name->asPropertyName();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ParseNode*
|
static inline ParseNode*
|
||||||
FunctionStatementList(ParseNode* fn)
|
FunctionStatementList(FunctionNode* funNode)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(fn->pn_body->isKind(PNK_PARAMSBODY));
|
MOZ_ASSERT(funNode->body()->isKind(PNK_PARAMSBODY));
|
||||||
ParseNode* last = fn->pn_body->last();
|
LexicalScopeNode* last = &funNode->body()->as<ListNode>().last()->as<LexicalScopeNode>();
|
||||||
MOZ_ASSERT(last->isKind(PNK_LEXICALSCOPE));
|
|
||||||
MOZ_ASSERT(last->isEmptyScope());
|
MOZ_ASSERT(last->isEmptyScope());
|
||||||
ParseNode* body = last->scopeBody();
|
ParseNode* body = last->scopeBody();
|
||||||
MOZ_ASSERT(body->isKind(PNK_STATEMENTLIST));
|
MOZ_ASSERT(body->isKind(PNK_STATEMENTLIST));
|
||||||
|
|
@ -710,7 +688,7 @@ ObjectNormalFieldName(ExclusiveContext* cx, ParseNode* pn)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(IsNormalObjectField(cx, pn));
|
MOZ_ASSERT(IsNormalObjectField(cx, pn));
|
||||||
MOZ_ASSERT(BinaryLeft(pn)->isKind(PNK_OBJECT_PROPERTY_NAME));
|
MOZ_ASSERT(BinaryLeft(pn)->isKind(PNK_OBJECT_PROPERTY_NAME));
|
||||||
return BinaryLeft(pn)->pn_atom->asPropertyName();
|
return BinaryLeft(pn)->as<NameNode>().atom()->asPropertyName();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ParseNode*
|
static inline ParseNode*
|
||||||
|
|
@ -723,7 +701,7 @@ ObjectNormalFieldInitializer(ExclusiveContext* cx, ParseNode* pn)
|
||||||
static inline ParseNode*
|
static inline ParseNode*
|
||||||
MaybeInitializer(ParseNode* pn)
|
MaybeInitializer(ParseNode* pn)
|
||||||
{
|
{
|
||||||
return pn->expr();
|
return pn->as<NameNode>().initializer();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
|
|
@ -744,7 +722,7 @@ IsIgnoredDirective(ExclusiveContext* cx, ParseNode* pn)
|
||||||
return pn->isKind(PNK_SEMI) &&
|
return pn->isKind(PNK_SEMI) &&
|
||||||
UnaryKid(pn) &&
|
UnaryKid(pn) &&
|
||||||
UnaryKid(pn)->isKind(PNK_STRING) &&
|
UnaryKid(pn)->isKind(PNK_STRING) &&
|
||||||
IsIgnoredDirectiveName(cx, UnaryKid(pn)->pn_atom);
|
IsIgnoredDirectiveName(cx, UnaryKid(pn)->as<NameNode>().atom());
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
|
|
@ -1637,7 +1615,7 @@ class MOZ_STACK_CLASS ModuleValidator
|
||||||
|
|
||||||
ExclusiveContext* cx_;
|
ExclusiveContext* cx_;
|
||||||
AsmJSParser& parser_;
|
AsmJSParser& parser_;
|
||||||
ParseNode* moduleFunctionNode_;
|
FunctionNode* moduleFunctionNode_;
|
||||||
PropertyName* moduleFunctionName_;
|
PropertyName* moduleFunctionName_;
|
||||||
PropertyName* globalArgumentName_;
|
PropertyName* globalArgumentName_;
|
||||||
PropertyName* importArgumentName_;
|
PropertyName* importArgumentName_;
|
||||||
|
|
@ -1716,7 +1694,7 @@ class MOZ_STACK_CLASS ModuleValidator
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ModuleValidator(ExclusiveContext* cx, AsmJSParser& parser, ParseNode* moduleFunctionNode)
|
ModuleValidator(ExclusiveContext* cx, AsmJSParser& parser, FunctionNode* moduleFunctionNode)
|
||||||
: cx_(cx),
|
: cx_(cx),
|
||||||
parser_(parser),
|
parser_(parser),
|
||||||
moduleFunctionNode_(moduleFunctionNode),
|
moduleFunctionNode_(moduleFunctionNode),
|
||||||
|
|
@ -1759,8 +1737,8 @@ class MOZ_STACK_CLASS ModuleValidator
|
||||||
if (!asmJSMetadata_)
|
if (!asmJSMetadata_)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
asmJSMetadata_->toStringStart = moduleFunctionNode_->pn_funbox->toStringStart;
|
asmJSMetadata_->toStringStart = moduleFunctionNode_->funbox()->toStringStart;
|
||||||
asmJSMetadata_->srcStart = moduleFunctionNode_->pn_body->pn_pos.begin;
|
asmJSMetadata_->srcStart = moduleFunctionNode_->body()->pn_pos.begin;
|
||||||
asmJSMetadata_->srcBodyStart = parser_.tokenStream.currentToken().pos.end;
|
asmJSMetadata_->srcBodyStart = parser_.tokenStream.currentToken().pos.end;
|
||||||
asmJSMetadata_->strict = parser_.pc->sc()->strict() &&
|
asmJSMetadata_->strict = parser_.pc->sc()->strict() &&
|
||||||
!parser_.pc->sc()->hasExplicitUseStrict();
|
!parser_.pc->sc()->hasExplicitUseStrict();
|
||||||
|
|
@ -3248,14 +3226,15 @@ CheckModuleLevelName(ModuleValidator& m, ParseNode* usepn, PropertyName* name)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
CheckFunctionHead(ModuleValidator& m, ParseNode* fn)
|
CheckFunctionHead(ModuleValidator& m, FunctionNode* funNode)
|
||||||
{
|
{
|
||||||
if (fn->pn_funbox->hasRest())
|
FunctionBox* funbox = funNode->funbox();
|
||||||
return m.fail(fn, "rest args not allowed");
|
MOZ_ASSERT(!funbox->isExprBody());
|
||||||
if (fn->pn_funbox->isExprBody())
|
|
||||||
return m.fail(fn, "expression closures not allowed");
|
if (funbox->hasRest())
|
||||||
if (fn->pn_funbox->hasDestructuringArgs)
|
return m.fail(funNode, "rest args not allowed");
|
||||||
return m.fail(fn, "destructuring args not allowed");
|
if (funbox->hasDestructuringArgs)
|
||||||
|
return m.fail(funNode, "destructuring args not allowed");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3287,15 +3266,15 @@ CheckModuleArgument(ModuleValidator& m, ParseNode* arg, PropertyName** name)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
CheckModuleArguments(ModuleValidator& m, ParseNode* fn)
|
CheckModuleArguments(ModuleValidator& m, FunctionNode* funNode)
|
||||||
{
|
{
|
||||||
unsigned numFormals;
|
unsigned numFormals;
|
||||||
ParseNode* arg1 = FunctionFormalParametersList(fn, &numFormals);
|
ParseNode* arg1 = FunctionFormalParametersList(funNode, &numFormals);
|
||||||
ParseNode* arg2 = arg1 ? NextNode(arg1) : nullptr;
|
ParseNode* arg2 = arg1 ? NextNode(arg1) : nullptr;
|
||||||
ParseNode* arg3 = arg2 ? NextNode(arg2) : nullptr;
|
ParseNode* arg3 = arg2 ? NextNode(arg2) : nullptr;
|
||||||
|
|
||||||
if (numFormals > 3)
|
if (numFormals > 3)
|
||||||
return m.fail(fn, "asm.js modules takes at most 3 argument");
|
return m.fail(funNode, "asm.js modules takes at most 3 argument");
|
||||||
|
|
||||||
PropertyName* arg1Name = nullptr;
|
PropertyName* arg1Name = nullptr;
|
||||||
if (arg1 && !CheckModuleArgument(m, arg1, &arg1Name))
|
if (arg1 && !CheckModuleArgument(m, arg1, &arg1Name))
|
||||||
|
|
@ -3433,9 +3412,11 @@ IsArrayViewCtorName(ModuleValidator& m, PropertyName* name, Scalar::Type* type)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
CheckNewArrayViewArgs(ModuleValidator& m, ParseNode* ctorExpr, PropertyName* bufferName)
|
CheckNewArrayViewArgs(ModuleValidator& m, ParseNode* newExpr, PropertyName* bufferName)
|
||||||
{
|
{
|
||||||
ParseNode* bufArg = NextNode(ctorExpr);
|
ParseNode* ctorExpr = BinaryLeft(newExpr);
|
||||||
|
ParseNode* ctorArgs = BinaryRight(newExpr);
|
||||||
|
ParseNode* bufArg = ListHead(ctorArgs);
|
||||||
if (!bufArg || NextNode(bufArg) != nullptr)
|
if (!bufArg || NextNode(bufArg) != nullptr)
|
||||||
return m.fail(ctorExpr, "array view constructor takes exactly one argument");
|
return m.fail(ctorExpr, "array view constructor takes exactly one argument");
|
||||||
|
|
||||||
|
|
@ -3456,7 +3437,7 @@ CheckNewArrayView(ModuleValidator& m, PropertyName* varName, ParseNode* newExpr)
|
||||||
if (!bufferName)
|
if (!bufferName)
|
||||||
return m.fail(newExpr, "cannot create array view without an asm.js heap parameter");
|
return m.fail(newExpr, "cannot create array view without an asm.js heap parameter");
|
||||||
|
|
||||||
ParseNode* ctorExpr = ListHead(newExpr);
|
ParseNode* ctorExpr = BinaryLeft(newExpr);
|
||||||
|
|
||||||
PropertyName* field;
|
PropertyName* field;
|
||||||
Scalar::Type type;
|
Scalar::Type type;
|
||||||
|
|
@ -3485,7 +3466,7 @@ CheckNewArrayView(ModuleValidator& m, PropertyName* varName, ParseNode* newExpr)
|
||||||
type = global->viewType();
|
type = global->viewType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CheckNewArrayViewArgs(m, ctorExpr, bufferName))
|
if (!CheckNewArrayViewArgs(m, newExpr, bufferName))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return m.addArrayView(varName, type, field);
|
return m.addArrayView(varName, type, field);
|
||||||
|
|
@ -6825,10 +6806,11 @@ CheckSwitch(FunctionValidator& f, ParseNode* switchStmt)
|
||||||
ParseNode* switchExpr = BinaryLeft(switchStmt);
|
ParseNode* switchExpr = BinaryLeft(switchStmt);
|
||||||
ParseNode* switchBody = BinaryRight(switchStmt);
|
ParseNode* switchBody = BinaryRight(switchStmt);
|
||||||
|
|
||||||
if (switchBody->isKind(PNK_LEXICALSCOPE)) {
|
if (switchBody->is<LexicalScopeNode>()) {
|
||||||
if (!switchBody->isEmptyScope())
|
LexicalScopeNode* scope = &switchBody->as<LexicalScopeNode>();
|
||||||
return f.fail(switchBody, "switch body may not contain lexical declarations");
|
if (!scope->isEmptyScope())
|
||||||
switchBody = switchBody->scopeBody();
|
return f.fail(scope, "switch body may not contain lexical declarations");
|
||||||
|
switchBody = scope->scopeBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
ParseNode* stmt = ListHead(switchBody);
|
ParseNode* stmt = ListHead(switchBody);
|
||||||
|
|
@ -7002,10 +6984,9 @@ CheckStatementList(FunctionValidator& f, ParseNode* stmtList, const NameVector*
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
CheckLexicalScope(FunctionValidator& f, ParseNode* lexicalScope)
|
CheckLexicalScope(FunctionValidator& f, ParseNode* node)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(lexicalScope->isKind(PNK_LEXICALSCOPE));
|
LexicalScopeNode* lexicalScope = &node->as<LexicalScopeNode>();
|
||||||
|
|
||||||
if (!lexicalScope->isEmptyScope())
|
if (!lexicalScope->isEmptyScope())
|
||||||
return f.fail(lexicalScope, "cannot have 'let' or 'const' declarations");
|
return f.fail(lexicalScope, "cannot have 'let' or 'const' declarations");
|
||||||
|
|
||||||
|
|
@ -7045,7 +7026,7 @@ CheckStatement(FunctionValidator& f, ParseNode* stmt)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
ParseFunction(ModuleValidator& m, ParseNode** fnOut, unsigned* line)
|
ParseFunction(ModuleValidator& m, FunctionNode** funNodeOut, unsigned* line)
|
||||||
{
|
{
|
||||||
TokenStream& tokenStream = m.tokenStream();
|
TokenStream& tokenStream = m.tokenStream();
|
||||||
|
|
||||||
|
|
@ -7063,8 +7044,9 @@ ParseFunction(ModuleValidator& m, ParseNode** fnOut, unsigned* line)
|
||||||
if (!name)
|
if (!name)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ParseNode* fn = m.parser().handler.newFunctionStatement();
|
FunctionSyntaxKind syntaxKind = FunctionSyntaxKind::Statement;
|
||||||
if (!fn)
|
FunctionNode* funNode = m.parser().handler.newFunction(syntaxKind);
|
||||||
|
if (!funNode)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
RootedFunction& fun = m.dummyFunction();
|
RootedFunction& fun = m.dummyFunction();
|
||||||
|
|
@ -7073,28 +7055,28 @@ ParseFunction(ModuleValidator& m, ParseNode** fnOut, unsigned* line)
|
||||||
|
|
||||||
ParseContext* outerpc = m.parser().pc;
|
ParseContext* outerpc = m.parser().pc;
|
||||||
Directives directives(outerpc);
|
Directives directives(outerpc);
|
||||||
FunctionBox* funbox = m.parser().newFunctionBox(fn, fun, toStringStart, directives, NotGenerator,
|
FunctionBox* funbox = m.parser().newFunctionBox(funNode, fun, toStringStart, directives, NotGenerator,
|
||||||
SyncFunction, /* tryAnnexB = */ false);
|
SyncFunction, /* tryAnnexB = */ false);
|
||||||
if (!funbox)
|
if (!funbox)
|
||||||
return false;
|
return false;
|
||||||
funbox->initWithEnclosingParseContext(outerpc, frontend::Statement);
|
funbox->initWithEnclosingParseContext(outerpc, syntaxKind);
|
||||||
|
|
||||||
Directives newDirectives = directives;
|
Directives newDirectives = directives;
|
||||||
ParseContext funpc(&m.parser(), funbox, &newDirectives);
|
ParseContext funpc(&m.parser(), funbox, &newDirectives);
|
||||||
if (!funpc.init())
|
if (!funpc.init())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!m.parser().functionFormalParametersAndBody(InAllowed, YieldIsName, fn, Statement)) {
|
if (!m.parser().functionFormalParametersAndBody(InAllowed, YieldIsName, funNode, syntaxKind)) {
|
||||||
if (tokenStream.hadError() || directives == newDirectives)
|
if (tokenStream.hadError() || directives == newDirectives)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return m.fail(fn, "encountered new directive in function");
|
return m.fail(funNode, "encountered new directive in function");
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(!tokenStream.hadError());
|
MOZ_ASSERT(!tokenStream.hadError());
|
||||||
MOZ_ASSERT(directives == newDirectives);
|
MOZ_ASSERT(directives == newDirectives);
|
||||||
|
|
||||||
*fnOut = fn;
|
*funNodeOut = funNode;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7105,19 +7087,19 @@ CheckFunction(ModuleValidator& m)
|
||||||
// the backing LifoAlloc after parsing/compiling each function.
|
// the backing LifoAlloc after parsing/compiling each function.
|
||||||
AsmJSParser::Mark mark = m.parser().mark();
|
AsmJSParser::Mark mark = m.parser().mark();
|
||||||
|
|
||||||
ParseNode* fn = nullptr;
|
FunctionNode* funNode = nullptr;
|
||||||
unsigned line = 0;
|
unsigned line = 0;
|
||||||
if (!ParseFunction(m, &fn, &line))
|
if (!ParseFunction(m, &funNode, &line))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!CheckFunctionHead(m, fn))
|
if (!CheckFunctionHead(m, funNode))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
FunctionValidator f(m, fn);
|
FunctionValidator f(m, funNode);
|
||||||
if (!f.init(FunctionName(fn), line))
|
if (!f.init(FunctionName(funNode), line))
|
||||||
return m.fail(fn, "internal compiler failure (probably out of memory)");
|
return m.fail(funNode, "internal compiler failure (probably out of memory)");
|
||||||
|
|
||||||
ParseNode* stmtIter = ListHead(FunctionStatementList(fn));
|
ParseNode* stmtIter = ListHead(FunctionStatementList(funNode));
|
||||||
|
|
||||||
if (!CheckProcessingDirectives(m, &stmtIter))
|
if (!CheckProcessingDirectives(m, &stmtIter))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -7140,16 +7122,16 @@ CheckFunction(ModuleValidator& m)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ModuleValidator::Func* func = nullptr;
|
ModuleValidator::Func* func = nullptr;
|
||||||
if (!CheckFunctionSignature(m, fn, Sig(Move(args), f.returnedType()), FunctionName(fn), &func))
|
if (!CheckFunctionSignature(m, funNode, Sig(Move(args), f.returnedType()), FunctionName(funNode), &func))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (func->defined())
|
if (func->defined())
|
||||||
return m.failName(fn, "function '%s' already defined", FunctionName(fn));
|
return m.failName(funNode, "function '%s' already defined", FunctionName(funNode));
|
||||||
|
|
||||||
func->define(fn);
|
func->define(funNode);
|
||||||
|
|
||||||
if (!f.finish(func->index()))
|
if (!f.finish(func->index()))
|
||||||
return m.fail(fn, "internal compiler failure (probably out of memory)");
|
return m.fail(funNode, "internal compiler failure (probably out of memory)");
|
||||||
|
|
||||||
// Release the parser's lifo memory only after the last use of a parse node.
|
// Release the parser's lifo memory only after the last use of a parse node.
|
||||||
m.parser().release(mark);
|
m.parser().release(mark);
|
||||||
|
|
@ -7355,8 +7337,7 @@ CheckModule(ExclusiveContext* cx, AsmJSParser& parser, ParseNode* stmtList, unsi
|
||||||
{
|
{
|
||||||
int64_t before = PRMJ_Now();
|
int64_t before = PRMJ_Now();
|
||||||
|
|
||||||
ParseNode* moduleFunctionNode = parser.pc->functionBox()->functionNode;
|
FunctionNode* moduleFunctionNode = parser.pc->functionBox()->functionNode;
|
||||||
MOZ_ASSERT(moduleFunctionNode);
|
|
||||||
|
|
||||||
ModuleValidator m(cx, parser, moduleFunctionNode);
|
ModuleValidator m(cx, parser, moduleFunctionNode);
|
||||||
if (!m.init())
|
if (!m.init())
|
||||||
|
|
@ -8312,7 +8293,7 @@ class ModuleCharsForStore : ModuleChars
|
||||||
isFunCtor_ = parser.pc->isStandaloneFunctionBody();
|
isFunCtor_ = parser.pc->isStandaloneFunctionBody();
|
||||||
if (isFunCtor_) {
|
if (isFunCtor_) {
|
||||||
unsigned numArgs;
|
unsigned numArgs;
|
||||||
ParseNode* functionNode = parser.pc->functionBox()->functionNode;
|
FunctionNode* functionNode = parser.pc->functionBox()->functionNode;
|
||||||
ParseNode* arg = FunctionFormalParametersList(functionNode, &numArgs);
|
ParseNode* arg = FunctionFormalParametersList(functionNode, &numArgs);
|
||||||
for (unsigned i = 0; i < numArgs; i++, arg = arg->pn_next) {
|
for (unsigned i = 0; i < numArgs; i++, arg = arg->pn_next) {
|
||||||
UniqueChars name = StringToNewUTF8CharsZ(nullptr, *arg->name());
|
UniqueChars name = StringToNewUTF8CharsZ(nullptr, *arg->name());
|
||||||
|
|
@ -8393,7 +8374,7 @@ class ModuleCharsForLookup : ModuleChars
|
||||||
if (parseBegin + chars_.length() != parseLimit)
|
if (parseBegin + chars_.length() != parseLimit)
|
||||||
return false;
|
return false;
|
||||||
unsigned numArgs;
|
unsigned numArgs;
|
||||||
ParseNode* functionNode = parser.pc->functionBox()->functionNode;
|
FunctionNode* functionNode = parser.pc->functionBox()->functionNode;
|
||||||
ParseNode* arg = FunctionFormalParametersList(functionNode, &numArgs);
|
ParseNode* arg = FunctionFormalParametersList(functionNode, &numArgs);
|
||||||
if (funCtorArgs_.length() != numArgs)
|
if (funCtorArgs_.length() != numArgs)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -8554,7 +8535,7 @@ LookupAsmJSModuleInCache(ExclusiveContext* cx, AsmJSParser& parser, bool* loaded
|
||||||
|
|
||||||
// See AsmJSMetadata comment as well as ModuleValidator::init().
|
// See AsmJSMetadata comment as well as ModuleValidator::init().
|
||||||
asmJSMetadata->toStringStart = parser.pc->functionBox()->toStringStart;
|
asmJSMetadata->toStringStart = parser.pc->functionBox()->toStringStart;
|
||||||
asmJSMetadata->srcStart = parser.pc->functionBox()->functionNode->pn_body->pn_pos.begin;
|
asmJSMetadata->srcStart = parser.pc->functionBox()->functionNode->body()->pn_pos.begin;
|
||||||
asmJSMetadata->srcBodyStart = parser.tokenStream.currentToken().pos.end;
|
asmJSMetadata->srcBodyStart = parser.tokenStream.currentToken().pos.end;
|
||||||
asmJSMetadata->strict = parser.pc->sc()->strict() && !parser.pc->sc()->hasExplicitUseStrict();
|
asmJSMetadata->strict = parser.pc->sc()->strict() && !parser.pc->sc()->hasExplicitUseStrict();
|
||||||
asmJSMetadata->scriptSource.reset(parser.ss);
|
asmJSMetadata->scriptSource.reset(parser.ss);
|
||||||
|
|
|
||||||
|
|
@ -401,7 +401,7 @@ void *_mmap(void *addr, size_t length, int prot, int flags,
|
||||||
*/
|
*/
|
||||||
#define CHUNK_2POW_DEFAULT 20
|
#define CHUNK_2POW_DEFAULT 20
|
||||||
/* Maximum number of dirty pages per arena. */
|
/* Maximum number of dirty pages per arena. */
|
||||||
#define DIRTY_MAX_DEFAULT (1U << 8)
|
#define DIRTY_MAX_DEFAULT (1U << 12)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Maximum size of L1 cache line. This is used to avoid cache line aliasing,
|
* Maximum size of L1 cache line. This is used to avoid cache line aliasing,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# CMakeLists.txt
|
# CMakeLists.txt
|
||||||
#
|
#
|
||||||
# Copyright 2013-2018 by
|
# Copyright (C) 2013-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# Written originally by John Cary <cary@txcorp.com>
|
# Written originally by John Cary <cary@txcorp.com>
|
||||||
|
|
@ -12,16 +12,20 @@
|
||||||
# fully.
|
# fully.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# The following will 1. create a build directory and 2. change into it and
|
# The following will (1) create a build directory, and (2) change into it and
|
||||||
# call cmake to configure the build with default parameters as a static
|
# call cmake to configure the build with default parameters as a static
|
||||||
# library.
|
# library. See
|
||||||
|
#
|
||||||
|
# https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
|
||||||
|
#
|
||||||
|
# for information about debug or release builds, for example
|
||||||
|
#
|
||||||
|
# cmake -B build -D CMAKE_BUILD_TYPE=Release
|
||||||
#
|
#
|
||||||
# cmake -E make_directory build
|
|
||||||
# cmake -E chdir build cmake ..
|
|
||||||
#
|
#
|
||||||
# For a dynamic library, use
|
# For a dynamic library, use
|
||||||
#
|
#
|
||||||
# cmake -E chdir build cmake -D BUILD_SHARED_LIBS:BOOL=true ..
|
# cmake -B build -D BUILD_SHARED_LIBS=true -D CMAKE_BUILD_TYPE=Release
|
||||||
#
|
#
|
||||||
# For a framework on OS X, use
|
# For a framework on OS X, use
|
||||||
#
|
#
|
||||||
|
|
@ -35,7 +39,12 @@
|
||||||
#
|
#
|
||||||
# cmake -E chdir build cmake -G Xcode -D IOS_PLATFORM=SIMULATOR ..
|
# cmake -E chdir build cmake -G Xcode -D IOS_PLATFORM=SIMULATOR ..
|
||||||
#
|
#
|
||||||
# Finally, build the project with:
|
# or
|
||||||
|
#
|
||||||
|
# cmake -E chdir build cmake -G Xcode -D IOS_PLATFORM=SIMULATOR64 ..
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Finally, build the project with
|
||||||
#
|
#
|
||||||
# cmake --build build
|
# cmake --build build
|
||||||
#
|
#
|
||||||
|
|
@ -52,53 +61,78 @@
|
||||||
#
|
#
|
||||||
# Some notes.
|
# Some notes.
|
||||||
#
|
#
|
||||||
# . `cmake' creates configuration files in
|
# - Say `cmake -LAH` to see all configuration options.
|
||||||
|
#
|
||||||
|
# - `cmake' creates configuration files in
|
||||||
#
|
#
|
||||||
# <build-directory>/include/freetype/config
|
# <build-directory>/include/freetype/config
|
||||||
#
|
#
|
||||||
# which should be further modified if necessary.
|
# which should be further modified if necessary.
|
||||||
#
|
#
|
||||||
# . You can use `cmake' directly on a freshly cloned FreeType git
|
# - You can use `cmake' directly on a freshly cloned FreeType git
|
||||||
# repository.
|
# repository.
|
||||||
#
|
#
|
||||||
# . `CMakeLists.txt' is provided as-is since it is normally not used by the
|
# - `CMakeLists.txt' is provided as-is since it is normally not used by the
|
||||||
# developer team.
|
# developer team.
|
||||||
#
|
#
|
||||||
# . Set the `FT_WITH_ZLIB', `FT_WITH_BZIP2', `FT_WITH_PNG', and
|
# - Set the `FT_REQUIRE_ZLIB', `FT_REQUIRE_BZIP2', `FT_REQUIRE_PNG',
|
||||||
# `FT_WITH_HARFBUZZ' CMake variables to `ON' to force using a dependency.
|
# `FT_REQUIRE_HARFBUZZ', and `FT_REQUIRE_BROTLI' CMake variables to `ON'
|
||||||
# Leave a variable undefined (which is the default) to use the dependency
|
# or `TRUE' to force using a dependency. Leave a variable undefined
|
||||||
# only if it is available. Set `CMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE' to
|
# (which is the default) to use the dependency only if it is available.
|
||||||
# disable a dependency completely (CMake package name, so `BZip2' instead of
|
# Example:
|
||||||
# `BZIP2'). Example:
|
|
||||||
#
|
#
|
||||||
# cmake -DFT_WITH_ZLIB=ON -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE [...]
|
# cmake -B build -D FT_REQUIRE_ZLIB=TRUE \
|
||||||
|
# -D FT_REQUIRE_BZIP2=TRUE \
|
||||||
|
# -D FT_REQUIRE_PNG=TRUE \
|
||||||
|
# -D FT_REQUIRE_HARFBUZZ=TRUE \
|
||||||
|
# -D FT_REQUIRE_BROTLI=TRUE [...]
|
||||||
#
|
#
|
||||||
# . Installation of FreeType can be controlled with the CMake variables
|
# - Set `FT_DISABLE_XXX=TRUE' to disable a dependency completely (where
|
||||||
|
# `XXX' is a CMake package name like `BZip2'). Example for disabling all
|
||||||
|
# dependencies:
|
||||||
|
#
|
||||||
|
# cmake -B build -D FT_DISABLE_ZLIB=TRUE \
|
||||||
|
# -D FT_DISABLE_BZIP2=TRUE \
|
||||||
|
# -D FT_DISABLE_PNG=TRUE \
|
||||||
|
# -D FT_DISABLE_HARFBUZZ=TRUE \
|
||||||
|
# -D FT_DISABLE_BROTLI=TRUE [...]
|
||||||
|
#
|
||||||
|
# - NOTE: If a package is set as DISABLED, it cannot be set as REQUIRED
|
||||||
|
# without unsetting the DISABLED value first. For example, if
|
||||||
|
# `FT_DISABLE_HARFBUZZ=TRUE' has been set (Cache is present), you need to
|
||||||
|
# call `FT_DISABLE_HARFBUZZ=FALSE' before calling
|
||||||
|
# `FT_REQUIRE_HARFBUZZ=TRUE'.
|
||||||
|
#
|
||||||
|
# - Installation of FreeType can be controlled with the CMake variables
|
||||||
# `SKIP_INSTALL_HEADERS', `SKIP_INSTALL_LIBRARIES', and `SKIP_INSTALL_ALL'
|
# `SKIP_INSTALL_HEADERS', `SKIP_INSTALL_LIBRARIES', and `SKIP_INSTALL_ALL'
|
||||||
# (this is compatible with the same CMake variables in zlib's CMake
|
# (this is compatible with the same CMake variables in zlib's CMake
|
||||||
# support).
|
# support).
|
||||||
|
|
||||||
# FreeType explicitly marks the API to be exported and relies on the compiler
|
# To minimize the number of cmake_policy() workarounds,
|
||||||
# to hide all other symbols. CMake supports a C_VISBILITY_PRESET property
|
# CMake >= 3 is requested.
|
||||||
# starting with 2.8.12.
|
cmake_minimum_required(VERSION 3.0)
|
||||||
cmake_minimum_required(VERSION 2.8.12)
|
|
||||||
|
|
||||||
if (NOT CMAKE_VERSION VERSION_LESS 3.3)
|
if (NOT CMAKE_VERSION VERSION_LESS 3.3)
|
||||||
# Allow symbol visibility settings also on static libraries. CMake < 3.3
|
# Allow symbol visibility settings also on static libraries. CMake < 3.3
|
||||||
# only sets the propery on a shared library build.
|
# only sets the property on a shared library build.
|
||||||
cmake_policy(SET CMP0063 NEW)
|
cmake_policy(SET CMP0063 NEW)
|
||||||
|
|
||||||
|
# Support new IN_LIST if() operator.
|
||||||
|
cmake_policy(SET CMP0057 NEW)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
include(CheckIncludeFile)
|
include(CheckIncludeFile)
|
||||||
|
include(CMakeDependentOption)
|
||||||
|
|
||||||
# CMAKE_TOOLCHAIN_FILE must be set before `project' is called, which
|
# CMAKE_TOOLCHAIN_FILE must be set before `project' is called, which
|
||||||
# configures the base build environment and references the toolchain file
|
# configures the base build environment and references the toolchain file
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
if (DEFINED IOS_PLATFORM)
|
if (DEFINED IOS_PLATFORM)
|
||||||
if (NOT "${IOS_PLATFORM}" STREQUAL "OS"
|
if (NOT "${IOS_PLATFORM}" STREQUAL "OS"
|
||||||
AND NOT "${IOS_PLATFORM}" STREQUAL "SIMULATOR")
|
AND NOT "${IOS_PLATFORM}" STREQUAL "SIMULATOR"
|
||||||
|
AND NOT "${IOS_PLATFORM}" STREQUAL "SIMULATOR64")
|
||||||
message(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
"IOS_PLATFORM must be set to either OS or SIMULATOR")
|
"IOS_PLATFORM must be set to either OS, SIMULATOR, or SIMULATOR64")
|
||||||
endif ()
|
endif ()
|
||||||
if (NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode")
|
if (NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode")
|
||||||
message(AUTHOR_WARNING
|
message(AUTHOR_WARNING
|
||||||
|
|
@ -129,31 +163,65 @@ endif ()
|
||||||
project(freetype C)
|
project(freetype C)
|
||||||
|
|
||||||
set(VERSION_MAJOR "2")
|
set(VERSION_MAJOR "2")
|
||||||
set(VERSION_MINOR "9")
|
set(VERSION_MINOR "13")
|
||||||
set(VERSION_PATCH "1")
|
set(VERSION_PATCH "0")
|
||||||
|
|
||||||
# SOVERSION scheme: CURRENT.AGE.REVISION
|
# Generate LIBRARY_VERSION and LIBRARY_SOVERSION.
|
||||||
# If there was an incompatible interface change:
|
set(LIBTOOL_REGEX "version_info='([0-9]+):([0-9]+):([0-9]+)'")
|
||||||
# Increment CURRENT. Set AGE and REVISION to 0
|
file(STRINGS "${PROJECT_SOURCE_DIR}/builds/unix/configure.raw"
|
||||||
# If there was a compatible interface change:
|
VERSION_INFO
|
||||||
# Increment AGE. Set REVISION to 0
|
REGEX ${LIBTOOL_REGEX})
|
||||||
# If the source code was changed, but there were no interface changes:
|
string(REGEX REPLACE
|
||||||
# Increment REVISION.
|
${LIBTOOL_REGEX} "\\1"
|
||||||
set(LIBRARY_VERSION "6.16.0")
|
LIBTOOL_CURRENT "${VERSION_INFO}")
|
||||||
set(LIBRARY_SOVERSION "6")
|
string(REGEX REPLACE
|
||||||
|
${LIBTOOL_REGEX} "\\2"
|
||||||
|
LIBTOOL_REVISION "${VERSION_INFO}")
|
||||||
|
string(REGEX REPLACE
|
||||||
|
${LIBTOOL_REGEX} "\\3"
|
||||||
|
LIBTOOL_AGE "${VERSION_INFO}")
|
||||||
|
|
||||||
# These options mean "require x and complain if not found". They'll get
|
# This is what libtool does internally on Unix platforms.
|
||||||
# optionally found anyway. Use `-DCMAKE_DISABLE_FIND_PACKAGE_x=TRUE` to disable
|
math(EXPR LIBRARY_SOVERSION "${LIBTOOL_CURRENT} - ${LIBTOOL_AGE}")
|
||||||
# searching for a packge entirely (x is the CMake package name, so "BZip2"
|
set(LIBRARY_VERSION "${LIBRARY_SOVERSION}.${LIBTOOL_AGE}.${LIBTOOL_REVISION}")
|
||||||
# instead of "BZIP2").
|
|
||||||
option(FT_WITH_ZLIB "Use system zlib instead of internal library." OFF)
|
|
||||||
option(FT_WITH_BZIP2 "Support bzip2 compressed fonts." OFF)
|
|
||||||
option(FT_WITH_PNG "Support PNG compressed OpenType embedded bitmaps." OFF)
|
|
||||||
option(FT_WITH_HARFBUZZ "Improve auto-hinting of OpenType fonts." OFF)
|
|
||||||
|
|
||||||
|
# External dependency library detection is automatic. See the notes at the
|
||||||
|
# top of this file, for how to force or disable dependencies completely.
|
||||||
|
option(FT_DISABLE_ZLIB
|
||||||
|
"Disable use of system zlib and use internal zlib library instead." OFF)
|
||||||
|
cmake_dependent_option(FT_REQUIRE_ZLIB
|
||||||
|
"Require system zlib instead of internal zlib library." OFF
|
||||||
|
"NOT FT_DISABLE_ZLIB" OFF)
|
||||||
|
|
||||||
|
option(FT_DISABLE_BZIP2
|
||||||
|
"Disable support of bzip2 compressed fonts." OFF)
|
||||||
|
cmake_dependent_option(FT_REQUIRE_BZIP2
|
||||||
|
"Require support of bzip2 compressed fonts." OFF
|
||||||
|
"NOT FT_DISABLE_BZIP2" OFF)
|
||||||
|
|
||||||
|
option(FT_DISABLE_PNG
|
||||||
|
"Disable support of PNG compressed OpenType embedded bitmaps." OFF)
|
||||||
|
cmake_dependent_option(FT_REQUIRE_PNG
|
||||||
|
"Require support of PNG compressed OpenType embedded bitmaps." OFF
|
||||||
|
"NOT FT_DISABLE_PNG" OFF)
|
||||||
|
|
||||||
|
option(FT_DISABLE_HARFBUZZ
|
||||||
|
"Disable HarfBuzz (used for improving auto-hinting of OpenType fonts)." OFF)
|
||||||
|
cmake_dependent_option(FT_REQUIRE_HARFBUZZ
|
||||||
|
"Require HarfBuzz for improving auto-hinting of OpenType fonts." OFF
|
||||||
|
"NOT FT_DISABLE_HARFBUZZ" OFF)
|
||||||
|
|
||||||
|
option(FT_DISABLE_BROTLI
|
||||||
|
"Disable support of compressed WOFF2 fonts." OFF)
|
||||||
|
cmake_dependent_option(FT_REQUIRE_BROTLI
|
||||||
|
"Require support of compressed WOFF2 fonts." OFF
|
||||||
|
"NOT FT_DISABLE_BROTLI" OFF)
|
||||||
|
|
||||||
|
option(FT_ENABLE_ERROR_STRINGS
|
||||||
|
"Enable support for meaningful error descriptions." OFF)
|
||||||
|
|
||||||
# Disallow in-source builds
|
# Disallow in-source builds
|
||||||
if ("${PROJECT_BINARY_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}")
|
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
|
||||||
message(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
"In-source builds are not permitted! Make a separate folder for"
|
"In-source builds are not permitted! Make a separate folder for"
|
||||||
" building, e.g.,\n"
|
" building, e.g.,\n"
|
||||||
|
|
@ -174,43 +242,66 @@ if (BUILD_FRAMEWORK)
|
||||||
message(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
"You should use Xcode generator with BUILD_FRAMEWORK enabled")
|
"You should use Xcode generator with BUILD_FRAMEWORK enabled")
|
||||||
endif ()
|
endif ()
|
||||||
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_64_BIT)")
|
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)")
|
||||||
set(BUILD_SHARED_LIBS ON)
|
set(BUILD_SHARED_LIBS ON)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
# Find dependencies
|
# Find dependencies
|
||||||
if (FT_WITH_HARFBUZZ)
|
include(FindPkgConfig)
|
||||||
find_package(HarfBuzz 1.3.0 REQUIRED)
|
|
||||||
else ()
|
if (NOT FT_DISABLE_HARFBUZZ)
|
||||||
find_package(HarfBuzz 1.3.0)
|
set(HARFBUZZ_MIN_VERSION "2.0.0")
|
||||||
|
if (FT_REQUIRE_HARFBUZZ)
|
||||||
|
find_package(HarfBuzz ${HARFBUZZ_MIN_VERSION} REQUIRED)
|
||||||
|
else ()
|
||||||
|
find_package(HarfBuzz ${HARFBUZZ_MIN_VERSION})
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (FT_WITH_PNG)
|
if (NOT FT_DISABLE_PNG)
|
||||||
find_package(PNG REQUIRED)
|
if (FT_REQUIRE_PNG)
|
||||||
else ()
|
find_package(PNG REQUIRED)
|
||||||
find_package(PNG)
|
else ()
|
||||||
|
find_package(PNG)
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (FT_WITH_ZLIB)
|
if (NOT FT_DISABLE_ZLIB)
|
||||||
find_package(ZLIB REQUIRED)
|
if (FT_REQUIRE_ZLIB)
|
||||||
else ()
|
find_package(ZLIB REQUIRED)
|
||||||
find_package(ZLIB)
|
else ()
|
||||||
|
find_package(ZLIB)
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (FT_WITH_BZIP2)
|
if (NOT FT_DISABLE_BZIP2)
|
||||||
find_package(BZip2 REQUIRED)
|
# Genuine BZip2 does not provide bzip2.pc, but some platforms have it.
|
||||||
else ()
|
# For better dependency in freetype2.pc, bzip2.pc is searched
|
||||||
find_package(BZip2)
|
# regardless of the availability of libbz2. If bzip2.pc is found,
|
||||||
|
# Requires.private is used instead of Libs.private.
|
||||||
|
if (FT_REQUIRE_BZIP2)
|
||||||
|
find_package(BZip2 REQUIRED)
|
||||||
|
else ()
|
||||||
|
find_package(BZip2)
|
||||||
|
endif ()
|
||||||
|
pkg_check_modules(PC_BZIP2 bzip2)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (NOT FT_DISABLE_BROTLI)
|
||||||
|
if (FT_REQUIRE_BROTLI)
|
||||||
|
find_package(BrotliDec REQUIRED)
|
||||||
|
else ()
|
||||||
|
find_package(BrotliDec)
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Create the configuration file
|
# Create the configuration file
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
check_include_file("unistd.h" HAVE_UNISTD_H)
|
check_include_file("unistd.h" HAVE_UNISTD_H)
|
||||||
check_include_file("fcntl.h" HAVE_FCNTL_H)
|
check_include_file("fcntl.h" HAVE_FCNTL_H)
|
||||||
check_include_file("stdint.h" HAVE_STDINT_H)
|
|
||||||
|
|
||||||
file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.in"
|
file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.h.in"
|
||||||
FTCONFIG_H)
|
FTCONFIG_H)
|
||||||
if (HAVE_UNISTD_H)
|
if (HAVE_UNISTD_H)
|
||||||
string(REGEX REPLACE
|
string(REGEX REPLACE
|
||||||
|
|
@ -222,15 +313,19 @@ if (UNIX)
|
||||||
"#undef +(HAVE_FCNTL_H)" "#define \\1 1"
|
"#undef +(HAVE_FCNTL_H)" "#define \\1 1"
|
||||||
FTCONFIG_H "${FTCONFIG_H}")
|
FTCONFIG_H "${FTCONFIG_H}")
|
||||||
endif ()
|
endif ()
|
||||||
if (HAVE_STDINT_H)
|
else ()
|
||||||
string(REGEX REPLACE
|
file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftconfig.h"
|
||||||
"#undef +(HAVE_STDINT_H)" "#define \\1 1"
|
FTCONFIG_H)
|
||||||
FTCONFIG_H "${FTCONFIG_H}")
|
endif ()
|
||||||
endif ()
|
|
||||||
string(REPLACE "/undef " "#undef "
|
set(FTCONFIG_H_NAME "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h")
|
||||||
FTCONFIG_H "${FTCONFIG_H}")
|
if (EXISTS "${FTCONFIG_H_NAME}")
|
||||||
file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h"
|
file(READ "${FTCONFIG_H_NAME}" ORIGINAL_FTCONFIG_H)
|
||||||
"${FTCONFIG_H}")
|
else ()
|
||||||
|
set(ORIGINAL_FTCONFIG_H "")
|
||||||
|
endif ()
|
||||||
|
if (NOT (ORIGINAL_FTCONFIG_H STREQUAL FTCONFIG_H))
|
||||||
|
file(WRITE "${FTCONFIG_H_NAME}" "${FTCONFIG_H}")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -257,8 +352,27 @@ if (HARFBUZZ_FOUND)
|
||||||
"/\\* +(#define +FT_CONFIG_OPTION_USE_HARFBUZZ) +\\*/" "\\1"
|
"/\\* +(#define +FT_CONFIG_OPTION_USE_HARFBUZZ) +\\*/" "\\1"
|
||||||
FTOPTION_H "${FTOPTION_H}")
|
FTOPTION_H "${FTOPTION_H}")
|
||||||
endif ()
|
endif ()
|
||||||
file(WRITE "${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h"
|
if (BROTLIDEC_FOUND)
|
||||||
"${FTOPTION_H}")
|
string(REGEX REPLACE
|
||||||
|
"/\\* +(#define +FT_CONFIG_OPTION_USE_BROTLI) +\\*/" "\\1"
|
||||||
|
FTOPTION_H "${FTOPTION_H}")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (FT_ENABLE_ERROR_STRINGS)
|
||||||
|
string(REGEX REPLACE
|
||||||
|
"/\\* +(#define +FT_CONFIG_OPTION_ERROR_STRINGS) +\\*/" "\\1"
|
||||||
|
FTOPTION_H "${FTOPTION_H}")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
set(FTOPTION_H_NAME "${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h")
|
||||||
|
if (EXISTS "${FTOPTION_H_NAME}")
|
||||||
|
file(READ "${FTOPTION_H_NAME}" ORIGINAL_FTOPTION_H)
|
||||||
|
else ()
|
||||||
|
set(ORIGINAL_FTOPTION_H "")
|
||||||
|
endif ()
|
||||||
|
if (NOT (ORIGINAL_FTOPTION_H STREQUAL FTOPTION_H))
|
||||||
|
file(WRITE "${FTOPTION_H_NAME}" "${FTOPTION_H}")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
file(GLOB PUBLIC_HEADERS "include/ft2build.h" "include/freetype/*.h")
|
file(GLOB PUBLIC_HEADERS "include/ft2build.h" "include/freetype/*.h")
|
||||||
|
|
@ -284,7 +398,6 @@ set(BASE_SRCS
|
||||||
src/base/ftpfr.c
|
src/base/ftpfr.c
|
||||||
src/base/ftstroke.c
|
src/base/ftstroke.c
|
||||||
src/base/ftsynth.c
|
src/base/ftsynth.c
|
||||||
src/base/ftsystem.c
|
|
||||||
src/base/fttype1.c
|
src/base/fttype1.c
|
||||||
src/base/ftwinfnt.c
|
src/base/ftwinfnt.c
|
||||||
src/bdf/bdf.c
|
src/bdf/bdf.c
|
||||||
|
|
@ -300,14 +413,24 @@ set(BASE_SRCS
|
||||||
src/pshinter/pshinter.c
|
src/pshinter/pshinter.c
|
||||||
src/psnames/psnames.c
|
src/psnames/psnames.c
|
||||||
src/raster/raster.c
|
src/raster/raster.c
|
||||||
|
src/sdf/sdf.c
|
||||||
src/sfnt/sfnt.c
|
src/sfnt/sfnt.c
|
||||||
src/smooth/smooth.c
|
src/smooth/smooth.c
|
||||||
|
src/svg/svg.c
|
||||||
src/truetype/truetype.c
|
src/truetype/truetype.c
|
||||||
src/type1/type1.c
|
src/type1/type1.c
|
||||||
src/type42/type42.c
|
src/type42/type42.c
|
||||||
src/winfonts/winfnt.c
|
src/winfonts/winfnt.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (UNIX)
|
||||||
|
list(APPEND BASE_SRCS "builds/unix/ftsystem.c")
|
||||||
|
elseif (WIN32)
|
||||||
|
list(APPEND BASE_SRCS "builds/windows/ftsystem.c")
|
||||||
|
else ()
|
||||||
|
list(APPEND BASE_SRCS "src/base/ftsystem.c")
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
enable_language(RC)
|
enable_language(RC)
|
||||||
list(APPEND BASE_SRCS builds/windows/ftdebug.c
|
list(APPEND BASE_SRCS builds/windows/ftdebug.c
|
||||||
|
|
@ -325,7 +448,7 @@ endif ()
|
||||||
|
|
||||||
if (NOT DISABLE_FORCE_DEBUG_POSTFIX)
|
if (NOT DISABLE_FORCE_DEBUG_POSTFIX)
|
||||||
set(CMAKE_DEBUG_POSTFIX d)
|
set(CMAKE_DEBUG_POSTFIX d)
|
||||||
endif()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
add_library(freetype
|
add_library(freetype
|
||||||
|
|
@ -345,6 +468,10 @@ target_compile_definitions(
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
freetype PRIVATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS)
|
freetype PRIVATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS)
|
||||||
|
if (BUILD_SHARED_LIBS)
|
||||||
|
target_compile_definitions(
|
||||||
|
freetype PRIVATE DLL_EXPORT)
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (BUILD_SHARED_LIBS)
|
if (BUILD_SHARED_LIBS)
|
||||||
|
|
@ -353,17 +480,21 @@ if (BUILD_SHARED_LIBS)
|
||||||
SOVERSION ${LIBRARY_SOVERSION})
|
SOVERSION ${LIBRARY_SOVERSION})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
target_include_directories(
|
# Pick up ftconfig.h and ftoption.h generated above, first.
|
||||||
freetype BEFORE # Pick up ftconfig.h and ftoption.h generated above.
|
|
||||||
PRIVATE "${PROJECT_BINARY_DIR}/include")
|
|
||||||
|
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
freetype
|
freetype
|
||||||
PRIVATE "${PROJECT_SOURCE_DIR}/include")
|
PUBLIC
|
||||||
|
$<INSTALL_INTERFACE:include/freetype2>
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
|
PRIVATE
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/include
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||||
|
|
||||||
|
# Make <ftconfig.h> available for builds/unix/ftsystem.c.
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/include/freetype/config
|
||||||
|
)
|
||||||
|
|
||||||
target_include_directories(
|
|
||||||
freetype
|
|
||||||
PUBLIC $<INSTALL_INTERFACE:include/freetype2>)
|
|
||||||
|
|
||||||
if (BUILD_FRAMEWORK)
|
if (BUILD_FRAMEWORK)
|
||||||
set_property(SOURCE ${PUBLIC_CONFIG_HEADERS}
|
set_property(SOURCE ${PUBLIC_CONFIG_HEADERS}
|
||||||
|
|
@ -371,35 +502,55 @@ if (BUILD_FRAMEWORK)
|
||||||
)
|
)
|
||||||
set_target_properties(freetype PROPERTIES
|
set_target_properties(freetype PROPERTIES
|
||||||
FRAMEWORK TRUE
|
FRAMEWORK TRUE
|
||||||
MACOSX_FRAMEWORK_INFO_PLIST builds/mac/freetype-Info.plist
|
MACOSX_FRAMEWORK_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/builds/mac/freetype-Info.plist
|
||||||
PUBLIC_HEADER "${PUBLIC_HEADERS}"
|
PUBLIC_HEADER "${PUBLIC_HEADERS}"
|
||||||
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
|
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
|
||||||
)
|
)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
# 'freetype-interface' is an interface library, to be accessed with
|
||||||
|
# `EXPORT_NAME Freetype::Freetype`. This is the target name provided by
|
||||||
|
# CMake's `FindFreetype.cmake`, so we provide it for compatibility.
|
||||||
|
add_library(freetype-interface INTERFACE)
|
||||||
|
set_target_properties(freetype-interface PROPERTIES
|
||||||
|
EXPORT_NAME Freetype::Freetype
|
||||||
|
INTERFACE_LINK_LIBRARIES freetype)
|
||||||
|
|
||||||
set(PKG_CONFIG_REQUIRED_PRIVATE "")
|
set(PKGCONFIG_REQUIRES "")
|
||||||
|
set(PKGCONFIG_REQUIRES_PRIVATE "")
|
||||||
|
set(PKGCONFIG_LIBS "-L\${libdir} -lfreetype")
|
||||||
|
set(PKGCONFIG_LIBS_PRIVATE "")
|
||||||
|
|
||||||
if (ZLIB_FOUND)
|
if (ZLIB_FOUND)
|
||||||
target_link_libraries(freetype PRIVATE ${ZLIB_LIBRARIES})
|
target_link_libraries(freetype PRIVATE ${ZLIB_LIBRARIES})
|
||||||
target_include_directories(freetype PRIVATE ${ZLIB_INCLUDE_DIRS})
|
target_include_directories(freetype PRIVATE ${ZLIB_INCLUDE_DIRS})
|
||||||
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE zlib)
|
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "zlib")
|
||||||
endif ()
|
endif ()
|
||||||
if (BZIP2_FOUND)
|
if (BZIP2_FOUND)
|
||||||
target_link_libraries(freetype PRIVATE ${BZIP2_LIBRARIES})
|
target_link_libraries(freetype PRIVATE ${BZIP2_LIBRARIES})
|
||||||
target_include_directories(freetype PRIVATE ${BZIP2_INCLUDE_DIR}) # not BZIP2_INCLUDE_DIRS
|
target_include_directories(freetype PRIVATE ${BZIP2_INCLUDE_DIR}) # not BZIP2_INCLUDE_DIRS
|
||||||
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE bzip2)
|
if (PC_BZIP2_FOUND)
|
||||||
|
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "bzip2")
|
||||||
|
else ()
|
||||||
|
list(APPEND PKGCONFIG_LIBS_PRIVATE "-lbz2")
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
if (PNG_FOUND)
|
if (PNG_FOUND)
|
||||||
target_link_libraries(freetype PRIVATE ${PNG_LIBRARIES})
|
target_link_libraries(freetype PRIVATE ${PNG_LIBRARIES})
|
||||||
target_compile_definitions(freetype PRIVATE ${PNG_DEFINITIONS})
|
target_compile_definitions(freetype PRIVATE ${PNG_DEFINITIONS})
|
||||||
target_include_directories(freetype PRIVATE ${PNG_INCLUDE_DIRS})
|
target_include_directories(freetype PRIVATE ${PNG_INCLUDE_DIRS})
|
||||||
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE libpng)
|
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "libpng")
|
||||||
endif ()
|
endif ()
|
||||||
if (HARFBUZZ_FOUND)
|
if (HarfBuzz_FOUND)
|
||||||
target_link_libraries(freetype PRIVATE ${HARFBUZZ_LIBRARIES})
|
target_link_libraries(freetype PRIVATE ${HarfBuzz_LIBRARY})
|
||||||
target_include_directories(freetype PRIVATE ${HARFBUZZ_INCLUDE_DIRS})
|
target_include_directories(freetype PRIVATE ${HarfBuzz_INCLUDE_DIRS})
|
||||||
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE harfbuzz)
|
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "harfbuzz >= ${HARFBUZZ_MIN_VERSION}")
|
||||||
|
endif ()
|
||||||
|
if (BROTLIDEC_FOUND)
|
||||||
|
target_link_libraries(freetype PRIVATE ${BROTLIDEC_LIBRARIES})
|
||||||
|
target_compile_definitions(freetype PRIVATE ${BROTLIDEC_DEFINITIONS})
|
||||||
|
target_include_directories(freetype PRIVATE ${BROTLIDEC_INCLUDE_DIRS})
|
||||||
|
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "libbrotlidec")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -424,39 +575,68 @@ endif ()
|
||||||
|
|
||||||
if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
|
if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
|
||||||
# Generate the pkg-config file
|
# Generate the pkg-config file
|
||||||
if (UNIX)
|
file(READ "${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in" FREETYPE2_PC_IN)
|
||||||
file(READ ${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in FREETYPE2_PC_IN)
|
|
||||||
|
|
||||||
string(REPLACE ";" ", " PKG_CONFIG_REQUIRED_PRIVATE "${PKG_CONFIG_REQUIRED_PRIVATE}")
|
string(REPLACE ";" ", " PKGCONFIG_REQUIRES_PRIVATE "${PKGCONFIG_REQUIRES_PRIVATE}")
|
||||||
|
|
||||||
string(REPLACE "%prefix%" ${CMAKE_INSTALL_PREFIX}
|
string(REPLACE "%prefix%" ${CMAKE_INSTALL_PREFIX}
|
||||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||||
string(REPLACE "%exec_prefix%" "\${prefix}"
|
string(REPLACE "%exec_prefix%" "\${prefix}"
|
||||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||||
string(REPLACE "%libdir%" "\${prefix}/${CMAKE_INSTALL_LIBDIR}"
|
string(REPLACE "%libdir%" "\${prefix}/${CMAKE_INSTALL_LIBDIR}"
|
||||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||||
string(REPLACE "%includedir%" "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}"
|
string(REPLACE "%includedir%" "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}"
|
||||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||||
string(REPLACE "%ft_version%" "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
|
string(REPLACE "%ft_version%" "${LIBTOOL_CURRENT}.${LIBTOOL_REVISION}.${LIBTOOL_AGE}"
|
||||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||||
string(REPLACE "%REQUIRES_PRIVATE%" "${PKG_CONFIG_REQUIRED_PRIVATE}"
|
|
||||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
|
||||||
string(REPLACE "%LIBS_PRIVATE%" "" # All libs support pkg-config
|
|
||||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
|
||||||
|
|
||||||
file(WRITE ${PROJECT_BINARY_DIR}/freetype2.pc ${FREETYPE2_PC_IN})
|
if (BUILD_SHARED_LIBS)
|
||||||
|
string(REPLACE "%PKGCONFIG_REQUIRES%" "${PKGCONFIG_REQUIRES}"
|
||||||
|
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||||
|
string(REPLACE "%PKGCONFIG_REQUIRES_PRIVATE%" "${PKGCONFIG_REQUIRES_PRIVATE}"
|
||||||
|
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||||
|
string(REPLACE "%PKGCONFIG_LIBS%" "${PKGCONFIG_LIBS}"
|
||||||
|
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||||
|
string(REPLACE "%PKGCONFIG_LIBS_PRIVATE%" "${PKGCONFIG_LIBS_PRIVATE}"
|
||||||
|
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||||
|
else ()
|
||||||
|
string(REPLACE "%PKGCONFIG_REQUIRES%" "${PKGCONFIG_REQUIRES} ${PKGCONFIG_REQUIRES_PRIVATE}"
|
||||||
|
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||||
|
string(REPLACE "%PKGCONFIG_REQUIRES_PRIVATE%" ""
|
||||||
|
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||||
|
string(REPLACE "%PKGCONFIG_LIBS%" "${PKGCONFIG_LIBS} ${PKGCONFIG_LIBS_PRIVATE}"
|
||||||
|
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||||
|
string(REPLACE "%PKGCONFIG_LIBS_PRIVATE%" ""
|
||||||
|
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||||
|
endif ()
|
||||||
|
|
||||||
install(
|
set(FREETYPE2_PC_IN_NAME "${PROJECT_BINARY_DIR}/freetype2.pc")
|
||||||
FILES ${PROJECT_BINARY_DIR}/freetype2.pc
|
if (EXISTS "${FREETYPE2_PC_IN_NAME}")
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
file(READ "${FREETYPE2_PC_IN_NAME}" ORIGINAL_FREETYPE2_PC_IN)
|
||||||
COMPONENT pkgconfig)
|
else ()
|
||||||
|
set(ORIGINAL_FREETYPE2_PC_IN "")
|
||||||
|
endif ()
|
||||||
|
if (NOT (ORIGINAL_FREETYPE2_PC_IN STREQUAL FREETYPE2_PC_IN))
|
||||||
|
file(WRITE "${FREETYPE2_PC_IN_NAME}" ${FREETYPE2_PC_IN})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
install(
|
install(
|
||||||
TARGETS freetype
|
FILES ${PROJECT_BINARY_DIR}/freetype2.pc
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
||||||
|
COMPONENT pkgconfig)
|
||||||
|
|
||||||
|
include(CMakePackageConfigHelpers)
|
||||||
|
write_basic_package_version_file(
|
||||||
|
${PROJECT_BINARY_DIR}/freetype-config-version.cmake
|
||||||
|
VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
|
||||||
|
COMPATIBILITY SameMajorVersion)
|
||||||
|
|
||||||
|
install(
|
||||||
|
TARGETS freetype freetype-interface
|
||||||
EXPORT freetype-targets
|
EXPORT freetype-targets
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
FRAMEWORK DESTINATION Library/Frameworks
|
FRAMEWORK DESTINATION Library/Frameworks
|
||||||
COMPONENT libraries)
|
COMPONENT libraries)
|
||||||
install(
|
install(
|
||||||
|
|
@ -464,6 +644,10 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype
|
||||||
FILE freetype-config.cmake
|
FILE freetype-config.cmake
|
||||||
COMPONENT headers)
|
COMPONENT headers)
|
||||||
|
install(
|
||||||
|
FILES ${PROJECT_BINARY_DIR}/freetype-config-version.cmake
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype
|
||||||
|
COMPONENT headers)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -471,7 +655,7 @@ endif ()
|
||||||
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
|
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
|
||||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The FreeType font rendering library.")
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The FreeType font rendering library.")
|
||||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
|
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
|
||||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/docs/LICENSE.TXT")
|
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.TXT")
|
||||||
|
|
||||||
set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
|
set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
|
||||||
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
|
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
|
||||||
|
|
@ -480,9 +664,9 @@ set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSIO
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set(CPACK_GENERATOR ZIP)
|
set(CPACK_GENERATOR ZIP)
|
||||||
else()
|
else ()
|
||||||
set(CPACK_GENERATOR TGZ)
|
set(CPACK_GENERATOR TGZ)
|
||||||
endif()
|
endif ()
|
||||||
|
|
||||||
set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
|
set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
|
||||||
set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C/C++ Headers")
|
set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C/C++ Headers")
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,222 +0,0 @@
|
||||||
# FreeType 2 top Jamfile.
|
|
||||||
#
|
|
||||||
# Copyright 2001-2018 by
|
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
|
||||||
#
|
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
|
||||||
# and distributed under the terms of the FreeType project license,
|
|
||||||
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
|
|
||||||
# indicate that you have read the license and understand and accept it
|
|
||||||
# fully.
|
|
||||||
|
|
||||||
|
|
||||||
# The HDRMACRO is already defined in FTJam and is used to add
|
|
||||||
# the content of certain macros to the list of included header
|
|
||||||
# files.
|
|
||||||
#
|
|
||||||
# We can compile FreeType 2 with classic Jam however thanks to
|
|
||||||
# the following code
|
|
||||||
#
|
|
||||||
if ! $(JAM_TOOLSET)
|
|
||||||
{
|
|
||||||
rule HDRMACRO
|
|
||||||
{
|
|
||||||
# nothing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# We need to invoke a SubDir rule if the FT2 source directory top is not the
|
|
||||||
# current directory. This allows us to build FreeType 2 as part of a larger
|
|
||||||
# project easily.
|
|
||||||
#
|
|
||||||
if $(FT2_TOP) != $(DOT)
|
|
||||||
{
|
|
||||||
SubDir FT2_TOP ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# The following macros define the include directory, the source directory,
|
|
||||||
# and the final library name (without library extensions). They can be
|
|
||||||
# replaced by other definitions when the library is compiled as part of
|
|
||||||
# a larger project.
|
|
||||||
#
|
|
||||||
|
|
||||||
# Name of FreeType include directory during compilation.
|
|
||||||
# This is relative to FT2_TOP.
|
|
||||||
#
|
|
||||||
FT2_INCLUDE_DIR ?= include ;
|
|
||||||
|
|
||||||
# Name of FreeType source directory during compilation.
|
|
||||||
# This is relative to FT2_TOP.
|
|
||||||
#
|
|
||||||
FT2_SRC_DIR ?= src ;
|
|
||||||
|
|
||||||
# Name of final library, without extension.
|
|
||||||
#
|
|
||||||
FT2_LIB ?= $(LIBPREFIX)freetype ;
|
|
||||||
|
|
||||||
|
|
||||||
# Define FT2_BUILD_INCLUDE to point to your build-specific directory.
|
|
||||||
# This is prepended to FT2_INCLUDE_DIR. It can be used to specify
|
|
||||||
# the location of a custom <ft2build.h> which will point to custom
|
|
||||||
# versions of `ftmodule.h' and `ftoption.h', for example.
|
|
||||||
#
|
|
||||||
FT2_BUILD_INCLUDE ?= ;
|
|
||||||
|
|
||||||
# The list of modules to compile on any given build of the library.
|
|
||||||
# By default, this will contain _all_ modules defined in FT2_SRC_DIR.
|
|
||||||
#
|
|
||||||
# IMPORTANT: You'll need to change the content of `ftmodule.h' as well
|
|
||||||
# if you modify this list or provide your own.
|
|
||||||
#
|
|
||||||
FT2_COMPONENTS ?= autofit # auto-fitter
|
|
||||||
base # base component (public APIs)
|
|
||||||
bdf # BDF font driver
|
|
||||||
bzip2 # support for bzip2-compressed PCF font
|
|
||||||
cache # cache sub-system
|
|
||||||
cff # CFF/CEF font driver
|
|
||||||
cid # PostScript CID-keyed font driver
|
|
||||||
gzip # support for gzip-compressed PCF font
|
|
||||||
lzw # support for LZW-compressed PCF font
|
|
||||||
pcf # PCF font driver
|
|
||||||
pfr # PFR/TrueDoc font driver
|
|
||||||
psaux # common PostScript routines module
|
|
||||||
pshinter # PostScript hinter module
|
|
||||||
psnames # PostScript names handling
|
|
||||||
raster # monochrome rasterizer
|
|
||||||
sfnt # SFNT-based format support routines
|
|
||||||
smooth # anti-aliased rasterizer
|
|
||||||
truetype # TrueType font driver
|
|
||||||
type1 # PostScript Type 1 font driver
|
|
||||||
type42 # PostScript Type 42 (embedded TrueType) driver
|
|
||||||
winfonts # Windows FON/FNT font driver
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
# Don't touch.
|
|
||||||
#
|
|
||||||
FT2_INCLUDE = $(FT2_BUILD_INCLUDE)
|
|
||||||
[ FT2_SubDir $(FT2_INCLUDE_DIR) ] ;
|
|
||||||
|
|
||||||
FT2_SRC = [ FT2_SubDir $(FT2_SRC_DIR) ] ;
|
|
||||||
|
|
||||||
# Location of API Reference Documentation
|
|
||||||
#
|
|
||||||
if $(DOC_DIR)
|
|
||||||
{
|
|
||||||
DOC_DIR = $(DOCDIR:T) ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DOC_DIR = docs/reference ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Only used by FreeType developers.
|
|
||||||
#
|
|
||||||
if $(DEBUG_HINTER)
|
|
||||||
{
|
|
||||||
CCFLAGS += -DDEBUG_HINTER ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# We need `include' in the current include path in order to
|
|
||||||
# compile any part of FreeType 2.
|
|
||||||
#
|
|
||||||
HDRS += $(FT2_INCLUDE) ;
|
|
||||||
|
|
||||||
|
|
||||||
# We need to #define FT2_BUILD_LIBRARY so that our sources find the
|
|
||||||
# internal headers
|
|
||||||
#
|
|
||||||
CCFLAGS += -DFT2_BUILD_LIBRARY ;
|
|
||||||
|
|
||||||
# Uncomment the following line if you want to build individual source files
|
|
||||||
# for each FreeType 2 module. This is only useful during development, and
|
|
||||||
# is better defined as an environment variable anyway!
|
|
||||||
#
|
|
||||||
# FT2_MULTI = true ;
|
|
||||||
|
|
||||||
|
|
||||||
# The files `ftheader.h', `internal.h', and `ftserv.h' are used to define
|
|
||||||
# macros that are later used in #include statements. They need to be parsed
|
|
||||||
# in order to record these definitions.
|
|
||||||
#
|
|
||||||
HDRMACRO [ FT2_SubDir $(FT2_INCLUDE_DIR) freetype config ftheader.h ] ;
|
|
||||||
HDRMACRO [ FT2_SubDir $(FT2_INCLUDE_DIR) freetype internal internal.h ] ;
|
|
||||||
HDRMACRO [ FT2_SubDir $(FT2_INCLUDE_DIR) freetype internal ftserv.h ] ;
|
|
||||||
|
|
||||||
|
|
||||||
# Now include the Jamfile in `freetype2/src', used to drive the compilation
|
|
||||||
# of each FreeType 2 component and/or module.
|
|
||||||
#
|
|
||||||
SubInclude FT2_TOP $(FT2_SRC_DIR) ;
|
|
||||||
|
|
||||||
# Handle the generation of the `ftexport.sym' file, which contains the list
|
|
||||||
# of exported symbols. This can be used on Unix by libtool.
|
|
||||||
#
|
|
||||||
SubInclude FT2_TOP $(FT2_SRC_DIR) tools ;
|
|
||||||
|
|
||||||
rule GenExportSymbols
|
|
||||||
{
|
|
||||||
local apinames = apinames$(SUFEXE) ;
|
|
||||||
local aheader ;
|
|
||||||
local headers ;
|
|
||||||
|
|
||||||
for aheader in [ Glob $(2) : *.h ]
|
|
||||||
{
|
|
||||||
switch $(aheader)
|
|
||||||
{
|
|
||||||
case */ftmac.h :
|
|
||||||
if ( $(MAC) || $(OS) = MACOSX ) {
|
|
||||||
headers += $(aheader) ;
|
|
||||||
}
|
|
||||||
case *.h : headers += $(aheader) ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LOCATE on $(1) = $(ALL_LOCATE_TARGET) ;
|
|
||||||
|
|
||||||
APINAMES on $(1) = apinames$(SUFEXE) ;
|
|
||||||
|
|
||||||
Depends $(1) : $(apinames) $(headers) ;
|
|
||||||
GenExportSymbols1 $(1) : $(headers) ;
|
|
||||||
Clean clean : $(1) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
actions GenExportSymbols1 bind APINAMES
|
|
||||||
{
|
|
||||||
$(APINAMES) $(2) > $(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
GenExportSymbols ftexport.sym : include/freetype ;
|
|
||||||
|
|
||||||
# Test files (hinter debugging). Only used by FreeType developers.
|
|
||||||
#
|
|
||||||
if $(DEBUG_HINTER)
|
|
||||||
{
|
|
||||||
SubInclude FT2_TOP tests ;
|
|
||||||
}
|
|
||||||
|
|
||||||
rule RefDoc
|
|
||||||
{
|
|
||||||
Depends $1 : all ;
|
|
||||||
NotFile $1 ;
|
|
||||||
Always $1 ;
|
|
||||||
}
|
|
||||||
|
|
||||||
actions RefDoc
|
|
||||||
{
|
|
||||||
python $(FT2_SRC)/tools/docmaker/docmaker.py
|
|
||||||
--prefix=ft2
|
|
||||||
--title=FreeType-2.9.1
|
|
||||||
--output=$(DOC_DIR)
|
|
||||||
$(FT2_INCLUDE)/freetype/*.h
|
|
||||||
$(FT2_INCLUDE)/freetype/config/*.h
|
|
||||||
}
|
|
||||||
|
|
||||||
RefDoc refdoc ;
|
|
||||||
|
|
||||||
|
|
||||||
# end of top Jamfile
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
# FreeType 2 JamRules.
|
|
||||||
#
|
|
||||||
# Copyright 2001-2018 by
|
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
|
||||||
#
|
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
|
||||||
# and distributed under the terms of the FreeType project license,
|
|
||||||
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
|
|
||||||
# indicate that you have read the license and understand and accept it
|
|
||||||
# fully.
|
|
||||||
|
|
||||||
|
|
||||||
# This file contains the Jam rules needed to build the FreeType 2 library.
|
|
||||||
# It is shared by all Jamfiles and is included only once in the build
|
|
||||||
# process.
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
# Call SubDirHdrs on a list of directories.
|
|
||||||
#
|
|
||||||
rule AddSubDirHdrs
|
|
||||||
{
|
|
||||||
local x ;
|
|
||||||
|
|
||||||
for x in $(<)
|
|
||||||
{
|
|
||||||
SubDirHdrs $(x) ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Determine prefix of library file. We must use "libxxxxx" on Unix systems,
|
|
||||||
# while all other simply use the real name.
|
|
||||||
#
|
|
||||||
if $(UNIX)
|
|
||||||
{
|
|
||||||
LIBPREFIX ?= lib ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LIBPREFIX ?= "" ;
|
|
||||||
}
|
|
||||||
|
|
||||||
# FT2_TOP contains the location of the FreeType source directory. You can
|
|
||||||
# set it to a specific value if you want to compile the library as part of a
|
|
||||||
# larger project.
|
|
||||||
#
|
|
||||||
FT2_TOP ?= $(DOT) ;
|
|
||||||
|
|
||||||
# Define a new rule used to declare a sub directory of the Nirvana source
|
|
||||||
# tree.
|
|
||||||
#
|
|
||||||
rule FT2_SubDir
|
|
||||||
{
|
|
||||||
if $(FT2_TOP) = $(DOT)
|
|
||||||
{
|
|
||||||
return [ FDirName $(<) ] ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return [ FDirName $(FT2_TOP) $(<) ] ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# We also set ALL_LOCATE_TARGET in order to place all object and library
|
|
||||||
# files in "objs".
|
|
||||||
#
|
|
||||||
ALL_LOCATE_TARGET ?= [ FT2_SubDir objs ] ;
|
|
||||||
|
|
||||||
|
|
||||||
# end of Jamrules
|
|
||||||
|
|
@ -1,39 +1,46 @@
|
||||||
|
FREETYPE LICENSES
|
||||||
|
-----------------
|
||||||
|
|
||||||
The FreeType 2 font engine is copyrighted work and cannot be used
|
The FreeType 2 font engine is copyrighted work and cannot be used
|
||||||
legally without a software license. In order to make this project
|
legally without a software license. In order to make this project
|
||||||
usable to a vast majority of developers, we distribute it under two
|
usable to a vast majority of developers, we distribute it under two
|
||||||
mutually exclusive open-source licenses.
|
mutually exclusive open-source licenses.
|
||||||
|
|
||||||
This means that *you* must choose *one* of the two licenses described
|
This means that *you* must choose *one* of the two licenses described
|
||||||
below, then obey all its terms and conditions when using FreeType 2 in
|
below, then obey all its terms and conditions when using FreeType 2 in
|
||||||
any of your projects or products.
|
any of your projects or products.
|
||||||
|
|
||||||
- The FreeType License, found in the file `FTL.TXT', which is similar
|
- The FreeType License, found in the file `docs/FTL.TXT`, which is
|
||||||
to the original BSD license *with* an advertising clause that forces
|
similar to the original BSD license *with* an advertising clause
|
||||||
you to explicitly cite the FreeType project in your product's
|
that forces you to explicitly cite the FreeType project in your
|
||||||
documentation. All details are in the license file. This license
|
product's documentation. All details are in the license file.
|
||||||
is suited to products which don't use the GNU General Public
|
This license is suited to products which don't use the GNU General
|
||||||
License.
|
Public License.
|
||||||
|
|
||||||
Note that this license is compatible to the GNU General Public
|
Note that this license is compatible to the GNU General Public
|
||||||
License version 3, but not version 2.
|
License version 3, but not version 2.
|
||||||
|
|
||||||
- The GNU General Public License version 2, found in `GPLv2.TXT' (any
|
- The GNU General Public License version 2, found in
|
||||||
later version can be used also), for programs which already use the
|
`docs/GPLv2.TXT` (any later version can be used also), for
|
||||||
GPL. Note that the FTL is incompatible with GPLv2 due to its
|
programs which already use the GPL. Note that the FTL is
|
||||||
advertisement clause.
|
incompatible with GPLv2 due to its advertisement clause.
|
||||||
|
|
||||||
The contributed BDF and PCF drivers come with a license similar to that
|
The contributed BDF and PCF drivers come with a license similar to
|
||||||
of the X Window System. It is compatible to the above two licenses (see
|
that of the X Window System. It is compatible to the above two
|
||||||
file src/bdf/README and src/pcf/README). The same holds for the files
|
licenses (see files `src/bdf/README` and `src/pcf/README`). The same
|
||||||
`fthash.c' and `fthash.h'; their code was part of the BDF driver in
|
holds for the source code files `src/base/fthash.c` and
|
||||||
earlier FreeType versions.
|
`include/freetype/internal/fthash.h`; they were part of the BDF driver
|
||||||
|
in earlier FreeType versions.
|
||||||
|
|
||||||
The gzip module uses the zlib license (see src/gzip/zlib.h) which too is
|
The gzip module uses the zlib license (see `src/gzip/zlib.h`) which
|
||||||
compatible to the above two licenses.
|
too is compatible to the above two licenses.
|
||||||
|
|
||||||
The MD5 checksum support (only used for debugging in development builds)
|
The files `src/autofit/ft-hb.c` and `src/autofit/ft-hb.h` contain code
|
||||||
is in the public domain.
|
taken almost verbatim from the HarfBuzz file `hb-ft.cc`, which uses
|
||||||
|
the 'Old MIT' license, compatible to the above two licenses.
|
||||||
|
|
||||||
|
The MD5 checksum support (only used for debugging in development
|
||||||
|
builds) is in the public domain.
|
||||||
|
|
||||||
|
|
||||||
--- end of LICENSE.TXT ---
|
--- end of LICENSE.TXT ---
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -1,77 +1,100 @@
|
||||||
FreeType 2.9.1
|
FreeType 2.13.0
|
||||||
==============
|
===============
|
||||||
|
|
||||||
Homepage: https://www.freetype.org
|
Homepage: https://www.freetype.org
|
||||||
|
|
||||||
FreeType is a freely available software library to render fonts.
|
FreeType is a freely available software library to render fonts.
|
||||||
|
|
||||||
It is written in C, designed to be small, efficient, highly
|
It is written in C, designed to be small, efficient, highly
|
||||||
customizable, and portable while capable of producing high-quality
|
customizable, and portable while capable of producing high-quality
|
||||||
output (glyph images) of most vector and bitmap font formats.
|
output (glyph images) of most vector and bitmap font formats.
|
||||||
|
|
||||||
Please read the docs/CHANGES file, it contains IMPORTANT
|
Please read the `docs/CHANGES` file, it contains IMPORTANT
|
||||||
INFORMATION.
|
INFORMATION.
|
||||||
|
|
||||||
Read the files `docs/INSTALL*' for installation instructions; see
|
Read the files `docs/INSTALL*` for installation instructions; see the
|
||||||
the file `docs/LICENSE.TXT' for the available licenses.
|
file `docs/LICENSE.TXT` for the available licenses.
|
||||||
|
|
||||||
The FreeType 2 API reference is located in `docs/reference'; use the
|
For using FreeType's git repository instead of a distribution bundle,
|
||||||
file `ft2-toc.html' as the top entry point. Additional
|
please read file `README.git`. Note that you have to actually clone
|
||||||
documentation is available as a separate package from our sites. Go
|
the repository; using a snapshot will not work (in other words, don't
|
||||||
to
|
use gitlab's 'Download' button).
|
||||||
|
|
||||||
https://download.savannah.gnu.org/releases/freetype/
|
The FreeType 2 API reference is located in directory `docs/reference`;
|
||||||
|
use the file `index.html` as the top entry point. [Please note that
|
||||||
|
currently the search function for locally installed documentation
|
||||||
|
doesn't work due to cross-site scripting issues.]
|
||||||
|
|
||||||
and download one of the following files.
|
Additional documentation is available as a separate package from our
|
||||||
|
sites. Go to
|
||||||
|
|
||||||
freetype-doc-2.9.1.tar.bz2
|
https://download.savannah.gnu.org/releases/freetype/
|
||||||
freetype-doc-2.9.1.tar.gz
|
|
||||||
ftdoc291.zip
|
|
||||||
|
|
||||||
To view the documentation online, go to
|
and download one of the following files.
|
||||||
|
|
||||||
https://www.freetype.org/freetype2/documentation.html
|
freetype-doc-2.13.0.tar.xz
|
||||||
|
freetype-doc-2.13.0.tar.gz
|
||||||
|
ftdoc2130.zip
|
||||||
|
|
||||||
|
To view the documentation online, go to
|
||||||
|
|
||||||
|
https://www.freetype.org/freetype2/docs/
|
||||||
|
|
||||||
|
|
||||||
Mailing Lists
|
Mailing Lists
|
||||||
=============
|
-------------
|
||||||
|
|
||||||
The preferred way of communication with the FreeType team is using
|
The preferred way of communication with the FreeType team is using
|
||||||
e-mail lists.
|
e-mail lists.
|
||||||
|
|
||||||
general use and discussion: freetype@nongnu.org
|
general use and discussion: freetype@nongnu.org
|
||||||
engine internals, porting, etc.: freetype-devel@nongnu.org
|
engine internals, porting, etc.: freetype-devel@nongnu.org
|
||||||
announcements: freetype-announce@nongnu.org
|
announcements: freetype-announce@nongnu.org
|
||||||
git repository tracker: freetype-commit@nongnu.org
|
git repository tracker: freetype-commit@nongnu.org
|
||||||
|
|
||||||
The lists are moderated; see
|
The lists are moderated; see
|
||||||
|
|
||||||
https://www.freetype.org/contact.html
|
https://www.freetype.org/contact.html
|
||||||
|
|
||||||
how to subscribe.
|
how to subscribe.
|
||||||
|
|
||||||
|
|
||||||
Bugs
|
Bugs
|
||||||
====
|
----
|
||||||
|
|
||||||
Please submit bug reports at
|
Please submit bug reports at
|
||||||
|
|
||||||
https://savannah.nongnu.org/bugs/?group=freetype
|
https://gitlab.freedesktop.org/freetype/freetype/-/issues
|
||||||
|
|
||||||
Alternatively, you might report bugs by e-mail to
|
Alternatively, you might report bugs by e-mail to
|
||||||
`freetype-devel@nongnu.org'. Don't forget to send a detailed
|
`freetype-devel@nongnu.org`. Don't forget to send a detailed
|
||||||
explanation of the problem -- there is nothing worse than receiving
|
explanation of the problem -- there is nothing worse than receiving a
|
||||||
a terse message that only says `it doesn't work'.
|
terse message that only says 'it doesn't work'.
|
||||||
|
|
||||||
|
|
||||||
Enjoy!
|
Patches
|
||||||
|
-------
|
||||||
|
|
||||||
|
For larger changes please provide merge requests at
|
||||||
|
|
||||||
|
https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests
|
||||||
|
|
||||||
|
Alternatively, you can send patches to the `freetype-devel@nongnu.org`
|
||||||
|
mailing list -- and thank you in advance for your work on improving
|
||||||
|
FreeType!
|
||||||
|
|
||||||
|
Details on the process can be found here:
|
||||||
|
|
||||||
|
https://www.freetype.org/developer.html#patches
|
||||||
|
|
||||||
|
|
||||||
The FreeType Team
|
Enjoy!
|
||||||
|
|
||||||
|
The FreeType Team
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright 2006-2018 by
|
Copyright (C) 2006-2023 by
|
||||||
David Turner, Robert Wilhelm, and Werner Lemberg.
|
David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
|
|
||||||
This file is part of the FreeType project, and may only be used,
|
This file is part of the FreeType project, and may only be used,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,36 @@
|
||||||
The git archive doesn't contain pre-built configuration scripts for
|
README.git
|
||||||
|
==========
|
||||||
|
|
||||||
|
|
||||||
|
repository issues
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
FreeType's official repository site is
|
||||||
|
|
||||||
|
https://gitlab.freedesktop.org/freetype ,
|
||||||
|
|
||||||
|
from which the 'freetype.git' and 'freetype-demos.git' repositories
|
||||||
|
can be cloned in the usual way.
|
||||||
|
|
||||||
|
git clone https://gitlab.freedesktop.org/freetype/freetype.git
|
||||||
|
git clone https://gitlab.freedesktop.org/freetype/freetype-demos.git
|
||||||
|
|
||||||
|
If you want to use the Savannah mirror instead, you have to do a
|
||||||
|
slightly different incantation because the repository names contain
|
||||||
|
digit '2' for historical reasons.
|
||||||
|
|
||||||
|
git clone \
|
||||||
|
https://git.savannah.nongnu.org/git/freetype/freetype2.git \
|
||||||
|
freetype
|
||||||
|
git clone \
|
||||||
|
https://git.savannah.nongnu.org/git/freetype/freetype2-demos.git \
|
||||||
|
freetype-demos
|
||||||
|
|
||||||
|
|
||||||
|
standard builds with `configure`
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
The git repository doesn't contain pre-built configuration scripts for
|
||||||
UNIXish platforms. To generate them say
|
UNIXish platforms. To generate them say
|
||||||
|
|
||||||
sh autogen.sh
|
sh autogen.sh
|
||||||
|
|
@ -10,34 +42,54 @@ which in turn depends on the following packages:
|
||||||
autoconf (2.62)
|
autoconf (2.62)
|
||||||
|
|
||||||
The versions given in parentheses are known to work. Newer versions
|
The versions given in parentheses are known to work. Newer versions
|
||||||
should work too, of course. Note that autogen.sh also sets up proper
|
should work too, of course. Note that `autogen.sh` also sets up
|
||||||
file permissions for the `configure' and auxiliary scripts.
|
proper file permissions for the `configure` and auxiliary scripts.
|
||||||
|
|
||||||
The autogen.sh script now checks the version of above three packages
|
The `autogen.sh` script checks whether the versions of the above three
|
||||||
whether they match the numbers above. Otherwise it will complain and
|
tools match the numbers above. Otherwise it will complain and suggest
|
||||||
suggest either upgrading or using an environment variable to point to
|
either upgrading or using environment variables to point to more
|
||||||
a more recent version of the required tool(s).
|
recent versions of the required tools.
|
||||||
|
|
||||||
Note that `aclocal' is provided by the `automake' package on Linux,
|
Note that `aclocal` is provided by the 'automake' package on Linux,
|
||||||
and that `libtoolize' is called `glibtoolize' on Darwin (OS X).
|
and that `libtoolize` is called `glibtoolize` on Darwin (OS X).
|
||||||
|
|
||||||
|
|
||||||
For static builds which don't use platform specific optimizations, no
|
alternative build methods
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
For static builds that don't use platform-specific optimizations, no
|
||||||
configure script is necessary at all; saying
|
configure script is necessary at all; saying
|
||||||
|
|
||||||
make setup ansi
|
make setup ansi
|
||||||
make
|
make
|
||||||
|
|
||||||
should work on all platforms which have GNU make (or makepp).
|
should work on all platforms that have GNU `make` (or `makepp`).
|
||||||
|
|
||||||
|
A build with `cmake` or `meson` can be done directly from the git
|
||||||
|
repository. However, if you want to use the `FT_DEBUG_LOGGING` macro
|
||||||
|
(see file `docs/DEBUG` for more information) it is currently mandatory
|
||||||
|
to execute `autogen.sh` in advance; this script clones the 'dlg' git
|
||||||
|
submodule and copies some files into FreeType's source tree.
|
||||||
|
|
||||||
|
|
||||||
Similarly, a build with `cmake' can be done directly from the git
|
Code of Conduct
|
||||||
repository.
|
---------------
|
||||||
|
|
||||||
|
Please note that this project is released with a Contributor Code of
|
||||||
|
Conduct (CoC). By participating in this project you agree to abide by
|
||||||
|
its terms, which you can find in the following link:
|
||||||
|
|
||||||
|
https://www.freedesktop.org/wiki/CodeOfConduct
|
||||||
|
|
||||||
|
CoC issues may be raised to the project maintainers at the following
|
||||||
|
address:
|
||||||
|
|
||||||
|
wl@gnu.org
|
||||||
|
apodtele@gmail.com
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright 2005-2018 by
|
Copyright (C) 2005-2023 by
|
||||||
David Turner, Robert Wilhelm, and Werner Lemberg.
|
David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
|
|
||||||
This file is part of the FreeType project, and may only be used,
|
This file is part of the FreeType project, and may only be used,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
This directory contains freetype2 v2.9.1 downloaded from
|
This directory contains FreeType v2.13.0 downloaded from
|
||||||
http://savannah.nongnu.org/download/freetype/
|
https://download.savannah.gnu.org/releases/freetype/
|
||||||
|
|
||||||
There are currently no local changes applied to the freetype tree,
|
No post-2.13.0 commits have been cherry-picked from the upstream FreeType
|
||||||
except that the file docs/LICENSE.TXT has been copied to the top-level
|
repository at this time.
|
||||||
directory of the FreeType tree as LICENSE.TXT.
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Copyright 2005-2018 by
|
# Copyright (C) 2005-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -110,7 +110,10 @@ check_tool_version ()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if test ! -f ./builds/unix/configure.raw; then
|
# Solaris 10's shell doesn't like the `!` operator to negate the exit status.
|
||||||
|
if test -f ./builds/unix/configure.raw; then
|
||||||
|
:
|
||||||
|
else
|
||||||
echo "You must be in the same directory as \`autogen.sh'."
|
echo "You must be in the same directory as \`autogen.sh'."
|
||||||
echo "Bootstrapping doesn't work if srcdir != builddir."
|
echo "Bootstrapping doesn't work if srcdir != builddir."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -138,18 +141,25 @@ check_tool_version $ACLOCAL aclocal ACLOCAL 1.10.1
|
||||||
check_tool_version $LIBTOOLIZE libtoolize LIBTOOLIZE 2.2.4
|
check_tool_version $LIBTOOLIZE libtoolize LIBTOOLIZE 2.2.4
|
||||||
check_tool_version $AUTOCONF autoconf AUTOCONF 2.62
|
check_tool_version $AUTOCONF autoconf AUTOCONF 2.62
|
||||||
|
|
||||||
# This sets freetype_major, freetype_minor, and freetype_patch.
|
# This sets FREETYPE version.
|
||||||
eval `sed -nf version.sed include/freetype/freetype.h`
|
eval `sed -n \
|
||||||
|
-e 's/^#define *\(FREETYPE_MAJOR\) *\([0-9][0-9]*\).*/\1=\2/p' \
|
||||||
|
-e 's/^#define *\(FREETYPE_MINOR\) *\([0-9][0-9]*\).*/\1=\2/p' \
|
||||||
|
-e 's/^#define *\(FREETYPE_PATCH\) *\([0-9][0-9]*\).*/\1=\2/p' \
|
||||||
|
include/freetype/freetype.h`
|
||||||
|
|
||||||
# We set freetype-patch to an empty value if it is zero.
|
if test "$FREETYPE_PATCH" = "0"; then
|
||||||
if test "$freetype_patch" = ".0"; then
|
FREETYPE=$FREETYPE_MAJOR.$FREETYPE_MINOR
|
||||||
freetype_patch=
|
else
|
||||||
|
FREETYPE=$FREETYPE_MAJOR.$FREETYPE_MINOR.$FREETYPE_PATCH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "FreeType $FREETYPE:"
|
||||||
|
|
||||||
cd builds/unix
|
cd builds/unix
|
||||||
|
|
||||||
echo "generating \`configure.ac'"
|
echo "generating \`configure.ac'"
|
||||||
sed -e "s;@VERSION@;$freetype_major$freetype_minor$freetype_patch;" \
|
sed -e "s;@VERSION@;$FREETYPE;" \
|
||||||
< configure.raw > configure.ac
|
< configure.raw > configure.ac
|
||||||
|
|
||||||
run aclocal -I . --force
|
run aclocal -I . --force
|
||||||
|
|
@ -162,4 +172,29 @@ cd ../..
|
||||||
|
|
||||||
chmod +x ./configure
|
chmod +x ./configure
|
||||||
|
|
||||||
|
# Copy all necessary 'dlg' files.
|
||||||
|
copy_submodule_files ()
|
||||||
|
{
|
||||||
|
echo "Copying files from \`subprojects/dlg' to \`src/dlg' and \`include/dlg'"
|
||||||
|
mkdir include/dlg 2> /dev/null
|
||||||
|
cp $DLG_INC_DIR/output.h include/dlg
|
||||||
|
cp $DLG_INC_DIR/dlg.h include/dlg
|
||||||
|
cp $DLG_SRC_DIR/* src/dlg
|
||||||
|
}
|
||||||
|
|
||||||
|
if test -e ".git"; then
|
||||||
|
DLG_INC_DIR=subprojects/dlg/include/dlg
|
||||||
|
DLG_SRC_DIR=subprojects/dlg/src/dlg
|
||||||
|
|
||||||
|
if test -d "$DLG_INC_DIR"; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
echo "Checking out submodule in \`subprojects/dlg':"
|
||||||
|
git submodule init
|
||||||
|
git submodule update
|
||||||
|
fi
|
||||||
|
|
||||||
|
copy_submodule_files
|
||||||
|
fi
|
||||||
|
|
||||||
# EOF
|
# EOF
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
README for the builds/amiga subdirectory.
|
README for the builds/amiga subdirectory.
|
||||||
|
|
||||||
Copyright 2005-2018 by
|
Copyright (C) 2005-2023 by
|
||||||
Werner Lemberg and Detlef Würkner.
|
Werner Lemberg and Detlef Würkner.
|
||||||
|
|
||||||
This file is part of the FreeType project, and may only be used, modified,
|
This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -26,7 +26,7 @@ FreeType 1.3.1 from Richard Griffith (ragriffi@sprynet.com,
|
||||||
http://ragriffi.home.sprynet.com).
|
http://ragriffi.home.sprynet.com).
|
||||||
|
|
||||||
You will also need the latest include files and amiga.lib from the
|
You will also need the latest include files and amiga.lib from the
|
||||||
Amiga web site (http://www.amiga.com/3.9/download/NDK3.9.lha) for
|
Amiga web site (https://os.amigaworld.de/download.php?id=3) for
|
||||||
AmigaOS 3.9; the generated code should work under AmigaOS 2.04 and up.
|
AmigaOS 3.9; the generated code should work under AmigaOS 2.04 and up.
|
||||||
|
|
||||||
To use it, call "smake assign" and then "smake" from the builds/amiga
|
To use it, call "smake assign" and then "smake" from the builds/amiga
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
/* */
|
/* */
|
||||||
/* Amiga-specific configuration file (specification only). */
|
/* Amiga-specific configuration file (specification only). */
|
||||||
/* */
|
/* */
|
||||||
/* Copyright 2005-2018 by */
|
/* Copyright (C) 2005-2023 by */
|
||||||
/* Werner Lemberg and Detlef Würkner. */
|
/* Werner Lemberg and Detlef Würkner. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of the FreeType project, and may only be used, */
|
/* This file is part of the FreeType project, and may only be used, */
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
/* */
|
/* */
|
||||||
/* Amiga-specific FreeType module selection. */
|
/* Amiga-specific FreeType module selection. */
|
||||||
/* */
|
/* */
|
||||||
/* Copyright 2005-2018 by */
|
/* Copyright (C) 2005-2023 by */
|
||||||
/* Werner Lemberg and Detlef Würkner. */
|
/* Werner Lemberg and Detlef Würkner. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of the FreeType project, and may only be used, */
|
/* This file is part of the FreeType project, and may only be used, */
|
||||||
|
|
@ -137,8 +137,6 @@ FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
|
||||||
|
|
||||||
#ifdef FT_USE_SMOOTH
|
#ifdef FT_USE_SMOOTH
|
||||||
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
|
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
|
||||||
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )
|
|
||||||
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FT_USE_OTV
|
#ifdef FT_USE_OTV
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 2005-2018 by
|
# Copyright (C) 2005-2023 by
|
||||||
# Werner Lemberg and Detlef Würkner.
|
# Werner Lemberg and Detlef Würkner.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 2005-2018 by
|
# Copyright (C) 2005-2023 by
|
||||||
# Werner Lemberg and Detlef Würkner.
|
# Werner Lemberg and Detlef Würkner.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 2005-2018 by
|
# Copyright (C) 2005-2023 by
|
||||||
# Werner Lemberg and Detlef Würkner.
|
# Werner Lemberg and Detlef Würkner.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -1,76 +1,78 @@
|
||||||
/***************************************************************************/
|
/****************************************************************************
|
||||||
/* */
|
*
|
||||||
/* ftdebug.c */
|
* ftdebug.c
|
||||||
/* */
|
*
|
||||||
/* Debugging and logging component for amiga (body). */
|
* Debugging and logging component for amiga (body).
|
||||||
/* */
|
*
|
||||||
/* Copyright 1996-2018 by */
|
* Copyright (C) 1996-2023 by
|
||||||
/* David Turner, Robert Wilhelm, Werner Lemberg and Detlef Würkner. */
|
* David Turner, Robert Wilhelm, Werner Lemberg, and Detlef Wuerkner.
|
||||||
/* */
|
*
|
||||||
/* This file is part of the FreeType project, and may only be used, */
|
* This file is part of the FreeType project, and may only be used,
|
||||||
/* modified, and distributed under the terms of the FreeType project */
|
* modified, and distributed under the terms of the FreeType project
|
||||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||||
/* this file you indicate that you have read the license and */
|
* this file you indicate that you have read the license and
|
||||||
/* understand and accept it fully. */
|
* understand and accept it fully.
|
||||||
/* */
|
*
|
||||||
/***************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/**************************************************************************
|
||||||
/* */
|
*
|
||||||
/* This component contains various macros and functions used to ease the */
|
* This component contains various macros and functions used to ease the
|
||||||
/* debugging of the FreeType engine. Its main purpose is in assertion */
|
* debugging of the FreeType engine. Its main purpose is in assertion
|
||||||
/* checking, tracing, and error detection. */
|
* checking, tracing, and error detection.
|
||||||
/* */
|
*
|
||||||
/* There are now three debugging modes: */
|
* There are now three debugging modes:
|
||||||
/* */
|
*
|
||||||
/* - trace mode */
|
* - trace mode
|
||||||
/* */
|
*
|
||||||
/* Error and trace messages are sent to the log file (which can be the */
|
* Error and trace messages are sent to the log file (which can be the
|
||||||
/* standard error output). */
|
* standard error output).
|
||||||
/* */
|
*
|
||||||
/* - error mode */
|
* - error mode
|
||||||
/* */
|
*
|
||||||
/* Only error messages are generated. */
|
* Only error messages are generated.
|
||||||
/* */
|
*
|
||||||
/* - release mode: */
|
* - release mode:
|
||||||
/* */
|
*
|
||||||
/* No error message is sent or generated. The code is free from any */
|
* No error message is sent or generated. The code is free from any
|
||||||
/* debugging parts. */
|
* debugging parts.
|
||||||
/* */
|
*
|
||||||
/*************************************************************************/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Based on the default ftdebug.c,
|
* Based on the default `ftdebug.c' file,
|
||||||
* replaced vprintf() with KVPrintF(),
|
* replaced `vprintf' with `KVPrintF',
|
||||||
* commented out exit(),
|
* commented out `exit',
|
||||||
* replaced getenv() with GetVar().
|
* replaced `getenv' with `GetVar'.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <exec/types.h>
|
#include <exec/types.h>
|
||||||
#include <utility/tagitem.h>
|
#include <utility/tagitem.h>
|
||||||
#include <dos/exall.h>
|
#include <dos/exall.h>
|
||||||
#include <dos/var.h>
|
#include <dos/var.h>
|
||||||
|
|
||||||
#define __NOLIBBASE__
|
#define __NOLIBBASE__
|
||||||
#define __NOLOBALIFACE__
|
#define __NOLOBALIFACE__
|
||||||
#define __USE_INLINE__
|
#define __USE_INLINE__
|
||||||
|
|
||||||
#include <proto/dos.h>
|
#include <proto/dos.h>
|
||||||
#include <clib/debug_protos.h>
|
#include <clib/debug_protos.h>
|
||||||
|
|
||||||
#ifndef __amigaos4__
|
#ifndef __amigaos4__
|
||||||
extern struct Library *DOSBase;
|
extern struct Library* DOSBase;
|
||||||
#else
|
#else
|
||||||
extern struct DOSIFace *IDOS;
|
extern struct DOSIFace* IDOS;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
#include FT_FREETYPE_H
|
#include <freetype/freetype.h>
|
||||||
#include FT_INTERNAL_DEBUG_H
|
#include <freetype/internal/ftdebug.h>
|
||||||
|
|
||||||
|
|
||||||
#if defined( FT_DEBUG_LEVEL_ERROR )
|
#ifdef FT_DEBUG_LEVEL_ERROR
|
||||||
|
|
||||||
/* documentation is in ftdebug.h */
|
/* documentation is in ftdebug.h */
|
||||||
|
|
||||||
|
|
@ -100,7 +102,7 @@
|
||||||
KVPrintF( fmt, ap );
|
KVPrintF( fmt, ap );
|
||||||
va_end( ap );
|
va_end( ap );
|
||||||
|
|
||||||
/* exit( EXIT_FAILURE ); */
|
/* exit( EXIT_FAILURE ); */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -111,9 +113,19 @@
|
||||||
int line,
|
int line,
|
||||||
const char* file )
|
const char* file )
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
|
/* activating the code in this block makes FreeType very chatty */
|
||||||
|
fprintf( stderr,
|
||||||
|
"%s:%d: error 0x%02x: %s\n",
|
||||||
|
file,
|
||||||
|
line,
|
||||||
|
error,
|
||||||
|
FT_Error_String( error ) );
|
||||||
|
#else
|
||||||
FT_UNUSED( error );
|
FT_UNUSED( error );
|
||||||
FT_UNUSED( line );
|
FT_UNUSED( line );
|
||||||
FT_UNUSED( file );
|
FT_UNUSED( file );
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -124,16 +136,23 @@
|
||||||
|
|
||||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||||
|
|
||||||
/* array of trace levels, initialized to 0 */
|
/* array of trace levels, initialized to 0; */
|
||||||
int ft_trace_levels[trace_count];
|
/* this gets adjusted at run-time */
|
||||||
|
static int ft_trace_levels_enabled[trace_count];
|
||||||
|
|
||||||
|
/* array of trace levels, always initialized to 0 */
|
||||||
|
static int ft_trace_levels_disabled[trace_count];
|
||||||
|
|
||||||
|
/* a pointer to either `ft_trace_levels_enabled' */
|
||||||
|
/* or `ft_trace_levels_disabled' */
|
||||||
|
int* ft_trace_levels;
|
||||||
|
|
||||||
/* define array of trace toggle names */
|
/* define array of trace toggle names */
|
||||||
#define FT_TRACE_DEF( x ) #x ,
|
#define FT_TRACE_DEF( x ) #x ,
|
||||||
|
|
||||||
static const char* ft_trace_toggles[trace_count + 1] =
|
static const char* ft_trace_toggles[trace_count + 1] =
|
||||||
{
|
{
|
||||||
#include FT_INTERNAL_TRACE_H
|
#include <freetype/internal/fttrace.h>
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -164,33 +183,51 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/* documentation is in ftdebug.h */
|
||||||
/* */
|
|
||||||
/* Initialize the tracing sub-system. This is done by retrieving the */
|
FT_BASE_DEF( void )
|
||||||
/* value of the `FT2_DEBUG' environment variable. It must be a list of */
|
FT_Trace_Disable( void )
|
||||||
/* toggles, separated by spaces, `;', or `,'. Example: */
|
{
|
||||||
/* */
|
ft_trace_levels = ft_trace_levels_disabled;
|
||||||
/* export FT2_DEBUG="any:3 memory:7 stream:5" */
|
}
|
||||||
/* */
|
|
||||||
/* This requests that all levels be set to 3, except the trace level for */
|
|
||||||
/* the memory and stream components which are set to 7 and 5, */
|
/* documentation is in ftdebug.h */
|
||||||
/* respectively. */
|
|
||||||
/* */
|
FT_BASE_DEF( void )
|
||||||
/* See the file `include/freetype/internal/fttrace.h' for details of the */
|
FT_Trace_Enable( void )
|
||||||
/* available toggle names. */
|
{
|
||||||
/* */
|
ft_trace_levels = ft_trace_levels_enabled;
|
||||||
/* The level must be between 0 and 7; 0 means quiet (except for serious */
|
}
|
||||||
/* runtime errors), and 7 means _very_ verbose. */
|
|
||||||
/* */
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* Initialize the tracing sub-system. This is done by retrieving the
|
||||||
|
* value of the `FT2_DEBUG' environment variable. It must be a list of
|
||||||
|
* toggles, separated by spaces, `;', or `,'. Example:
|
||||||
|
*
|
||||||
|
* export FT2_DEBUG="any:3 memory:7 stream:5"
|
||||||
|
*
|
||||||
|
* This requests that all levels be set to 3, except the trace level for
|
||||||
|
* the memory and stream components which are set to 7 and 5,
|
||||||
|
* respectively.
|
||||||
|
*
|
||||||
|
* See the file `include/freetype/internal/fttrace.h' for details of
|
||||||
|
* the available toggle names.
|
||||||
|
*
|
||||||
|
* The level must be between 0 and 7; 0 means quiet (except for serious
|
||||||
|
* runtime errors), and 7 means _very_ verbose.
|
||||||
|
*/
|
||||||
FT_BASE_DEF( void )
|
FT_BASE_DEF( void )
|
||||||
ft_debug_init( void )
|
ft_debug_init( void )
|
||||||
{
|
{
|
||||||
/* const char* ft2_debug = getenv( "FT2_DEBUG" ); */
|
/* const char* ft2_debug = ft_getenv( "FT2_DEBUG" ); */
|
||||||
char buf[256];
|
char buf[256];
|
||||||
const char* ft2_debug = &buf[0];
|
const char* ft2_debug = &buf[0];
|
||||||
|
|
||||||
|
|
||||||
/* if ( ft2_debug ) */
|
/* if ( ft2_debug ) */
|
||||||
if ( GetVar( "FT2_DEBUG", (STRPTR)ft2_debug, 256, LV_VAR ) > 0 )
|
if ( GetVar( "FT2_DEBUG", (STRPTR)ft2_debug, 256, LV_VAR ) > 0 )
|
||||||
{
|
{
|
||||||
const char* p = ft2_debug;
|
const char* p = ft2_debug;
|
||||||
|
|
@ -250,14 +287,16 @@
|
||||||
{
|
{
|
||||||
/* special case for `any' */
|
/* special case for `any' */
|
||||||
for ( n = 0; n < trace_count; n++ )
|
for ( n = 0; n < trace_count; n++ )
|
||||||
ft_trace_levels[n] = level;
|
ft_trace_levels_enabled[n] = level;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ft_trace_levels[found] = level;
|
ft_trace_levels_enabled[found] = level;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ft_trace_levels = ft_trace_levels_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -287,11 +326,23 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FT_BASE_DEF( void )
|
||||||
|
FT_Trace_Disable( void )
|
||||||
|
{
|
||||||
|
/* nothing */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* documentation is in ftdebug.h */
|
||||||
|
|
||||||
|
FT_BASE_DEF( void )
|
||||||
|
FT_Trace_Enable( void )
|
||||||
|
{
|
||||||
|
/* nothing */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* !FT_DEBUG_LEVEL_TRACE */
|
#endif /* !FT_DEBUG_LEVEL_TRACE */
|
||||||
|
|
||||||
/*
|
|
||||||
Local Variables:
|
|
||||||
coding: latin-1
|
|
||||||
End:
|
|
||||||
*/
|
|
||||||
/* END */
|
/* END */
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
/* */
|
/* */
|
||||||
/* Amiga-specific FreeType low-level system interface (body). */
|
/* Amiga-specific FreeType low-level system interface (body). */
|
||||||
/* */
|
/* */
|
||||||
/* Copyright 1996-2018 by */
|
/* Copyright (C) 1996-2023 by */
|
||||||
/* David Turner, Robert Wilhelm, Werner Lemberg and Detlef Würkner. */
|
/* David Turner, Robert Wilhelm, Werner Lemberg and Detlef Würkner. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of the FreeType project, and may only be used, */
|
/* This file is part of the FreeType project, and may only be used, */
|
||||||
|
|
@ -96,10 +96,10 @@ Free_VecPooled( APTR poolHeader,
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
#include FT_CONFIG_CONFIG_H
|
#include FT_CONFIG_CONFIG_H
|
||||||
#include FT_INTERNAL_DEBUG_H
|
#include <freetype/internal/ftdebug.h>
|
||||||
#include FT_SYSTEM_H
|
#include <freetype/ftsystem.h>
|
||||||
#include FT_ERRORS_H
|
#include <freetype/fterrors.h>
|
||||||
#include FT_TYPES_H
|
#include <freetype/fttypes.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
@ -235,7 +235,7 @@ Free_VecPooled( APTR poolHeader,
|
||||||
/* messages during execution. */
|
/* messages during execution. */
|
||||||
/* */
|
/* */
|
||||||
#undef FT_COMPONENT
|
#undef FT_COMPONENT
|
||||||
#define FT_COMPONENT trace_io
|
#define FT_COMPONENT io
|
||||||
|
|
||||||
/* We use the macro STREAM_FILE for convenience to extract the */
|
/* We use the macro STREAM_FILE for convenience to extract the */
|
||||||
/* system-specific stream handle from a given FreeType stream object */
|
/* system-specific stream handle from a given FreeType stream object */
|
||||||
|
|
@ -264,7 +264,7 @@ Free_VecPooled( APTR poolHeader,
|
||||||
|
|
||||||
stream->descriptor.pointer = NULL;
|
stream->descriptor.pointer = NULL;
|
||||||
stream->size = 0;
|
stream->size = 0;
|
||||||
stream->base = 0;
|
stream->base = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -13,12 +13,15 @@
|
||||||
# fully.
|
# fully.
|
||||||
|
|
||||||
|
|
||||||
DELETE := rm -f
|
DELETE := rm -f
|
||||||
CAT := cat
|
CAT := cat
|
||||||
SEP := /
|
SEP := /
|
||||||
BUILD_DIR := $(TOP_DIR)/builds/ansi
|
PLATFORM_DIR := $(TOP_DIR)/builds/ansi
|
||||||
PLATFORM := ansi
|
PLATFORM := ansi
|
||||||
|
|
||||||
|
# This is used for `make refdoc' and `make refdoc-venv'
|
||||||
|
#
|
||||||
|
BIN := bin
|
||||||
|
|
||||||
# The directory where all library files are placed.
|
# The directory where all library files are placed.
|
||||||
#
|
#
|
||||||
|
|
@ -61,14 +64,14 @@ T := -o$(space)
|
||||||
#
|
#
|
||||||
# These should concern: debug output, optimization & warnings.
|
# These should concern: debug output, optimization & warnings.
|
||||||
#
|
#
|
||||||
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
|
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
|
||||||
# ANSI compliance.
|
# ANSI compliance.
|
||||||
#
|
#
|
||||||
CFLAGS ?= -c
|
CFLAGS ?= -c
|
||||||
|
|
||||||
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
||||||
#
|
#
|
||||||
ANSIFLAGS :=
|
ANSIFLAGS ?=
|
||||||
|
|
||||||
|
|
||||||
# EOF
|
# EOF
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ To compile FreeType 2 as a library the following changes must be applied:
|
||||||
|
|
||||||
INCLUDE;E:\freetype2\include
|
INCLUDE;E:\freetype2\include
|
||||||
|
|
||||||
- The file `freetype2/include/Ft2build.h' must be patched as follows to
|
- The file `freetype/include/Ft2build.h' must be patched as follows to
|
||||||
include ATARI.H:
|
include ATARI.H:
|
||||||
|
|
||||||
#ifndef FT2_BUILD_GENERIC_H_
|
#ifndef FT2_BUILD_GENERIC_H_
|
||||||
|
|
@ -40,7 +40,7 @@ ge
|
||||||
|
|
||||||
INCLUDE;E:\freetype2\include
|
INCLUDE;E:\freetype2\include
|
||||||
|
|
||||||
- In der Datei freetype2/include/Ft2build.h muss zu Beginn
|
- In der Datei freetype/include/Ft2build.h muss zu Beginn
|
||||||
ein #include "ATARI.H" wie folgt eingef<65>gt werden:
|
ein #include "ATARI.H" wie folgt eingef<65>gt werden:
|
||||||
|
|
||||||
#ifndef FT2_BUILD_GENERIC_H_
|
#ifndef FT2_BUILD_GENERIC_H_
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -15,12 +15,15 @@
|
||||||
# fully.
|
# fully.
|
||||||
|
|
||||||
|
|
||||||
DELETE := rm -f
|
DELETE := rm -f
|
||||||
CAT := cat
|
CAT := cat
|
||||||
SEP := /
|
SEP := /
|
||||||
BUILD_DIR := $(TOP_DIR)/builds/beos
|
PLATFORM_DIR := $(TOP_DIR)/builds/beos
|
||||||
PLATFORM := beos
|
PLATFORM := beos
|
||||||
|
|
||||||
|
# This is used for `make refdoc' and `make refdoc-venv'
|
||||||
|
#
|
||||||
|
BIN := bin
|
||||||
|
|
||||||
# The directory where all library files are placed.
|
# The directory where all library files are placed.
|
||||||
#
|
#
|
||||||
|
|
@ -63,14 +66,14 @@ T := -o$(space)
|
||||||
#
|
#
|
||||||
# These should concern: debug output, optimization & warnings.
|
# These should concern: debug output, optimization & warnings.
|
||||||
#
|
#
|
||||||
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
|
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
|
||||||
# ANSI compliance.
|
# ANSI compliance.
|
||||||
#
|
#
|
||||||
CFLAGS ?= -c
|
CFLAGS ?= -c
|
||||||
|
|
||||||
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
||||||
#
|
#
|
||||||
ANSIFLAGS :=
|
ANSIFLAGS ?=
|
||||||
|
|
||||||
|
|
||||||
# EOF
|
# EOF
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# FreeType 2 configuration rules for a BeOS system
|
# FreeType 2 configuration rules for a BeOS system
|
||||||
#
|
#
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -27,11 +27,11 @@ endif
|
||||||
|
|
||||||
ifeq ($(PLATFORM),beos)
|
ifeq ($(PLATFORM),beos)
|
||||||
|
|
||||||
DELETE := rm -f
|
DELETE := rm -f
|
||||||
CAT := cat
|
CAT := cat
|
||||||
SEP := /
|
SEP := /
|
||||||
BUILD_DIR := $(TOP_DIR)/builds/beos
|
PLATFORM_DIR := $(TOP_DIR)/builds/beos
|
||||||
CONFIG_FILE := beos.mk
|
CONFIG_FILE := beos.mk
|
||||||
|
|
||||||
setup: std_setup
|
setup: std_setup
|
||||||
|
|
||||||
|
|
|
||||||
52
modules/freetype2/builds/cmake/FindBrotliDec.cmake
Normal file
52
modules/freetype2/builds/cmake/FindBrotliDec.cmake
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
# FindBrotliDec.cmake
|
||||||
|
#
|
||||||
|
# Copyright (C) 2019-2023 by
|
||||||
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
|
#
|
||||||
|
# Written by Werner Lemberg <wl@gnu.org>
|
||||||
|
#
|
||||||
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
# and distributed under the terms of the FreeType project license,
|
||||||
|
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
|
||||||
|
# indicate that you have read the license and understand and accept it
|
||||||
|
# fully.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Try to find libbrotlidec include and library directories.
|
||||||
|
#
|
||||||
|
# If found, the following variables are set.
|
||||||
|
#
|
||||||
|
# BROTLIDEC_INCLUDE_DIRS
|
||||||
|
# BROTLIDEC_LIBRARIES
|
||||||
|
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
|
||||||
|
pkg_check_modules(PC_BROTLIDEC QUIET libbrotlidec)
|
||||||
|
|
||||||
|
if (PC_BROTLIDEC_VERSION)
|
||||||
|
set(BROTLIDEC_VERSION "${PC_BROTLIDEC_VERSION}")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
find_path(BROTLIDEC_INCLUDE_DIRS
|
||||||
|
NAMES brotli/decode.h
|
||||||
|
HINTS ${PC_BROTLIDEC_INCLUDEDIR}
|
||||||
|
${PC_BROTLIDEC_INCLUDE_DIRS}
|
||||||
|
PATH_SUFFIXES brotli)
|
||||||
|
|
||||||
|
find_library(BROTLIDEC_LIBRARIES
|
||||||
|
NAMES brotlidec
|
||||||
|
HINTS ${PC_BROTLIDEC_LIBDIR}
|
||||||
|
${PC_BROTLIDEC_LIBRARY_DIRS})
|
||||||
|
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(
|
||||||
|
BrotliDec
|
||||||
|
REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES
|
||||||
|
FOUND_VAR BROTLIDEC_FOUND
|
||||||
|
VERSION_VAR BROTLIDEC_VERSION)
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
BROTLIDEC_INCLUDE_DIRS
|
||||||
|
BROTLIDEC_LIBRARIES)
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
# Copyright (c) 2012, Intel Corporation
|
# Copyright (c) 2012, Intel Corporation
|
||||||
|
# Copyright (c) 2019 Sony Interactive Entertainment Inc.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
# modification, are permitted provided that the following conditions are met:
|
# modification, are permitted provided that the following conditions are met:
|
||||||
|
|
@ -27,55 +28,176 @@
|
||||||
# Try to find Harfbuzz include and library directories.
|
# Try to find Harfbuzz include and library directories.
|
||||||
#
|
#
|
||||||
# After successful discovery, this will set for inclusion where needed:
|
# After successful discovery, this will set for inclusion where needed:
|
||||||
# HARFBUZZ_INCLUDE_DIRS - containg the HarfBuzz headers
|
# HarfBuzz_INCLUDE_DIRS - containg the HarfBuzz headers
|
||||||
# HARFBUZZ_LIBRARIES - containg the HarfBuzz library
|
# HarfBuzz_LIBRARIES - containg the HarfBuzz library
|
||||||
|
|
||||||
include(FindPkgConfig)
|
#[=======================================================================[.rst:
|
||||||
|
FindHarfBuzz
|
||||||
|
--------------
|
||||||
|
|
||||||
|
Find HarfBuzz headers and libraries.
|
||||||
|
|
||||||
|
Imported Targets
|
||||||
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
``HarfBuzz::HarfBuzz``
|
||||||
|
The HarfBuzz library, if found.
|
||||||
|
|
||||||
|
``HarfBuzz::ICU``
|
||||||
|
The HarfBuzz ICU library, if found.
|
||||||
|
|
||||||
|
Result Variables
|
||||||
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
This will define the following variables in your project:
|
||||||
|
|
||||||
|
``HarfBuzz_FOUND``
|
||||||
|
true if (the requested version of) HarfBuzz is available.
|
||||||
|
``HarfBuzz_VERSION``
|
||||||
|
the version of HarfBuzz.
|
||||||
|
``HarfBuzz_LIBRARIES``
|
||||||
|
the libraries to link against to use HarfBuzz.
|
||||||
|
``HarfBuzz_INCLUDE_DIRS``
|
||||||
|
where to find the HarfBuzz headers.
|
||||||
|
``HarfBuzz_COMPILE_OPTIONS``
|
||||||
|
this should be passed to target_compile_options(), if the
|
||||||
|
target is not used for linking
|
||||||
|
|
||||||
|
#]=======================================================================]
|
||||||
|
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
pkg_check_modules(PC_HARFBUZZ QUIET harfbuzz)
|
pkg_check_modules(PC_HARFBUZZ QUIET harfbuzz)
|
||||||
|
set(HarfBuzz_COMPILE_OPTIONS ${PC_HARFBUZZ_CFLAGS_OTHER})
|
||||||
|
set(HarfBuzz_VERSION ${PC_HARFBUZZ_CFLAGS_VERSION})
|
||||||
|
|
||||||
find_path(HARFBUZZ_INCLUDE_DIRS
|
find_path(HarfBuzz_INCLUDE_DIR
|
||||||
NAMES hb.h
|
NAMES hb.h
|
||||||
HINTS ${PC_HARFBUZZ_INCLUDEDIR}
|
HINTS ${PC_HARFBUZZ_INCLUDEDIR} ${PC_HARFBUZZ_INCLUDE_DIRS}
|
||||||
${PC_HARFBUZZ_INCLUDE_DIRS}
|
|
||||||
PATH_SUFFIXES harfbuzz
|
PATH_SUFFIXES harfbuzz
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(HARFBUZZ_LIBRARIES NAMES harfbuzz
|
find_library(HarfBuzz_LIBRARY
|
||||||
HINTS ${PC_HARFBUZZ_LIBDIR}
|
NAMES ${HarfBuzz_NAMES} harfbuzz
|
||||||
${PC_HARFBUZZ_LIBRARY_DIRS}
|
HINTS ${PC_HARFBUZZ_LIBDIR} ${PC_HARFBUZZ_LIBRARY_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (HARFBUZZ_INCLUDE_DIRS)
|
if (HarfBuzz_INCLUDE_DIR AND NOT HarfBuzz_VERSION)
|
||||||
if (EXISTS "${HARFBUZZ_INCLUDE_DIRS}/hb-version.h")
|
if (EXISTS "${HarfBuzz_INCLUDE_DIR}/hb-version.h")
|
||||||
file(READ "${HARFBUZZ_INCLUDE_DIRS}/hb-version.h" _harfbuzz_version_content)
|
file(READ "${HarfBuzz_INCLUDE_DIR}/hb-version.h" _harfbuzz_version_content)
|
||||||
|
|
||||||
string(REGEX MATCH "#define +HB_VERSION_STRING +\"([0-9]+\\.[0-9]+\\.[0-9]+)\"" _dummy "${_harfbuzz_version_content}")
|
string(REGEX MATCH "#define +HB_VERSION_STRING +\"([0-9]+\\.[0-9]+\\.[0-9]+)\"" _dummy "${_harfbuzz_version_content}")
|
||||||
set(HARFBUZZ_VERSION "${CMAKE_MATCH_1}")
|
set(HarfBuzz_VERSION "${CMAKE_MATCH_1}")
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if ("${harfbuzz_FIND_VERSION}" VERSION_GREATER "${HARFBUZZ_VERSION}")
|
if ("${HarfBuzz_FIND_VERSION}" VERSION_GREATER "${HarfBuzz_VERSION}")
|
||||||
message(FATAL_ERROR "Required version (" ${harfbuzz_FIND_VERSION} ") is higher than found version (" ${HARFBUZZ_VERSION} ")")
|
if (HarfBuzz_FIND_REQUIRED)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"Required version (" ${HarfBuzz_FIND_VERSION} ")"
|
||||||
|
" is higher than found version (" ${HarfBuzz_VERSION} ")")
|
||||||
|
else ()
|
||||||
|
message(WARNING
|
||||||
|
"Required version (" ${HarfBuzz_FIND_VERSION} ")"
|
||||||
|
" is higher than found version (" ${HarfBuzz_VERSION} ")")
|
||||||
|
unset(HarfBuzz_VERSION)
|
||||||
|
unset(HarfBuzz_INCLUDE_DIRS)
|
||||||
|
unset(HarfBuzz_LIBRARIES)
|
||||||
|
return ()
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# Find components
|
||||||
|
if (HarfBuzz_INCLUDE_DIR AND HarfBuzz_LIBRARY)
|
||||||
|
set(_HarfBuzz_REQUIRED_LIBS_FOUND ON)
|
||||||
|
set(HarfBuzz_LIBS_FOUND "HarfBuzz (required): ${HarfBuzz_LIBRARY}")
|
||||||
|
else ()
|
||||||
|
set(_HarfBuzz_REQUIRED_LIBS_FOUND OFF)
|
||||||
|
set(HarfBuzz_LIBS_NOT_FOUND "HarfBuzz (required)")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (NOT CMAKE_VERSION VERSION_LESS 3.3)
|
||||||
|
if ("ICU" IN_LIST HarfBuzz_FIND_COMPONENTS)
|
||||||
|
pkg_check_modules(PC_HARFBUZZ_ICU QUIET harfbuzz-icu)
|
||||||
|
set(HarfBuzz_ICU_COMPILE_OPTIONS ${PC_HARFBUZZ_ICU_CFLAGS_OTHER})
|
||||||
|
|
||||||
|
find_path(HarfBuzz_ICU_INCLUDE_DIR
|
||||||
|
NAMES hb-icu.h
|
||||||
|
HINTS ${PC_HARFBUZZ_ICU_INCLUDEDIR} ${PC_HARFBUZZ_ICU_INCLUDE_DIRS}
|
||||||
|
PATH_SUFFIXES harfbuzz
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(HarfBuzz_ICU_LIBRARY
|
||||||
|
NAMES ${HarfBuzz_ICU_NAMES} harfbuzz-icu
|
||||||
|
HINTS ${PC_HARFBUZZ_ICU_LIBDIR} ${PC_HARFBUZZ_ICU_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
if (HarfBuzz_ICU_LIBRARY)
|
||||||
|
if (HarfBuzz_FIND_REQUIRED_ICU)
|
||||||
|
list(APPEND HarfBuzz_LIBS_FOUND "ICU (required): ${HarfBuzz_ICU_LIBRARY}")
|
||||||
|
else ()
|
||||||
|
list(APPEND HarfBuzz_LIBS_FOUND "ICU (optional): ${HarfBuzz_ICU_LIBRARY}")
|
||||||
|
endif ()
|
||||||
|
else ()
|
||||||
|
if (HarfBuzz_FIND_REQUIRED_ICU)
|
||||||
|
set(_HarfBuzz_REQUIRED_LIBS_FOUND OFF)
|
||||||
|
list(APPEND HarfBuzz_LIBS_NOT_FOUND "ICU (required)")
|
||||||
|
else ()
|
||||||
|
list(APPEND HarfBuzz_LIBS_NOT_FOUND "ICU (optional)")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (NOT HarfBuzz_FIND_QUIETLY)
|
||||||
|
if (HarfBuzz_LIBS_FOUND)
|
||||||
|
message(STATUS "Found the following HarfBuzz libraries:")
|
||||||
|
foreach (found ${HarfBuzz_LIBS_FOUND})
|
||||||
|
message(STATUS " ${found}")
|
||||||
|
endforeach ()
|
||||||
|
endif ()
|
||||||
|
if (HarfBuzz_LIBS_NOT_FOUND)
|
||||||
|
message(STATUS "The following HarfBuzz libraries were not found:")
|
||||||
|
foreach (found ${HarfBuzz_LIBS_NOT_FOUND})
|
||||||
|
message(STATUS " ${found}")
|
||||||
|
endforeach ()
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
|
find_package_handle_standard_args(HarfBuzz
|
||||||
harfbuzz
|
FOUND_VAR HarfBuzz_FOUND
|
||||||
REQUIRED_VARS HARFBUZZ_INCLUDE_DIRS HARFBUZZ_LIBRARIES
|
REQUIRED_VARS HarfBuzz_INCLUDE_DIR HarfBuzz_LIBRARY _HarfBuzz_REQUIRED_LIBS_FOUND
|
||||||
VERSION_VAR HARFBUZZ_VERSION)
|
VERSION_VAR HarfBuzz_VERSION
|
||||||
|
|
||||||
mark_as_advanced(
|
|
||||||
HARFBUZZ_INCLUDE_DIRS
|
|
||||||
HARFBUZZ_LIBRARIES
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Allows easy linking as in
|
|
||||||
# target_link_libraries(freetype PRIVATE Harfbuzz::Harfbuzz)
|
|
||||||
if (NOT CMAKE_VERSION VERSION_LESS 3.1)
|
if (NOT CMAKE_VERSION VERSION_LESS 3.1)
|
||||||
if (HARFBUZZ_FOUND AND NOT TARGET Harfbuzz::Harfbuzz)
|
if (HarfBuzz_LIBRARY AND NOT TARGET HarfBuzz::HarfBuzz)
|
||||||
add_library(Harfbuzz::Harfbuzz INTERFACE IMPORTED)
|
add_library(HarfBuzz::HarfBuzz UNKNOWN IMPORTED GLOBAL)
|
||||||
set_target_properties(
|
set_target_properties(HarfBuzz::HarfBuzz PROPERTIES
|
||||||
Harfbuzz::Harfbuzz PROPERTIES
|
IMPORTED_LOCATION "${HarfBuzz_LIBRARY}"
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${HARFBUZZ_INCLUDE_DIRS}")
|
INTERFACE_COMPILE_OPTIONS "${HarfBuzz_COMPILE_OPTIONS}"
|
||||||
endif ()
|
INTERFACE_INCLUDE_DIRECTORIES "${HarfBuzz_INCLUDE_DIR}"
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (HarfBuzz_ICU_LIBRARY AND NOT TARGET HarfBuzz::ICU)
|
||||||
|
add_library(HarfBuzz::ICU UNKNOWN IMPORTED GLOBAL)
|
||||||
|
set_target_properties(HarfBuzz::ICU PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${HarfBuzz_ICU_LIBRARY}"
|
||||||
|
INTERFACE_COMPILE_OPTIONS "${HarfBuzz_ICU_COMPILE_OPTIONS}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${HarfBuzz_ICU_INCLUDE_DIR}"
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
HarfBuzz_INCLUDE_DIR
|
||||||
|
HarfBuzz_ICU_INCLUDE_DIR
|
||||||
|
HarfBuzz_LIBRARY
|
||||||
|
HarfBuzz_ICU_LIBRARY
|
||||||
|
)
|
||||||
|
|
||||||
|
if (HarfBuzz_FOUND)
|
||||||
|
set(HarfBuzz_LIBRARIES ${HarfBuzz_LIBRARY} ${HarfBuzz_ICU_LIBRARY})
|
||||||
|
set(HarfBuzz_INCLUDE_DIRS ${HarfBuzz_INCLUDE_DIR} ${HarfBuzz_ICU_INCLUDE_DIR})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# iOS.cmake
|
# iOS.cmake
|
||||||
#
|
#
|
||||||
# Copyright 2014-2018 by
|
# Copyright (C) 2014-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# Written by David Wimsey <david@wimsey.us>
|
# Written by David Wimsey <david@wimsey.us>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
# Copyright 2015-2018 by
|
# Copyright (C) 2015-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -93,7 +93,7 @@ cat >$tmpdir/main.c << END
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
#include FT_FREETYPE_H
|
#include <freetype/freetype.h>
|
||||||
|
|
||||||
|
|
||||||
FT_Library library;
|
FT_Library library;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -59,7 +59,7 @@ T := -o$(space)
|
||||||
#
|
#
|
||||||
# These should concern: debug output, optimization & warnings.
|
# These should concern: debug output, optimization & warnings.
|
||||||
#
|
#
|
||||||
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
|
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
|
||||||
# ANSI compliance.
|
# ANSI compliance.
|
||||||
#
|
#
|
||||||
CFLAGS ?= -c
|
CFLAGS ?= -c
|
||||||
|
|
@ -68,7 +68,7 @@ CFLAGS ?= -c
|
||||||
#
|
#
|
||||||
# we assume the compiler is already strictly ANSI
|
# we assume the compiler is already strictly ANSI
|
||||||
#
|
#
|
||||||
ANSIFLAGS :=
|
ANSIFLAGS ?=
|
||||||
|
|
||||||
|
|
||||||
# Library linking
|
# Library linking
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -60,14 +60,14 @@ TE := -e
|
||||||
#
|
#
|
||||||
# These should concern: debug output, optimization & warnings.
|
# These should concern: debug output, optimization & warnings.
|
||||||
#
|
#
|
||||||
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
|
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
|
||||||
# ANSI compliance.
|
# ANSI compliance.
|
||||||
#
|
#
|
||||||
CFLAGS ?= -q -c -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
|
CFLAGS ?= -q -c -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
|
||||||
|
|
||||||
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
||||||
#
|
#
|
||||||
ANSIFLAGS := -A
|
ANSIFLAGS ?= -A
|
||||||
|
|
||||||
|
|
||||||
# Library linking
|
# Library linking
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -60,14 +60,14 @@ TE := -e
|
||||||
#
|
#
|
||||||
# These should concern: debug output, optimization & warnings.
|
# These should concern: debug output, optimization & warnings.
|
||||||
#
|
#
|
||||||
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
|
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
|
||||||
# ANSI compliance.
|
# ANSI compliance.
|
||||||
#
|
#
|
||||||
CFLAGS ?= -c -q -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
|
CFLAGS ?= -c -q -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
|
||||||
|
|
||||||
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
||||||
#
|
#
|
||||||
ANSIFLAGS := -A
|
ANSIFLAGS ?= -A
|
||||||
|
|
||||||
|
|
||||||
# Library linking
|
# Library linking
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 2003-2018 by
|
# Copyright (C) 2003-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -58,14 +58,14 @@ T := -o$(space)
|
||||||
#
|
#
|
||||||
# These should concern: debug output, optimization & warnings.
|
# These should concern: debug output, optimization & warnings.
|
||||||
#
|
#
|
||||||
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
|
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
|
||||||
# ANSI compliance.
|
# ANSI compliance.
|
||||||
#
|
#
|
||||||
CFLAGS ?= -c -g -O6 -Wall
|
CFLAGS ?= -c -g -O6 -Wall
|
||||||
|
|
||||||
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
||||||
#
|
#
|
||||||
ANSIFLAGS :=
|
ANSIFLAGS ?=
|
||||||
|
|
||||||
|
|
||||||
# Library linking
|
# Library linking
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -59,7 +59,7 @@ T := -o$(space)
|
||||||
#
|
#
|
||||||
# These should concern: debug output, optimization & warnings.
|
# These should concern: debug output, optimization & warnings.
|
||||||
#
|
#
|
||||||
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
|
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
|
||||||
# ANSI compliance.
|
# ANSI compliance.
|
||||||
#
|
#
|
||||||
ifndef CFLAGS
|
ifndef CFLAGS
|
||||||
|
|
@ -82,8 +82,9 @@ ifndef CFLAGS
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
||||||
|
# You can override this on the command line.
|
||||||
#
|
#
|
||||||
ANSIFLAGS := -ansi -pedantic
|
ANSIFLAGS ?= -std=c99 -pedantic
|
||||||
|
|
||||||
|
|
||||||
# Library linking
|
# Library linking
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -58,14 +58,14 @@ T := -o$(space)
|
||||||
#
|
#
|
||||||
# These should concern: debug output, optimization & warnings.
|
# These should concern: debug output, optimization & warnings.
|
||||||
#
|
#
|
||||||
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
|
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
|
||||||
# ANSI compliance.
|
# ANSI compliance.
|
||||||
#
|
#
|
||||||
CFLAGS ?= -c -g -O3 -Wall
|
CFLAGS ?= -c -g -O3 -Wall
|
||||||
|
|
||||||
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
||||||
#
|
#
|
||||||
ANSIFLAGS := -ansi -pedantic
|
ANSIFLAGS ?= -std=c99 -pedantic
|
||||||
|
|
||||||
|
|
||||||
# Library linking
|
# Library linking
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -61,7 +61,7 @@ TE := /Fe
|
||||||
#
|
#
|
||||||
# These should concern: debug output, optimization & warnings.
|
# These should concern: debug output, optimization & warnings.
|
||||||
#
|
#
|
||||||
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
|
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
|
||||||
# ANSI compliance.
|
# ANSI compliance.
|
||||||
#
|
#
|
||||||
# Note that the Intel C/C++ compiler version 4.5 complains about
|
# Note that the Intel C/C++ compiler version 4.5 complains about
|
||||||
|
|
@ -74,7 +74,7 @@ CFLAGS ?= /nologo /c /Ox /G5 /W3 /Qwd32
|
||||||
|
|
||||||
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
||||||
#
|
#
|
||||||
ANSIFLAGS := /Qansi_alias /Za
|
ANSIFLAGS ?= /Qansi_alias /Za
|
||||||
|
|
||||||
# Library linking
|
# Library linking
|
||||||
#
|
#
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -60,7 +60,7 @@ T := -o$(space)
|
||||||
#
|
#
|
||||||
# These should concern: debug output, optimization & warnings.
|
# These should concern: debug output, optimization & warnings.
|
||||||
#
|
#
|
||||||
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
|
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
|
||||||
# ANSI compliance.
|
# ANSI compliance.
|
||||||
#
|
#
|
||||||
CFLAGS ?= -c -g
|
CFLAGS ?= -c -g
|
||||||
|
|
@ -71,7 +71,7 @@ CFLAGS ?= -c -g
|
||||||
#
|
#
|
||||||
# the "-A" flag simply increments verbosity about non ANSI code
|
# the "-A" flag simply increments verbosity about non ANSI code
|
||||||
#
|
#
|
||||||
ANSIFLAGS := -A
|
ANSIFLAGS ?= -A
|
||||||
|
|
||||||
|
|
||||||
# library linking
|
# library linking
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -63,14 +63,14 @@ TE := /Fe
|
||||||
#
|
#
|
||||||
# These should concern: debug output, optimization & warnings.
|
# These should concern: debug output, optimization & warnings.
|
||||||
#
|
#
|
||||||
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
|
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
|
||||||
# ANSI compliance.
|
# ANSI compliance.
|
||||||
#
|
#
|
||||||
CFLAGS ?= /nologo /c /Ox /W3 /WX
|
CFLAGS ?= /nologo /c /Ox /W3 /WX
|
||||||
|
|
||||||
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
||||||
#
|
#
|
||||||
ANSIFLAGS := /Za /D_CRT_SECURE_NO_DEPRECATE
|
ANSIFLAGS ?= /Za /D_CRT_SECURE_NO_DEPRECATE
|
||||||
|
|
||||||
|
|
||||||
# Library linking
|
# Library linking
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -60,14 +60,14 @@ T := -FO=
|
||||||
#
|
#
|
||||||
# These should concern: debug output, optimization & warnings.
|
# These should concern: debug output, optimization & warnings.
|
||||||
#
|
#
|
||||||
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
|
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
|
||||||
# ANSI compliance.
|
# ANSI compliance.
|
||||||
#
|
#
|
||||||
CFLAGS ?= -zq
|
CFLAGS ?= -zq
|
||||||
|
|
||||||
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
||||||
#
|
#
|
||||||
ANSIFLAGS := -za
|
ANSIFLAGS ?= -za
|
||||||
|
|
||||||
|
|
||||||
# Library linking
|
# Library linking
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -60,7 +60,7 @@ T := -Fo
|
||||||
#
|
#
|
||||||
# These should concern: debug output, optimization & warnings.
|
# These should concern: debug output, optimization & warnings.
|
||||||
#
|
#
|
||||||
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
|
# Use the ANSIFLAGS variable to define the compiler flags used to enforce
|
||||||
# ANSI compliance.
|
# ANSI compliance.
|
||||||
#
|
#
|
||||||
CFLAGS ?= -c -g2 -O
|
CFLAGS ?= -c -g2 -O
|
||||||
|
|
@ -69,7 +69,7 @@ CFLAGS ?= -c -g2 -O
|
||||||
#
|
#
|
||||||
# LCC is pure ANSI anyway!
|
# LCC is pure ANSI anyway!
|
||||||
#
|
#
|
||||||
ANSIFLAGS :=
|
ANSIFLAGS ?=
|
||||||
|
|
||||||
|
|
||||||
# library linking
|
# library linking
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
# This sub-Makefile is in charge of detecting the current platform. It sets
|
# This sub-Makefile is in charge of detecting the current platform. It sets
|
||||||
# the following variables:
|
# the following variables:
|
||||||
#
|
#
|
||||||
# BUILD_DIR The configuration and system-specific directory. Usually
|
# PLATFORM_DIR The configuration and system-specific directory. Usually
|
||||||
# `builds/$(PLATFORM)' but can be different for custom builds
|
# `builds/$(PLATFORM)' but can be different for custom builds
|
||||||
# of the library.
|
# of the library.
|
||||||
#
|
#
|
||||||
|
|
@ -49,8 +49,8 @@ SEP := /
|
||||||
BUILD_CONFIG := $(TOP_DIR)/builds
|
BUILD_CONFIG := $(TOP_DIR)/builds
|
||||||
|
|
||||||
# These two assignments must be delayed.
|
# These two assignments must be delayed.
|
||||||
BUILD_DIR = $(BUILD_CONFIG)/$(PLATFORM)
|
PLATFORM_DIR = $(BUILD_CONFIG)/$(PLATFORM)
|
||||||
CONFIG_RULES = $(BUILD_DIR)/$(CONFIG_FILE)
|
CONFIG_RULES = $(PLATFORM_DIR)/$(CONFIG_FILE)
|
||||||
|
|
||||||
# We define the BACKSLASH variable to hold a single back-slash character.
|
# We define the BACKSLASH variable to hold a single back-slash character.
|
||||||
# This is needed because a line like
|
# This is needed because a line like
|
||||||
|
|
@ -113,14 +113,14 @@ std_setup:
|
||||||
$(info )
|
$(info )
|
||||||
$(info $(empty) platform $(PLATFORM))
|
$(info $(empty) platform $(PLATFORM))
|
||||||
$(info $(empty) compiler $(CC))
|
$(info $(empty) compiler $(CC))
|
||||||
$(info $(empty) configuration directory $(subst /,$(SEP),$(BUILD_DIR)))
|
$(info $(empty) configuration directory $(subst /,$(SEP),$(PLATFORM_DIR)))
|
||||||
$(info $(empty) configuration rules $(subst /,$(SEP),$(CONFIG_RULES)))
|
$(info $(empty) configuration rules $(subst /,$(SEP),$(CONFIG_RULES)))
|
||||||
$(info )
|
$(info )
|
||||||
$(info If this does not correspond to your system or settings please remove the file)
|
$(info If this does not correspond to your system or settings please remove the file)
|
||||||
$(info `$(CONFIG_MK)' from this directory then read the INSTALL file for help.)
|
$(info `$(CONFIG_MK)' from this directory then read the INSTALL file for help.)
|
||||||
$(info )
|
$(info )
|
||||||
$(info Otherwise, simply type `$(MAKE)' again to build the library,)
|
$(info Otherwise, simply type `$(MAKE)' again to build the library,)
|
||||||
$(info or `$(MAKE) refdoc' to build the API reference (this needs python >= 2.6).)
|
$(info or `$(MAKE) refdoc' to build the API reference (this needs Python >= 3.5).)
|
||||||
$(info )
|
$(info )
|
||||||
@$(COPY) $(subst /,$(SEP),$(CONFIG_RULES) $(CONFIG_MK))
|
@$(COPY) $(subst /,$(SEP),$(CONFIG_RULES) $(CONFIG_MK))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -80,36 +80,46 @@ ifeq ($(PLATFORM),dos)
|
||||||
ifneq ($(findstring emx,$(MAKECMDGOALS)),) # EMX gcc
|
ifneq ($(findstring emx,$(MAKECMDGOALS)),) # EMX gcc
|
||||||
CONFIG_FILE := dos-emx.mk
|
CONFIG_FILE := dos-emx.mk
|
||||||
CC := gcc
|
CC := gcc
|
||||||
emx: setup
|
|
||||||
.PHONY: emx
|
.PHONY: emx
|
||||||
|
emx: setup
|
||||||
|
@cd .
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(findstring turboc,$(MAKECMDGOALS)),) # Turbo C
|
ifneq ($(findstring turboc,$(MAKECMDGOALS)),) # Turbo C
|
||||||
CONFIG_FILE := dos-tcc.mk
|
CONFIG_FILE := dos-tcc.mk
|
||||||
CC := tcc
|
CC := tcc
|
||||||
turboc: setup
|
|
||||||
.PHONY: turboc
|
.PHONY: turboc
|
||||||
|
turboc: setup
|
||||||
|
@cd .
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++
|
ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++
|
||||||
CONFIG_FILE := dos-wat.mk
|
CONFIG_FILE := dos-wat.mk
|
||||||
CC := wcc386
|
CC := wcc386
|
||||||
watcom: setup
|
|
||||||
.PHONY: watcom
|
.PHONY: watcom
|
||||||
|
watcom: setup
|
||||||
|
@cd .
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(findstring borlandc,$(MAKECMDGOALS)),) # Borland C/C++ 32-bit
|
ifneq ($(findstring borlandc,$(MAKECMDGOALS)),) # Borland C/C++ 32-bit
|
||||||
CONFIG_FILE := dos-bcc.mk
|
CONFIG_FILE := dos-bcc.mk
|
||||||
CC := bcc32
|
CC := bcc32
|
||||||
borlandc: setup
|
|
||||||
.PHONY: borlandc
|
.PHONY: borlandc
|
||||||
|
borlandc: setup
|
||||||
|
@cd .
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(findstring borlandc16,$(MAKECMDGOALS)),) # Borland C/C++ 16-bit
|
ifneq ($(findstring borlandc16,$(MAKECMDGOALS)),) # Borland C/C++ 16-bit
|
||||||
CONFIG_FILE := dos-bcc.mk
|
CONFIG_FILE := dos-bcc.mk
|
||||||
CC := bcc
|
CC := bcc
|
||||||
borlandc16: setup
|
|
||||||
.PHONY: borlandc16
|
.PHONY: borlandc16
|
||||||
|
borlandc16: setup
|
||||||
|
@cd .
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(findstring bash,$(SHELL)),) # check for bash
|
ifneq ($(findstring bash,$(SHELL)),) # check for bash
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -13,12 +13,15 @@
|
||||||
# fully.
|
# fully.
|
||||||
|
|
||||||
|
|
||||||
DELETE := del
|
DELETE := del
|
||||||
CAT := type
|
CAT := type
|
||||||
SEP := $(strip \ )
|
SEP := $(strip \ )
|
||||||
BUILD_DIR := $(TOP_DIR)/builds/dos
|
PLATFORM_DIR := $(TOP_DIR)/builds/dos
|
||||||
PLATFORM := dos
|
PLATFORM := dos
|
||||||
|
|
||||||
|
# This is used for `make refdoc' and `make refdoc-venv'
|
||||||
|
#
|
||||||
|
BIN := Scripts
|
||||||
|
|
||||||
# The executable file extension (for tools), *with* leading dot.
|
# The executable file extension (for tools), *with* leading dot.
|
||||||
#
|
#
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 2003-2018 by
|
# Copyright (C) 2003-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 2003-2018 by
|
# Copyright (C) 2003-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 2005-2018 by
|
# Copyright (C) 2005-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -20,8 +20,8 @@
|
||||||
# The following variables (set by other Makefile components, in the
|
# The following variables (set by other Makefile components, in the
|
||||||
# environment, or on the command line) are used:
|
# environment, or on the command line) are used:
|
||||||
#
|
#
|
||||||
# BUILD_DIR The architecture dependent directory,
|
# PLATFORM_DIR The architecture-dependent directory,
|
||||||
# e.g. `$(TOP_DIR)/builds/unix'. Added to INCLUDES also.
|
# e.g., `$(TOP_DIR)/builds/unix'. Added to INCLUDES also.
|
||||||
#
|
#
|
||||||
# OBJ_DIR The directory in which object files are created.
|
# OBJ_DIR The directory in which object files are created.
|
||||||
#
|
#
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
# The targets `objects' and `library' are defined at the end of this
|
# The targets `objects' and `library' are defined at the end of this
|
||||||
# Makefile after all other rules have been included.
|
# Makefile after all other rules have been included.
|
||||||
#
|
#
|
||||||
.PHONY: single multi objects library refdoc
|
.PHONY: single multi objects library refdoc refdoc-venv
|
||||||
|
|
||||||
# default target -- build single objects and library
|
# default target -- build single objects and library
|
||||||
#
|
#
|
||||||
|
|
@ -104,7 +104,7 @@ CONFIG_DIR := $(PUBLIC_DIR)/config
|
||||||
|
|
||||||
# The documentation directory.
|
# The documentation directory.
|
||||||
#
|
#
|
||||||
DOC_DIR ?= $(TOP_DIR)/docs/reference
|
DOC_DIR ?= $(TOP_DIR)/docs
|
||||||
|
|
||||||
# The final name of the library file.
|
# The final name of the library file.
|
||||||
#
|
#
|
||||||
|
|
@ -121,17 +121,19 @@ PROJECT_LIBRARY := $(LIB_DIR)/$(LIBRARY).$A
|
||||||
#
|
#
|
||||||
INCLUDES := $(subst /,$(COMPILER_SEP),$(OBJ_DIR) \
|
INCLUDES := $(subst /,$(COMPILER_SEP),$(OBJ_DIR) \
|
||||||
$(DEVEL_DIR) \
|
$(DEVEL_DIR) \
|
||||||
$(BUILD_DIR) \
|
$(PLATFORM_DIR) \
|
||||||
$(TOP_DIR)/include)
|
$(TOP_DIR)/include)
|
||||||
|
|
||||||
INCLUDE_FLAGS := $(INCLUDES:%=$I%)
|
INCLUDE_FLAGS := $(INCLUDES:%=$I%)
|
||||||
|
|
||||||
|
# For a development build, we assume that the external library dependencies
|
||||||
|
# defined in `ftoption.h' are fulfilled, so we directly access the necessary
|
||||||
|
# include directory information using `pkg-config'.
|
||||||
|
#
|
||||||
ifdef DEVEL_DIR
|
ifdef DEVEL_DIR
|
||||||
# We assume that all library dependencies for FreeType are fulfilled for a
|
INCLUDE_FLAGS += $(shell pkg-config --cflags libpng)
|
||||||
# development build, so we directly access the necessary include directory
|
INCLUDE_FLAGS += $(shell pkg-config --cflags harfbuzz)
|
||||||
# information using `pkg-config'.
|
INCLUDE_FLAGS += $(shell pkg-config --cflags libbrotlidec)
|
||||||
INCLUDE_FLAGS += $(shell pkg-config --cflags libpng \
|
|
||||||
harfbuzz )
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -146,25 +148,13 @@ endif
|
||||||
# FreeType. This is required to let our sources include the internal
|
# FreeType. This is required to let our sources include the internal
|
||||||
# headers (something forbidden by clients).
|
# headers (something forbidden by clients).
|
||||||
#
|
#
|
||||||
# Finally, we define FT_CONFIG_MODULES_H so that the compiler uses the
|
|
||||||
# generated version of `ftmodule.h' in $(OBJ_DIR). If there is an
|
|
||||||
# `ftoption.h' files in $(OBJ_DIR), define FT_CONFIG_OPTIONS_H too.
|
|
||||||
#
|
|
||||||
ifneq ($(wildcard $(OBJ_DIR)/ftoption.h),)
|
|
||||||
FTOPTION_H := $(OBJ_DIR)/ftoption.h
|
|
||||||
FTOPTION_FLAG := $DFT_CONFIG_OPTIONS_H="<ftoption.h>"
|
|
||||||
else ifneq ($(wildcard $(BUILD_DIR)/ftoption.h),)
|
|
||||||
FTOPTION_H := $(BUILD_DIR)/ftoption.h
|
|
||||||
FTOPTION_FLAG := $DFT_CONFIG_OPTIONS_H="<ftoption.h>"
|
|
||||||
endif
|
|
||||||
|
|
||||||
# `CPPFLAGS' might be specified by the user in the environment.
|
# `CPPFLAGS' might be specified by the user in the environment.
|
||||||
#
|
#
|
||||||
FT_CFLAGS = $(CPPFLAGS) \
|
FT_CFLAGS = $(CPPFLAGS) \
|
||||||
$(CFLAGS) \
|
$(CFLAGS) \
|
||||||
$DFT2_BUILD_LIBRARY \
|
$DFT2_BUILD_LIBRARY
|
||||||
$DFT_CONFIG_MODULES_H="<ftmodule.h>" \
|
|
||||||
$(FTOPTION_FLAG)
|
FT_COMPILE := $(CC) $(ANSIFLAGS) $(INCLUDE_FLAGS) $(FT_CFLAGS)
|
||||||
|
|
||||||
|
|
||||||
# Include the `exports' rules file.
|
# Include the `exports' rules file.
|
||||||
|
|
@ -179,16 +169,22 @@ OBJECTS_LIST :=
|
||||||
|
|
||||||
# Define $(PUBLIC_H) as the list of all public header files located in
|
# Define $(PUBLIC_H) as the list of all public header files located in
|
||||||
# `$(TOP_DIR)/include/freetype'. $(INTERNAL_H), and $(CONFIG_H) are defined
|
# `$(TOP_DIR)/include/freetype'. $(INTERNAL_H), and $(CONFIG_H) are defined
|
||||||
# similarly.
|
# similarly. $(FTOPTION_H) is the option file used in the compilation.
|
||||||
#
|
#
|
||||||
# This is used to simplify the dependency rules -- if one of these files
|
# This is used to simplify the dependency rules -- if one of these files
|
||||||
# changes, the whole library is recompiled.
|
# changes, the whole library is recompiled.
|
||||||
#
|
#
|
||||||
|
ifneq ($(wildcard $(OBJ_DIR)/ftoption.h),)
|
||||||
|
FTOPTION_H := $(OBJ_DIR)/ftoption.h
|
||||||
|
else ifneq ($(wildcard $(PLATFORM_DIR)/ftoption.h),)
|
||||||
|
FTOPTION_H := $(PLATFORM_DIR)/ftoption.h
|
||||||
|
endif
|
||||||
|
|
||||||
PUBLIC_H := $(wildcard $(PUBLIC_DIR)/*.h)
|
PUBLIC_H := $(wildcard $(PUBLIC_DIR)/*.h)
|
||||||
INTERNAL_H := $(wildcard $(INTERNAL_DIR)/*.h) \
|
INTERNAL_H := $(wildcard $(INTERNAL_DIR)/*.h) \
|
||||||
$(wildcard $(SERVICES_DIR)/*.h)
|
$(wildcard $(SERVICES_DIR)/*.h)
|
||||||
CONFIG_H := $(wildcard $(CONFIG_DIR)/*.h) \
|
CONFIG_H := $(wildcard $(CONFIG_DIR)/*.h) \
|
||||||
$(wildcard $(BUILD_DIR)/config/*.h) \
|
$(wildcard $(PLATFORM_DIR)/config/*.h) \
|
||||||
$(FTMODULE_H) \
|
$(FTMODULE_H) \
|
||||||
$(FTOPTION_H)
|
$(FTOPTION_H)
|
||||||
DEVEL_H := $(wildcard $(TOP_DIR)/devel/*.h)
|
DEVEL_H := $(wildcard $(TOP_DIR)/devel/*.h)
|
||||||
|
|
@ -196,8 +192,6 @@ DEVEL_H := $(wildcard $(TOP_DIR)/devel/*.h)
|
||||||
FREETYPE_H := $(PUBLIC_H) $(INTERNAL_H) $(CONFIG_H) $(DEVEL_H)
|
FREETYPE_H := $(PUBLIC_H) $(INTERNAL_H) $(CONFIG_H) $(DEVEL_H)
|
||||||
|
|
||||||
|
|
||||||
FT_COMPILE := $(CC) $(ANSIFLAGS) $(INCLUDE_FLAGS) $(FT_CFLAGS)
|
|
||||||
|
|
||||||
# ftsystem component
|
# ftsystem component
|
||||||
#
|
#
|
||||||
FTSYS_SRC ?= $(BASE_DIR)/ftsystem.c
|
FTSYS_SRC ?= $(BASE_DIR)/ftsystem.c
|
||||||
|
|
@ -226,6 +220,7 @@ $(FTDEBUG_OBJ): $(FTDEBUG_SRC) $(FREETYPE_H)
|
||||||
#
|
#
|
||||||
include $(SRC_DIR)/base/rules.mk
|
include $(SRC_DIR)/base/rules.mk
|
||||||
include $(patsubst %,$(SRC_DIR)/%/rules.mk,$(MODULES))
|
include $(patsubst %,$(SRC_DIR)/%/rules.mk,$(MODULES))
|
||||||
|
include $(SRC_DIR)/dlg/rules.mk
|
||||||
|
|
||||||
|
|
||||||
# ftinit component
|
# ftinit component
|
||||||
|
|
@ -266,8 +261,8 @@ endif
|
||||||
|
|
||||||
# All FreeType library objects.
|
# All FreeType library objects.
|
||||||
#
|
#
|
||||||
OBJ_M := $(BASE_OBJ_M) $(BASE_EXT_OBJ) $(DRV_OBJS_M)
|
OBJ_M := $(BASE_OBJ_M) $(BASE_EXT_OBJ) $(DRV_OBJS_M) $(DLG_OBJS_M)
|
||||||
OBJ_S := $(BASE_OBJ_S) $(BASE_EXT_OBJ) $(DRV_OBJS_S)
|
OBJ_S := $(BASE_OBJ_S) $(BASE_EXT_OBJ) $(DRV_OBJS_S) $(DLG_OBJS_S)
|
||||||
|
|
||||||
|
|
||||||
# The target `multi' on the Make command line indicates that we want to
|
# The target `multi' on the Make command line indicates that we want to
|
||||||
|
|
@ -289,18 +284,51 @@ objects: $(OBJECTS_LIST)
|
||||||
|
|
||||||
library: $(PROJECT_LIBRARY)
|
library: $(PROJECT_LIBRARY)
|
||||||
|
|
||||||
|
# Run `docwriter' in the current Python environment.
|
||||||
# Option `-B' disables generation of .pyc files (available since python 2.6)
|
|
||||||
#
|
#
|
||||||
refdoc:
|
PYTHON ?= python
|
||||||
python -B $(SRC_DIR)/tools/docmaker/docmaker.py \
|
|
||||||
--prefix=ft2 \
|
|
||||||
--title=FreeType-$(version) \
|
|
||||||
--output=$(DOC_DIR) \
|
|
||||||
$(PUBLIC_DIR)/*.h \
|
|
||||||
$(PUBLIC_DIR)/config/*.h \
|
|
||||||
$(PUBLIC_DIR)/cache/*.h
|
|
||||||
|
|
||||||
|
refdoc:
|
||||||
|
@echo Running docwriter...
|
||||||
|
$(PYTHON) -m docwriter \
|
||||||
|
--prefix=ft2 \
|
||||||
|
--title=FreeType-$(version) \
|
||||||
|
--site=reference \
|
||||||
|
--output=$(DOC_DIR) \
|
||||||
|
$(PUBLIC_DIR)/*.h \
|
||||||
|
$(PUBLIC_DIR)/config/*.h \
|
||||||
|
$(PUBLIC_DIR)/cache/*.h
|
||||||
|
@echo Building static site...
|
||||||
|
cd $(DOC_DIR) && mkdocs build
|
||||||
|
@echo Done.
|
||||||
|
|
||||||
|
# Variables for running `refdoc' with Python's `virtualenv'. The
|
||||||
|
# environment is created in `DOC_DIR/env' and is gitignored.
|
||||||
|
#
|
||||||
|
# We still need to cd into `DOC_DIR' to build `mkdocs' because paths in
|
||||||
|
# `mkdocs.yml' are relative to the current working directory.
|
||||||
|
#
|
||||||
|
VENV_NAME := env
|
||||||
|
VENV_DIR := $(DOC_DIR)$(SEP)$(VENV_NAME)
|
||||||
|
ENV_PYTHON := $(VENV_DIR)$(SEP)$(BIN)$(SEP)$(PYTHON)
|
||||||
|
|
||||||
|
refdoc-venv:
|
||||||
|
@echo Setting up virtualenv for Python...
|
||||||
|
virtualenv --python=$(PYTHON) $(VENV_DIR)
|
||||||
|
@echo Installing docwriter...
|
||||||
|
$(ENV_PYTHON) -m pip install docwriter
|
||||||
|
@echo Running docwriter...
|
||||||
|
$(ENV_PYTHON) -m docwriter \
|
||||||
|
--prefix=ft2 \
|
||||||
|
--title=FreeType-$(version) \
|
||||||
|
--site=reference \
|
||||||
|
--output=$(DOC_DIR) \
|
||||||
|
$(PUBLIC_DIR)/*.h \
|
||||||
|
$(PUBLIC_DIR)/config/*.h \
|
||||||
|
$(PUBLIC_DIR)/cache/*.h
|
||||||
|
@echo Building static site...
|
||||||
|
cd $(DOC_DIR) && $(VENV_NAME)$(SEP)$(BIN)$(SEP)python -m mkdocs build
|
||||||
|
@echo Done.
|
||||||
|
|
||||||
.PHONY: clean_project_std distclean_project_std
|
.PHONY: clean_project_std distclean_project_std
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ environment by Metrowerks. GCC for MPW and Symantec
|
||||||
|
|
||||||
Required files are downloadable from:
|
Required files are downloadable from:
|
||||||
|
|
||||||
http://developer.apple.com/tools/mpw-tools/index.html
|
http://macintoshgarden.org/apps/macintosh-programmers-workshop
|
||||||
|
|
||||||
Also you can find documents how to update by MPW-PR.
|
Also you can find documents how to update by MPW-PR.
|
||||||
|
|
||||||
|
|
@ -54,7 +54,7 @@ environment by Metrowerks. GCC for MPW and Symantec
|
||||||
skeletons. Python bundled to Mac OS X is enough. For
|
skeletons. Python bundled to Mac OS X is enough. For
|
||||||
classic MacOS, MacPython is available:
|
classic MacOS, MacPython is available:
|
||||||
|
|
||||||
http://homepages.cwi.nl/~jack/macpython/
|
https://homepages.cwi.nl/~jack/macpython/
|
||||||
|
|
||||||
MPW requires all files are typed by resource fork.
|
MPW requires all files are typed by resource fork.
|
||||||
ResEdit bundled to MPW is enough. In Mac OS X,
|
ResEdit bundled to MPW is enough. In Mac OS X,
|
||||||
|
|
@ -280,7 +280,7 @@ APPENDIX I
|
||||||
migrate to FSRef datatype. The big differences of FSRef
|
migrate to FSRef datatype. The big differences of FSRef
|
||||||
against FSSpec are explained in Apple TechNotes 2078.
|
against FSSpec are explained in Apple TechNotes 2078.
|
||||||
|
|
||||||
http://developer.apple.com/technotes/tn2002/tn2078.html
|
https://developer.apple.com/library/archive/technotes/tn2078/
|
||||||
|
|
||||||
- filename length: the max length of file
|
- filename length: the max length of file
|
||||||
name of FSRef is 255 chars (it is limit of HFS+),
|
name of FSRef is 255 chars (it is limit of HFS+),
|
||||||
|
|
@ -314,7 +314,7 @@ APPENDIX I
|
||||||
of FontManager emulation without QuickDraw is
|
of FontManager emulation without QuickDraw is
|
||||||
explained in
|
explained in
|
||||||
|
|
||||||
http://www.gyve.org/~mpsuzuki/ats_benchmark.html
|
http://gyvern.ipc.hiroshima-u.ac.jp/~mpsuzuki/ats_benchmark.html
|
||||||
|
|
||||||
A-3. Framework Availabilities
|
A-3. Framework Availabilities
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
|
||||||
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
"https://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<string>English</string>
|
<string>English</string>
|
||||||
|
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>FreeType</string>
|
<string>freetype</string>
|
||||||
|
|
||||||
<key>CFBundleGetInfoString</key>
|
<key>CFBundleGetInfoString</key>
|
||||||
<string>FreeType ${PROJECT_VERSION}</string>
|
<string>FreeType ${PROJECT_VERSION}</string>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
/* Mac FOND support. Written by just@letterror.com. */
|
/* Mac FOND support. Written by just@letterror.com. */
|
||||||
/* Heavily Fixed by mpsuzuki, George Williams and Sean McBride */
|
/* Heavily Fixed by mpsuzuki, George Williams and Sean McBride */
|
||||||
/* */
|
/* */
|
||||||
/* Copyright 1996-2018 by */
|
/* Copyright (C) 1996-2023 by */
|
||||||
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
|
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of the FreeType project, and may only be used, */
|
/* This file is part of the FreeType project, and may only be used, */
|
||||||
|
|
@ -62,10 +62,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <ft2build.h>
|
#include <freetype/freetype.h>
|
||||||
#include FT_FREETYPE_H
|
#include <freetype/tttags.h>
|
||||||
#include FT_TRUETYPE_TAGS_H
|
#include <freetype/internal/ftstream.h>
|
||||||
#include FT_INTERNAL_STREAM_H
|
|
||||||
#include "ftbase.h"
|
#include "ftbase.h"
|
||||||
|
|
||||||
#if defined( __GNUC__ ) || defined( __IBMC__ )
|
#if defined( __GNUC__ ) || defined( __IBMC__ )
|
||||||
|
|
@ -98,7 +97,7 @@
|
||||||
|
|
||||||
#define FT_DEPRECATED_ATTRIBUTE
|
#define FT_DEPRECATED_ATTRIBUTE
|
||||||
|
|
||||||
#include FT_MAC_H
|
#include <freetype/ftmac.h>
|
||||||
|
|
||||||
/* undefine blocking-macros in ftmac.h */
|
/* undefine blocking-macros in ftmac.h */
|
||||||
#undef FT_GetFile_From_Mac_Name
|
#undef FT_GetFile_From_Mac_Name
|
||||||
|
|
@ -448,7 +447,7 @@ typedef short ResourceIndex;
|
||||||
|
|
||||||
stream->descriptor.pointer = NULL;
|
stream->descriptor.pointer = NULL;
|
||||||
stream->size = 0;
|
stream->size = 0;
|
||||||
stream->base = 0;
|
stream->base = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -780,9 +779,10 @@ typedef short ResourceIndex;
|
||||||
style = (StyleTable*)p;
|
style = (StyleTable*)p;
|
||||||
p += sizeof ( StyleTable );
|
p += sizeof ( StyleTable );
|
||||||
string_count = EndianS16_BtoN( *(short*)(p) );
|
string_count = EndianS16_BtoN( *(short*)(p) );
|
||||||
|
string_count = FT_MIN( 64, string_count );
|
||||||
p += sizeof ( short );
|
p += sizeof ( short );
|
||||||
|
|
||||||
for ( i = 0; i < string_count && i < 64; i++ )
|
for ( i = 0; i < string_count; i++ )
|
||||||
{
|
{
|
||||||
names[i] = p;
|
names[i] = p;
|
||||||
p += names[i][0];
|
p += names[i][0];
|
||||||
|
|
@ -799,7 +799,7 @@ typedef short ResourceIndex;
|
||||||
ps_name[ps_name_len] = 0;
|
ps_name[ps_name_len] = 0;
|
||||||
}
|
}
|
||||||
if ( style->indexes[face_index] > 1 &&
|
if ( style->indexes[face_index] > 1 &&
|
||||||
style->indexes[face_index] <= FT_MIN( string_count, 64 ) )
|
style->indexes[face_index] <= string_count )
|
||||||
{
|
{
|
||||||
unsigned char* suffixes = names[style->indexes[face_index] - 1];
|
unsigned char* suffixes = names[style->indexes[face_index] - 1];
|
||||||
|
|
||||||
|
|
@ -939,7 +939,7 @@ typedef short ResourceIndex;
|
||||||
if ( lwfn_file_name[0] )
|
if ( lwfn_file_name[0] )
|
||||||
{
|
{
|
||||||
err = lookup_lwfn_by_fond( pathname, lwfn_file_name,
|
err = lookup_lwfn_by_fond( pathname, lwfn_file_name,
|
||||||
buff, sizeof ( buff ) );
|
buff, sizeof ( buff ) );
|
||||||
if ( !err )
|
if ( !err )
|
||||||
have_lwfn = 1;
|
have_lwfn = 1;
|
||||||
}
|
}
|
||||||
|
|
@ -1011,7 +1011,7 @@ typedef short ResourceIndex;
|
||||||
old_total_size = total_size;
|
old_total_size = total_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( FT_ALLOC( buffer, (FT_Long)total_size ) )
|
if ( FT_QALLOC( buffer, (FT_Long)total_size ) )
|
||||||
goto Error;
|
goto Error;
|
||||||
|
|
||||||
/* Second pass: append all POST data to the buffer, add PFB fields. */
|
/* Second pass: append all POST data to the buffer, add PFB fields. */
|
||||||
|
|
@ -1127,7 +1127,7 @@ typedef short ResourceIndex;
|
||||||
return FT_THROW( Invalid_Handle );
|
return FT_THROW( Invalid_Handle );
|
||||||
|
|
||||||
sfnt_size = (FT_ULong)GetHandleSize( sfnt );
|
sfnt_size = (FT_ULong)GetHandleSize( sfnt );
|
||||||
if ( FT_ALLOC( sfnt_data, (FT_Long)sfnt_size ) )
|
if ( FT_QALLOC( sfnt_data, (FT_Long)sfnt_size ) )
|
||||||
{
|
{
|
||||||
ReleaseResource( sfnt );
|
ReleaseResource( sfnt );
|
||||||
return error;
|
return error;
|
||||||
|
|
|
||||||
117
modules/freetype2/builds/meson/extract_freetype_version.py
Normal file
117
modules/freetype2/builds/meson/extract_freetype_version.py
Normal file
|
|
@ -0,0 +1,117 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
#
|
||||||
|
# Copyright (C) 2020-2023 by
|
||||||
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
|
#
|
||||||
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
# and distributed under the terms of the FreeType project license,
|
||||||
|
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
|
||||||
|
# indicate that you have read the license and understand and accept it
|
||||||
|
# fully.
|
||||||
|
|
||||||
|
"""Extract the FreeType version numbers from `<freetype/freetype.h>`.
|
||||||
|
|
||||||
|
This script parses the header to extract the version number defined there.
|
||||||
|
By default, the full dotted version number is printed, but `--major`,
|
||||||
|
`--minor` or `--patch` can be used to only print one of these values
|
||||||
|
instead.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
# Expected input:
|
||||||
|
#
|
||||||
|
# ...
|
||||||
|
# #define FREETYPE_MAJOR 2
|
||||||
|
# #define FREETYPE_MINOR 10
|
||||||
|
# #define FREETYPE_PATCH 2
|
||||||
|
# ...
|
||||||
|
|
||||||
|
RE_MAJOR = re.compile(r"^ \#define \s+ FREETYPE_MAJOR \s+ (.*) $", re.X)
|
||||||
|
RE_MINOR = re.compile(r"^ \#define \s+ FREETYPE_MINOR \s+ (.*) $", re.X)
|
||||||
|
RE_PATCH = re.compile(r"^ \#define \s+ FREETYPE_PATCH \s+ (.*) $", re.X)
|
||||||
|
|
||||||
|
|
||||||
|
def parse_freetype_header(header):
|
||||||
|
major = None
|
||||||
|
minor = None
|
||||||
|
patch = None
|
||||||
|
|
||||||
|
for line in header.splitlines():
|
||||||
|
line = line.rstrip()
|
||||||
|
m = RE_MAJOR.match(line)
|
||||||
|
if m:
|
||||||
|
assert major == None, "FREETYPE_MAJOR appears more than once!"
|
||||||
|
major = m.group(1)
|
||||||
|
continue
|
||||||
|
|
||||||
|
m = RE_MINOR.match(line)
|
||||||
|
if m:
|
||||||
|
assert minor == None, "FREETYPE_MINOR appears more than once!"
|
||||||
|
minor = m.group(1)
|
||||||
|
continue
|
||||||
|
|
||||||
|
m = RE_PATCH.match(line)
|
||||||
|
if m:
|
||||||
|
assert patch == None, "FREETYPE_PATCH appears more than once!"
|
||||||
|
patch = m.group(1)
|
||||||
|
continue
|
||||||
|
|
||||||
|
assert (
|
||||||
|
major and minor and patch
|
||||||
|
), "This header is missing one of FREETYPE_MAJOR, FREETYPE_MINOR or FREETYPE_PATCH!"
|
||||||
|
|
||||||
|
return (major, minor, patch)
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
|
|
||||||
|
group = parser.add_mutually_exclusive_group()
|
||||||
|
group.add_argument(
|
||||||
|
"--major",
|
||||||
|
action="store_true",
|
||||||
|
help="Only print the major version number.",
|
||||||
|
)
|
||||||
|
group.add_argument(
|
||||||
|
"--minor",
|
||||||
|
action="store_true",
|
||||||
|
help="Only print the minor version number.",
|
||||||
|
)
|
||||||
|
group.add_argument(
|
||||||
|
"--patch",
|
||||||
|
action="store_true",
|
||||||
|
help="Only print the patch version number.",
|
||||||
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"input",
|
||||||
|
metavar="FREETYPE_H",
|
||||||
|
help="The input freetype.h header to parse.",
|
||||||
|
)
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
with open(args.input) as f:
|
||||||
|
header = f.read()
|
||||||
|
|
||||||
|
version = parse_freetype_header(header)
|
||||||
|
|
||||||
|
if args.major:
|
||||||
|
print(version[0])
|
||||||
|
elif args.minor:
|
||||||
|
print(version[1])
|
||||||
|
elif args.patch:
|
||||||
|
print(version[2])
|
||||||
|
else:
|
||||||
|
print("%s.%s.%s" % version)
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.exit(main())
|
||||||
115
modules/freetype2/builds/meson/extract_libtool_version.py
Normal file
115
modules/freetype2/builds/meson/extract_libtool_version.py
Normal file
|
|
@ -0,0 +1,115 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
#
|
||||||
|
# Copyright (C) 2020-2023 by
|
||||||
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
|
#
|
||||||
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
# and distributed under the terms of the FreeType project license,
|
||||||
|
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
|
||||||
|
# indicate that you have read the license and understand and accept it
|
||||||
|
# fully.
|
||||||
|
|
||||||
|
"""Extract the libtool version from `configure.raw`.
|
||||||
|
|
||||||
|
This script parses the `configure.raw` file to extract the libtool version
|
||||||
|
number. By default, the full dotted version number is printed, but
|
||||||
|
`--major`, `--minor` or `--patch` can be used to only print one of these
|
||||||
|
values instead.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
# Expected input:
|
||||||
|
#
|
||||||
|
# ...
|
||||||
|
# version_info='23:2:17'
|
||||||
|
# ...
|
||||||
|
|
||||||
|
RE_VERSION_INFO = re.compile(r"^version_info='(\d+):(\d+):(\d+)'")
|
||||||
|
|
||||||
|
|
||||||
|
def parse_configure_raw(header):
|
||||||
|
major = None
|
||||||
|
minor = None
|
||||||
|
patch = None
|
||||||
|
|
||||||
|
for line in header.splitlines():
|
||||||
|
line = line.rstrip()
|
||||||
|
m = RE_VERSION_INFO.match(line)
|
||||||
|
if m:
|
||||||
|
assert major == None, "version_info appears more than once!"
|
||||||
|
major = m.group(1)
|
||||||
|
minor = m.group(2)
|
||||||
|
patch = m.group(3)
|
||||||
|
continue
|
||||||
|
|
||||||
|
assert (
|
||||||
|
major and minor and patch
|
||||||
|
), "This input file is missing a version_info definition!"
|
||||||
|
|
||||||
|
return (major, minor, patch)
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
|
|
||||||
|
group = parser.add_mutually_exclusive_group()
|
||||||
|
group.add_argument(
|
||||||
|
"--major",
|
||||||
|
action="store_true",
|
||||||
|
help="Only print the major version number.",
|
||||||
|
)
|
||||||
|
group.add_argument(
|
||||||
|
"--minor",
|
||||||
|
action="store_true",
|
||||||
|
help="Only print the minor version number.",
|
||||||
|
)
|
||||||
|
group.add_argument(
|
||||||
|
"--patch",
|
||||||
|
action="store_true",
|
||||||
|
help="Only print the patch version number.",
|
||||||
|
)
|
||||||
|
group.add_argument(
|
||||||
|
"--soversion",
|
||||||
|
action="store_true",
|
||||||
|
help="Only print the libtool library suffix.",
|
||||||
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"input",
|
||||||
|
metavar="CONFIGURE_RAW",
|
||||||
|
help="The input configure.raw file to parse.",
|
||||||
|
)
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
with open(args.input) as f:
|
||||||
|
raw_file = f.read()
|
||||||
|
|
||||||
|
version = parse_configure_raw(raw_file)
|
||||||
|
|
||||||
|
if args.major:
|
||||||
|
print(version[0])
|
||||||
|
elif args.minor:
|
||||||
|
print(version[1])
|
||||||
|
elif args.patch:
|
||||||
|
print(version[2])
|
||||||
|
elif args.soversion:
|
||||||
|
# Convert libtool version_info to the library suffix.
|
||||||
|
# (current,revision, age) -> (current - age, age, revision)
|
||||||
|
print(
|
||||||
|
"%d.%s.%s"
|
||||||
|
% (int(version[0]) - int(version[2]), version[2], version[1])
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
print("%s.%s.%s" % version)
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.exit(main())
|
||||||
89
modules/freetype2/builds/meson/generate_reference_docs.py
Normal file
89
modules/freetype2/builds/meson/generate_reference_docs.py
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
#
|
||||||
|
# Copyright (C) 2020-2023 by
|
||||||
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
|
#
|
||||||
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
# and distributed under the terms of the FreeType project license,
|
||||||
|
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
|
||||||
|
# indicate that you have read the license and understand and accept it
|
||||||
|
# fully.
|
||||||
|
|
||||||
|
"""Generate FreeType reference documentation."""
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import glob
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"--input-dir",
|
||||||
|
required=True,
|
||||||
|
help="Top-level FreeType source directory.",
|
||||||
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"--version", required=True, help='FreeType version (e.g. "2.x.y").'
|
||||||
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"--output-dir", required=True, help="Output directory."
|
||||||
|
)
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
# Get the list of input files of interest.
|
||||||
|
include_dir = os.path.join(args.input_dir, "include")
|
||||||
|
include_config_dir = os.path.join(include_dir, "config")
|
||||||
|
include_cache_dir = os.path.join(include_dir, "cache")
|
||||||
|
|
||||||
|
all_headers = (
|
||||||
|
glob.glob(os.path.join(args.input_dir, "include", "freetype", "*.h"))
|
||||||
|
+ glob.glob(
|
||||||
|
os.path.join(
|
||||||
|
args.input_dir, "include", "freetype", "config", "*.h"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
+ glob.glob(
|
||||||
|
os.path.join(
|
||||||
|
args.input_dir, "include", "freetype", "cache", "*.h"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if not os.path.exists(args.output_dir):
|
||||||
|
os.makedirs(args.output_dir)
|
||||||
|
else:
|
||||||
|
assert os.path.isdir(args.output_dir), (
|
||||||
|
"Not a directory: " + args.output_dir
|
||||||
|
)
|
||||||
|
|
||||||
|
cmds = [
|
||||||
|
sys.executable,
|
||||||
|
"-m",
|
||||||
|
"docwriter",
|
||||||
|
"--prefix=ft2",
|
||||||
|
"--title=FreeType-" + args.version,
|
||||||
|
"--site=reference",
|
||||||
|
"--output=" + args.output_dir,
|
||||||
|
] + all_headers
|
||||||
|
|
||||||
|
print("Running docwriter...")
|
||||||
|
subprocess.check_call(cmds)
|
||||||
|
|
||||||
|
print("Building static site...")
|
||||||
|
subprocess.check_call(
|
||||||
|
[sys.executable, "-m", "mkdocs", "build"], cwd=args.output_dir
|
||||||
|
)
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.exit(main())
|
||||||
173
modules/freetype2/builds/meson/parse_modules_cfg.py
Normal file
173
modules/freetype2/builds/meson/parse_modules_cfg.py
Normal file
|
|
@ -0,0 +1,173 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
#
|
||||||
|
# Copyright (C) 2020-2023 by
|
||||||
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
|
#
|
||||||
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
# and distributed under the terms of the FreeType project license,
|
||||||
|
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
|
||||||
|
# indicate that you have read the license and understand and accept it
|
||||||
|
# fully.
|
||||||
|
|
||||||
|
"""Parse modules.cfg and dump its output either as ftmodule.h or a list of
|
||||||
|
base extensions.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
# Expected input:
|
||||||
|
#
|
||||||
|
# ...
|
||||||
|
# FONT_MODULES += <name>
|
||||||
|
# HINTING_MODULES += <name>
|
||||||
|
# RASTER_MODULES += <name>
|
||||||
|
# AUX_MODULES += <name>
|
||||||
|
# BASE_EXTENSIONS += <name>
|
||||||
|
# ...
|
||||||
|
|
||||||
|
|
||||||
|
def parse_modules_cfg(input_file):
|
||||||
|
|
||||||
|
lists = {
|
||||||
|
"FONT_MODULES": [],
|
||||||
|
"HINTING_MODULES": [],
|
||||||
|
"RASTER_MODULES": [],
|
||||||
|
"AUX_MODULES": [],
|
||||||
|
"BASE_EXTENSIONS": [],
|
||||||
|
}
|
||||||
|
|
||||||
|
for line in input_file.splitlines():
|
||||||
|
line = line.rstrip()
|
||||||
|
# Ignore empty lines and those that start with a comment.
|
||||||
|
if not line or line[0] == "#":
|
||||||
|
continue
|
||||||
|
|
||||||
|
items = line.split()
|
||||||
|
assert len(items) == 3 and items[1] == "+=", (
|
||||||
|
"Unexpected input line [%s]" % line
|
||||||
|
)
|
||||||
|
assert items[0] in lists, (
|
||||||
|
"Unexpected configuration variable name " + items[0]
|
||||||
|
)
|
||||||
|
|
||||||
|
lists[items[0]].append(items[2])
|
||||||
|
|
||||||
|
return lists
|
||||||
|
|
||||||
|
|
||||||
|
def generate_ftmodule(lists):
|
||||||
|
result = "/* This is a generated file. */\n"
|
||||||
|
for driver in lists["FONT_MODULES"]:
|
||||||
|
if driver == "sfnt": # Special case for the sfnt 'driver'.
|
||||||
|
result += "FT_USE_MODULE( FT_Module_Class, sfnt_module_class )\n"
|
||||||
|
continue
|
||||||
|
|
||||||
|
name = {
|
||||||
|
"truetype": "tt",
|
||||||
|
"type1": "t1",
|
||||||
|
"cid": "t1cid",
|
||||||
|
"type42": "t42",
|
||||||
|
"winfonts": "winfnt",
|
||||||
|
}.get(driver, driver)
|
||||||
|
result += (
|
||||||
|
"FT_USE_MODULE( FT_Driver_ClassRec, %s_driver_class )\n" % name
|
||||||
|
)
|
||||||
|
|
||||||
|
for module in lists["HINTING_MODULES"]:
|
||||||
|
result += (
|
||||||
|
"FT_USE_MODULE( FT_Module_Class, %s_module_class )\n" % module
|
||||||
|
)
|
||||||
|
|
||||||
|
for module in lists["RASTER_MODULES"]:
|
||||||
|
names = {
|
||||||
|
"raster": ("ft_raster1",),
|
||||||
|
"smooth": ("ft_smooth",),
|
||||||
|
"svg": ("ft_svg",),
|
||||||
|
"sdf": ("ft_sdf", "ft_bitmap_sdf"),
|
||||||
|
}.get(module)
|
||||||
|
for name in names:
|
||||||
|
result += (
|
||||||
|
"FT_USE_MODULE( FT_Renderer_Class, %s_renderer_class )\n" % name
|
||||||
|
)
|
||||||
|
|
||||||
|
for module in lists["AUX_MODULES"]:
|
||||||
|
if module in ("psaux", "psnames", "otvalid", "gxvalid"):
|
||||||
|
result += (
|
||||||
|
"FT_USE_MODULE( FT_Module_Class, %s_module_class )\n" % module
|
||||||
|
)
|
||||||
|
|
||||||
|
result += "/* EOF */\n"
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def generate_main_modules(lists):
|
||||||
|
return "\n".join(
|
||||||
|
lists["FONT_MODULES"]
|
||||||
|
+ lists["HINTING_MODULES"]
|
||||||
|
+ lists["RASTER_MODULES"]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def generate_aux_modules(lists):
|
||||||
|
return "\n".join(lists["AUX_MODULES"])
|
||||||
|
|
||||||
|
|
||||||
|
def generate_base_extensions(lists):
|
||||||
|
return "\n".join(lists["BASE_EXTENSIONS"])
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"--format",
|
||||||
|
required=True,
|
||||||
|
choices=(
|
||||||
|
"ftmodule.h",
|
||||||
|
"main-modules",
|
||||||
|
"aux-modules",
|
||||||
|
"base-extensions-list",
|
||||||
|
),
|
||||||
|
help="Select output format.",
|
||||||
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"input",
|
||||||
|
metavar="CONFIGURE_RAW",
|
||||||
|
help="The input configure.raw file to parse.",
|
||||||
|
)
|
||||||
|
|
||||||
|
parser.add_argument("--output", help="Output file (default is stdout).")
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
with open(args.input) as f:
|
||||||
|
input_data = f.read()
|
||||||
|
|
||||||
|
lists = parse_modules_cfg(input_data)
|
||||||
|
|
||||||
|
if args.format == "ftmodule.h":
|
||||||
|
result = generate_ftmodule(lists)
|
||||||
|
elif args.format == "main-modules":
|
||||||
|
result = generate_main_modules(lists)
|
||||||
|
elif args.format == "aux-modules":
|
||||||
|
result = generate_aux_modules(lists)
|
||||||
|
elif args.format == "base-extensions-list":
|
||||||
|
result = generate_base_extensions(lists)
|
||||||
|
else:
|
||||||
|
assert False, "Invalid output format!"
|
||||||
|
|
||||||
|
if args.output:
|
||||||
|
with open(args.output, "w") as f:
|
||||||
|
f.write(result)
|
||||||
|
else:
|
||||||
|
print(result)
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.exit(main())
|
||||||
115
modules/freetype2/builds/meson/process_ftoption_h.py
Normal file
115
modules/freetype2/builds/meson/process_ftoption_h.py
Normal file
|
|
@ -0,0 +1,115 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
#
|
||||||
|
# Copyright (C) 2020-2023 by
|
||||||
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
|
#
|
||||||
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
# and distributed under the terms of the FreeType project license,
|
||||||
|
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
|
||||||
|
# indicate that you have read the license and understand and accept it
|
||||||
|
# fully.
|
||||||
|
|
||||||
|
"""Toggle settings in `ftoption.h` file based on command-line arguments.
|
||||||
|
|
||||||
|
This script takes an `ftoption.h` file as input and rewrites
|
||||||
|
`#define`/`#undef` lines in it based on `--enable=CONFIG_VARNAME` or
|
||||||
|
`--disable=CONFIG_VARNAME` arguments passed to it, where `CONFIG_VARNAME` is
|
||||||
|
configuration variable name, such as `FT_CONFIG_OPTION_USE_LZW`, that may
|
||||||
|
appear in the file.
|
||||||
|
|
||||||
|
Note that if one of `CONFIG_VARNAME` is not found in the input file, this
|
||||||
|
script exits with an error message listing the missing variable names.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"input", metavar="FTOPTION_H", help="Path to input ftoption.h file."
|
||||||
|
)
|
||||||
|
|
||||||
|
parser.add_argument("--output", help="Output to file instead of stdout.")
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"--enable",
|
||||||
|
action="append",
|
||||||
|
default=[],
|
||||||
|
help="Enable a given build option (e.g. FT_CONFIG_OPTION_USE_LZW).",
|
||||||
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"--disable",
|
||||||
|
action="append",
|
||||||
|
default=[],
|
||||||
|
help="Disable a given build option.",
|
||||||
|
)
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
common_options = set(args.enable) & set(args.disable)
|
||||||
|
if common_options:
|
||||||
|
parser.error(
|
||||||
|
"Options cannot be both enabled and disabled: %s"
|
||||||
|
% sorted(common_options)
|
||||||
|
)
|
||||||
|
return 1
|
||||||
|
|
||||||
|
with open(args.input) as f:
|
||||||
|
input_file = f.read()
|
||||||
|
|
||||||
|
options_seen = set()
|
||||||
|
|
||||||
|
new_lines = []
|
||||||
|
for line in input_file.splitlines():
|
||||||
|
# Expected formats:
|
||||||
|
# #define <CONFIG_VAR>
|
||||||
|
# /* #define <CONFIG_VAR> */
|
||||||
|
# #undef <CONFIG_VAR>
|
||||||
|
line = line.rstrip()
|
||||||
|
if line.startswith("/* #define ") and line.endswith(" */"):
|
||||||
|
option_name = line[11:-3].strip()
|
||||||
|
option_enabled = False
|
||||||
|
elif line.startswith("#define "):
|
||||||
|
option_name = line[8:].strip()
|
||||||
|
option_enabled = True
|
||||||
|
elif line.startswith("#undef "):
|
||||||
|
option_name = line[7:].strip()
|
||||||
|
option_enabled = False
|
||||||
|
else:
|
||||||
|
new_lines.append(line)
|
||||||
|
continue
|
||||||
|
|
||||||
|
options_seen.add(option_name)
|
||||||
|
if option_enabled and option_name in args.disable:
|
||||||
|
line = "#undef " + option_name
|
||||||
|
elif not option_enabled and option_name in args.enable:
|
||||||
|
line = "#define " + option_name
|
||||||
|
new_lines.append(line)
|
||||||
|
|
||||||
|
result = "\n".join(new_lines) + "\n"
|
||||||
|
|
||||||
|
# Sanity check that all command-line options were actually processed.
|
||||||
|
cmdline_options = set(args.enable) | set(args.disable)
|
||||||
|
assert cmdline_options.issubset(
|
||||||
|
options_seen
|
||||||
|
), "Could not find options in input file: " + ", ".join(
|
||||||
|
sorted(cmdline_options - options_seen)
|
||||||
|
)
|
||||||
|
|
||||||
|
if args.output:
|
||||||
|
with open(args.output, "w") as f:
|
||||||
|
f.write(result)
|
||||||
|
else:
|
||||||
|
print(result)
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.exit(main())
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -40,29 +40,37 @@ ifeq ($(PLATFORM),os2)
|
||||||
ifneq ($(findstring visualage,$(MAKECMDGOALS)),) # Visual Age C++
|
ifneq ($(findstring visualage,$(MAKECMDGOALS)),) # Visual Age C++
|
||||||
CONFIG_FILE := os2-icc.mk
|
CONFIG_FILE := os2-icc.mk
|
||||||
CC := icc
|
CC := icc
|
||||||
visualage: setup
|
|
||||||
.PHONY: visualage
|
.PHONY: visualage
|
||||||
|
visualage: setup
|
||||||
|
@cd .
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++
|
ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++
|
||||||
CONFIG_FILE := os2-wat.mk
|
CONFIG_FILE := os2-wat.mk
|
||||||
CC := wcc386
|
CC := wcc386
|
||||||
watcom: setup
|
|
||||||
.PHONY: watcom
|
.PHONY: watcom
|
||||||
|
watcom: setup
|
||||||
|
@cd .
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(findstring borlandc,$(MAKECMDGOALS)),) # Borland C++ 32-bit
|
ifneq ($(findstring borlandc,$(MAKECMDGOALS)),) # Borland C++ 32-bit
|
||||||
CONFIG_FILE := os2-bcc.mk
|
CONFIG_FILE := os2-bcc.mk
|
||||||
CC := bcc32
|
CC := bcc32
|
||||||
borlandc: setup
|
|
||||||
.PHONY: borlandc
|
.PHONY: borlandc
|
||||||
|
borlandc: setup
|
||||||
|
@cd .
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(findstring devel,$(MAKECMDGOALS)),) # development target
|
ifneq ($(findstring devel,$(MAKECMDGOALS)),) # development target
|
||||||
CONFIG_FILE := os2-dev.mk
|
CONFIG_FILE := os2-dev.mk
|
||||||
CC := gcc
|
CC := gcc
|
||||||
devel: setup
|
|
||||||
.PHONY: devel
|
.PHONY: devel
|
||||||
|
devel: setup
|
||||||
|
@cd .
|
||||||
endif
|
endif
|
||||||
|
|
||||||
setup: std_setup
|
setup: std_setup
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -13,11 +13,15 @@
|
||||||
# fully.
|
# fully.
|
||||||
|
|
||||||
|
|
||||||
DELETE := del
|
DELETE := del
|
||||||
CAT := type
|
CAT := type
|
||||||
SEP := $(strip \ )
|
SEP := $(strip \ )
|
||||||
BUILD_DIR := $(TOP_DIR)/builds/os2
|
PLATFORM_DIR := $(TOP_DIR)/builds/os2
|
||||||
PLATFORM := os2
|
PLATFORM := os2
|
||||||
|
|
||||||
|
# This is used for `make refdoc' and `make refdoc-venv'
|
||||||
|
#
|
||||||
|
BIN := Scripts
|
||||||
|
|
||||||
# The executable file extension (for tools), *with* leading dot.
|
# The executable file extension (for tools), *with* leading dot.
|
||||||
#
|
#
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// FreeType 2 project for the symbian platform
|
// FreeType 2 project for the symbian platform
|
||||||
//
|
//
|
||||||
|
|
||||||
// Copyright 2008-2018 by
|
// Copyright (C) 2008-2023 by
|
||||||
// David Turner, Robert Wilhelm, and Werner Lemberg.
|
// David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
//
|
//
|
||||||
// This file is part of the FreeType project, and may only be used, modified,
|
// This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// FreeType 2 makefile for the symbian platform
|
// FreeType 2 makefile for the symbian platform
|
||||||
//
|
//
|
||||||
|
|
||||||
// Copyright 2008-2018 by
|
// Copyright (C) 2008-2023 by
|
||||||
// David Turner, Robert Wilhelm, and Werner Lemberg.
|
// David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
//
|
//
|
||||||
// This file is part of the FreeType project, and may only be used, modified,
|
// This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -103,6 +103,7 @@ ifneq ($(findstring setup,$(MAKECMDGOALS)),)
|
||||||
check_platform := 1
|
check_platform := 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# Include the automatic host platform detection rules when we need to
|
# Include the automatic host platform detection rules when we need to
|
||||||
# check the platform.
|
# check the platform.
|
||||||
#
|
#
|
||||||
|
|
@ -112,6 +113,17 @@ ifdef check_platform
|
||||||
|
|
||||||
include $(TOP_DIR)/builds/detect.mk
|
include $(TOP_DIR)/builds/detect.mk
|
||||||
|
|
||||||
|
# For builds directly from the git repository we need to copy files
|
||||||
|
# from `subprojects/dlg' to `src/dlg' and `include/dlg'.
|
||||||
|
#
|
||||||
|
ifeq ($(wildcard $(TOP_DIR)/src/dlg/dlg.*),)
|
||||||
|
ifeq ($(wildcard $(TOP_DIR)/subprojects/dlg/*),)
|
||||||
|
copy_submodule: check_out_submodule
|
||||||
|
endif
|
||||||
|
|
||||||
|
setup: copy_submodule
|
||||||
|
endif
|
||||||
|
|
||||||
# This rule makes sense for Unix only to remove files created by a run of
|
# This rule makes sense for Unix only to remove files created by a run of
|
||||||
# the configure script which hasn't been successful (so that no
|
# the configure script which hasn't been successful (so that no
|
||||||
# `config.mk' has been created). It uses the built-in $(RM) command of
|
# `config.mk' has been created). It uses the built-in $(RM) command of
|
||||||
|
|
@ -127,12 +139,12 @@ ifdef check_platform
|
||||||
ifneq ($(is_unix),)
|
ifneq ($(is_unix),)
|
||||||
|
|
||||||
distclean:
|
distclean:
|
||||||
$(RM) builds/unix/config.cache
|
$(RM) $(TOP_DIR)/builds/unix/config.cache
|
||||||
$(RM) builds/unix/config.log
|
$(RM) $(TOP_DIR)/builds/unix/config.log
|
||||||
$(RM) builds/unix/config.status
|
$(RM) $(TOP_DIR)/builds/unix/config.status
|
||||||
$(RM) builds/unix/unix-def.mk
|
$(RM) $(TOP_DIR)/builds/unix/unix-def.mk
|
||||||
$(RM) builds/unix/unix-cc.mk
|
$(RM) $(TOP_DIR)/builds/unix/unix-cc.mk
|
||||||
$(RM) builds/unix/freetype2.pc
|
$(RM) $(TOP_DIR)/builds/unix/freetype2.pc
|
||||||
$(RM) nul
|
$(RM) nul
|
||||||
|
|
||||||
endif # test is_unix
|
endif # test is_unix
|
||||||
|
|
@ -154,6 +166,23 @@ else
|
||||||
endif # test check_platform
|
endif # test check_platform
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: check_out_submodule copy_submodule
|
||||||
|
|
||||||
|
check_out_submodule:
|
||||||
|
$(info Checking out submodule in `subprojects/dlg')
|
||||||
|
git --git-dir=$(TOP_DIR) submodule init
|
||||||
|
git --git-dir=$(TOP_DIR) submodule update
|
||||||
|
|
||||||
|
copy_submodule:
|
||||||
|
$(info Copying files from `subprojects/dlg' to `src/dlg' and `include/dlg')
|
||||||
|
ifeq ($(wildcard $(TOP_DIR)/include/dlg),)
|
||||||
|
mkdir $(subst /,$(SEP),$(TOP_DIR)/include/dlg)
|
||||||
|
endif
|
||||||
|
$(COPY) $(subst /,$(SEP),$(TOP_DIR)/subprojects/dlg/include/dlg/output.h $(TOP_DIR)/include/dlg)
|
||||||
|
$(COPY) $(subst /,$(SEP),$(TOP_DIR)/subprojects/dlg/include/dlg/dlg.h $(TOP_DIR)/include/dlg)
|
||||||
|
$(COPY) $(subst /,$(SEP),$(TOP_DIR)/subprojects/dlg/src/dlg/dlg.c $(TOP_DIR)/src/dlg)
|
||||||
|
|
||||||
|
|
||||||
# We always need the list of modules in ftmodule.h.
|
# We always need the list of modules in ftmodule.h.
|
||||||
#
|
#
|
||||||
all setup: $(FTMODULE_H)
|
all setup: $(FTMODULE_H)
|
||||||
|
|
@ -191,13 +220,14 @@ work := $(word 2,$(work))
|
||||||
patch := $(subst |,$(space),$(work))
|
patch := $(subst |,$(space),$(work))
|
||||||
patch := $(firstword $(patch))
|
patch := $(firstword $(patch))
|
||||||
|
|
||||||
ifneq ($(findstring x0x,x$(patch)x),)
|
# ifneq ($(findstring x0x,x$(patch)x),)
|
||||||
version := $(major).$(minor)
|
# version := $(major).$(minor)
|
||||||
winversion := $(major)$(minor)
|
# winversion := $(major)$(minor)
|
||||||
else
|
# else
|
||||||
version := $(major).$(minor).$(patch)
|
version := $(major).$(minor).$(patch)
|
||||||
winversion := $(major)$(minor)$(patch)
|
winversion := $(major)$(minor)$(patch)
|
||||||
endif
|
version_tag := VER-$(major)-$(minor)-$(patch)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
|
||||||
# This target builds the tarballs.
|
# This target builds the tarballs.
|
||||||
|
|
@ -208,7 +238,7 @@ endif
|
||||||
dist:
|
dist:
|
||||||
-rm -rf tmp
|
-rm -rf tmp
|
||||||
rm -f freetype-$(version).tar.gz
|
rm -f freetype-$(version).tar.gz
|
||||||
rm -f freetype-$(version).tar.bz2
|
rm -f freetype-$(version).tar.xz
|
||||||
rm -f ft$(winversion).zip
|
rm -f ft$(winversion).zip
|
||||||
|
|
||||||
for d in `find . -wholename '*/.git' -prune \
|
for d in `find . -wholename '*/.git' -prune \
|
||||||
|
|
@ -219,30 +249,26 @@ dist:
|
||||||
|
|
||||||
currdir=`pwd` ; \
|
currdir=`pwd` ; \
|
||||||
for f in `find . -wholename '*/.git' -prune \
|
for f in `find . -wholename '*/.git' -prune \
|
||||||
|
-o -name .gitattributes \
|
||||||
-o -name .gitignore \
|
-o -name .gitignore \
|
||||||
|
-o -name .gitlab-ci.yml \
|
||||||
|
-o -name .gitmodules \
|
||||||
-o -name .mailmap \
|
-o -name .mailmap \
|
||||||
-o -type d \
|
-o -type d \
|
||||||
-o -print` ; do \
|
-o -print` ; do \
|
||||||
ln -s $$currdir/$$f tmp/$$f ; \
|
ln -s $$currdir/$$f tmp/$$f ; \
|
||||||
done
|
done
|
||||||
|
|
||||||
@# Prevent generation of .pyc files. Python follows (soft) links if
|
|
||||||
@# the link's directory is write protected, so we have temporarily
|
|
||||||
@# disable write access here too.
|
|
||||||
chmod -w src/tools/docmaker
|
|
||||||
|
|
||||||
cd tmp ; \
|
cd tmp ; \
|
||||||
$(MAKE) devel ; \
|
$(MAKE) devel ; \
|
||||||
$(MAKE) do-dist
|
$(MAKE) do-dist
|
||||||
|
|
||||||
chmod +w src/tools/docmaker
|
|
||||||
|
|
||||||
mv tmp freetype-$(version)
|
mv tmp freetype-$(version)
|
||||||
|
|
||||||
tar -H ustar -chf - freetype-$(version) \
|
tar -H ustar -chf - freetype-$(version) \
|
||||||
| gzip -9 -c > freetype-$(version).tar.gz
|
| gzip -9 -c > freetype-$(version).tar.gz
|
||||||
tar -H ustar -chf - freetype-$(version) \
|
tar -H ustar -chf - freetype-$(version) \
|
||||||
| bzip2 -c > freetype-$(version).tar.bz2
|
| xz -c > freetype-$(version).tar.xz
|
||||||
|
|
||||||
@# Use CR/LF for zip files.
|
@# Use CR/LF for zip files.
|
||||||
zip -lr9 ft$(winversion).zip freetype-$(version)
|
zip -lr9 ft$(winversion).zip freetype-$(version)
|
||||||
|
|
@ -257,6 +283,10 @@ dist:
|
||||||
CONFIG_GUESS = ~/git/config/config.guess
|
CONFIG_GUESS = ~/git/config/config.guess
|
||||||
CONFIG_SUB = ~/git/config/config.sub
|
CONFIG_SUB = ~/git/config/config.sub
|
||||||
|
|
||||||
|
# We also use this repository to access the gnulib script that converts git
|
||||||
|
# commit messages to a ChangeLog file.
|
||||||
|
CHANGELOG_SCRIPT = ~/git/config/gitlog-to-changelog
|
||||||
|
|
||||||
|
|
||||||
# Don't say `make do-dist'. Always use `make dist' instead.
|
# Don't say `make do-dist'. Always use `make dist' instead.
|
||||||
#
|
#
|
||||||
|
|
@ -264,14 +294,29 @@ CONFIG_SUB = ~/git/config/config.sub
|
||||||
|
|
||||||
do-dist: distclean refdoc
|
do-dist: distclean refdoc
|
||||||
@# Without removing the files, `autoconf' and friends follow links.
|
@# Without removing the files, `autoconf' and friends follow links.
|
||||||
rm -f builds/unix/aclocal.m4
|
rm -f $(TOP_DIR)/builds/unix/aclocal.m4
|
||||||
rm -f builds/unix/configure.ac
|
rm -f $(TOP_DIR)/builds/unix/configure.ac
|
||||||
rm -f builds/unix/configure
|
rm -f $(TOP_DIR)/builds/unix/configure
|
||||||
|
|
||||||
sh autogen.sh
|
sh autogen.sh
|
||||||
rm -rf builds/unix/autom4te.cache
|
rm -rf $(TOP_DIR)/builds/unix/autom4te.cache
|
||||||
|
|
||||||
cp $(CONFIG_GUESS) builds/unix
|
cp $(CONFIG_GUESS) $(TOP_DIR)/builds/unix
|
||||||
cp $(CONFIG_SUB) builds/unix
|
cp $(CONFIG_SUB) $(TOP_DIR)/builds/unix
|
||||||
|
|
||||||
|
@# Generate `ChangeLog' file with commits since release 2.11.0
|
||||||
|
@# (when we stopped creating this file manually).
|
||||||
|
$(CHANGELOG_SCRIPT) \
|
||||||
|
--format='%B%n' \
|
||||||
|
--no-cluster \
|
||||||
|
-- VER-2-11-0..$(version_tag) \
|
||||||
|
> ChangeLog
|
||||||
|
|
||||||
|
@# Remove intermediate files created by the `refdoc' target.
|
||||||
|
rm -rf $(TOP_DIR)/docs/markdown
|
||||||
|
rm -f $(TOP_DIR)/docs/mkdocs.yml
|
||||||
|
|
||||||
|
@# Remove more stuff related to git.
|
||||||
|
rm -rf $(TOP_DIR)/subprojects/dlg
|
||||||
|
|
||||||
# EOF
|
# EOF
|
||||||
|
|
|
||||||
372
modules/freetype2/builds/unix/aclocal.m4
vendored
372
modules/freetype2/builds/unix/aclocal.m4
vendored
|
|
@ -1,6 +1,6 @@
|
||||||
# generated automatically by aclocal 1.15 -*- Autoconf -*-
|
# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
|
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
|
|
@ -14,7 +14,8 @@
|
||||||
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_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
|
||||||
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
|
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
|
# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
# Written by Gordon Matzigkeit, 1996
|
# Written by Gordon Matzigkeit, 1996
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation gives
|
# This file is free software; the Free Software Foundation gives
|
||||||
|
|
@ -45,7 +46,7 @@ m4_define([_LT_COPYING], [dnl
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
])
|
])
|
||||||
|
|
||||||
# serial 58 LT_INIT
|
# serial 59 LT_INIT
|
||||||
|
|
||||||
|
|
||||||
# LT_PREREQ(VERSION)
|
# LT_PREREQ(VERSION)
|
||||||
|
|
@ -195,6 +196,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
|
||||||
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
|
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
|
||||||
m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
|
m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
|
||||||
m4_require([_LT_CMD_RELOAD])dnl
|
m4_require([_LT_CMD_RELOAD])dnl
|
||||||
|
m4_require([_LT_DECL_FILECMD])dnl
|
||||||
m4_require([_LT_CHECK_MAGIC_METHOD])dnl
|
m4_require([_LT_CHECK_MAGIC_METHOD])dnl
|
||||||
m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
|
m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
|
||||||
m4_require([_LT_CMD_OLD_ARCHIVE])dnl
|
m4_require([_LT_CMD_OLD_ARCHIVE])dnl
|
||||||
|
|
@ -233,8 +235,8 @@ esac
|
||||||
ofile=libtool
|
ofile=libtool
|
||||||
can_build_shared=yes
|
can_build_shared=yes
|
||||||
|
|
||||||
# All known linkers require a '.a' archive for static linking (except MSVC,
|
# All known linkers require a '.a' archive for static linking (except MSVC and
|
||||||
# which needs '.lib').
|
# ICC, which need '.lib').
|
||||||
libext=a
|
libext=a
|
||||||
|
|
||||||
with_gnu_ld=$lt_cv_prog_gnu_ld
|
with_gnu_ld=$lt_cv_prog_gnu_ld
|
||||||
|
|
@ -736,7 +738,6 @@ _LT_CONFIG_SAVE_COMMANDS([
|
||||||
cat <<_LT_EOF >> "$cfgfile"
|
cat <<_LT_EOF >> "$cfgfile"
|
||||||
#! $SHELL
|
#! $SHELL
|
||||||
# Generated automatically by $as_me ($PACKAGE) $VERSION
|
# Generated automatically by $as_me ($PACKAGE) $VERSION
|
||||||
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
|
|
||||||
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
|
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
|
||||||
|
|
||||||
# Provide generalized library-building support services.
|
# Provide generalized library-building support services.
|
||||||
|
|
@ -786,7 +787,7 @@ _LT_EOF
|
||||||
# if finds mixed CR/LF and LF-only lines. Since sed operates in
|
# if finds mixed CR/LF and LF-only lines. Since sed operates in
|
||||||
# text mode, it properly converts lines to CR/LF. This bash problem
|
# text mode, it properly converts lines to CR/LF. This bash problem
|
||||||
# is reportedly fixed, but why not run on old versions too?
|
# is reportedly fixed, but why not run on old versions too?
|
||||||
sed '$q' "$ltmain" >> "$cfgfile" \
|
$SED '$q' "$ltmain" >> "$cfgfile" \
|
||||||
|| (rm -f "$cfgfile"; exit 1)
|
|| (rm -f "$cfgfile"; exit 1)
|
||||||
|
|
||||||
mv -f "$cfgfile" "$ofile" ||
|
mv -f "$cfgfile" "$ofile" ||
|
||||||
|
|
@ -1048,8 +1049,8 @@ int forced_loaded() { return 2;}
|
||||||
_LT_EOF
|
_LT_EOF
|
||||||
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
|
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
|
||||||
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
|
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
|
||||||
echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
|
echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
|
||||||
$AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
|
$AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
|
||||||
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
|
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
|
||||||
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
|
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
|
||||||
cat > conftest.c << _LT_EOF
|
cat > conftest.c << _LT_EOF
|
||||||
|
|
@ -1073,17 +1074,12 @@ _LT_EOF
|
||||||
_lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
|
_lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
|
||||||
darwin1.*)
|
darwin1.*)
|
||||||
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
|
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
|
||||||
darwin*) # darwin 5.x on
|
darwin*)
|
||||||
# if running on 10.5 or later, the deployment target defaults
|
case $MACOSX_DEPLOYMENT_TARGET,$host in
|
||||||
# to the OS version, if on x86, and 10.4, the deployment
|
10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
|
||||||
# target defaults to 10.4. Don't you love it?
|
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
|
||||||
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
|
*)
|
||||||
10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
|
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
|
||||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
|
|
||||||
10.[[012]][[,.]]*)
|
|
||||||
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
|
|
||||||
10.*)
|
|
||||||
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
|
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -1132,12 +1128,12 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
|
||||||
output_verbose_link_cmd=func_echo_all
|
output_verbose_link_cmd=func_echo_all
|
||||||
_LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
|
_LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
|
||||||
_LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
|
_LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
|
||||||
_LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
|
_LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
|
||||||
_LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
|
_LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
|
||||||
m4_if([$1], [CXX],
|
m4_if([$1], [CXX],
|
||||||
[ if test yes != "$lt_cv_apple_cc_single_mod"; then
|
[ if test yes != "$lt_cv_apple_cc_single_mod"; then
|
||||||
_LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
|
_LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
|
||||||
_LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
|
_LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
|
||||||
fi
|
fi
|
||||||
],[])
|
],[])
|
||||||
else
|
else
|
||||||
|
|
@ -1251,7 +1247,8 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
|
||||||
# _LT_WITH_SYSROOT
|
# _LT_WITH_SYSROOT
|
||||||
# ----------------
|
# ----------------
|
||||||
AC_DEFUN([_LT_WITH_SYSROOT],
|
AC_DEFUN([_LT_WITH_SYSROOT],
|
||||||
[AC_MSG_CHECKING([for sysroot])
|
[m4_require([_LT_DECL_SED])dnl
|
||||||
|
AC_MSG_CHECKING([for sysroot])
|
||||||
AC_ARG_WITH([sysroot],
|
AC_ARG_WITH([sysroot],
|
||||||
[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
|
[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
|
||||||
[Search for dependent libraries within DIR (or the compiler's sysroot
|
[Search for dependent libraries within DIR (or the compiler's sysroot
|
||||||
|
|
@ -1268,7 +1265,7 @@ case $with_sysroot in #(
|
||||||
fi
|
fi
|
||||||
;; #(
|
;; #(
|
||||||
/*)
|
/*)
|
||||||
lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
|
lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
|
||||||
;; #(
|
;; #(
|
||||||
no|'')
|
no|'')
|
||||||
;; #(
|
;; #(
|
||||||
|
|
@ -1298,7 +1295,7 @@ ia64-*-hpux*)
|
||||||
# options accordingly.
|
# options accordingly.
|
||||||
echo 'int i;' > conftest.$ac_ext
|
echo 'int i;' > conftest.$ac_ext
|
||||||
if AC_TRY_EVAL(ac_compile); then
|
if AC_TRY_EVAL(ac_compile); then
|
||||||
case `/usr/bin/file conftest.$ac_objext` in
|
case `$FILECMD conftest.$ac_objext` in
|
||||||
*ELF-32*)
|
*ELF-32*)
|
||||||
HPUX_IA64_MODE=32
|
HPUX_IA64_MODE=32
|
||||||
;;
|
;;
|
||||||
|
|
@ -1315,7 +1312,7 @@ ia64-*-hpux*)
|
||||||
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
|
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
|
||||||
if AC_TRY_EVAL(ac_compile); then
|
if AC_TRY_EVAL(ac_compile); then
|
||||||
if test yes = "$lt_cv_prog_gnu_ld"; then
|
if test yes = "$lt_cv_prog_gnu_ld"; then
|
||||||
case `/usr/bin/file conftest.$ac_objext` in
|
case `$FILECMD conftest.$ac_objext` in
|
||||||
*32-bit*)
|
*32-bit*)
|
||||||
LD="${LD-ld} -melf32bsmip"
|
LD="${LD-ld} -melf32bsmip"
|
||||||
;;
|
;;
|
||||||
|
|
@ -1327,7 +1324,7 @@ ia64-*-hpux*)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
case `/usr/bin/file conftest.$ac_objext` in
|
case `$FILECMD conftest.$ac_objext` in
|
||||||
*32-bit*)
|
*32-bit*)
|
||||||
LD="${LD-ld} -32"
|
LD="${LD-ld} -32"
|
||||||
;;
|
;;
|
||||||
|
|
@ -1349,7 +1346,7 @@ mips64*-*linux*)
|
||||||
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
|
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
|
||||||
if AC_TRY_EVAL(ac_compile); then
|
if AC_TRY_EVAL(ac_compile); then
|
||||||
emul=elf
|
emul=elf
|
||||||
case `/usr/bin/file conftest.$ac_objext` in
|
case `$FILECMD conftest.$ac_objext` in
|
||||||
*32-bit*)
|
*32-bit*)
|
||||||
emul="${emul}32"
|
emul="${emul}32"
|
||||||
;;
|
;;
|
||||||
|
|
@ -1357,7 +1354,7 @@ mips64*-*linux*)
|
||||||
emul="${emul}64"
|
emul="${emul}64"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
case `/usr/bin/file conftest.$ac_objext` in
|
case `$FILECMD conftest.$ac_objext` in
|
||||||
*MSB*)
|
*MSB*)
|
||||||
emul="${emul}btsmip"
|
emul="${emul}btsmip"
|
||||||
;;
|
;;
|
||||||
|
|
@ -1365,7 +1362,7 @@ mips64*-*linux*)
|
||||||
emul="${emul}ltsmip"
|
emul="${emul}ltsmip"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
case `/usr/bin/file conftest.$ac_objext` in
|
case `$FILECMD conftest.$ac_objext` in
|
||||||
*N32*)
|
*N32*)
|
||||||
emul="${emul}n32"
|
emul="${emul}n32"
|
||||||
;;
|
;;
|
||||||
|
|
@ -1385,14 +1382,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
|
||||||
# not appear in the list.
|
# not appear in the list.
|
||||||
echo 'int i;' > conftest.$ac_ext
|
echo 'int i;' > conftest.$ac_ext
|
||||||
if AC_TRY_EVAL(ac_compile); then
|
if AC_TRY_EVAL(ac_compile); then
|
||||||
case `/usr/bin/file conftest.o` in
|
case `$FILECMD conftest.o` in
|
||||||
*32-bit*)
|
*32-bit*)
|
||||||
case $host in
|
case $host in
|
||||||
x86_64-*kfreebsd*-gnu)
|
x86_64-*kfreebsd*-gnu)
|
||||||
LD="${LD-ld} -m elf_i386_fbsd"
|
LD="${LD-ld} -m elf_i386_fbsd"
|
||||||
;;
|
;;
|
||||||
x86_64-*linux*)
|
x86_64-*linux*)
|
||||||
case `/usr/bin/file conftest.o` in
|
case `$FILECMD conftest.o` in
|
||||||
*x86-64*)
|
*x86-64*)
|
||||||
LD="${LD-ld} -m elf32_x86_64"
|
LD="${LD-ld} -m elf32_x86_64"
|
||||||
;;
|
;;
|
||||||
|
|
@ -1460,7 +1457,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
|
||||||
# options accordingly.
|
# options accordingly.
|
||||||
echo 'int i;' > conftest.$ac_ext
|
echo 'int i;' > conftest.$ac_ext
|
||||||
if AC_TRY_EVAL(ac_compile); then
|
if AC_TRY_EVAL(ac_compile); then
|
||||||
case `/usr/bin/file conftest.o` in
|
case `$FILECMD conftest.o` in
|
||||||
*64-bit*)
|
*64-bit*)
|
||||||
case $lt_cv_prog_gnu_ld in
|
case $lt_cv_prog_gnu_ld in
|
||||||
yes*)
|
yes*)
|
||||||
|
|
@ -1499,9 +1496,22 @@ need_locks=$enable_libtool_lock
|
||||||
m4_defun([_LT_PROG_AR],
|
m4_defun([_LT_PROG_AR],
|
||||||
[AC_CHECK_TOOLS(AR, [ar], false)
|
[AC_CHECK_TOOLS(AR, [ar], false)
|
||||||
: ${AR=ar}
|
: ${AR=ar}
|
||||||
: ${AR_FLAGS=cru}
|
|
||||||
_LT_DECL([], [AR], [1], [The archiver])
|
_LT_DECL([], [AR], [1], [The archiver])
|
||||||
_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
|
|
||||||
|
# Use ARFLAGS variable as AR's operation code to sync the variable naming with
|
||||||
|
# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
|
||||||
|
# higher priority because thats what people were doing historically (setting
|
||||||
|
# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
|
||||||
|
# variable obsoleted/removed.
|
||||||
|
|
||||||
|
test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
|
||||||
|
lt_ar_flags=$AR_FLAGS
|
||||||
|
_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
|
||||||
|
|
||||||
|
# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
|
||||||
|
# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
|
||||||
|
_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
|
||||||
|
[Flags to create an archive])
|
||||||
|
|
||||||
AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
|
AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
|
||||||
[lt_cv_ar_at_file=no
|
[lt_cv_ar_at_file=no
|
||||||
|
|
@ -1720,7 +1730,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
|
||||||
lt_cv_sys_max_cmd_len=8192;
|
lt_cv_sys_max_cmd_len=8192;
|
||||||
;;
|
;;
|
||||||
|
|
||||||
bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
|
bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
|
||||||
# This has been around since 386BSD, at least. Likely further.
|
# This has been around since 386BSD, at least. Likely further.
|
||||||
if test -x /sbin/sysctl; then
|
if test -x /sbin/sysctl; then
|
||||||
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
|
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
|
||||||
|
|
@ -1763,7 +1773,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
|
||||||
sysv5* | sco5v6* | sysv4.2uw2*)
|
sysv5* | sco5v6* | sysv4.2uw2*)
|
||||||
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
|
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
|
||||||
if test -n "$kargmax"; then
|
if test -n "$kargmax"; then
|
||||||
lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
|
lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'`
|
||||||
else
|
else
|
||||||
lt_cv_sys_max_cmd_len=32768
|
lt_cv_sys_max_cmd_len=32768
|
||||||
fi
|
fi
|
||||||
|
|
@ -2213,26 +2223,35 @@ m4_defun([_LT_CMD_STRIPLIB],
|
||||||
striplib=
|
striplib=
|
||||||
old_striplib=
|
old_striplib=
|
||||||
AC_MSG_CHECKING([whether stripping libraries is possible])
|
AC_MSG_CHECKING([whether stripping libraries is possible])
|
||||||
if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
|
if test -z "$STRIP"; then
|
||||||
test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
|
AC_MSG_RESULT([no])
|
||||||
test -z "$striplib" && striplib="$STRIP --strip-unneeded"
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
else
|
else
|
||||||
# FIXME - insert some real tests, host_os isn't really good enough
|
if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
|
||||||
case $host_os in
|
old_striplib="$STRIP --strip-debug"
|
||||||
darwin*)
|
striplib="$STRIP --strip-unneeded"
|
||||||
if test -n "$STRIP"; then
|
AC_MSG_RESULT([yes])
|
||||||
|
else
|
||||||
|
case $host_os in
|
||||||
|
darwin*)
|
||||||
|
# FIXME - insert some real tests, host_os isn't really good enough
|
||||||
striplib="$STRIP -x"
|
striplib="$STRIP -x"
|
||||||
old_striplib="$STRIP -S"
|
old_striplib="$STRIP -S"
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
else
|
;;
|
||||||
|
freebsd*)
|
||||||
|
if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
|
||||||
|
old_striplib="$STRIP --strip-debug"
|
||||||
|
striplib="$STRIP --strip-unneeded"
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
fi
|
;;
|
||||||
;;
|
esac
|
||||||
*)
|
fi
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
fi
|
||||||
_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
|
_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
|
||||||
_LT_DECL([], [striplib], [1])
|
_LT_DECL([], [striplib], [1])
|
||||||
|
|
@ -2555,7 +2574,7 @@ cygwin* | mingw* | pw32* | cegcc*)
|
||||||
case $host_os in
|
case $host_os in
|
||||||
cygwin*)
|
cygwin*)
|
||||||
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
|
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
|
||||||
soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||||
m4_if([$1], [],[
|
m4_if([$1], [],[
|
||||||
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
|
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
|
||||||
;;
|
;;
|
||||||
|
|
@ -2565,14 +2584,14 @@ m4_if([$1], [],[
|
||||||
;;
|
;;
|
||||||
pw32*)
|
pw32*)
|
||||||
# pw32 DLLs use 'pw' prefix rather than 'lib'
|
# pw32 DLLs use 'pw' prefix rather than 'lib'
|
||||||
library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
dynamic_linker='Win32 ld.exe'
|
dynamic_linker='Win32 ld.exe'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*,cl*)
|
*,cl* | *,icl*)
|
||||||
# Native MSVC
|
# Native MSVC or ICC
|
||||||
libname_spec='$name'
|
libname_spec='$name'
|
||||||
soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
|
||||||
library_names_spec='$libname.dll.lib'
|
library_names_spec='$libname.dll.lib'
|
||||||
|
|
@ -2591,7 +2610,7 @@ m4_if([$1], [],[
|
||||||
done
|
done
|
||||||
IFS=$lt_save_ifs
|
IFS=$lt_save_ifs
|
||||||
# Convert to MSYS style.
|
# Convert to MSYS style.
|
||||||
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
|
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
|
||||||
;;
|
;;
|
||||||
cygwin*)
|
cygwin*)
|
||||||
# Convert to unix form, then to dos form, then back to unix form
|
# Convert to unix form, then to dos form, then back to unix form
|
||||||
|
|
@ -2628,7 +2647,7 @@ m4_if([$1], [],[
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
# Assume MSVC wrapper
|
# Assume MSVC and ICC wrapper
|
||||||
library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
|
library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
|
||||||
dynamic_linker='Win32 ld.exe'
|
dynamic_linker='Win32 ld.exe'
|
||||||
;;
|
;;
|
||||||
|
|
@ -2661,7 +2680,7 @@ dgux*)
|
||||||
shlibpath_var=LD_LIBRARY_PATH
|
shlibpath_var=LD_LIBRARY_PATH
|
||||||
;;
|
;;
|
||||||
|
|
||||||
freebsd* | dragonfly*)
|
freebsd* | dragonfly* | midnightbsd*)
|
||||||
# DragonFly does not have aout. When/if they implement a new
|
# DragonFly does not have aout. When/if they implement a new
|
||||||
# versioning mechanism, adjust this.
|
# versioning mechanism, adjust this.
|
||||||
if test -x /usr/bin/objformat; then
|
if test -x /usr/bin/objformat; then
|
||||||
|
|
@ -3460,7 +3479,7 @@ beos*)
|
||||||
|
|
||||||
bsdi[[45]]*)
|
bsdi[[45]]*)
|
||||||
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
|
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
|
||||||
lt_cv_file_magic_cmd='/usr/bin/file -L'
|
lt_cv_file_magic_cmd='$FILECMD -L'
|
||||||
lt_cv_file_magic_test_file=/shlib/libc.so
|
lt_cv_file_magic_test_file=/shlib/libc.so
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -3494,14 +3513,14 @@ darwin* | rhapsody*)
|
||||||
lt_cv_deplibs_check_method=pass_all
|
lt_cv_deplibs_check_method=pass_all
|
||||||
;;
|
;;
|
||||||
|
|
||||||
freebsd* | dragonfly*)
|
freebsd* | dragonfly* | midnightbsd*)
|
||||||
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
|
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
|
||||||
case $host_cpu in
|
case $host_cpu in
|
||||||
i*86 )
|
i*86 )
|
||||||
# Not sure whether the presence of OpenBSD here was a mistake.
|
# Not sure whether the presence of OpenBSD here was a mistake.
|
||||||
# Let's accept both of them until this is cleared up.
|
# Let's accept both of them until this is cleared up.
|
||||||
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
|
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
|
||||||
lt_cv_file_magic_cmd=/usr/bin/file
|
lt_cv_file_magic_cmd=$FILECMD
|
||||||
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
|
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -3515,7 +3534,7 @@ haiku*)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
hpux10.20* | hpux11*)
|
hpux10.20* | hpux11*)
|
||||||
lt_cv_file_magic_cmd=/usr/bin/file
|
lt_cv_file_magic_cmd=$FILECMD
|
||||||
case $host_cpu in
|
case $host_cpu in
|
||||||
ia64*)
|
ia64*)
|
||||||
lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
|
lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
|
||||||
|
|
@ -3562,7 +3581,7 @@ netbsd*)
|
||||||
|
|
||||||
newos6*)
|
newos6*)
|
||||||
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
|
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
|
||||||
lt_cv_file_magic_cmd=/usr/bin/file
|
lt_cv_file_magic_cmd=$FILECMD
|
||||||
lt_cv_file_magic_test_file=/usr/lib/libnls.so
|
lt_cv_file_magic_test_file=/usr/lib/libnls.so
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -3689,13 +3708,13 @@ else
|
||||||
mingw*) lt_bad_file=conftest.nm/nofile ;;
|
mingw*) lt_bad_file=conftest.nm/nofile ;;
|
||||||
*) lt_bad_file=/dev/null ;;
|
*) lt_bad_file=/dev/null ;;
|
||||||
esac
|
esac
|
||||||
case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
|
case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
|
||||||
*$lt_bad_file* | *'Invalid file or object type'*)
|
*$lt_bad_file* | *'Invalid file or object type'*)
|
||||||
lt_cv_path_NM="$tmp_nm -B"
|
lt_cv_path_NM="$tmp_nm -B"
|
||||||
break 2
|
break 2
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
|
case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
|
||||||
*/dev/null*)
|
*/dev/null*)
|
||||||
lt_cv_path_NM="$tmp_nm -p"
|
lt_cv_path_NM="$tmp_nm -p"
|
||||||
break 2
|
break 2
|
||||||
|
|
@ -3721,7 +3740,7 @@ else
|
||||||
# Let the user override the test.
|
# Let the user override the test.
|
||||||
else
|
else
|
||||||
AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
|
AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
|
||||||
case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
|
case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
|
||||||
*COFF*)
|
*COFF*)
|
||||||
DUMPBIN="$DUMPBIN -symbols -headers"
|
DUMPBIN="$DUMPBIN -symbols -headers"
|
||||||
;;
|
;;
|
||||||
|
|
@ -3961,7 +3980,7 @@ esac
|
||||||
|
|
||||||
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
|
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
|
||||||
# Gets list of data symbols to import.
|
# Gets list of data symbols to import.
|
||||||
lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
|
lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
|
||||||
# Adjust the below global symbol transforms to fixup imported variables.
|
# Adjust the below global symbol transforms to fixup imported variables.
|
||||||
lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
|
lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
|
||||||
lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
|
lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
|
||||||
|
|
@ -3979,20 +3998,20 @@ fi
|
||||||
# Transform an extracted symbol line into a proper C declaration.
|
# Transform an extracted symbol line into a proper C declaration.
|
||||||
# Some systems (esp. on ia64) link data and code symbols differently,
|
# Some systems (esp. on ia64) link data and code symbols differently,
|
||||||
# so use this general approach.
|
# so use this general approach.
|
||||||
lt_cv_sys_global_symbol_to_cdecl="sed -n"\
|
lt_cv_sys_global_symbol_to_cdecl="$SED -n"\
|
||||||
$lt_cdecl_hook\
|
$lt_cdecl_hook\
|
||||||
" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
|
" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
|
||||||
" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
|
" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
|
||||||
|
|
||||||
# Transform an extracted symbol line into symbol name and symbol address
|
# Transform an extracted symbol line into symbol name and symbol address
|
||||||
lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
|
lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
|
||||||
$lt_c_name_hook\
|
$lt_c_name_hook\
|
||||||
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
|
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
|
||||||
" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
|
" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
|
||||||
|
|
||||||
# Transform an extracted symbol line into symbol name with lib prefix and
|
# Transform an extracted symbol line into symbol name with lib prefix and
|
||||||
# symbol address.
|
# symbol address.
|
||||||
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
|
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
|
||||||
$lt_c_name_lib_hook\
|
$lt_c_name_lib_hook\
|
||||||
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
|
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
|
||||||
" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
|
" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
|
||||||
|
|
@ -4016,7 +4035,7 @@ for ac_symprfx in "" "_"; do
|
||||||
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
|
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
|
||||||
# Fake it for dumpbin and say T for any non-static function,
|
# Fake it for dumpbin and say T for any non-static function,
|
||||||
# D for any global variable and I for any imported variable.
|
# D for any global variable and I for any imported variable.
|
||||||
# Also find C++ and __fastcall symbols from MSVC++,
|
# Also find C++ and __fastcall symbols from MSVC++ or ICC,
|
||||||
# which start with @ or ?.
|
# which start with @ or ?.
|
||||||
lt_cv_sys_global_symbol_pipe="$AWK ['"\
|
lt_cv_sys_global_symbol_pipe="$AWK ['"\
|
||||||
" {last_section=section; section=\$ 3};"\
|
" {last_section=section; section=\$ 3};"\
|
||||||
|
|
@ -4034,9 +4053,9 @@ for ac_symprfx in "" "_"; do
|
||||||
" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
|
" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
|
||||||
" ' prfx=^$ac_symprfx]"
|
" ' prfx=^$ac_symprfx]"
|
||||||
else
|
else
|
||||||
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
|
lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
|
||||||
fi
|
fi
|
||||||
lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
|
lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
|
||||||
|
|
||||||
# Check to see that the pipe works correctly.
|
# Check to see that the pipe works correctly.
|
||||||
pipe_works=no
|
pipe_works=no
|
||||||
|
|
@ -4323,7 +4342,7 @@ m4_if([$1], [CXX], [
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
freebsd* | dragonfly*)
|
freebsd* | dragonfly* | midnightbsd*)
|
||||||
# FreeBSD uses GNU C++
|
# FreeBSD uses GNU C++
|
||||||
;;
|
;;
|
||||||
hpux9* | hpux10* | hpux11*)
|
hpux9* | hpux10* | hpux11*)
|
||||||
|
|
@ -4406,7 +4425,7 @@ m4_if([$1], [CXX], [
|
||||||
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
|
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
case `$CC -V 2>&1 | sed 5q` in
|
case `$CC -V 2>&1 | $SED 5q` in
|
||||||
*Sun\ C*)
|
*Sun\ C*)
|
||||||
# Sun C++ 5.9
|
# Sun C++ 5.9
|
||||||
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
|
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
|
||||||
|
|
@ -4742,7 +4761,7 @@ m4_if([$1], [CXX], [
|
||||||
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
|
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
case `$CC -V 2>&1 | sed 5q` in
|
case `$CC -V 2>&1 | $SED 5q` in
|
||||||
*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
|
*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
|
||||||
# Sun Fortran 8.3 passes all unrecognized flags to the linker
|
# Sun Fortran 8.3 passes all unrecognized flags to the linker
|
||||||
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
|
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
|
||||||
|
|
@ -4925,7 +4944,7 @@ m4_if([$1], [CXX], [
|
||||||
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
|
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
|
||||||
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
|
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
|
||||||
else
|
else
|
||||||
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
|
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
pw32*)
|
pw32*)
|
||||||
|
|
@ -4933,7 +4952,7 @@ m4_if([$1], [CXX], [
|
||||||
;;
|
;;
|
||||||
cygwin* | mingw* | cegcc*)
|
cygwin* | mingw* | cegcc*)
|
||||||
case $cc_basename in
|
case $cc_basename in
|
||||||
cl*)
|
cl* | icl*)
|
||||||
_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
|
_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
@ -4990,15 +5009,15 @@ dnl Note also adjust exclude_expsyms for C++ above.
|
||||||
|
|
||||||
case $host_os in
|
case $host_os in
|
||||||
cygwin* | mingw* | pw32* | cegcc*)
|
cygwin* | mingw* | pw32* | cegcc*)
|
||||||
# FIXME: the MSVC++ port hasn't been tested in a loooong time
|
# FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
|
||||||
# When not using gcc, we currently assume that we are using
|
# When not using gcc, we currently assume that we are using
|
||||||
# Microsoft Visual C++.
|
# Microsoft Visual C++ or Intel C++ Compiler.
|
||||||
if test yes != "$GCC"; then
|
if test yes != "$GCC"; then
|
||||||
with_gnu_ld=no
|
with_gnu_ld=no
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
interix*)
|
interix*)
|
||||||
# we just hope/assume this is gcc and not c89 (= MSVC++)
|
# we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
|
||||||
with_gnu_ld=yes
|
with_gnu_ld=yes
|
||||||
;;
|
;;
|
||||||
openbsd* | bitrig*)
|
openbsd* | bitrig*)
|
||||||
|
|
@ -5050,7 +5069,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
|
||||||
_LT_TAGVAR(whole_archive_flag_spec, $1)=
|
_LT_TAGVAR(whole_archive_flag_spec, $1)=
|
||||||
fi
|
fi
|
||||||
supports_anon_versioning=no
|
supports_anon_versioning=no
|
||||||
case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
|
case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in
|
||||||
*GNU\ gold*) supports_anon_versioning=yes ;;
|
*GNU\ gold*) supports_anon_versioning=yes ;;
|
||||||
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
|
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
|
||||||
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
|
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
|
||||||
|
|
@ -5162,6 +5181,7 @@ _LT_EOF
|
||||||
emximp -o $lib $output_objdir/$libname.def'
|
emximp -o $lib $output_objdir/$libname.def'
|
||||||
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
|
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
|
||||||
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
|
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
|
||||||
|
_LT_TAGVAR(file_list_spec, $1)='@'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
interix[[3-9]]*)
|
interix[[3-9]]*)
|
||||||
|
|
@ -5176,7 +5196,7 @@ _LT_EOF
|
||||||
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
|
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
|
||||||
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
|
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
|
||||||
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
|
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
|
||||||
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
|
_LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
|
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||||
|
|
@ -5219,7 +5239,7 @@ _LT_EOF
|
||||||
_LT_TAGVAR(compiler_needs_object, $1)=yes
|
_LT_TAGVAR(compiler_needs_object, $1)=yes
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
case `$CC -V 2>&1 | sed 5q` in
|
case `$CC -V 2>&1 | $SED 5q` in
|
||||||
*Sun\ C*) # Sun C 5.9
|
*Sun\ C*) # Sun C 5.9
|
||||||
_LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
|
_LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
|
||||||
_LT_TAGVAR(compiler_needs_object, $1)=yes
|
_LT_TAGVAR(compiler_needs_object, $1)=yes
|
||||||
|
|
@ -5231,7 +5251,7 @@ _LT_EOF
|
||||||
|
|
||||||
if test yes = "$supports_anon_versioning"; then
|
if test yes = "$supports_anon_versioning"; then
|
||||||
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
|
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
|
||||||
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
|
cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
|
||||||
echo "local: *; };" >> $output_objdir/$libname.ver~
|
echo "local: *; };" >> $output_objdir/$libname.ver~
|
||||||
$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
|
$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
|
||||||
fi
|
fi
|
||||||
|
|
@ -5247,7 +5267,7 @@ _LT_EOF
|
||||||
_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
|
_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
|
||||||
if test yes = "$supports_anon_versioning"; then
|
if test yes = "$supports_anon_versioning"; then
|
||||||
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
|
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
|
||||||
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
|
cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
|
||||||
echo "local: *; };" >> $output_objdir/$libname.ver~
|
echo "local: *; };" >> $output_objdir/$libname.ver~
|
||||||
$LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
|
$LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
|
||||||
fi
|
fi
|
||||||
|
|
@ -5379,7 +5399,7 @@ _LT_EOF
|
||||||
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
|
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
|
||||||
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
|
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
|
||||||
else
|
else
|
||||||
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
|
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
|
||||||
fi
|
fi
|
||||||
aix_use_runtimelinking=no
|
aix_use_runtimelinking=no
|
||||||
|
|
||||||
|
|
@ -5562,12 +5582,12 @@ _LT_EOF
|
||||||
|
|
||||||
cygwin* | mingw* | pw32* | cegcc*)
|
cygwin* | mingw* | pw32* | cegcc*)
|
||||||
# When not using gcc, we currently assume that we are using
|
# When not using gcc, we currently assume that we are using
|
||||||
# Microsoft Visual C++.
|
# Microsoft Visual C++ or Intel C++ Compiler.
|
||||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||||
# no search path for DLLs.
|
# no search path for DLLs.
|
||||||
case $cc_basename in
|
case $cc_basename in
|
||||||
cl*)
|
cl* | icl*)
|
||||||
# Native MSVC
|
# Native MSVC or ICC
|
||||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
|
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
|
||||||
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
|
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
|
||||||
_LT_TAGVAR(always_export_symbols, $1)=yes
|
_LT_TAGVAR(always_export_symbols, $1)=yes
|
||||||
|
|
@ -5608,7 +5628,7 @@ _LT_EOF
|
||||||
fi'
|
fi'
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# Assume MSVC wrapper
|
# Assume MSVC and ICC wrapper
|
||||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
|
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
|
||||||
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
|
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
|
||||||
# Tell ltmain to make .lib files, not .a files.
|
# Tell ltmain to make .lib files, not .a files.
|
||||||
|
|
@ -5656,7 +5676,7 @@ _LT_EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
|
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
|
||||||
freebsd* | dragonfly*)
|
freebsd* | dragonfly* | midnightbsd*)
|
||||||
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
|
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
|
||||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
|
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
|
||||||
_LT_TAGVAR(hardcode_direct, $1)=yes
|
_LT_TAGVAR(hardcode_direct, $1)=yes
|
||||||
|
|
@ -5867,6 +5887,7 @@ _LT_EOF
|
||||||
emximp -o $lib $output_objdir/$libname.def'
|
emximp -o $lib $output_objdir/$libname.def'
|
||||||
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
|
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
|
||||||
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
|
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
|
||||||
|
_LT_TAGVAR(file_list_spec, $1)='@'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
osf3*)
|
osf3*)
|
||||||
|
|
@ -6633,8 +6654,8 @@ if test yes != "$_lt_caught_CXX_error"; then
|
||||||
|
|
||||||
cygwin* | mingw* | pw32* | cegcc*)
|
cygwin* | mingw* | pw32* | cegcc*)
|
||||||
case $GXX,$cc_basename in
|
case $GXX,$cc_basename in
|
||||||
,cl* | no,cl*)
|
,cl* | no,cl* | ,icl* | no,icl*)
|
||||||
# Native MSVC
|
# Native MSVC or ICC
|
||||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||||
# no search path for DLLs.
|
# no search path for DLLs.
|
||||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
|
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
|
||||||
|
|
@ -6732,6 +6753,7 @@ if test yes != "$_lt_caught_CXX_error"; then
|
||||||
emximp -o $lib $output_objdir/$libname.def'
|
emximp -o $lib $output_objdir/$libname.def'
|
||||||
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
|
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
|
||||||
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
|
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
|
||||||
|
_LT_TAGVAR(file_list_spec, $1)='@'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
dgux*)
|
dgux*)
|
||||||
|
|
@ -6762,7 +6784,7 @@ if test yes != "$_lt_caught_CXX_error"; then
|
||||||
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
|
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
|
||||||
;;
|
;;
|
||||||
|
|
||||||
freebsd* | dragonfly*)
|
freebsd* | dragonfly* | midnightbsd*)
|
||||||
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
|
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
|
||||||
# conventions
|
# conventions
|
||||||
_LT_TAGVAR(ld_shlibs, $1)=yes
|
_LT_TAGVAR(ld_shlibs, $1)=yes
|
||||||
|
|
@ -6899,7 +6921,7 @@ if test yes != "$_lt_caught_CXX_error"; then
|
||||||
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
|
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
|
||||||
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
|
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
|
||||||
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
|
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
|
||||||
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
|
_LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
|
||||||
;;
|
;;
|
||||||
irix5* | irix6*)
|
irix5* | irix6*)
|
||||||
case $cc_basename in
|
case $cc_basename in
|
||||||
|
|
@ -7039,13 +7061,13 @@ if test yes != "$_lt_caught_CXX_error"; then
|
||||||
_LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
|
_LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
|
||||||
if test yes = "$supports_anon_versioning"; then
|
if test yes = "$supports_anon_versioning"; then
|
||||||
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
|
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
|
||||||
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
|
cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
|
||||||
echo "local: *; };" >> $output_objdir/$libname.ver~
|
echo "local: *; };" >> $output_objdir/$libname.ver~
|
||||||
$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
|
$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
case `$CC -V 2>&1 | sed 5q` in
|
case `$CC -V 2>&1 | $SED 5q` in
|
||||||
*Sun\ C*)
|
*Sun\ C*)
|
||||||
# Sun C++ 5.9
|
# Sun C++ 5.9
|
||||||
_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
|
_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
|
||||||
|
|
@ -8183,6 +8205,14 @@ _LT_DECL([], [DLLTOOL], [1], [DLL creation program])
|
||||||
AC_SUBST([DLLTOOL])
|
AC_SUBST([DLLTOOL])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# _LT_DECL_FILECMD
|
||||||
|
# ----------------
|
||||||
|
# Check for a file(cmd) program that can be used to detect file type and magic
|
||||||
|
m4_defun([_LT_DECL_FILECMD],
|
||||||
|
[AC_CHECK_TOOL([FILECMD], [file], [:])
|
||||||
|
_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
|
||||||
|
])# _LD_DECL_FILECMD
|
||||||
|
|
||||||
# _LT_DECL_SED
|
# _LT_DECL_SED
|
||||||
# ------------
|
# ------------
|
||||||
# Check for a fully-functional sed program, that truncates
|
# Check for a fully-functional sed program, that truncates
|
||||||
|
|
@ -8360,124 +8390,10 @@ _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
|
||||||
[0], [convert $build files to toolchain format])dnl
|
[0], [convert $build files to toolchain format])dnl
|
||||||
])# _LT_PATH_CONVERSION_FUNCTIONS
|
])# _LT_PATH_CONVERSION_FUNCTIONS
|
||||||
|
|
||||||
# longlong.m4 serial 17
|
|
||||||
dnl Copyright (C) 1999-2007, 2009-2016 Free Software Foundation, Inc.
|
|
||||||
dnl This file is free software; the Free Software Foundation
|
|
||||||
dnl gives unlimited permission to copy and/or distribute it,
|
|
||||||
dnl with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
dnl From Paul Eggert.
|
|
||||||
|
|
||||||
# Define HAVE_LONG_LONG_INT if 'long long int' works.
|
|
||||||
# This fixes a bug in Autoconf 2.61, and can be faster
|
|
||||||
# than what's in Autoconf 2.62 through 2.68.
|
|
||||||
|
|
||||||
# Note: If the type 'long long int' exists but is only 32 bits large
|
|
||||||
# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
|
|
||||||
# defined. In this case you can treat 'long long int' like 'long int'.
|
|
||||||
|
|
||||||
AC_DEFUN([AC_TYPE_LONG_LONG_INT],
|
|
||||||
[
|
|
||||||
AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
|
|
||||||
AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
|
|
||||||
[ac_cv_type_long_long_int=yes
|
|
||||||
if test "x${ac_cv_prog_cc_c99-no}" = xno; then
|
|
||||||
ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
|
|
||||||
if test $ac_cv_type_long_long_int = yes; then
|
|
||||||
dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
|
|
||||||
dnl If cross compiling, assume the bug is not important, since
|
|
||||||
dnl nobody cross compiles for this platform as far as we know.
|
|
||||||
AC_RUN_IFELSE(
|
|
||||||
[AC_LANG_PROGRAM(
|
|
||||||
[[@%:@include <limits.h>
|
|
||||||
@%:@ifndef LLONG_MAX
|
|
||||||
@%:@ define HALF \
|
|
||||||
(1LL << (sizeof (long long int) * CHAR_BIT - 2))
|
|
||||||
@%:@ define LLONG_MAX (HALF - 1 + HALF)
|
|
||||||
@%:@endif]],
|
|
||||||
[[long long int n = 1;
|
|
||||||
int i;
|
|
||||||
for (i = 0; ; i++)
|
|
||||||
{
|
|
||||||
long long int m = n << i;
|
|
||||||
if (m >> i != n)
|
|
||||||
return 1;
|
|
||||||
if (LLONG_MAX / 2 < m)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;]])],
|
|
||||||
[],
|
|
||||||
[ac_cv_type_long_long_int=no],
|
|
||||||
[:])
|
|
||||||
fi
|
|
||||||
fi])
|
|
||||||
if test $ac_cv_type_long_long_int = yes; then
|
|
||||||
AC_DEFINE([HAVE_LONG_LONG_INT], [1],
|
|
||||||
[Define to 1 if the system has the type 'long long int'.])
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
|
|
||||||
# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
|
|
||||||
# This fixes a bug in Autoconf 2.61, and can be faster
|
|
||||||
# than what's in Autoconf 2.62 through 2.68.
|
|
||||||
|
|
||||||
# Note: If the type 'unsigned long long int' exists but is only 32 bits
|
|
||||||
# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
|
|
||||||
# will not be defined. In this case you can treat 'unsigned long long int'
|
|
||||||
# like 'unsigned long int'.
|
|
||||||
|
|
||||||
AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
|
|
||||||
[
|
|
||||||
AC_CACHE_CHECK([for unsigned long long int],
|
|
||||||
[ac_cv_type_unsigned_long_long_int],
|
|
||||||
[ac_cv_type_unsigned_long_long_int=yes
|
|
||||||
if test "x${ac_cv_prog_cc_c99-no}" = xno; then
|
|
||||||
AC_LINK_IFELSE(
|
|
||||||
[_AC_TYPE_LONG_LONG_SNIPPET],
|
|
||||||
[],
|
|
||||||
[ac_cv_type_unsigned_long_long_int=no])
|
|
||||||
fi])
|
|
||||||
if test $ac_cv_type_unsigned_long_long_int = yes; then
|
|
||||||
AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
|
|
||||||
[Define to 1 if the system has the type 'unsigned long long int'.])
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
|
|
||||||
# Expands to a C program that can be used to test for simultaneous support
|
|
||||||
# of 'long long' and 'unsigned long long'. We don't want to say that
|
|
||||||
# 'long long' is available if 'unsigned long long' is not, or vice versa,
|
|
||||||
# because too many programs rely on the symmetry between signed and unsigned
|
|
||||||
# integer types (excluding 'bool').
|
|
||||||
AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
|
|
||||||
[
|
|
||||||
AC_LANG_PROGRAM(
|
|
||||||
[[/* For now, do not test the preprocessor; as of 2007 there are too many
|
|
||||||
implementations with broken preprocessors. Perhaps this can
|
|
||||||
be revisited in 2012. In the meantime, code should not expect
|
|
||||||
#if to work with literals wider than 32 bits. */
|
|
||||||
/* Test literals. */
|
|
||||||
long long int ll = 9223372036854775807ll;
|
|
||||||
long long int nll = -9223372036854775807LL;
|
|
||||||
unsigned long long int ull = 18446744073709551615ULL;
|
|
||||||
/* Test constant expressions. */
|
|
||||||
typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
|
|
||||||
? 1 : -1)];
|
|
||||||
typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
|
|
||||||
? 1 : -1)];
|
|
||||||
int i = 63;]],
|
|
||||||
[[/* Test availability of runtime routines for shift and division. */
|
|
||||||
long long int llmax = 9223372036854775807ll;
|
|
||||||
unsigned long long int ullmax = 18446744073709551615ull;
|
|
||||||
return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
|
|
||||||
| (llmax / ll) | (llmax % ll)
|
|
||||||
| (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
|
|
||||||
| (ullmax / ull) | (ullmax % ull));]])
|
|
||||||
])
|
|
||||||
|
|
||||||
# Helper functions for option handling. -*- Autoconf -*-
|
# Helper functions for option handling. -*- Autoconf -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
|
# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
|
||||||
# Foundation, Inc.
|
# Software Foundation, Inc.
|
||||||
# Written by Gary V. Vaughan, 2004
|
# Written by Gary V. Vaughan, 2004
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation gives
|
# This file is free software; the Free Software Foundation gives
|
||||||
|
|
@ -8908,7 +8824,7 @@ LT_OPTION_DEFINE([LTDL_INIT], [convenience],
|
||||||
|
|
||||||
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
|
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
|
# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software
|
||||||
# Foundation, Inc.
|
# Foundation, Inc.
|
||||||
# Written by Gary V. Vaughan, 2004
|
# Written by Gary V. Vaughan, 2004
|
||||||
#
|
#
|
||||||
|
|
@ -9033,7 +8949,8 @@ m4_define([lt_dict_filter],
|
||||||
|
|
||||||
# ltversion.m4 -- version numbers -*- Autoconf -*-
|
# ltversion.m4 -- version numbers -*- Autoconf -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
|
# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation,
|
||||||
|
# Inc.
|
||||||
# Written by Scott James Remnant, 2004
|
# Written by Scott James Remnant, 2004
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation gives
|
# This file is free software; the Free Software Foundation gives
|
||||||
|
|
@ -9042,23 +8959,23 @@ m4_define([lt_dict_filter],
|
||||||
|
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# serial 4179 ltversion.m4
|
# serial 4245 ltversion.m4
|
||||||
# This file is part of GNU Libtool
|
# This file is part of GNU Libtool
|
||||||
|
|
||||||
m4_define([LT_PACKAGE_VERSION], [2.4.6])
|
m4_define([LT_PACKAGE_VERSION], [2.4.7])
|
||||||
m4_define([LT_PACKAGE_REVISION], [2.4.6])
|
m4_define([LT_PACKAGE_REVISION], [2.4.7])
|
||||||
|
|
||||||
AC_DEFUN([LTVERSION_VERSION],
|
AC_DEFUN([LTVERSION_VERSION],
|
||||||
[macro_version='2.4.6'
|
[macro_version='2.4.7'
|
||||||
macro_revision='2.4.6'
|
macro_revision='2.4.7'
|
||||||
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
|
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
|
||||||
_LT_DECL(, macro_revision, 0)
|
_LT_DECL(, macro_revision, 0)
|
||||||
])
|
])
|
||||||
|
|
||||||
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
|
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
|
# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free
|
||||||
# Foundation, Inc.
|
# Software Foundation, Inc.
|
||||||
# Written by Scott James Remnant, 2004.
|
# Written by Scott James Remnant, 2004.
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation gives
|
# This file is free software; the Free Software Foundation gives
|
||||||
|
|
@ -9155,5 +9072,8 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
|
||||||
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
|
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
|
||||||
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
|
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
|
||||||
|
|
||||||
|
m4_include([ax_compare_version.m4])
|
||||||
|
m4_include([ax_prog_python_version.m4])
|
||||||
|
m4_include([ax_pthread.m4])
|
||||||
m4_include([ft-munmap.m4])
|
m4_include([ft-munmap.m4])
|
||||||
m4_include([pkg.m4])
|
m4_include([pkg.m4])
|
||||||
|
|
|
||||||
177
modules/freetype2/builds/unix/ax_compare_version.m4
Normal file
177
modules/freetype2/builds/unix/ax_compare_version.m4
Normal file
|
|
@ -0,0 +1,177 @@
|
||||||
|
# ===========================================================================
|
||||||
|
# https://www.gnu.org/software/autoconf-archive/ax_compare_version.html
|
||||||
|
# ===========================================================================
|
||||||
|
#
|
||||||
|
# SYNOPSIS
|
||||||
|
#
|
||||||
|
# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
|
||||||
|
#
|
||||||
|
# DESCRIPTION
|
||||||
|
#
|
||||||
|
# This macro compares two version strings. Due to the various number of
|
||||||
|
# minor-version numbers that can exist, and the fact that string
|
||||||
|
# comparisons are not compatible with numeric comparisons, this is not
|
||||||
|
# necessarily trivial to do in a autoconf script. This macro makes doing
|
||||||
|
# these comparisons easy.
|
||||||
|
#
|
||||||
|
# The six basic comparisons are available, as well as checking equality
|
||||||
|
# limited to a certain number of minor-version levels.
|
||||||
|
#
|
||||||
|
# The operator OP determines what type of comparison to do, and can be one
|
||||||
|
# of:
|
||||||
|
#
|
||||||
|
# eq - equal (test A == B)
|
||||||
|
# ne - not equal (test A != B)
|
||||||
|
# le - less than or equal (test A <= B)
|
||||||
|
# ge - greater than or equal (test A >= B)
|
||||||
|
# lt - less than (test A < B)
|
||||||
|
# gt - greater than (test A > B)
|
||||||
|
#
|
||||||
|
# Additionally, the eq and ne operator can have a number after it to limit
|
||||||
|
# the test to that number of minor versions.
|
||||||
|
#
|
||||||
|
# eq0 - equal up to the length of the shorter version
|
||||||
|
# ne0 - not equal up to the length of the shorter version
|
||||||
|
# eqN - equal up to N sub-version levels
|
||||||
|
# neN - not equal up to N sub-version levels
|
||||||
|
#
|
||||||
|
# When the condition is true, shell commands ACTION-IF-TRUE are run,
|
||||||
|
# otherwise shell commands ACTION-IF-FALSE are run. The environment
|
||||||
|
# variable 'ax_compare_version' is always set to either 'true' or 'false'
|
||||||
|
# as well.
|
||||||
|
#
|
||||||
|
# Examples:
|
||||||
|
#
|
||||||
|
# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
|
||||||
|
# AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
|
||||||
|
#
|
||||||
|
# would both be true.
|
||||||
|
#
|
||||||
|
# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
|
||||||
|
# AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
|
||||||
|
#
|
||||||
|
# would both be false.
|
||||||
|
#
|
||||||
|
# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
|
||||||
|
#
|
||||||
|
# would be true because it is only comparing two minor versions.
|
||||||
|
#
|
||||||
|
# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
|
||||||
|
#
|
||||||
|
# would be true because it is only comparing the lesser number of minor
|
||||||
|
# versions of the two values.
|
||||||
|
#
|
||||||
|
# Note: The characters that separate the version numbers do not matter. An
|
||||||
|
# empty string is the same as version 0. OP is evaluated by autoconf, not
|
||||||
|
# configure, so must be a string, not a variable.
|
||||||
|
#
|
||||||
|
# The author would like to acknowledge Guido Draheim whose advice about
|
||||||
|
# the m4_case and m4_ifvaln functions make this macro only include the
|
||||||
|
# portions necessary to perform the specific comparison specified by the
|
||||||
|
# OP argument in the final configure script.
|
||||||
|
#
|
||||||
|
# LICENSE
|
||||||
|
#
|
||||||
|
# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
|
||||||
|
#
|
||||||
|
# Copying and distribution of this file, with or without modification, are
|
||||||
|
# permitted in any medium without royalty provided the copyright notice
|
||||||
|
# and this notice are preserved. This file is offered as-is, without any
|
||||||
|
# warranty.
|
||||||
|
|
||||||
|
#serial 13
|
||||||
|
|
||||||
|
dnl #########################################################################
|
||||||
|
AC_DEFUN([AX_COMPARE_VERSION], [
|
||||||
|
AC_REQUIRE([AC_PROG_AWK])
|
||||||
|
|
||||||
|
# Used to indicate true or false condition
|
||||||
|
ax_compare_version=false
|
||||||
|
|
||||||
|
# Convert the two version strings to be compared into a format that
|
||||||
|
# allows a simple string comparison. The end result is that a version
|
||||||
|
# string of the form 1.12.5-r617 will be converted to the form
|
||||||
|
# 0001001200050617. In other words, each number is zero padded to four
|
||||||
|
# digits, and non digits are removed.
|
||||||
|
AS_VAR_PUSHDEF([A],[ax_compare_version_A])
|
||||||
|
A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
|
||||||
|
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
|
||||||
|
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||||
|
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||||
|
-e 's/[[^0-9]]//g'`
|
||||||
|
|
||||||
|
AS_VAR_PUSHDEF([B],[ax_compare_version_B])
|
||||||
|
B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
|
||||||
|
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
|
||||||
|
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||||
|
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||||
|
-e 's/[[^0-9]]//g'`
|
||||||
|
|
||||||
|
dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
|
||||||
|
dnl # then the first line is used to determine if the condition is true.
|
||||||
|
dnl # The sed right after the echo is to remove any indented white space.
|
||||||
|
m4_case(m4_tolower($2),
|
||||||
|
[lt],[
|
||||||
|
ax_compare_version=`echo "x$A
|
||||||
|
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
|
||||||
|
],
|
||||||
|
[gt],[
|
||||||
|
ax_compare_version=`echo "x$A
|
||||||
|
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
|
||||||
|
],
|
||||||
|
[le],[
|
||||||
|
ax_compare_version=`echo "x$A
|
||||||
|
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
|
||||||
|
],
|
||||||
|
[ge],[
|
||||||
|
ax_compare_version=`echo "x$A
|
||||||
|
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
|
||||||
|
],[
|
||||||
|
dnl Split the operator from the subversion count if present.
|
||||||
|
m4_bmatch(m4_substr($2,2),
|
||||||
|
[0],[
|
||||||
|
# A count of zero means use the length of the shorter version.
|
||||||
|
# Determine the number of characters in A and B.
|
||||||
|
ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
|
||||||
|
ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
|
||||||
|
|
||||||
|
# Set A to no more than B's length and B to no more than A's length.
|
||||||
|
A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
|
||||||
|
B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
|
||||||
|
],
|
||||||
|
[[0-9]+],[
|
||||||
|
# A count greater than zero means use only that many subversions
|
||||||
|
A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
|
||||||
|
B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
|
||||||
|
],
|
||||||
|
[.+],[
|
||||||
|
AC_WARNING(
|
||||||
|
[invalid OP numeric parameter: $2])
|
||||||
|
],[])
|
||||||
|
|
||||||
|
# Pad zeros at end of numbers to make same length.
|
||||||
|
ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
|
||||||
|
B="$B`echo $A | sed 's/./0/g'`"
|
||||||
|
A="$ax_compare_version_tmp_A"
|
||||||
|
|
||||||
|
# Check for equality or inequality as necessary.
|
||||||
|
m4_case(m4_tolower(m4_substr($2,0,2)),
|
||||||
|
[eq],[
|
||||||
|
test "x$A" = "x$B" && ax_compare_version=true
|
||||||
|
],
|
||||||
|
[ne],[
|
||||||
|
test "x$A" != "x$B" && ax_compare_version=true
|
||||||
|
],[
|
||||||
|
AC_WARNING([invalid OP parameter: $2])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AS_VAR_POPDEF([A])dnl
|
||||||
|
AS_VAR_POPDEF([B])dnl
|
||||||
|
|
||||||
|
dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
|
||||||
|
if test "$ax_compare_version" = "true" ; then
|
||||||
|
m4_ifvaln([$4],[$4],[:])dnl
|
||||||
|
m4_ifvaln([$5],[else $5])dnl
|
||||||
|
fi
|
||||||
|
]) dnl AX_COMPARE_VERSION
|
||||||
66
modules/freetype2/builds/unix/ax_prog_python_version.m4
Normal file
66
modules/freetype2/builds/unix/ax_prog_python_version.m4
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
# ===========================================================================
|
||||||
|
# https://www.gnu.org/software/autoconf-archive/ax_prog_python_version.html
|
||||||
|
# ===========================================================================
|
||||||
|
#
|
||||||
|
# SYNOPSIS
|
||||||
|
#
|
||||||
|
# AX_PROG_PYTHON_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE])
|
||||||
|
#
|
||||||
|
# DESCRIPTION
|
||||||
|
#
|
||||||
|
# Makes sure that python supports the version indicated. If true the shell
|
||||||
|
# commands in ACTION-IF-TRUE are executed. If not the shell commands in
|
||||||
|
# ACTION-IF-FALSE are run. Note if $PYTHON is not set (for example by
|
||||||
|
# running AC_CHECK_PROG or AC_PATH_PROG) the macro will fail.
|
||||||
|
#
|
||||||
|
# Example:
|
||||||
|
#
|
||||||
|
# AC_PATH_PROG([PYTHON],[python])
|
||||||
|
# AX_PROG_PYTHON_VERSION([2.4.4],[ ... ],[ ... ])
|
||||||
|
#
|
||||||
|
# This will check to make sure that the python you have supports at least
|
||||||
|
# version 2.4.4.
|
||||||
|
#
|
||||||
|
# NOTE: This macro uses the $PYTHON variable to perform the check.
|
||||||
|
# AX_WITH_PYTHON can be used to set that variable prior to running this
|
||||||
|
# macro. The $PYTHON_VERSION variable will be valorized with the detected
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# LICENSE
|
||||||
|
#
|
||||||
|
# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
|
||||||
|
#
|
||||||
|
# Copying and distribution of this file, with or without modification, are
|
||||||
|
# permitted in any medium without royalty provided the copyright notice
|
||||||
|
# and this notice are preserved. This file is offered as-is, without any
|
||||||
|
# warranty.
|
||||||
|
|
||||||
|
#serial 12
|
||||||
|
|
||||||
|
AC_DEFUN([AX_PROG_PYTHON_VERSION],[
|
||||||
|
AC_REQUIRE([AC_PROG_SED])
|
||||||
|
AC_REQUIRE([AC_PROG_GREP])
|
||||||
|
|
||||||
|
AS_IF([test -n "$PYTHON"],[
|
||||||
|
ax_python_version="$1"
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([for python version])
|
||||||
|
changequote(<<,>>)
|
||||||
|
python_version=`$PYTHON -V 2>&1 | $GREP "^Python " | $SED -e 's/^.* \([0-9]*\.[0-9]*\.[0-9]*\)/\1/'`
|
||||||
|
changequote([,])
|
||||||
|
AC_MSG_RESULT($python_version)
|
||||||
|
|
||||||
|
AC_SUBST([PYTHON_VERSION],[$python_version])
|
||||||
|
|
||||||
|
AX_COMPARE_VERSION([$ax_python_version],[le],[$python_version],[
|
||||||
|
:
|
||||||
|
$2
|
||||||
|
],[
|
||||||
|
:
|
||||||
|
$3
|
||||||
|
])
|
||||||
|
],[
|
||||||
|
AC_MSG_WARN([could not find the python interpreter])
|
||||||
|
$3
|
||||||
|
])
|
||||||
|
])
|
||||||
522
modules/freetype2/builds/unix/ax_pthread.m4
Normal file
522
modules/freetype2/builds/unix/ax_pthread.m4
Normal file
|
|
@ -0,0 +1,522 @@
|
||||||
|
# ===========================================================================
|
||||||
|
# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
|
||||||
|
# ===========================================================================
|
||||||
|
#
|
||||||
|
# SYNOPSIS
|
||||||
|
#
|
||||||
|
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||||
|
#
|
||||||
|
# DESCRIPTION
|
||||||
|
#
|
||||||
|
# This macro figures out how to build C programs using POSIX threads. It
|
||||||
|
# sets the PTHREAD_LIBS output variable to the threads library and linker
|
||||||
|
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
|
||||||
|
# flags that are needed. (The user can also force certain compiler
|
||||||
|
# flags/libs to be tested by setting these environment variables.)
|
||||||
|
#
|
||||||
|
# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is
|
||||||
|
# needed for multi-threaded programs (defaults to the value of CC
|
||||||
|
# respectively CXX otherwise). (This is necessary on e.g. AIX to use the
|
||||||
|
# special cc_r/CC_r compiler alias.)
|
||||||
|
#
|
||||||
|
# NOTE: You are assumed to not only compile your program with these flags,
|
||||||
|
# but also to link with them as well. For example, you might link with
|
||||||
|
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
|
||||||
|
# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
|
||||||
|
#
|
||||||
|
# If you are only building threaded programs, you may wish to use these
|
||||||
|
# variables in your default LIBS, CFLAGS, and CC:
|
||||||
|
#
|
||||||
|
# LIBS="$PTHREAD_LIBS $LIBS"
|
||||||
|
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||||
|
# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
|
||||||
|
# CC="$PTHREAD_CC"
|
||||||
|
# CXX="$PTHREAD_CXX"
|
||||||
|
#
|
||||||
|
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
|
||||||
|
# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
|
||||||
|
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||||
|
#
|
||||||
|
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
|
||||||
|
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
|
||||||
|
# PTHREAD_CFLAGS.
|
||||||
|
#
|
||||||
|
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
|
||||||
|
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
|
||||||
|
# is not found. If ACTION-IF-FOUND is not specified, the default action
|
||||||
|
# will define HAVE_PTHREAD.
|
||||||
|
#
|
||||||
|
# Please let the authors know if this macro fails on any platform, or if
|
||||||
|
# you have any other suggestions or comments. This macro was based on work
|
||||||
|
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
|
||||||
|
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
|
||||||
|
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
|
||||||
|
# grateful for the helpful feedback of numerous users.
|
||||||
|
#
|
||||||
|
# Updated for Autoconf 2.68 by Daniel Richard G.
|
||||||
|
#
|
||||||
|
# LICENSE
|
||||||
|
#
|
||||||
|
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||||
|
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
|
||||||
|
# Copyright (c) 2019 Marc Stevens <marc.stevens@cwi.nl>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU General Public License as published by the
|
||||||
|
# Free Software Foundation, either version 3 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 General
|
||||||
|
# Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along
|
||||||
|
# with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||||
|
# gives unlimited permission to copy, distribute and modify the configure
|
||||||
|
# scripts that are the output of Autoconf when processing the Macro. You
|
||||||
|
# need not follow the terms of the GNU General Public License when using
|
||||||
|
# or distributing such scripts, even though portions of the text of the
|
||||||
|
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||||
|
# all other use of the material that constitutes the Autoconf Macro.
|
||||||
|
#
|
||||||
|
# This special exception to the GPL applies to versions of the Autoconf
|
||||||
|
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||||
|
# modified version of the Autoconf Macro, you may extend this special
|
||||||
|
# exception to the GPL to apply to your modified version as well.
|
||||||
|
|
||||||
|
#serial 30
|
||||||
|
|
||||||
|
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
|
||||||
|
AC_DEFUN([AX_PTHREAD], [
|
||||||
|
AC_REQUIRE([AC_CANONICAL_TARGET])
|
||||||
|
AC_REQUIRE([AC_PROG_CC])
|
||||||
|
AC_REQUIRE([AC_PROG_SED])
|
||||||
|
AC_LANG_PUSH([C])
|
||||||
|
ax_pthread_ok=no
|
||||||
|
|
||||||
|
# We used to check for pthread.h first, but this fails if pthread.h
|
||||||
|
# requires special compiler flags (e.g. on Tru64 or Sequent).
|
||||||
|
# It gets checked for in the link test anyway.
|
||||||
|
|
||||||
|
# First of all, check if the user has set any of the PTHREAD_LIBS,
|
||||||
|
# etcetera environment variables, and if threads linking works using
|
||||||
|
# them:
|
||||||
|
if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
|
||||||
|
ax_pthread_save_CC="$CC"
|
||||||
|
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||||
|
ax_pthread_save_LIBS="$LIBS"
|
||||||
|
AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
|
||||||
|
AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"])
|
||||||
|
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||||
|
LIBS="$PTHREAD_LIBS $LIBS"
|
||||||
|
AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
|
||||||
|
AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes])
|
||||||
|
AC_MSG_RESULT([$ax_pthread_ok])
|
||||||
|
if test "x$ax_pthread_ok" = "xno"; then
|
||||||
|
PTHREAD_LIBS=""
|
||||||
|
PTHREAD_CFLAGS=""
|
||||||
|
fi
|
||||||
|
CC="$ax_pthread_save_CC"
|
||||||
|
CFLAGS="$ax_pthread_save_CFLAGS"
|
||||||
|
LIBS="$ax_pthread_save_LIBS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# We must check for the threads library under a number of different
|
||||||
|
# names; the ordering is very important because some systems
|
||||||
|
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
||||||
|
# libraries is broken (non-POSIX).
|
||||||
|
|
||||||
|
# Create a list of thread flags to try. Items with a "," contain both
|
||||||
|
# C compiler flags (before ",") and linker flags (after ","). Other items
|
||||||
|
# starting with a "-" are C compiler flags, and remaining items are
|
||||||
|
# library names, except for "none" which indicates that we try without
|
||||||
|
# any flags at all, and "pthread-config" which is a program returning
|
||||||
|
# the flags for the Pth emulation library.
|
||||||
|
|
||||||
|
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||||
|
|
||||||
|
# The ordering *is* (sometimes) important. Some notes on the
|
||||||
|
# individual items follow:
|
||||||
|
|
||||||
|
# pthreads: AIX (must check this before -lpthread)
|
||||||
|
# none: in case threads are in libc; should be tried before -Kthread and
|
||||||
|
# other compiler flags to prevent continual compiler warnings
|
||||||
|
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
|
||||||
|
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
|
||||||
|
# (Note: HP C rejects this with "bad form for `-t' option")
|
||||||
|
# -pthreads: Solaris/gcc (Note: HP C also rejects)
|
||||||
|
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
|
||||||
|
# doesn't hurt to check since this sometimes defines pthreads and
|
||||||
|
# -D_REENTRANT too), HP C (must be checked before -lpthread, which
|
||||||
|
# is present but should not be used directly; and before -mthreads,
|
||||||
|
# because the compiler interprets this as "-mt" + "-hreads")
|
||||||
|
# -mthreads: Mingw32/gcc, Lynx/gcc
|
||||||
|
# pthread: Linux, etcetera
|
||||||
|
# --thread-safe: KAI C++
|
||||||
|
# pthread-config: use pthread-config program (for GNU Pth library)
|
||||||
|
|
||||||
|
case $target_os in
|
||||||
|
|
||||||
|
freebsd*)
|
||||||
|
|
||||||
|
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
|
||||||
|
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
|
||||||
|
|
||||||
|
ax_pthread_flags="-kthread lthread $ax_pthread_flags"
|
||||||
|
;;
|
||||||
|
|
||||||
|
hpux*)
|
||||||
|
|
||||||
|
# From the cc(1) man page: "[-mt] Sets various -D flags to enable
|
||||||
|
# multi-threading and also sets -lpthread."
|
||||||
|
|
||||||
|
ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
|
||||||
|
;;
|
||||||
|
|
||||||
|
openedition*)
|
||||||
|
|
||||||
|
# IBM z/OS requires a feature-test macro to be defined in order to
|
||||||
|
# enable POSIX threads at all, so give the user a hint if this is
|
||||||
|
# not set. (We don't define these ourselves, as they can affect
|
||||||
|
# other portions of the system API in unpredictable ways.)
|
||||||
|
|
||||||
|
AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
|
||||||
|
[
|
||||||
|
# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
|
||||||
|
AX_PTHREAD_ZOS_MISSING
|
||||||
|
# endif
|
||||||
|
],
|
||||||
|
[AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
|
||||||
|
;;
|
||||||
|
|
||||||
|
solaris*)
|
||||||
|
|
||||||
|
# On Solaris (at least, for some versions), libc contains stubbed
|
||||||
|
# (non-functional) versions of the pthreads routines, so link-based
|
||||||
|
# tests will erroneously succeed. (N.B.: The stubs are missing
|
||||||
|
# pthread_cleanup_push, or rather a function called by this macro,
|
||||||
|
# so we could check for that, but who knows whether they'll stub
|
||||||
|
# that too in a future libc.) So we'll check first for the
|
||||||
|
# standard Solaris way of linking pthreads (-mt -lpthread).
|
||||||
|
|
||||||
|
ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Are we compiling with Clang?
|
||||||
|
|
||||||
|
AC_CACHE_CHECK([whether $CC is Clang],
|
||||||
|
[ax_cv_PTHREAD_CLANG],
|
||||||
|
[ax_cv_PTHREAD_CLANG=no
|
||||||
|
# Note that Autoconf sets GCC=yes for Clang as well as GCC
|
||||||
|
if test "x$GCC" = "xyes"; then
|
||||||
|
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
|
||||||
|
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
|
||||||
|
# if defined(__clang__) && defined(__llvm__)
|
||||||
|
AX_PTHREAD_CC_IS_CLANG
|
||||||
|
# endif
|
||||||
|
],
|
||||||
|
[ax_cv_PTHREAD_CLANG=yes])
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
|
||||||
|
|
||||||
|
|
||||||
|
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
|
||||||
|
|
||||||
|
# Note that for GCC and Clang -pthread generally implies -lpthread,
|
||||||
|
# except when -nostdlib is passed.
|
||||||
|
# This is problematic using libtool to build C++ shared libraries with pthread:
|
||||||
|
# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
|
||||||
|
# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333
|
||||||
|
# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555
|
||||||
|
# To solve this, first try -pthread together with -lpthread for GCC
|
||||||
|
|
||||||
|
AS_IF([test "x$GCC" = "xyes"],
|
||||||
|
[ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"])
|
||||||
|
|
||||||
|
# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first
|
||||||
|
|
||||||
|
AS_IF([test "x$ax_pthread_clang" = "xyes"],
|
||||||
|
[ax_pthread_flags="-pthread,-lpthread -pthread"])
|
||||||
|
|
||||||
|
|
||||||
|
# The presence of a feature test macro requesting re-entrant function
|
||||||
|
# definitions is, on some systems, a strong hint that pthreads support is
|
||||||
|
# correctly enabled
|
||||||
|
|
||||||
|
case $target_os in
|
||||||
|
darwin* | hpux* | linux* | osf* | solaris*)
|
||||||
|
ax_pthread_check_macro="_REENTRANT"
|
||||||
|
;;
|
||||||
|
|
||||||
|
aix*)
|
||||||
|
ax_pthread_check_macro="_THREAD_SAFE"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
ax_pthread_check_macro="--"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
AS_IF([test "x$ax_pthread_check_macro" = "x--"],
|
||||||
|
[ax_pthread_check_cond=0],
|
||||||
|
[ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
|
||||||
|
|
||||||
|
|
||||||
|
if test "x$ax_pthread_ok" = "xno"; then
|
||||||
|
for ax_pthread_try_flag in $ax_pthread_flags; do
|
||||||
|
|
||||||
|
case $ax_pthread_try_flag in
|
||||||
|
none)
|
||||||
|
AC_MSG_CHECKING([whether pthreads work without any flags])
|
||||||
|
;;
|
||||||
|
|
||||||
|
*,*)
|
||||||
|
PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"`
|
||||||
|
PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"`
|
||||||
|
AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"])
|
||||||
|
;;
|
||||||
|
|
||||||
|
-*)
|
||||||
|
AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
|
||||||
|
PTHREAD_CFLAGS="$ax_pthread_try_flag"
|
||||||
|
;;
|
||||||
|
|
||||||
|
pthread-config)
|
||||||
|
AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
|
||||||
|
AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
|
||||||
|
PTHREAD_CFLAGS="`pthread-config --cflags`"
|
||||||
|
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
|
||||||
|
PTHREAD_LIBS="-l$ax_pthread_try_flag"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||||
|
ax_pthread_save_LIBS="$LIBS"
|
||||||
|
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||||
|
LIBS="$PTHREAD_LIBS $LIBS"
|
||||||
|
|
||||||
|
# Check for various functions. We must include pthread.h,
|
||||||
|
# since some functions may be macros. (On the Sequent, we
|
||||||
|
# need a special flag -Kthread to make this header compile.)
|
||||||
|
# We check for pthread_join because it is in -lpthread on IRIX
|
||||||
|
# while pthread_create is in libc. We check for pthread_attr_init
|
||||||
|
# due to DEC craziness with -lpthreads. We check for
|
||||||
|
# pthread_cleanup_push because it is one of the few pthread
|
||||||
|
# functions on Solaris that doesn't have a non-functional libc stub.
|
||||||
|
# We try pthread_create on general principles.
|
||||||
|
|
||||||
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
|
||||||
|
# if $ax_pthread_check_cond
|
||||||
|
# error "$ax_pthread_check_macro must be defined"
|
||||||
|
# endif
|
||||||
|
static void *some_global = NULL;
|
||||||
|
static void routine(void *a)
|
||||||
|
{
|
||||||
|
/* To avoid any unused-parameter or
|
||||||
|
unused-but-set-parameter warning. */
|
||||||
|
some_global = a;
|
||||||
|
}
|
||||||
|
static void *start_routine(void *a) { return a; }],
|
||||||
|
[pthread_t th; pthread_attr_t attr;
|
||||||
|
pthread_create(&th, 0, start_routine, 0);
|
||||||
|
pthread_join(th, 0);
|
||||||
|
pthread_attr_init(&attr);
|
||||||
|
pthread_cleanup_push(routine, 0);
|
||||||
|
pthread_cleanup_pop(0) /* ; */])],
|
||||||
|
[ax_pthread_ok=yes],
|
||||||
|
[])
|
||||||
|
|
||||||
|
CFLAGS="$ax_pthread_save_CFLAGS"
|
||||||
|
LIBS="$ax_pthread_save_LIBS"
|
||||||
|
|
||||||
|
AC_MSG_RESULT([$ax_pthread_ok])
|
||||||
|
AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
|
||||||
|
|
||||||
|
PTHREAD_LIBS=""
|
||||||
|
PTHREAD_CFLAGS=""
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Clang needs special handling, because older versions handle the -pthread
|
||||||
|
# option in a rather... idiosyncratic way
|
||||||
|
|
||||||
|
if test "x$ax_pthread_clang" = "xyes"; then
|
||||||
|
|
||||||
|
# Clang takes -pthread; it has never supported any other flag
|
||||||
|
|
||||||
|
# (Note 1: This will need to be revisited if a system that Clang
|
||||||
|
# supports has POSIX threads in a separate library. This tends not
|
||||||
|
# to be the way of modern systems, but it's conceivable.)
|
||||||
|
|
||||||
|
# (Note 2: On some systems, notably Darwin, -pthread is not needed
|
||||||
|
# to get POSIX threads support; the API is always present and
|
||||||
|
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
|
||||||
|
# -pthread does define _REENTRANT, and while the Darwin headers
|
||||||
|
# ignore this macro, third-party headers might not.)
|
||||||
|
|
||||||
|
# However, older versions of Clang make a point of warning the user
|
||||||
|
# that, in an invocation where only linking and no compilation is
|
||||||
|
# taking place, the -pthread option has no effect ("argument unused
|
||||||
|
# during compilation"). They expect -pthread to be passed in only
|
||||||
|
# when source code is being compiled.
|
||||||
|
#
|
||||||
|
# Problem is, this is at odds with the way Automake and most other
|
||||||
|
# C build frameworks function, which is that the same flags used in
|
||||||
|
# compilation (CFLAGS) are also used in linking. Many systems
|
||||||
|
# supported by AX_PTHREAD require exactly this for POSIX threads
|
||||||
|
# support, and in fact it is often not straightforward to specify a
|
||||||
|
# flag that is used only in the compilation phase and not in
|
||||||
|
# linking. Such a scenario is extremely rare in practice.
|
||||||
|
#
|
||||||
|
# Even though use of the -pthread flag in linking would only print
|
||||||
|
# a warning, this can be a nuisance for well-run software projects
|
||||||
|
# that build with -Werror. So if the active version of Clang has
|
||||||
|
# this misfeature, we search for an option to squash it.
|
||||||
|
|
||||||
|
AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
|
||||||
|
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
|
||||||
|
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
|
||||||
|
# Create an alternate version of $ac_link that compiles and
|
||||||
|
# links in two steps (.c -> .o, .o -> exe) instead of one
|
||||||
|
# (.c -> exe), because the warning occurs only in the second
|
||||||
|
# step
|
||||||
|
ax_pthread_save_ac_link="$ac_link"
|
||||||
|
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
|
||||||
|
ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"`
|
||||||
|
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
|
||||||
|
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||||
|
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
|
||||||
|
AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
|
||||||
|
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
|
||||||
|
ac_link="$ax_pthread_save_ac_link"
|
||||||
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
|
||||||
|
[ac_link="$ax_pthread_2step_ac_link"
|
||||||
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
|
||||||
|
[break])
|
||||||
|
])
|
||||||
|
done
|
||||||
|
ac_link="$ax_pthread_save_ac_link"
|
||||||
|
CFLAGS="$ax_pthread_save_CFLAGS"
|
||||||
|
AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
|
||||||
|
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
|
||||||
|
])
|
||||||
|
|
||||||
|
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
|
||||||
|
no | unknown) ;;
|
||||||
|
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
fi # $ax_pthread_clang = yes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Various other checks:
|
||||||
|
if test "x$ax_pthread_ok" = "xyes"; then
|
||||||
|
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||||
|
ax_pthread_save_LIBS="$LIBS"
|
||||||
|
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||||
|
LIBS="$PTHREAD_LIBS $LIBS"
|
||||||
|
|
||||||
|
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
|
||||||
|
AC_CACHE_CHECK([for joinable pthread attribute],
|
||||||
|
[ax_cv_PTHREAD_JOINABLE_ATTR],
|
||||||
|
[ax_cv_PTHREAD_JOINABLE_ATTR=unknown
|
||||||
|
for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||||
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
|
||||||
|
[int attr = $ax_pthread_attr; return attr /* ; */])],
|
||||||
|
[ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break],
|
||||||
|
[])
|
||||||
|
done
|
||||||
|
])
|
||||||
|
AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
|
||||||
|
test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
|
||||||
|
test "x$ax_pthread_joinable_attr_defined" != "xyes"],
|
||||||
|
[AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE],
|
||||||
|
[$ax_cv_PTHREAD_JOINABLE_ATTR],
|
||||||
|
[Define to necessary symbol if this constant
|
||||||
|
uses a non-standard name on your system.])
|
||||||
|
ax_pthread_joinable_attr_defined=yes
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_CACHE_CHECK([whether more special flags are required for pthreads],
|
||||||
|
[ax_cv_PTHREAD_SPECIAL_FLAGS],
|
||||||
|
[ax_cv_PTHREAD_SPECIAL_FLAGS=no
|
||||||
|
case $target_os in
|
||||||
|
solaris*)
|
||||||
|
ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
])
|
||||||
|
AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
|
||||||
|
test "x$ax_pthread_special_flags_added" != "xyes"],
|
||||||
|
[PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
|
||||||
|
ax_pthread_special_flags_added=yes])
|
||||||
|
|
||||||
|
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
|
||||||
|
[ax_cv_PTHREAD_PRIO_INHERIT],
|
||||||
|
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
|
||||||
|
[[int i = PTHREAD_PRIO_INHERIT;
|
||||||
|
return i;]])],
|
||||||
|
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
|
||||||
|
[ax_cv_PTHREAD_PRIO_INHERIT=no])
|
||||||
|
])
|
||||||
|
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
|
||||||
|
test "x$ax_pthread_prio_inherit_defined" != "xyes"],
|
||||||
|
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])
|
||||||
|
ax_pthread_prio_inherit_defined=yes
|
||||||
|
])
|
||||||
|
|
||||||
|
CFLAGS="$ax_pthread_save_CFLAGS"
|
||||||
|
LIBS="$ax_pthread_save_LIBS"
|
||||||
|
|
||||||
|
# More AIX lossage: compile with *_r variant
|
||||||
|
if test "x$GCC" != "xyes"; then
|
||||||
|
case $target_os in
|
||||||
|
aix*)
|
||||||
|
AS_CASE(["x/$CC"],
|
||||||
|
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
|
||||||
|
[#handle absolute path differently from PATH based program lookup
|
||||||
|
AS_CASE(["x$CC"],
|
||||||
|
[x/*],
|
||||||
|
[
|
||||||
|
AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])
|
||||||
|
AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])])
|
||||||
|
],
|
||||||
|
[
|
||||||
|
AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])
|
||||||
|
AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
|
||||||
|
test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX"
|
||||||
|
|
||||||
|
AC_SUBST([PTHREAD_LIBS])
|
||||||
|
AC_SUBST([PTHREAD_CFLAGS])
|
||||||
|
AC_SUBST([PTHREAD_CC])
|
||||||
|
AC_SUBST([PTHREAD_CXX])
|
||||||
|
|
||||||
|
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||||
|
if test "x$ax_pthread_ok" = "xyes"; then
|
||||||
|
ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
|
||||||
|
:
|
||||||
|
else
|
||||||
|
ax_pthread_ok=no
|
||||||
|
$2
|
||||||
|
fi
|
||||||
|
AC_LANG_POP
|
||||||
|
])dnl AX_PTHREAD
|
||||||
1518
modules/freetype2/builds/unix/config.guess
vendored
1518
modules/freetype2/builds/unix/config.guess
vendored
File diff suppressed because it is too large
Load diff
2874
modules/freetype2/builds/unix/config.sub
vendored
2874
modules/freetype2/builds/unix/config.sub
vendored
File diff suppressed because it is too large
Load diff
8132
modules/freetype2/builds/unix/configure
vendored
8132
modules/freetype2/builds/unix/configure
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
#
|
#
|
||||||
# Copyright 2001-2018 by
|
# Copyright (C) 2001-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -11,13 +11,13 @@
|
||||||
# indicate that you have read the license and understand and accept it
|
# indicate that you have read the license and understand and accept it
|
||||||
# fully.
|
# fully.
|
||||||
|
|
||||||
AC_INIT([FreeType], [2.9.1], [freetype@nongnu.org], [freetype])
|
AC_INIT([FreeType], [2.13], [freetype@nongnu.org], [freetype])
|
||||||
AC_CONFIG_SRCDIR([ftconfig.in])
|
AC_CONFIG_SRCDIR([ftconfig.h.in])
|
||||||
|
|
||||||
|
|
||||||
# Don't forget to update `docs/VERSIONS.TXT'!
|
# Don't forget to update `docs/VERSIONS.TXT'!
|
||||||
|
|
||||||
version_info='22:1:16'
|
version_info='25:0:19'
|
||||||
AC_SUBST([version_info])
|
AC_SUBST([version_info])
|
||||||
ft_version=`echo $version_info | tr : .`
|
ft_version=`echo $version_info | tr : .`
|
||||||
AC_SUBST([ft_version])
|
AC_SUBST([ft_version])
|
||||||
|
|
@ -37,7 +37,7 @@ AC_SUBST(EXEEXT)
|
||||||
PKG_PROG_PKG_CONFIG([0.24])
|
PKG_PROG_PKG_CONFIG([0.24])
|
||||||
|
|
||||||
LT_INIT(win32-dll)
|
LT_INIT(win32-dll)
|
||||||
LT_PROG_RC
|
AC_CHECK_HEADER([windows.h], [LT_PROG_RC])
|
||||||
|
|
||||||
|
|
||||||
# checks for native programs to generate building tool
|
# checks for native programs to generate building tool
|
||||||
|
|
@ -50,7 +50,7 @@ if test ${cross_compiling} = yes; then
|
||||||
|
|
||||||
AC_MSG_CHECKING([for suffix of native executables])
|
AC_MSG_CHECKING([for suffix of native executables])
|
||||||
rm -f a.* b.* a_out.exe conftest.*
|
rm -f a.* b.* a_out.exe conftest.*
|
||||||
echo > conftest.c "int main() { return 0;}"
|
echo > conftest.c "int main(void) { return 0;}"
|
||||||
${CC_BUILD} conftest.c || AC_MSG_ERROR([native C compiler is not working])
|
${CC_BUILD} conftest.c || AC_MSG_ERROR([native C compiler is not working])
|
||||||
rm -f conftest.c
|
rm -f conftest.c
|
||||||
if test -x a.out -o -x b.out -o -x conftest; then
|
if test -x a.out -o -x b.out -o -x conftest; then
|
||||||
|
|
@ -97,85 +97,12 @@ esac
|
||||||
|
|
||||||
# checks for header files
|
# checks for header files
|
||||||
|
|
||||||
AC_HEADER_STDC
|
|
||||||
AC_CHECK_HEADERS([fcntl.h unistd.h])
|
AC_CHECK_HEADERS([fcntl.h unistd.h])
|
||||||
|
|
||||||
|
|
||||||
# checks for typedefs, structures, and compiler characteristics
|
# checks for typedefs, structures, and compiler characteristics
|
||||||
|
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
AC_CHECK_SIZEOF([int])
|
|
||||||
AC_CHECK_SIZEOF([long])
|
|
||||||
AC_TYPE_LONG_LONG_INT
|
|
||||||
|
|
||||||
|
|
||||||
# check whether cpp computation of size of int and long in ftconfig.in works
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.in works])
|
|
||||||
orig_CPPFLAGS="${CPPFLAGS}"
|
|
||||||
CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include/freetype/config ${CPPFLAGS}"
|
|
||||||
|
|
||||||
ac_clean_files=
|
|
||||||
if test ! -f ft2build.h; then
|
|
||||||
ac_clean_files=ft2build.h
|
|
||||||
touch ft2build.h
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat > conftest.c <<\_ACEOF
|
|
||||||
#include <limits.h>
|
|
||||||
#define FT_CONFIG_OPTIONS_H "ftoption.h"
|
|
||||||
#define FT_CONFIG_STANDARD_LIBRARY_H "ftstdlib.h"
|
|
||||||
#define FT_UINT_MAX UINT_MAX
|
|
||||||
#define FT_ULONG_MAX ULONG_MAX
|
|
||||||
#include "ftconfig.in"
|
|
||||||
_ACEOF
|
|
||||||
echo >> conftest.c "#if FT_SIZEOF_INT == "${ac_cv_sizeof_int}
|
|
||||||
echo >> conftest.c "ac_cpp_ft_sizeof_int="${ac_cv_sizeof_int}
|
|
||||||
echo >> conftest.c "#endif"
|
|
||||||
echo >> conftest.c "#if FT_SIZEOF_LONG == "${ac_cv_sizeof_long}
|
|
||||||
echo >> conftest.c "ac_cpp_ft_sizeof_long="${ac_cv_sizeof_long}
|
|
||||||
echo >> conftest.c "#endif"
|
|
||||||
|
|
||||||
${CPP} ${CPPFLAGS} conftest.c | ${GREP} ac_cpp_ft > conftest.sh
|
|
||||||
eval `cat conftest.sh`
|
|
||||||
rm -f conftest.* $ac_clean_files
|
|
||||||
|
|
||||||
if test x != "x${ac_cpp_ft_sizeof_int}" \
|
|
||||||
-a x != x"${ac_cpp_ft_sizeof_long}"; then
|
|
||||||
unset ft_use_autoconf_sizeof_types
|
|
||||||
else
|
|
||||||
ft_use_autoconf_sizeof_types=yes
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(biarch-config,
|
|
||||||
[ --enable-biarch-config install biarch ftconfig.h to support multiple
|
|
||||||
architectures by single file], [], [])
|
|
||||||
|
|
||||||
case :${ft_use_autoconf_sizeof_types}:${enable_biarch_config}: in
|
|
||||||
:yes:yes:)
|
|
||||||
AC_MSG_RESULT([broken but use it])
|
|
||||||
unset ft_use_autoconf_sizeof_types
|
|
||||||
;;
|
|
||||||
::no:)
|
|
||||||
AC_MSG_RESULT([works but ignore it])
|
|
||||||
ft_use_autoconf_sizeof_types=yes
|
|
||||||
;;
|
|
||||||
::yes: | :::)
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
unset ft_use_autoconf_sizeof_types
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
ft_use_autoconf_sizeof_types=yes
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test x"${ft_use_autoconf_sizeof_types}" = xyes; then
|
|
||||||
AC_DEFINE([FT_USE_AUTOCONF_SIZEOF_TYPES], [],
|
|
||||||
[Define if autoconf sizeof types should be used.])
|
|
||||||
fi
|
|
||||||
|
|
||||||
CPPFLAGS="${orig_CPPFLAGS}"
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([freetype-config],
|
AC_ARG_ENABLE([freetype-config],
|
||||||
AS_HELP_STRING([--enable-freetype-config], [install freetype-config]),
|
AS_HELP_STRING([--enable-freetype-config], [install freetype-config]),
|
||||||
|
|
@ -192,53 +119,56 @@ AC_SUBST(INSTALL_FT2_CONFIG, [$enable_freetype_config])
|
||||||
AC_SYS_LARGEFILE
|
AC_SYS_LARGEFILE
|
||||||
|
|
||||||
# Here we check whether we can use our mmap file component.
|
# Here we check whether we can use our mmap file component.
|
||||||
|
#
|
||||||
|
# Note that `ftsystem.c` for Windows has its own mmap-like implementation
|
||||||
|
# not covered by `AC_FUNC_MMAP` and/or `FT_UNMAP_PARAM`.
|
||||||
|
|
||||||
AC_ARG_ENABLE([mmap],
|
AC_ARG_ENABLE([mmap],
|
||||||
AS_HELP_STRING([--disable-mmap],
|
AS_HELP_STRING([--disable-mmap],
|
||||||
[do not check mmap() and do not use]),
|
[do not check mmap() and do not use]),
|
||||||
[enable_mmap="no"],[enable_mmap="yes"])
|
[enable_mmap="no"], [enable_mmap="yes"])
|
||||||
if test "x${enable_mmap}" != "xno"; then
|
if test "x${enable_mmap}" != "xno"; then
|
||||||
AC_FUNC_MMAP
|
case "$host" in
|
||||||
fi
|
*-*-mingw*)
|
||||||
if test "x${enable_mmap}" = "xno" \
|
AC_MSG_CHECKING([for working mmap])
|
||||||
-o "$ac_cv_func_mmap_fixed_mapped" != "yes"; then
|
AC_MSG_RESULT([using MapViewOfFile in Windows])
|
||||||
FTSYS_SRC='$(BASE_DIR)/ftsystem.c'
|
FTSYS_SRC='$(TOP_DIR)/builds/windows/ftsystem.c'
|
||||||
else
|
;;
|
||||||
FTSYS_SRC='$(BUILD_DIR)/ftsystem.c'
|
*)
|
||||||
|
AC_FUNC_MMAP
|
||||||
|
if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then
|
||||||
|
FTSYS_SRC='$(PLATFORM_DIR)/ftsystem.c'
|
||||||
|
|
||||||
AC_CHECK_DECLS([munmap],
|
AC_CHECK_DECLS([munmap],
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
[
|
[
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
||||||
FT_MUNMAP_PARAM
|
FT_MUNMAP_PARAM
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "$FTSYS_SRC"; then
|
||||||
|
FTSYS_SRC='$(BASE_DIR)/ftsystem.c'
|
||||||
fi
|
fi
|
||||||
AC_SUBST([FTSYS_SRC])
|
AC_SUBST([FTSYS_SRC])
|
||||||
|
|
||||||
AC_CHECK_FUNCS([memcpy memmove])
|
|
||||||
|
|
||||||
|
|
||||||
# get compiler flags right
|
# get compiler flags right
|
||||||
#
|
#
|
||||||
# We try to make the compiler work for C89-strict source. Even if the
|
# We try to make the compiler work for C99-strict source. Even if the
|
||||||
# C compiler is gcc and C89 flags are available, some system headers
|
# C compiler is gcc and C99 flags are available, some system headers
|
||||||
# (e.g., Android Bionic libc) are broken in C89 mode. We have to check
|
# might be broken in C99 mode. We have to check whether compilation
|
||||||
# whether the compilation finishes successfully.
|
# finishes successfully.
|
||||||
#
|
|
||||||
# Due to bugs in mingwrt 4.0.3 we don't use `-ansi' for MinGW.
|
|
||||||
#
|
|
||||||
# To avoid zillions of
|
|
||||||
#
|
|
||||||
# ISO C90 does not support 'long long'
|
|
||||||
#
|
|
||||||
# warnings, we disable `-pedantic' for gcc version < 4.6.
|
|
||||||
#
|
#
|
||||||
if test "x$GCC" = xyes; then
|
if test "x$GCC" = xyes; then
|
||||||
XX_CFLAGS="-Wall"
|
XX_CFLAGS="-Wall"
|
||||||
|
|
@ -250,23 +180,11 @@ if test "x$GCC" = xyes; then
|
||||||
XX_ANSIFLAGS="-pedantic"
|
XX_ANSIFLAGS="-pedantic"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
GCC_VERSION=`$CC -dumpversion`
|
|
||||||
GCC_MAJOR=`echo "$GCC_VERSION" | sed 's/\([[^.]][[^.]]*\).*/\1/'`
|
|
||||||
GCC_MINOR=`echo "$GCC_VERSION" | sed 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'`
|
|
||||||
|
|
||||||
XX_PEDANTIC=-pedantic
|
|
||||||
if test $GCC_MAJOR -lt 4; then
|
|
||||||
XX_PEDANTIC=
|
|
||||||
else
|
|
||||||
if test $GCC_MAJOR -eq 4 -a $GCC_MINOR -lt 6; then
|
|
||||||
XX_PEDANTIC=
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
XX_ANSIFLAGS=""
|
XX_ANSIFLAGS=""
|
||||||
for a in $XX_PEDANTIC -ansi
|
|
||||||
|
for a in "-pedantic" "-std=c99"
|
||||||
do
|
do
|
||||||
AC_MSG_CHECKING([gcc compiler flag ${a} to assure ANSI C works correctly])
|
AC_MSG_CHECKING([$CC compiler flag ${a} to assure ANSI C99 works correctly])
|
||||||
orig_CFLAGS="${CFLAGS}"
|
orig_CFLAGS="${CFLAGS}"
|
||||||
CFLAGS="${CFLAGS} ${XX_ANSIFLAGS} ${a}"
|
CFLAGS="${CFLAGS} ${XX_ANSIFLAGS} ${a}"
|
||||||
AC_COMPILE_IFELSE([
|
AC_COMPILE_IFELSE([
|
||||||
|
|
@ -311,14 +229,26 @@ AC_SUBST([XX_ANSIFLAGS])
|
||||||
# It is recommended that shared libraries hide symbols except those with
|
# It is recommended that shared libraries hide symbols except those with
|
||||||
# explicit __attribute__((visibility("default"))).
|
# explicit __attribute__((visibility("default"))).
|
||||||
#
|
#
|
||||||
|
found_visibility_flag=no
|
||||||
AC_MSG_CHECKING([for -fvisibility=hidden compiler flag])
|
AC_MSG_CHECKING([for -fvisibility=hidden compiler flag])
|
||||||
orig_CFLAGS="${CFLAGS}"
|
orig_CFLAGS="${CFLAGS}"
|
||||||
CFLAGS="${CFLAGS} -fvisibility=hidden"
|
CFLAGS="${CFLAGS} -fvisibility=hidden"
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
|
||||||
AC_MSG_RESULT(yes),
|
[found_visibility_flag=yes
|
||||||
CFLAGS="${orig_CFLAGS}"
|
AC_MSG_RESULT(yes)],
|
||||||
AC_MSG_RESULT(no))
|
[CFLAGS="${orig_CFLAGS}"
|
||||||
|
AC_MSG_RESULT(no)])
|
||||||
|
|
||||||
|
if test "${found_visibility_flag}" = "no"; then
|
||||||
|
AC_MSG_CHECKING([for -xldscope=hidden compiler flag])
|
||||||
|
orig_CFLAGS="${CFLAGS}"
|
||||||
|
CFLAGS="${CFLAGS} -xldscope=hidden"
|
||||||
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
|
||||||
|
[found_visibility_flag=yes
|
||||||
|
AC_MSG_RESULT(yes)],
|
||||||
|
[CFLAGS="${orig_CFLAGS}"
|
||||||
|
AC_MSG_RESULT(no)])
|
||||||
|
fi
|
||||||
|
|
||||||
# All library tests below try `pkg-config' first. If that fails, a function
|
# All library tests below try `pkg-config' first. If that fails, a function
|
||||||
# from the library is tested in the traditional autoconf way (zlib, bzip2),
|
# from the library is tested in the traditional autoconf way (zlib, bzip2),
|
||||||
|
|
@ -384,6 +314,12 @@ if test x"$with_zlib" = xyes -a "$have_zlib" = no; then
|
||||||
AC_MSG_ERROR([external zlib support requested but library not found])
|
AC_MSG_ERROR([external zlib support requested but library not found])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
SYSTEM_ZLIB=
|
||||||
|
if test "$have_zlib" != no; then
|
||||||
|
SYSTEM_ZLIB=yes
|
||||||
|
fi
|
||||||
|
AC_SUBST([SYSTEM_ZLIB])
|
||||||
|
|
||||||
|
|
||||||
# check for system libbz2
|
# check for system libbz2
|
||||||
|
|
||||||
|
|
@ -466,17 +402,13 @@ if test x"$with_png" = xyes -o x"$with_png" = xauto; then
|
||||||
libpng_libsstaticconf="$LIBPNG_LIBS"
|
libpng_libsstaticconf="$LIBPNG_LIBS"
|
||||||
have_libpng="yes (LIBPNG_CFLAGS and LIBPNG_LIBS)"
|
have_libpng="yes (LIBPNG_CFLAGS and LIBPNG_LIBS)"
|
||||||
else
|
else
|
||||||
# fall back to config script.
|
# fall back to config script
|
||||||
AC_MSG_CHECKING([for libpng-config])
|
AC_CHECK_PROG(have_libpng, [libpng-config], [yes (libpng-config)], [no])
|
||||||
if which libpng-config > /dev/null 2>&1; then
|
if test "$have_libpng" != no; then
|
||||||
LIBPNG_CFLAGS=`libpng-config --cflags`
|
LIBPNG_CFLAGS=`libpng-config --cflags`
|
||||||
LIBPNG_LIBS=`libpng-config --ldflags`
|
LIBPNG_LIBS=`libpng-config --ldflags`
|
||||||
libpng_libspriv=`libpng-config --static --ldflags`
|
libpng_libspriv=`libpng-config --static --ldflags`
|
||||||
libpng_libsstaticconf="$libpng_libspriv"
|
libpng_libsstaticconf="$libpng_libspriv"
|
||||||
have_libpng="yes (libpng-config)"
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
else
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
@ -496,7 +428,7 @@ AC_ARG_WITH([harfbuzz],
|
||||||
|
|
||||||
have_harfbuzz=no
|
have_harfbuzz=no
|
||||||
if test x"$with_harfbuzz" = xyes -o x"$with_harfbuzz" = xauto; then
|
if test x"$with_harfbuzz" = xyes -o x"$with_harfbuzz" = xauto; then
|
||||||
harfbuzz_pkg="harfbuzz >= 1.3.0"
|
harfbuzz_pkg="harfbuzz >= 2.0.0"
|
||||||
have_harfbuzz_pkg=no
|
have_harfbuzz_pkg=no
|
||||||
|
|
||||||
if test x"$HARFBUZZ_CFLAGS" = x -a x"$HARFBUZZ_LIBS" = x; then
|
if test x"$HARFBUZZ_CFLAGS" = x -a x"$HARFBUZZ_LIBS" = x; then
|
||||||
|
|
@ -531,19 +463,92 @@ if test x"$with_harfbuzz" = xyes -a "$have_harfbuzz" = no; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# check for librt
|
# check for system libbrotlidec
|
||||||
#
|
|
||||||
# We need `clock_gettime' for the `ftbench' demo program.
|
|
||||||
#
|
|
||||||
# The code is modeled after gnulib's file `clock_time.m4', ignoring
|
|
||||||
# very old Solaris systems.
|
|
||||||
|
|
||||||
|
AC_ARG_WITH([brotli],
|
||||||
|
[AS_HELP_STRING([--with-brotli=@<:@yes|no|auto@:>@],
|
||||||
|
[support decompression of WOFF2 streams @<:@default=auto@:>@])],
|
||||||
|
[], [with_brotli=auto])
|
||||||
|
|
||||||
|
have_brotli=no
|
||||||
|
if test x"$with_brotli" = xyes -o x"$with_brotli" = xauto; then
|
||||||
|
brotli_pkg="libbrotlidec"
|
||||||
|
have_brotli_pkg=no
|
||||||
|
|
||||||
|
if test x"$BROTLI_CFLAGS" = x -a x"$BROTLI_LIBS" = x; then
|
||||||
|
PKG_CHECK_EXISTS([$brotli_pkg], [have_brotli_pkg=yes])
|
||||||
|
fi
|
||||||
|
PKG_CHECK_MODULES([BROTLI], [$brotli_pkg],
|
||||||
|
[have_brotli="yes (pkg-config)"], [:])
|
||||||
|
|
||||||
|
if test $have_brotli_pkg = yes; then
|
||||||
|
# we have libbrotlidec.pc
|
||||||
|
brotli_reqpriv="$brotli_pkg"
|
||||||
|
brotli_libspriv=
|
||||||
|
brotli_libsstaticconf=`$PKG_CONFIG --static --libs "$brotli_pkg"`
|
||||||
|
else
|
||||||
|
brotli_reqpriv=
|
||||||
|
|
||||||
|
if test "$have_brotli" != no; then
|
||||||
|
# BROTLI_CFLAGS and BROTLI_LIBS are set by the user
|
||||||
|
brotli_libspriv="$BROTLI_LIBS"
|
||||||
|
brotli_libsstaticconf="$BROTLI_LIBS"
|
||||||
|
have_brotli="yes (BROTLI_CFLAGS and BROTLI_LIBS)"
|
||||||
|
else
|
||||||
|
# since Brotli is quite a new library we don't fall back to a
|
||||||
|
# different test
|
||||||
|
:
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test x"$with_brotli" = xyes -a "$have_brotli" = no; then
|
||||||
|
AC_MSG_ERROR([brotli support requested but library not found])
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Checks for the demo programs.
|
||||||
|
#
|
||||||
|
# FreeType doesn't need this. However, since the demo program repository
|
||||||
|
# doesn't come with a `configure` script of its own, we integrate the tests
|
||||||
|
# here for simplicity.
|
||||||
|
|
||||||
|
# We need `clock_gettime` from 'librt' for the `ftbench` demo program.
|
||||||
|
#
|
||||||
|
# The code is modeled after gnulib's file `clock_time.m4`, ignoring
|
||||||
|
# very old Solaris systems.
|
||||||
LIB_CLOCK_GETTIME=
|
LIB_CLOCK_GETTIME=
|
||||||
AC_SEARCH_LIBS([clock_gettime],
|
AC_SEARCH_LIBS([clock_gettime],
|
||||||
[rt],
|
[rt],
|
||||||
[test "$ac_cv_search_clock_gettime" = "none required" \
|
[test "$ac_cv_search_clock_gettime" = "none required" \
|
||||||
|| LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
|
|| LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
|
||||||
AC_SUBST([LIB_CLOCK_GETTIME])
|
|
||||||
|
FT_DEMO_CFLAGS=""
|
||||||
|
FT_DEMO_LDFLAGS="$LIB_CLOCK_GETTIME"
|
||||||
|
|
||||||
|
# 'librsvg' is needed to demonstrate SVG support.
|
||||||
|
AC_ARG_WITH([librsvg],
|
||||||
|
[AS_HELP_STRING([--with-librsvg=@<:@yes|no|auto@:>@],
|
||||||
|
[support OpenType SVG fonts in FreeType demo programs @<:@default=auto@:>@])],
|
||||||
|
[], [with_librsvg=auto])
|
||||||
|
|
||||||
|
have_librsvg=no
|
||||||
|
if test x"$with_librsvg" = xyes -o x"$with_librsvg" = xauto; then
|
||||||
|
PKG_CHECK_MODULES([LIBRSVG], [librsvg-2.0 >= 2.46.0],
|
||||||
|
[have_librsvg="yes (pkg-config)"], [:])
|
||||||
|
|
||||||
|
if test "$have_librsvg" != no; then
|
||||||
|
FT_DEMO_CFLAGS="$FT_DEMO_CFLAGS $LIBRSVG_CFLAGS -DHAVE_LIBRSVG"
|
||||||
|
FT_DEMO_LDFLAGS="$FT_DEMO_LDFLAGS $LIBRSVG_LIBS"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test x"$with_librsvg" = xyes -a "$have_librsvg" = no; then
|
||||||
|
AC_MSG_ERROR([librsvg support requested but library not found])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST([FT_DEMO_CFLAGS])
|
||||||
|
AC_SUBST([FT_DEMO_LDFLAGS])
|
||||||
|
|
||||||
|
|
||||||
# Some options handling SDKs/archs in CFLAGS should be copied
|
# Some options handling SDKs/archs in CFLAGS should be copied
|
||||||
|
|
@ -956,38 +961,68 @@ case "$CFLAGS" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Check for pthreads
|
||||||
|
|
||||||
# entries in Requires.private are separated by commas;
|
AX_PTHREAD([have_pthread=yes], [have_pthread=no])
|
||||||
REQUIRES_PRIVATE="$zlib_reqpriv, \
|
|
||||||
$bzip2_reqpriv, \
|
|
||||||
$libpng_reqpriv, \
|
|
||||||
$harfbuzz_reqpriv"
|
|
||||||
# beautify
|
|
||||||
REQUIRES_PRIVATE=`echo "$REQUIRES_PRIVATE" \
|
|
||||||
| sed -e 's/^ *//' \
|
|
||||||
-e 's/ *$//' \
|
|
||||||
-e 's/, */,/g' \
|
|
||||||
-e 's/,,*/,/g' \
|
|
||||||
-e 's/^,*//' \
|
|
||||||
-e 's/,*$//' \
|
|
||||||
-e 's/,/, /g'`
|
|
||||||
|
|
||||||
LIBS_PRIVATE="$zlib_libspriv \
|
# Check for Python and docwriter
|
||||||
$bzip2_libspriv \
|
|
||||||
$libpng_libspriv \
|
have_py3=no
|
||||||
$harfbuzz_libspriv \
|
have_docwriter=no
|
||||||
$ft2_extra_libs"
|
PIP=pip
|
||||||
|
|
||||||
|
AC_CHECK_PROGS([PYTHON], [python3 python], [missing])
|
||||||
|
if test "x$PYTHON" != "xmissing"; then
|
||||||
|
AX_PROG_PYTHON_VERSION([3.5], [have_py3=yes], [])
|
||||||
|
|
||||||
|
if test "x$have_py3" = "xyes"; then
|
||||||
|
PIP="$PYTHON -m $PIP"
|
||||||
|
AC_MSG_CHECKING([for `docwriter' Python module])
|
||||||
|
$PYTHON -m docwriter -h > /dev/null 2>&1
|
||||||
|
if test "x$?" = "x0"; then
|
||||||
|
have_docwriter=yes
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# entries in Requires.private are separated by commas
|
||||||
|
PKGCONFIG_REQUIRES_PRIVATE="$zlib_reqpriv, \
|
||||||
|
$bzip2_reqpriv, \
|
||||||
|
$libpng_reqpriv, \
|
||||||
|
$harfbuzz_reqpriv, \
|
||||||
|
$brotli_reqpriv"
|
||||||
# beautify
|
# beautify
|
||||||
LIBS_PRIVATE=`echo "$LIBS_PRIVATE" \
|
PKGCONFIG_REQUIRES_PRIVATE=`echo "$PKGCONFIG_REQUIRES_PRIVATE" \
|
||||||
| sed -e 's/^ *//' \
|
| sed -e 's/^ *//' \
|
||||||
-e 's/ *$//' \
|
-e 's/ *$//' \
|
||||||
-e 's/ */ /g'`
|
-e 's/, */,/g' \
|
||||||
|
-e 's/,,*/,/g' \
|
||||||
|
-e 's/^,*//' \
|
||||||
|
-e 's/,*$//' \
|
||||||
|
-e 's/,/, /g'`
|
||||||
|
|
||||||
|
PKGCONFIG_LIBS_PRIVATE="$zlib_libspriv \
|
||||||
|
$bzip2_libspriv \
|
||||||
|
$libpng_libspriv \
|
||||||
|
$harfbuzz_libspriv \
|
||||||
|
$brotli_libspriv \
|
||||||
|
$ft2_extra_libs"
|
||||||
|
# beautify
|
||||||
|
PKGCONFIG_LIBS_PRIVATE=`echo "$PKGCONFIG_LIBS_PRIVATE" \
|
||||||
|
| sed -e 's/^ *//' \
|
||||||
|
-e 's/ *$//' \
|
||||||
|
-e 's/ */ /g'`
|
||||||
|
|
||||||
LIBSSTATIC_CONFIG="-lfreetype \
|
LIBSSTATIC_CONFIG="-lfreetype \
|
||||||
$zlib_libsstaticconf \
|
$zlib_libsstaticconf \
|
||||||
$bzip2_libsstaticconf \
|
$bzip2_libsstaticconf \
|
||||||
$libpng_libsstaticconf \
|
$libpng_libsstaticconf \
|
||||||
$harfbuzz_libsstaticconf \
|
$harfbuzz_libsstaticconf \
|
||||||
|
$brotli_libsstaticconf \
|
||||||
$ft2_extra_libs"
|
$ft2_extra_libs"
|
||||||
# remove -L/usr/lib and -L/usr/lib64 since `freetype-config' adds them later
|
# remove -L/usr/lib and -L/usr/lib64 since `freetype-config' adds them later
|
||||||
# on if necessary; also beautify
|
# on if necessary; also beautify
|
||||||
|
|
@ -998,10 +1033,28 @@ LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG" \
|
||||||
-e 's/ *$//' \
|
-e 's/ *$//' \
|
||||||
-e 's/ */ /g'`
|
-e 's/ */ /g'`
|
||||||
|
|
||||||
|
# If FreeType gets installed with `--disable-shared', don't use
|
||||||
|
# 'private' fields. `pkg-config' only looks into `.pc' files and is
|
||||||
|
# completely agnostic to whether shared libraries are actually present
|
||||||
|
# or not. As a consequence, the user had to specify `--static' while
|
||||||
|
# calling `pkg-config', which configure scripts are normally not
|
||||||
|
# prepared for.
|
||||||
|
|
||||||
|
PKGCONFIG_REQUIRES=
|
||||||
|
PKGCONFIG_LIBS='-L${libdir} -lfreetype'
|
||||||
|
|
||||||
|
if test $enable_shared = "no"; then
|
||||||
|
PKGCONFIG_REQUIRES="$PKGCONFIG_REQUIRES $PKGCONFIG_REQUIRES_PRIVATE"
|
||||||
|
PKGCONFIG_REQUIRES_PRIVATE=
|
||||||
|
PKGCONFIG_LIBS="$PKGCONFIG_LIBS $PKGCONFIG_LIBS_PRIVATE"
|
||||||
|
PKGCONFIG_LIBS_PRIVATE=
|
||||||
|
fi
|
||||||
|
|
||||||
AC_SUBST([ftmac_c])
|
AC_SUBST([ftmac_c])
|
||||||
AC_SUBST([REQUIRES_PRIVATE])
|
AC_SUBST([PKGCONFIG_REQUIRES])
|
||||||
AC_SUBST([LIBS_PRIVATE])
|
AC_SUBST([PKGCONFIG_LIBS])
|
||||||
|
AC_SUBST([PKGCONFIG_REQUIRES_PRIVATE])
|
||||||
|
AC_SUBST([PKGCONFIG_LIBS_PRIVATE])
|
||||||
AC_SUBST([LIBSSTATIC_CONFIG])
|
AC_SUBST([LIBSSTATIC_CONFIG])
|
||||||
|
|
||||||
AC_SUBST([hardcode_libdir_flag_spec])
|
AC_SUBST([hardcode_libdir_flag_spec])
|
||||||
|
|
@ -1052,6 +1105,18 @@ if test "$have_harfbuzz" != no; then
|
||||||
else
|
else
|
||||||
ftoption_unset FT_CONFIG_OPTION_USE_HARFBUZZ
|
ftoption_unset FT_CONFIG_OPTION_USE_HARFBUZZ
|
||||||
fi
|
fi
|
||||||
|
if test "$have_brotli" != no; then
|
||||||
|
CFLAGS="$CFLAGS $BROTLI_CFLAGS"
|
||||||
|
LDFLAGS="$LDFLAGS $BROTLI_LIBS"
|
||||||
|
ftoption_set FT_CONFIG_OPTION_USE_BROTLI
|
||||||
|
else
|
||||||
|
ftoption_unset FT_CONFIG_OPTION_USE_BROTLI
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$have_pthread" != no; then
|
||||||
|
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||||
|
LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS $PTHREAD_LIBS"
|
||||||
|
fi
|
||||||
|
|
||||||
AC_SUBST([CFLAGS])
|
AC_SUBST([CFLAGS])
|
||||||
AC_SUBST([LDFLAGS])
|
AC_SUBST([LDFLAGS])
|
||||||
|
|
@ -1069,15 +1134,7 @@ AC_CONFIG_FILES([ftoption.h:${srcdir}/../../include/freetype/config/ftoption.h],
|
||||||
rm ftoption.tmp],
|
rm ftoption.tmp],
|
||||||
[FTOPTION_H_SED="$FTOPTION_H_SED"])
|
[FTOPTION_H_SED="$FTOPTION_H_SED"])
|
||||||
|
|
||||||
# configuration file -- stay in 8.3 limit
|
AC_CONFIG_HEADERS([ftconfig.h])
|
||||||
#
|
|
||||||
# since #undef doesn't survive in configuration header files we replace
|
|
||||||
# `/undef' with `#undef' after creating the output file
|
|
||||||
|
|
||||||
AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in],
|
|
||||||
[mv ftconfig.h ftconfig.tmp
|
|
||||||
sed 's|/undef|#undef|' < ftconfig.tmp > ftconfig.h
|
|
||||||
rm ftconfig.tmp])
|
|
||||||
|
|
||||||
# create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk'
|
# create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk'
|
||||||
# and `builds/unix/unix-cc.mk' that will be used by the build system
|
# and `builds/unix/unix-cc.mk' that will be used by the build system
|
||||||
|
|
@ -1085,10 +1142,6 @@ AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in],
|
||||||
AC_CONFIG_FILES([unix-cc.mk:unix-cc.in
|
AC_CONFIG_FILES([unix-cc.mk:unix-cc.in
|
||||||
unix-def.mk:unix-def.in])
|
unix-def.mk:unix-def.in])
|
||||||
|
|
||||||
# re-generate the Jamfile to use libtool now
|
|
||||||
#
|
|
||||||
# AC_CONFIG_FILES([../../Jamfile:../../Jamfile.in])
|
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
AC_MSG_NOTICE([
|
AC_MSG_NOTICE([
|
||||||
|
|
@ -1098,6 +1151,29 @@ Library configuration:
|
||||||
bzip2: $have_bzip2
|
bzip2: $have_bzip2
|
||||||
libpng: $have_libpng
|
libpng: $have_libpng
|
||||||
harfbuzz: $have_harfbuzz
|
harfbuzz: $have_harfbuzz
|
||||||
|
brotli: $have_brotli
|
||||||
|
pthread: $have_pthread
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# Warn if docwriter is not installed
|
||||||
|
|
||||||
|
if test $have_docwriter = no; then
|
||||||
|
AC_MSG_WARN([
|
||||||
|
`make refdoc' will fail since pip package `docwriter' is not installed.
|
||||||
|
To install, run `$PIP install docwriter', or to use a Python
|
||||||
|
virtual environment, run `make refdoc-venv' (requires pip package
|
||||||
|
`virtualenv'). These operations require Python >= 3.5.
|
||||||
|
])
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Warn if pthread is not available
|
||||||
|
|
||||||
|
if test $have_pthread = no; then
|
||||||
|
AC_MSG_WARN([
|
||||||
|
`FT_DEBUG_LOGGING' will not work since the `pthread' library is not
|
||||||
|
available. This warning can be safely ignored if you don't plan to use
|
||||||
|
this configuration macro.
|
||||||
|
])
|
||||||
|
fi
|
||||||
|
|
||||||
# end of configure.raw
|
# end of configure.raw
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
#
|
#
|
||||||
# Copyright 2001-2018 by
|
# Copyright (C) 2001-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -12,12 +12,12 @@
|
||||||
# fully.
|
# fully.
|
||||||
|
|
||||||
AC_INIT([FreeType], [@VERSION@], [freetype@nongnu.org], [freetype])
|
AC_INIT([FreeType], [@VERSION@], [freetype@nongnu.org], [freetype])
|
||||||
AC_CONFIG_SRCDIR([ftconfig.in])
|
AC_CONFIG_SRCDIR([ftconfig.h.in])
|
||||||
|
|
||||||
|
|
||||||
# Don't forget to update `docs/VERSIONS.TXT'!
|
# Don't forget to update `docs/VERSIONS.TXT'!
|
||||||
|
|
||||||
version_info='22:1:16'
|
version_info='25:0:19'
|
||||||
AC_SUBST([version_info])
|
AC_SUBST([version_info])
|
||||||
ft_version=`echo $version_info | tr : .`
|
ft_version=`echo $version_info | tr : .`
|
||||||
AC_SUBST([ft_version])
|
AC_SUBST([ft_version])
|
||||||
|
|
@ -37,7 +37,7 @@ AC_SUBST(EXEEXT)
|
||||||
PKG_PROG_PKG_CONFIG([0.24])
|
PKG_PROG_PKG_CONFIG([0.24])
|
||||||
|
|
||||||
LT_INIT(win32-dll)
|
LT_INIT(win32-dll)
|
||||||
LT_PROG_RC
|
AC_CHECK_HEADER([windows.h], [LT_PROG_RC])
|
||||||
|
|
||||||
|
|
||||||
# checks for native programs to generate building tool
|
# checks for native programs to generate building tool
|
||||||
|
|
@ -50,7 +50,7 @@ if test ${cross_compiling} = yes; then
|
||||||
|
|
||||||
AC_MSG_CHECKING([for suffix of native executables])
|
AC_MSG_CHECKING([for suffix of native executables])
|
||||||
rm -f a.* b.* a_out.exe conftest.*
|
rm -f a.* b.* a_out.exe conftest.*
|
||||||
echo > conftest.c "int main() { return 0;}"
|
echo > conftest.c "int main(void) { return 0;}"
|
||||||
${CC_BUILD} conftest.c || AC_MSG_ERROR([native C compiler is not working])
|
${CC_BUILD} conftest.c || AC_MSG_ERROR([native C compiler is not working])
|
||||||
rm -f conftest.c
|
rm -f conftest.c
|
||||||
if test -x a.out -o -x b.out -o -x conftest; then
|
if test -x a.out -o -x b.out -o -x conftest; then
|
||||||
|
|
@ -97,85 +97,12 @@ esac
|
||||||
|
|
||||||
# checks for header files
|
# checks for header files
|
||||||
|
|
||||||
AC_HEADER_STDC
|
|
||||||
AC_CHECK_HEADERS([fcntl.h unistd.h])
|
AC_CHECK_HEADERS([fcntl.h unistd.h])
|
||||||
|
|
||||||
|
|
||||||
# checks for typedefs, structures, and compiler characteristics
|
# checks for typedefs, structures, and compiler characteristics
|
||||||
|
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
AC_CHECK_SIZEOF([int])
|
|
||||||
AC_CHECK_SIZEOF([long])
|
|
||||||
AC_TYPE_LONG_LONG_INT
|
|
||||||
|
|
||||||
|
|
||||||
# check whether cpp computation of size of int and long in ftconfig.in works
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.in works])
|
|
||||||
orig_CPPFLAGS="${CPPFLAGS}"
|
|
||||||
CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include/freetype/config ${CPPFLAGS}"
|
|
||||||
|
|
||||||
ac_clean_files=
|
|
||||||
if test ! -f ft2build.h; then
|
|
||||||
ac_clean_files=ft2build.h
|
|
||||||
touch ft2build.h
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat > conftest.c <<\_ACEOF
|
|
||||||
#include <limits.h>
|
|
||||||
#define FT_CONFIG_OPTIONS_H "ftoption.h"
|
|
||||||
#define FT_CONFIG_STANDARD_LIBRARY_H "ftstdlib.h"
|
|
||||||
#define FT_UINT_MAX UINT_MAX
|
|
||||||
#define FT_ULONG_MAX ULONG_MAX
|
|
||||||
#include "ftconfig.in"
|
|
||||||
_ACEOF
|
|
||||||
echo >> conftest.c "#if FT_SIZEOF_INT == "${ac_cv_sizeof_int}
|
|
||||||
echo >> conftest.c "ac_cpp_ft_sizeof_int="${ac_cv_sizeof_int}
|
|
||||||
echo >> conftest.c "#endif"
|
|
||||||
echo >> conftest.c "#if FT_SIZEOF_LONG == "${ac_cv_sizeof_long}
|
|
||||||
echo >> conftest.c "ac_cpp_ft_sizeof_long="${ac_cv_sizeof_long}
|
|
||||||
echo >> conftest.c "#endif"
|
|
||||||
|
|
||||||
${CPP} ${CPPFLAGS} conftest.c | ${GREP} ac_cpp_ft > conftest.sh
|
|
||||||
eval `cat conftest.sh`
|
|
||||||
rm -f conftest.* $ac_clean_files
|
|
||||||
|
|
||||||
if test x != "x${ac_cpp_ft_sizeof_int}" \
|
|
||||||
-a x != x"${ac_cpp_ft_sizeof_long}"; then
|
|
||||||
unset ft_use_autoconf_sizeof_types
|
|
||||||
else
|
|
||||||
ft_use_autoconf_sizeof_types=yes
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(biarch-config,
|
|
||||||
[ --enable-biarch-config install biarch ftconfig.h to support multiple
|
|
||||||
architectures by single file], [], [])
|
|
||||||
|
|
||||||
case :${ft_use_autoconf_sizeof_types}:${enable_biarch_config}: in
|
|
||||||
:yes:yes:)
|
|
||||||
AC_MSG_RESULT([broken but use it])
|
|
||||||
unset ft_use_autoconf_sizeof_types
|
|
||||||
;;
|
|
||||||
::no:)
|
|
||||||
AC_MSG_RESULT([works but ignore it])
|
|
||||||
ft_use_autoconf_sizeof_types=yes
|
|
||||||
;;
|
|
||||||
::yes: | :::)
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
unset ft_use_autoconf_sizeof_types
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
ft_use_autoconf_sizeof_types=yes
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test x"${ft_use_autoconf_sizeof_types}" = xyes; then
|
|
||||||
AC_DEFINE([FT_USE_AUTOCONF_SIZEOF_TYPES], [],
|
|
||||||
[Define if autoconf sizeof types should be used.])
|
|
||||||
fi
|
|
||||||
|
|
||||||
CPPFLAGS="${orig_CPPFLAGS}"
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([freetype-config],
|
AC_ARG_ENABLE([freetype-config],
|
||||||
AS_HELP_STRING([--enable-freetype-config], [install freetype-config]),
|
AS_HELP_STRING([--enable-freetype-config], [install freetype-config]),
|
||||||
|
|
@ -192,53 +119,56 @@ AC_SUBST(INSTALL_FT2_CONFIG, [$enable_freetype_config])
|
||||||
AC_SYS_LARGEFILE
|
AC_SYS_LARGEFILE
|
||||||
|
|
||||||
# Here we check whether we can use our mmap file component.
|
# Here we check whether we can use our mmap file component.
|
||||||
|
#
|
||||||
|
# Note that `ftsystem.c` for Windows has its own mmap-like implementation
|
||||||
|
# not covered by `AC_FUNC_MMAP` and/or `FT_UNMAP_PARAM`.
|
||||||
|
|
||||||
AC_ARG_ENABLE([mmap],
|
AC_ARG_ENABLE([mmap],
|
||||||
AS_HELP_STRING([--disable-mmap],
|
AS_HELP_STRING([--disable-mmap],
|
||||||
[do not check mmap() and do not use]),
|
[do not check mmap() and do not use]),
|
||||||
[enable_mmap="no"],[enable_mmap="yes"])
|
[enable_mmap="no"], [enable_mmap="yes"])
|
||||||
if test "x${enable_mmap}" != "xno"; then
|
if test "x${enable_mmap}" != "xno"; then
|
||||||
AC_FUNC_MMAP
|
case "$host" in
|
||||||
fi
|
*-*-mingw*)
|
||||||
if test "x${enable_mmap}" = "xno" \
|
AC_MSG_CHECKING([for working mmap])
|
||||||
-o "$ac_cv_func_mmap_fixed_mapped" != "yes"; then
|
AC_MSG_RESULT([using MapViewOfFile in Windows])
|
||||||
FTSYS_SRC='$(BASE_DIR)/ftsystem.c'
|
FTSYS_SRC='$(TOP_DIR)/builds/windows/ftsystem.c'
|
||||||
else
|
;;
|
||||||
FTSYS_SRC='$(BUILD_DIR)/ftsystem.c'
|
*)
|
||||||
|
AC_FUNC_MMAP
|
||||||
|
if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then
|
||||||
|
FTSYS_SRC='$(PLATFORM_DIR)/ftsystem.c'
|
||||||
|
|
||||||
AC_CHECK_DECLS([munmap],
|
AC_CHECK_DECLS([munmap],
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
[
|
[
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
||||||
FT_MUNMAP_PARAM
|
FT_MUNMAP_PARAM
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "$FTSYS_SRC"; then
|
||||||
|
FTSYS_SRC='$(BASE_DIR)/ftsystem.c'
|
||||||
fi
|
fi
|
||||||
AC_SUBST([FTSYS_SRC])
|
AC_SUBST([FTSYS_SRC])
|
||||||
|
|
||||||
AC_CHECK_FUNCS([memcpy memmove])
|
|
||||||
|
|
||||||
|
|
||||||
# get compiler flags right
|
# get compiler flags right
|
||||||
#
|
#
|
||||||
# We try to make the compiler work for C89-strict source. Even if the
|
# We try to make the compiler work for C99-strict source. Even if the
|
||||||
# C compiler is gcc and C89 flags are available, some system headers
|
# C compiler is gcc and C99 flags are available, some system headers
|
||||||
# (e.g., Android Bionic libc) are broken in C89 mode. We have to check
|
# might be broken in C99 mode. We have to check whether compilation
|
||||||
# whether the compilation finishes successfully.
|
# finishes successfully.
|
||||||
#
|
|
||||||
# Due to bugs in mingwrt 4.0.3 we don't use `-ansi' for MinGW.
|
|
||||||
#
|
|
||||||
# To avoid zillions of
|
|
||||||
#
|
|
||||||
# ISO C90 does not support 'long long'
|
|
||||||
#
|
|
||||||
# warnings, we disable `-pedantic' for gcc version < 4.6.
|
|
||||||
#
|
#
|
||||||
if test "x$GCC" = xyes; then
|
if test "x$GCC" = xyes; then
|
||||||
XX_CFLAGS="-Wall"
|
XX_CFLAGS="-Wall"
|
||||||
|
|
@ -250,23 +180,11 @@ if test "x$GCC" = xyes; then
|
||||||
XX_ANSIFLAGS="-pedantic"
|
XX_ANSIFLAGS="-pedantic"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
GCC_VERSION=`$CC -dumpversion`
|
|
||||||
GCC_MAJOR=`echo "$GCC_VERSION" | sed 's/\([[^.]][[^.]]*\).*/\1/'`
|
|
||||||
GCC_MINOR=`echo "$GCC_VERSION" | sed 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'`
|
|
||||||
|
|
||||||
XX_PEDANTIC=-pedantic
|
|
||||||
if test $GCC_MAJOR -lt 4; then
|
|
||||||
XX_PEDANTIC=
|
|
||||||
else
|
|
||||||
if test $GCC_MAJOR -eq 4 -a $GCC_MINOR -lt 6; then
|
|
||||||
XX_PEDANTIC=
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
XX_ANSIFLAGS=""
|
XX_ANSIFLAGS=""
|
||||||
for a in $XX_PEDANTIC -ansi
|
|
||||||
|
for a in "-pedantic" "-std=c99"
|
||||||
do
|
do
|
||||||
AC_MSG_CHECKING([gcc compiler flag ${a} to assure ANSI C works correctly])
|
AC_MSG_CHECKING([$CC compiler flag ${a} to assure ANSI C99 works correctly])
|
||||||
orig_CFLAGS="${CFLAGS}"
|
orig_CFLAGS="${CFLAGS}"
|
||||||
CFLAGS="${CFLAGS} ${XX_ANSIFLAGS} ${a}"
|
CFLAGS="${CFLAGS} ${XX_ANSIFLAGS} ${a}"
|
||||||
AC_COMPILE_IFELSE([
|
AC_COMPILE_IFELSE([
|
||||||
|
|
@ -311,14 +229,26 @@ AC_SUBST([XX_ANSIFLAGS])
|
||||||
# It is recommended that shared libraries hide symbols except those with
|
# It is recommended that shared libraries hide symbols except those with
|
||||||
# explicit __attribute__((visibility("default"))).
|
# explicit __attribute__((visibility("default"))).
|
||||||
#
|
#
|
||||||
|
found_visibility_flag=no
|
||||||
AC_MSG_CHECKING([for -fvisibility=hidden compiler flag])
|
AC_MSG_CHECKING([for -fvisibility=hidden compiler flag])
|
||||||
orig_CFLAGS="${CFLAGS}"
|
orig_CFLAGS="${CFLAGS}"
|
||||||
CFLAGS="${CFLAGS} -fvisibility=hidden"
|
CFLAGS="${CFLAGS} -fvisibility=hidden"
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
|
||||||
AC_MSG_RESULT(yes),
|
[found_visibility_flag=yes
|
||||||
CFLAGS="${orig_CFLAGS}"
|
AC_MSG_RESULT(yes)],
|
||||||
AC_MSG_RESULT(no))
|
[CFLAGS="${orig_CFLAGS}"
|
||||||
|
AC_MSG_RESULT(no)])
|
||||||
|
|
||||||
|
if test "${found_visibility_flag}" = "no"; then
|
||||||
|
AC_MSG_CHECKING([for -xldscope=hidden compiler flag])
|
||||||
|
orig_CFLAGS="${CFLAGS}"
|
||||||
|
CFLAGS="${CFLAGS} -xldscope=hidden"
|
||||||
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
|
||||||
|
[found_visibility_flag=yes
|
||||||
|
AC_MSG_RESULT(yes)],
|
||||||
|
[CFLAGS="${orig_CFLAGS}"
|
||||||
|
AC_MSG_RESULT(no)])
|
||||||
|
fi
|
||||||
|
|
||||||
# All library tests below try `pkg-config' first. If that fails, a function
|
# All library tests below try `pkg-config' first. If that fails, a function
|
||||||
# from the library is tested in the traditional autoconf way (zlib, bzip2),
|
# from the library is tested in the traditional autoconf way (zlib, bzip2),
|
||||||
|
|
@ -384,6 +314,12 @@ if test x"$with_zlib" = xyes -a "$have_zlib" = no; then
|
||||||
AC_MSG_ERROR([external zlib support requested but library not found])
|
AC_MSG_ERROR([external zlib support requested but library not found])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
SYSTEM_ZLIB=
|
||||||
|
if test "$have_zlib" != no; then
|
||||||
|
SYSTEM_ZLIB=yes
|
||||||
|
fi
|
||||||
|
AC_SUBST([SYSTEM_ZLIB])
|
||||||
|
|
||||||
|
|
||||||
# check for system libbz2
|
# check for system libbz2
|
||||||
|
|
||||||
|
|
@ -466,17 +402,13 @@ if test x"$with_png" = xyes -o x"$with_png" = xauto; then
|
||||||
libpng_libsstaticconf="$LIBPNG_LIBS"
|
libpng_libsstaticconf="$LIBPNG_LIBS"
|
||||||
have_libpng="yes (LIBPNG_CFLAGS and LIBPNG_LIBS)"
|
have_libpng="yes (LIBPNG_CFLAGS and LIBPNG_LIBS)"
|
||||||
else
|
else
|
||||||
# fall back to config script.
|
# fall back to config script
|
||||||
AC_MSG_CHECKING([for libpng-config])
|
AC_CHECK_PROG(have_libpng, [libpng-config], [yes (libpng-config)], [no])
|
||||||
if which libpng-config > /dev/null 2>&1; then
|
if test "$have_libpng" != no; then
|
||||||
LIBPNG_CFLAGS=`libpng-config --cflags`
|
LIBPNG_CFLAGS=`libpng-config --cflags`
|
||||||
LIBPNG_LIBS=`libpng-config --ldflags`
|
LIBPNG_LIBS=`libpng-config --ldflags`
|
||||||
libpng_libspriv=`libpng-config --static --ldflags`
|
libpng_libspriv=`libpng-config --static --ldflags`
|
||||||
libpng_libsstaticconf="$libpng_libspriv"
|
libpng_libsstaticconf="$libpng_libspriv"
|
||||||
have_libpng="yes (libpng-config)"
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
else
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
@ -496,7 +428,7 @@ AC_ARG_WITH([harfbuzz],
|
||||||
|
|
||||||
have_harfbuzz=no
|
have_harfbuzz=no
|
||||||
if test x"$with_harfbuzz" = xyes -o x"$with_harfbuzz" = xauto; then
|
if test x"$with_harfbuzz" = xyes -o x"$with_harfbuzz" = xauto; then
|
||||||
harfbuzz_pkg="harfbuzz >= 1.3.0"
|
harfbuzz_pkg="harfbuzz >= 2.0.0"
|
||||||
have_harfbuzz_pkg=no
|
have_harfbuzz_pkg=no
|
||||||
|
|
||||||
if test x"$HARFBUZZ_CFLAGS" = x -a x"$HARFBUZZ_LIBS" = x; then
|
if test x"$HARFBUZZ_CFLAGS" = x -a x"$HARFBUZZ_LIBS" = x; then
|
||||||
|
|
@ -531,19 +463,92 @@ if test x"$with_harfbuzz" = xyes -a "$have_harfbuzz" = no; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# check for librt
|
# check for system libbrotlidec
|
||||||
#
|
|
||||||
# We need `clock_gettime' for the `ftbench' demo program.
|
|
||||||
#
|
|
||||||
# The code is modeled after gnulib's file `clock_time.m4', ignoring
|
|
||||||
# very old Solaris systems.
|
|
||||||
|
|
||||||
|
AC_ARG_WITH([brotli],
|
||||||
|
[AS_HELP_STRING([--with-brotli=@<:@yes|no|auto@:>@],
|
||||||
|
[support decompression of WOFF2 streams @<:@default=auto@:>@])],
|
||||||
|
[], [with_brotli=auto])
|
||||||
|
|
||||||
|
have_brotli=no
|
||||||
|
if test x"$with_brotli" = xyes -o x"$with_brotli" = xauto; then
|
||||||
|
brotli_pkg="libbrotlidec"
|
||||||
|
have_brotli_pkg=no
|
||||||
|
|
||||||
|
if test x"$BROTLI_CFLAGS" = x -a x"$BROTLI_LIBS" = x; then
|
||||||
|
PKG_CHECK_EXISTS([$brotli_pkg], [have_brotli_pkg=yes])
|
||||||
|
fi
|
||||||
|
PKG_CHECK_MODULES([BROTLI], [$brotli_pkg],
|
||||||
|
[have_brotli="yes (pkg-config)"], [:])
|
||||||
|
|
||||||
|
if test $have_brotli_pkg = yes; then
|
||||||
|
# we have libbrotlidec.pc
|
||||||
|
brotli_reqpriv="$brotli_pkg"
|
||||||
|
brotli_libspriv=
|
||||||
|
brotli_libsstaticconf=`$PKG_CONFIG --static --libs "$brotli_pkg"`
|
||||||
|
else
|
||||||
|
brotli_reqpriv=
|
||||||
|
|
||||||
|
if test "$have_brotli" != no; then
|
||||||
|
# BROTLI_CFLAGS and BROTLI_LIBS are set by the user
|
||||||
|
brotli_libspriv="$BROTLI_LIBS"
|
||||||
|
brotli_libsstaticconf="$BROTLI_LIBS"
|
||||||
|
have_brotli="yes (BROTLI_CFLAGS and BROTLI_LIBS)"
|
||||||
|
else
|
||||||
|
# since Brotli is quite a new library we don't fall back to a
|
||||||
|
# different test
|
||||||
|
:
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test x"$with_brotli" = xyes -a "$have_brotli" = no; then
|
||||||
|
AC_MSG_ERROR([brotli support requested but library not found])
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Checks for the demo programs.
|
||||||
|
#
|
||||||
|
# FreeType doesn't need this. However, since the demo program repository
|
||||||
|
# doesn't come with a `configure` script of its own, we integrate the tests
|
||||||
|
# here for simplicity.
|
||||||
|
|
||||||
|
# We need `clock_gettime` from 'librt' for the `ftbench` demo program.
|
||||||
|
#
|
||||||
|
# The code is modeled after gnulib's file `clock_time.m4`, ignoring
|
||||||
|
# very old Solaris systems.
|
||||||
LIB_CLOCK_GETTIME=
|
LIB_CLOCK_GETTIME=
|
||||||
AC_SEARCH_LIBS([clock_gettime],
|
AC_SEARCH_LIBS([clock_gettime],
|
||||||
[rt],
|
[rt],
|
||||||
[test "$ac_cv_search_clock_gettime" = "none required" \
|
[test "$ac_cv_search_clock_gettime" = "none required" \
|
||||||
|| LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
|
|| LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
|
||||||
AC_SUBST([LIB_CLOCK_GETTIME])
|
|
||||||
|
FT_DEMO_CFLAGS=""
|
||||||
|
FT_DEMO_LDFLAGS="$LIB_CLOCK_GETTIME"
|
||||||
|
|
||||||
|
# 'librsvg' is needed to demonstrate SVG support.
|
||||||
|
AC_ARG_WITH([librsvg],
|
||||||
|
[AS_HELP_STRING([--with-librsvg=@<:@yes|no|auto@:>@],
|
||||||
|
[support OpenType SVG fonts in FreeType demo programs @<:@default=auto@:>@])],
|
||||||
|
[], [with_librsvg=auto])
|
||||||
|
|
||||||
|
have_librsvg=no
|
||||||
|
if test x"$with_librsvg" = xyes -o x"$with_librsvg" = xauto; then
|
||||||
|
PKG_CHECK_MODULES([LIBRSVG], [librsvg-2.0 >= 2.46.0],
|
||||||
|
[have_librsvg="yes (pkg-config)"], [:])
|
||||||
|
|
||||||
|
if test "$have_librsvg" != no; then
|
||||||
|
FT_DEMO_CFLAGS="$FT_DEMO_CFLAGS $LIBRSVG_CFLAGS -DHAVE_LIBRSVG"
|
||||||
|
FT_DEMO_LDFLAGS="$FT_DEMO_LDFLAGS $LIBRSVG_LIBS"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test x"$with_librsvg" = xyes -a "$have_librsvg" = no; then
|
||||||
|
AC_MSG_ERROR([librsvg support requested but library not found])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST([FT_DEMO_CFLAGS])
|
||||||
|
AC_SUBST([FT_DEMO_LDFLAGS])
|
||||||
|
|
||||||
|
|
||||||
# Some options handling SDKs/archs in CFLAGS should be copied
|
# Some options handling SDKs/archs in CFLAGS should be copied
|
||||||
|
|
@ -956,38 +961,68 @@ case "$CFLAGS" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Check for pthreads
|
||||||
|
|
||||||
# entries in Requires.private are separated by commas;
|
AX_PTHREAD([have_pthread=yes], [have_pthread=no])
|
||||||
REQUIRES_PRIVATE="$zlib_reqpriv, \
|
|
||||||
$bzip2_reqpriv, \
|
|
||||||
$libpng_reqpriv, \
|
|
||||||
$harfbuzz_reqpriv"
|
|
||||||
# beautify
|
|
||||||
REQUIRES_PRIVATE=`echo "$REQUIRES_PRIVATE" \
|
|
||||||
| sed -e 's/^ *//' \
|
|
||||||
-e 's/ *$//' \
|
|
||||||
-e 's/, */,/g' \
|
|
||||||
-e 's/,,*/,/g' \
|
|
||||||
-e 's/^,*//' \
|
|
||||||
-e 's/,*$//' \
|
|
||||||
-e 's/,/, /g'`
|
|
||||||
|
|
||||||
LIBS_PRIVATE="$zlib_libspriv \
|
# Check for Python and docwriter
|
||||||
$bzip2_libspriv \
|
|
||||||
$libpng_libspriv \
|
have_py3=no
|
||||||
$harfbuzz_libspriv \
|
have_docwriter=no
|
||||||
$ft2_extra_libs"
|
PIP=pip
|
||||||
|
|
||||||
|
AC_CHECK_PROGS([PYTHON], [python3 python], [missing])
|
||||||
|
if test "x$PYTHON" != "xmissing"; then
|
||||||
|
AX_PROG_PYTHON_VERSION([3.5], [have_py3=yes], [])
|
||||||
|
|
||||||
|
if test "x$have_py3" = "xyes"; then
|
||||||
|
PIP="$PYTHON -m $PIP"
|
||||||
|
AC_MSG_CHECKING([for `docwriter' Python module])
|
||||||
|
$PYTHON -m docwriter -h > /dev/null 2>&1
|
||||||
|
if test "x$?" = "x0"; then
|
||||||
|
have_docwriter=yes
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# entries in Requires.private are separated by commas
|
||||||
|
PKGCONFIG_REQUIRES_PRIVATE="$zlib_reqpriv, \
|
||||||
|
$bzip2_reqpriv, \
|
||||||
|
$libpng_reqpriv, \
|
||||||
|
$harfbuzz_reqpriv, \
|
||||||
|
$brotli_reqpriv"
|
||||||
# beautify
|
# beautify
|
||||||
LIBS_PRIVATE=`echo "$LIBS_PRIVATE" \
|
PKGCONFIG_REQUIRES_PRIVATE=`echo "$PKGCONFIG_REQUIRES_PRIVATE" \
|
||||||
| sed -e 's/^ *//' \
|
| sed -e 's/^ *//' \
|
||||||
-e 's/ *$//' \
|
-e 's/ *$//' \
|
||||||
-e 's/ */ /g'`
|
-e 's/, */,/g' \
|
||||||
|
-e 's/,,*/,/g' \
|
||||||
|
-e 's/^,*//' \
|
||||||
|
-e 's/,*$//' \
|
||||||
|
-e 's/,/, /g'`
|
||||||
|
|
||||||
|
PKGCONFIG_LIBS_PRIVATE="$zlib_libspriv \
|
||||||
|
$bzip2_libspriv \
|
||||||
|
$libpng_libspriv \
|
||||||
|
$harfbuzz_libspriv \
|
||||||
|
$brotli_libspriv \
|
||||||
|
$ft2_extra_libs"
|
||||||
|
# beautify
|
||||||
|
PKGCONFIG_LIBS_PRIVATE=`echo "$PKGCONFIG_LIBS_PRIVATE" \
|
||||||
|
| sed -e 's/^ *//' \
|
||||||
|
-e 's/ *$//' \
|
||||||
|
-e 's/ */ /g'`
|
||||||
|
|
||||||
LIBSSTATIC_CONFIG="-lfreetype \
|
LIBSSTATIC_CONFIG="-lfreetype \
|
||||||
$zlib_libsstaticconf \
|
$zlib_libsstaticconf \
|
||||||
$bzip2_libsstaticconf \
|
$bzip2_libsstaticconf \
|
||||||
$libpng_libsstaticconf \
|
$libpng_libsstaticconf \
|
||||||
$harfbuzz_libsstaticconf \
|
$harfbuzz_libsstaticconf \
|
||||||
|
$brotli_libsstaticconf \
|
||||||
$ft2_extra_libs"
|
$ft2_extra_libs"
|
||||||
# remove -L/usr/lib and -L/usr/lib64 since `freetype-config' adds them later
|
# remove -L/usr/lib and -L/usr/lib64 since `freetype-config' adds them later
|
||||||
# on if necessary; also beautify
|
# on if necessary; also beautify
|
||||||
|
|
@ -998,10 +1033,28 @@ LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG" \
|
||||||
-e 's/ *$//' \
|
-e 's/ *$//' \
|
||||||
-e 's/ */ /g'`
|
-e 's/ */ /g'`
|
||||||
|
|
||||||
|
# If FreeType gets installed with `--disable-shared', don't use
|
||||||
|
# 'private' fields. `pkg-config' only looks into `.pc' files and is
|
||||||
|
# completely agnostic to whether shared libraries are actually present
|
||||||
|
# or not. As a consequence, the user had to specify `--static' while
|
||||||
|
# calling `pkg-config', which configure scripts are normally not
|
||||||
|
# prepared for.
|
||||||
|
|
||||||
|
PKGCONFIG_REQUIRES=
|
||||||
|
PKGCONFIG_LIBS='-L${libdir} -lfreetype'
|
||||||
|
|
||||||
|
if test $enable_shared = "no"; then
|
||||||
|
PKGCONFIG_REQUIRES="$PKGCONFIG_REQUIRES $PKGCONFIG_REQUIRES_PRIVATE"
|
||||||
|
PKGCONFIG_REQUIRES_PRIVATE=
|
||||||
|
PKGCONFIG_LIBS="$PKGCONFIG_LIBS $PKGCONFIG_LIBS_PRIVATE"
|
||||||
|
PKGCONFIG_LIBS_PRIVATE=
|
||||||
|
fi
|
||||||
|
|
||||||
AC_SUBST([ftmac_c])
|
AC_SUBST([ftmac_c])
|
||||||
AC_SUBST([REQUIRES_PRIVATE])
|
AC_SUBST([PKGCONFIG_REQUIRES])
|
||||||
AC_SUBST([LIBS_PRIVATE])
|
AC_SUBST([PKGCONFIG_LIBS])
|
||||||
|
AC_SUBST([PKGCONFIG_REQUIRES_PRIVATE])
|
||||||
|
AC_SUBST([PKGCONFIG_LIBS_PRIVATE])
|
||||||
AC_SUBST([LIBSSTATIC_CONFIG])
|
AC_SUBST([LIBSSTATIC_CONFIG])
|
||||||
|
|
||||||
AC_SUBST([hardcode_libdir_flag_spec])
|
AC_SUBST([hardcode_libdir_flag_spec])
|
||||||
|
|
@ -1052,6 +1105,18 @@ if test "$have_harfbuzz" != no; then
|
||||||
else
|
else
|
||||||
ftoption_unset FT_CONFIG_OPTION_USE_HARFBUZZ
|
ftoption_unset FT_CONFIG_OPTION_USE_HARFBUZZ
|
||||||
fi
|
fi
|
||||||
|
if test "$have_brotli" != no; then
|
||||||
|
CFLAGS="$CFLAGS $BROTLI_CFLAGS"
|
||||||
|
LDFLAGS="$LDFLAGS $BROTLI_LIBS"
|
||||||
|
ftoption_set FT_CONFIG_OPTION_USE_BROTLI
|
||||||
|
else
|
||||||
|
ftoption_unset FT_CONFIG_OPTION_USE_BROTLI
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$have_pthread" != no; then
|
||||||
|
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||||
|
LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS $PTHREAD_LIBS"
|
||||||
|
fi
|
||||||
|
|
||||||
AC_SUBST([CFLAGS])
|
AC_SUBST([CFLAGS])
|
||||||
AC_SUBST([LDFLAGS])
|
AC_SUBST([LDFLAGS])
|
||||||
|
|
@ -1069,15 +1134,7 @@ AC_CONFIG_FILES([ftoption.h:${srcdir}/../../include/freetype/config/ftoption.h],
|
||||||
rm ftoption.tmp],
|
rm ftoption.tmp],
|
||||||
[FTOPTION_H_SED="$FTOPTION_H_SED"])
|
[FTOPTION_H_SED="$FTOPTION_H_SED"])
|
||||||
|
|
||||||
# configuration file -- stay in 8.3 limit
|
AC_CONFIG_HEADERS([ftconfig.h])
|
||||||
#
|
|
||||||
# since #undef doesn't survive in configuration header files we replace
|
|
||||||
# `/undef' with `#undef' after creating the output file
|
|
||||||
|
|
||||||
AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in],
|
|
||||||
[mv ftconfig.h ftconfig.tmp
|
|
||||||
sed 's|/undef|#undef|' < ftconfig.tmp > ftconfig.h
|
|
||||||
rm ftconfig.tmp])
|
|
||||||
|
|
||||||
# create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk'
|
# create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk'
|
||||||
# and `builds/unix/unix-cc.mk' that will be used by the build system
|
# and `builds/unix/unix-cc.mk' that will be used by the build system
|
||||||
|
|
@ -1085,10 +1142,6 @@ AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in],
|
||||||
AC_CONFIG_FILES([unix-cc.mk:unix-cc.in
|
AC_CONFIG_FILES([unix-cc.mk:unix-cc.in
|
||||||
unix-def.mk:unix-def.in])
|
unix-def.mk:unix-def.in])
|
||||||
|
|
||||||
# re-generate the Jamfile to use libtool now
|
|
||||||
#
|
|
||||||
# AC_CONFIG_FILES([../../Jamfile:../../Jamfile.in])
|
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
AC_MSG_NOTICE([
|
AC_MSG_NOTICE([
|
||||||
|
|
@ -1098,6 +1151,29 @@ Library configuration:
|
||||||
bzip2: $have_bzip2
|
bzip2: $have_bzip2
|
||||||
libpng: $have_libpng
|
libpng: $have_libpng
|
||||||
harfbuzz: $have_harfbuzz
|
harfbuzz: $have_harfbuzz
|
||||||
|
brotli: $have_brotli
|
||||||
|
pthread: $have_pthread
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# Warn if docwriter is not installed
|
||||||
|
|
||||||
|
if test $have_docwriter = no; then
|
||||||
|
AC_MSG_WARN([
|
||||||
|
`make refdoc' will fail since pip package `docwriter' is not installed.
|
||||||
|
To install, run `$PIP install docwriter', or to use a Python
|
||||||
|
virtual environment, run `make refdoc-venv' (requires pip package
|
||||||
|
`virtualenv'). These operations require Python >= 3.5.
|
||||||
|
])
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Warn if pthread is not available
|
||||||
|
|
||||||
|
if test $have_pthread = no; then
|
||||||
|
AC_MSG_WARN([
|
||||||
|
`FT_DEBUG_LOGGING' will not work since the `pthread' library is not
|
||||||
|
available. This warning can be safely ignored if you don't plan to use
|
||||||
|
this configuration macro.
|
||||||
|
])
|
||||||
|
fi
|
||||||
|
|
||||||
# end of configure.raw
|
# end of configure.raw
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# Copyright 1996-2018 by
|
# Copyright (C) 1996-2023 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
|
@ -40,8 +40,10 @@ ifeq ($(PLATFORM),unix)
|
||||||
ifneq ($(findstring devel,$(MAKECMDGOALS)),)
|
ifneq ($(findstring devel,$(MAKECMDGOALS)),)
|
||||||
CONFIG_FILE := unix-dev.mk
|
CONFIG_FILE := unix-dev.mk
|
||||||
CC := gcc
|
CC := gcc
|
||||||
devel: setup
|
|
||||||
.PHONY: devel
|
.PHONY: devel
|
||||||
|
devel: setup
|
||||||
|
@:
|
||||||
else
|
else
|
||||||
|
|
||||||
# If `lcc' is the requested target, we use a special configuration
|
# If `lcc' is the requested target, we use a special configuration
|
||||||
|
|
@ -50,8 +52,10 @@ ifeq ($(PLATFORM),unix)
|
||||||
ifneq ($(findstring lcc,$(MAKECMDGOALS)),)
|
ifneq ($(findstring lcc,$(MAKECMDGOALS)),)
|
||||||
CONFIG_FILE := unix-lcc.mk
|
CONFIG_FILE := unix-lcc.mk
|
||||||
CC := lcc
|
CC := lcc
|
||||||
lcc: setup
|
|
||||||
.PHONY: lcc
|
.PHONY: lcc
|
||||||
|
lcc: setup
|
||||||
|
@:
|
||||||
else
|
else
|
||||||
|
|
||||||
# If a Unix platform is detected, the configure script is called and
|
# If a Unix platform is detected, the configure script is called and
|
||||||
|
|
@ -68,9 +72,11 @@ ifeq ($(PLATFORM),unix)
|
||||||
# platform).
|
# platform).
|
||||||
#
|
#
|
||||||
CONFIG_FILE := unix.mk
|
CONFIG_FILE := unix.mk
|
||||||
unix: setup
|
|
||||||
must_configure := 1
|
must_configure := 1
|
||||||
|
|
||||||
.PHONY: unix
|
.PHONY: unix
|
||||||
|
unix: setup
|
||||||
|
@:
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue