From reid at x10sys.com Mon Sep 13 10:37:44 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 10:37:44 -0500 Subject: [llvm-commits] CVS: llvm/tools/llee/StorageProxy.c Message-ID: <200409131537.KAA27324@zion.cs.uiuc.edu> Changes in directory llvm/tools/llee: StorageProxy.c updated: 1.3 -> 1.4 --- Log message: Get rid of compile warning by having llvmExecve return the result of its call to executeProgram. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llee/StorageProxy.c diff -u llvm/tools/llee/StorageProxy.c:1.3 llvm/tools/llee/StorageProxy.c:1.4 --- llvm/tools/llee/StorageProxy.c:1.3 Wed Sep 1 17:55:37 2004 +++ llvm/tools/llee/StorageProxy.c Mon Sep 13 10:37:33 2004 @@ -97,5 +97,5 @@ */ int llvmExecve(const char *filename, char *const argv[], char *const envp[]) { char* cacheFile = computeCachedFile(filename); - executeProgram(cacheFile, argv, envp); + return executeProgram(cacheFile, argv, envp); } From criswell at cs.uiuc.edu Mon Sep 13 13:56:55 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 13 Sep 2004 13:56:55 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/kimwitu++/LICENSE.TXT Message-ID: <200409131856.NAA10069@choi.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/kimwitu++: LICENSE.TXT updated: 1.1 -> 1.2 --- Log message: Added notes about what we changed. --- Diffs of the changes: (+4 -0) Index: llvm-test/MultiSource/Applications/kimwitu++/LICENSE.TXT diff -u llvm-test/MultiSource/Applications/kimwitu++/LICENSE.TXT:1.1 llvm-test/MultiSource/Applications/kimwitu++/LICENSE.TXT:1.2 --- llvm-test/MultiSource/Applications/kimwitu++/LICENSE.TXT:1.1 Tue Apr 6 15:22:47 2004 +++ llvm-test/MultiSource/Applications/kimwitu++/LICENSE.TXT Mon Sep 13 13:56:12 2004 @@ -39,3 +39,7 @@ GrammaTech and Synthesizer Generator, are tradenames of GrammaTech, Inc., One Hopkins Place, Ithaca, NY 14850, (607) 273-7340. +The kimwitu++ source base has been changed to accomodate LLVM testing. +The bootstrapping process has been removed. Long option support has also been +removed to aid in portability to other platforms. + From criswell at cs.uiuc.edu Mon Sep 13 13:57:01 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 13 Sep 2004 13:57:01 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/kimwitu++/main.cc Message-ID: <200409131857.NAA10075@choi.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/kimwitu++: main.cc updated: 1.2 -> 1.3 --- Log message: Removed the long options. Don't use getopt.h. Instead, just use stdlib.h and unistd.h, as getopt() is usually defined in one of those header files, and most systems provide both. --- Diffs of the changes: (+13 -1) Index: llvm-test/MultiSource/Applications/kimwitu++/main.cc diff -u llvm-test/MultiSource/Applications/kimwitu++/main.cc:1.2 llvm-test/MultiSource/Applications/kimwitu++/main.cc:1.3 --- llvm-test/MultiSource/Applications/kimwitu++/main.cc:1.2 Fri Sep 10 15:04:11 2004 +++ llvm-test/MultiSource/Applications/kimwitu++/main.cc Mon Sep 13 13:56:48 2004 @@ -39,7 +39,7 @@ #ifndef RCSMAKEID # define RCSMAKEID "@(#) Makefile version unknown" #endif -static char kimwc_cAccesSid[] = "@(#)$Id: main.cc,v 1.2 2004/09/10 20:04:11 criswell Exp $"; +static char kimwc_cAccesSid[] = "@(#)$Id: main.cc,v 1.3 2004/09/13 18:56:48 criswell Exp $"; static char kimwitu_release[] = KIMWITURELEASE; // defined in Makefile static char kimwitu_version[] = KIMWITUVERSIONSTRING; // defined in Makefile static char Makefile_AccesSid[] = RCSMAKEID; // defined in Makefile @@ -83,7 +83,13 @@ #include using std::string; +/* LLVM: Remove long option support for compatibility with other platforms */ +#if 0 #include "getopt.h" +#else +#include +#include +#endif extern int yyparse(void); extern void yyrestart(FILE*); @@ -265,6 +271,11 @@ g_progname = mkcasestring(get_basename(argv[0])); enum { O_stdafx = 1, O_commment_line, O_dir_line, O_rw_loop, O_operator_cast }; + +/* + * LLVM: Removed for portability with other platforms. + */ +#if 0 static struct option const long_options[] = { {"no-csgio", no_argument, 0, 'c'}, {"no-rewrite", no_argument, 0, 'r'}, @@ -295,6 +306,7 @@ {"version", no_argument, 0, 'V'}, {0, 0, 0, 0} }; +#endif int c; while ((c = getopt (argc, argv, From alkis at cs.uiuc.edu Mon Sep 13 14:54:22 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Sep 2004 14:54:22 -0500 Subject: [llvm-commits] CVS: llvm-java/runtime/runtime.c Makefile Message-ID: <200409131954.OAA00457@zion.cs.uiuc.edu> Changes in directory llvm-java/runtime: runtime.c added (r1.1) Makefile updated: 1.2 -> 1.3 --- Log message: Modify the vtable struct to reflect the object-layout doc. --- Diffs of the changes: (+53 -6) Index: llvm-java/runtime/runtime.c diff -c /dev/null llvm-java/runtime/runtime.c:1.1 *** /dev/null Mon Sep 13 14:54:21 2004 --- llvm-java/runtime/runtime.c Mon Sep 13 14:54:11 2004 *************** *** 0 **** --- 1,51 ---- + struct llvm_java_object_base; + struct llvm_java_object_header; + struct llvm_java_object_vtable; + struct llvm_java_object_typeinfo; + + struct llvm_java_object_header { + // gc info, hash info, locking + }; + + struct llvm_java_object_base { + struct llvm_java_object_header header; + struct llvm_java_object_vtable* vtable; + }; + + struct llvm_java_object_typeinfo { + unsigned depth; + struct llvm_java_object_vtable** vtables; + unsigned lastIface; + union { + struct llvm_java_object_vtable** interfaces; + unsigned interfaceFlag; + }; + }; + + struct llvm_java_object_vtable { + struct llvm_java_object_typeinfo typeinfo; + }; + + int llvm_java_IsInstanceOf(struct llvm_java_object_base* obj, + struct llvm_java_object_vtable* clazz) { + struct llvm_java_object_vtable* objClazz = obj->vtable; + if (objClazz == clazz) + return 1; + // we are checking against a class' typeinfo + if (clazz->typeinfo.interfaceFlag != (unsigned)-1) + return objClazz->typeinfo.depth > clazz->typeinfo.depth && + objClazz->typeinfo.vtables[objClazz->typeinfo.depth - clazz->typeinfo.depth - 1] == clazz; + // otherwise we are checking against an interface's typeinfo + else + return objClazz->typeinfo.lastIface >= clazz->typeinfo.lastIface && + objClazz->typeinfo.interfaces[clazz->typeinfo.lastIface]; + } + + extern void llvm_java_static_init(void); + extern void llvm_java_main(int, char**); + + int main(int argc, char** argv) { + llvm_java_static_init(); + llvm_java_main(argc, argv); + return 0; + } Index: llvm-java/runtime/Makefile diff -u llvm-java/runtime/Makefile:1.2 llvm-java/runtime/Makefile:1.3 --- llvm-java/runtime/Makefile:1.2 Wed Jul 28 05:09:30 2004 +++ llvm-java/runtime/Makefile Mon Sep 13 14:54:11 2004 @@ -7,11 +7,7 @@ # ##===----------------------------------------------------------------------===## LEVEL := .. +BYTECODE_LIBRARY=1 +LIBRARYNAME=jrt include $(LEVEL)/Makefile.common - -all:: runtime.bc - -clean:: - rm -f *.bc - From alkis at cs.uiuc.edu Mon Sep 13 14:54:22 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Sep 2004 14:54:22 -0500 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200409131954.OAA00452@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.93 -> 1.94 --- Log message: Modify the vtable struct to reflect the object-layout doc. --- Diffs of the changes: (+252 -81) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.93 llvm-java/lib/Compiler/Compiler.cpp:1.94 --- llvm-java/lib/Compiler/Compiler.cpp:1.93 Wed Sep 1 23:52:13 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Mon Sep 13 14:54:11 2004 @@ -30,6 +30,15 @@ #include #include +#define LLVM_JAVA_OBJECT_BASE "struct.llvm_java_object_base" +#define LLVM_JAVA_OBJECT_HEADER "struct.llvm_java_object_header" +#define LLVM_JAVA_OBJECT_TYPEINFO "struct.llvm_java_object_typeinfo" +#define LLVM_JAVA_OBJECT_VTABLE "struct.llvm_java_object_vtable" + +#define LLVM_JAVA_STATIC_INIT "llvm_java_static_init" + +#define LLVM_JAVA_ISINSTANCEOF "llvm_java_IsInstanceOf" + using namespace llvm; using namespace llvm::Java; @@ -135,6 +144,7 @@ struct VTableInfo { VTableInfo() : vtable(NULL) { } GlobalVariable* vtable; + std::vector superVtables; typedef std::map Method2IndexMap; Method2IndexMap m2iMap; }; @@ -237,6 +247,135 @@ } } + void initializeClassInfoMap() { + DEBUG(std::cerr << "Building ClassInfo for: java/lang/Object\n"); + ClassFile* cf = ClassFile::getClassFile("java/lang/Object"); + ClassInfo& ci = c2ciMap_["java/lang/Object"]; + assert(!ci.type && ci.f2iMap.empty() && + "java/lang/Object ClassInfo should not be initialized!"); + ci.type = OpaqueType::get(); + + std::vector elements; + + // because this is java/lang/Object, we add the opaque + // llvm_java_object_base type first + Type* base = OpaqueType::get(); + module_->addTypeName(LLVM_JAVA_OBJECT_BASE, base); + ci.f2iMap.insert(std::make_pair(LLVM_JAVA_OBJECT_BASE, elements.size())); + elements.push_back(base); + + const Fields& fields = cf->getFields(); + for (unsigned i = 0, e = fields.size(); i != e; ++i) { + Field* field = fields[i]; + if (!field->isStatic()) { + ci.f2iMap.insert( + std::make_pair(field->getName()->str(), elements.size())); + elements.push_back(getType(field->getDescriptor())); + } + } + PATypeHolder holder = ci.type; + cast(ci.type)->refineAbstractTypeTo(StructType::get(elements)); + ci.type = holder.get(); + DEBUG(std::cerr << "Adding java/lang/Object = " + << *ci.type << " to type map\n"); + module_->addTypeName("java/lang/Object", ci.type); + + assert(ci.type && "ClassInfo not initialized properly!"); + emitStaticInitializers(cf); + } + + void initializeVTableInfoMap() { + DEBUG(std::cerr << "Building VTableInfo for: java/lang/Object\n"); + ClassFile* cf = ClassFile::getClassFile("java/lang/Object"); + VTableInfo& vi = c2viMap_["java/lang/Object"]; + assert(!vi.vtable && vi.m2iMap.empty() && + "java/lang/Object VTableInfo should not be initialized!"); + + Type* VTtype = OpaqueType::get(); + + std::vector elements; + std::vector init; + + // this is java/lang/Object so we must add a + // llvm_java_object_typeinfo struct first + + // depth + elements.push_back(Type::UIntTy); + init.push_back(llvm::ConstantUInt::get(elements[0], 0)); + // superclasses vtable pointers + elements.push_back(PointerType::get(PointerType::get(VTtype))); + init.push_back(llvm::Constant::getNullValue(elements[1])); + // last interface index + elements.push_back(Type::IntTy); + init.push_back(llvm::ConstantSInt::get(elements[2], -1)); + // interfaces vtable pointers + elements.push_back(PointerType::get(PointerType::get(VTtype))); + init.push_back(llvm::Constant::getNullValue(elements[3])); + + StructType* typeInfoTy = StructType::get(elements); + module_->addTypeName(LLVM_JAVA_OBJECT_TYPEINFO, typeInfoTy); + llvm::Constant* typeInfoInit = ConstantStruct::get(typeInfoTy, init); + + // now that we have both the type and initializer for the + // llvm_java_object_typeinfo struct we can start adding the + // function pointers + elements.clear(); + init.clear(); + + /// first add the typeinfo struct itself + elements.push_back(typeInfoInit->getType()); + // add the typeinfo block for this class + init.push_back(typeInfoInit); + + const Methods& methods = cf->getMethods(); + + // add member functions to the vtable + for (unsigned i = 0, e = methods.size(); i != e; ++i) { + Method* method = methods[i]; + // the contructor is the only non-static method that is not + // dynamically dispatched so we skip it + if (!method->isStatic() && method->getName()->str() != "") { + std::string methodDescr = + method->getName()->str() + + method->getDescriptor()->str(); + + std::string funcName = "java/lang/Object/" + methodDescr; + const FunctionType* funcTy = cast( + getType(method->getDescriptor(), + getClassInfo("java/lang/Object").type)); + + Function* vfun = module_->getOrInsertFunction(funcName, funcTy); + toCompileFunctions_.insert(vfun); + + unsigned& index = vi.m2iMap[methodDescr]; + if (!index) { + index = elements.size(); + elements.resize(index + 1, NULL); + init.resize(index + 1, NULL); + } + elements[index] = vfun->getType(); + init[index] = vfun; + } + } + + PATypeHolder holder = VTtype; + cast(VTtype)->refineAbstractTypeTo(StructType::get(elements)); + VTtype = cast(holder.get()); + + vi.vtable = new GlobalVariable(VTtype, + true, GlobalVariable::ExternalLinkage, + ConstantStruct::get(init), + "java/lang/Object", + module_); + // java/lang/Object doesn't have a superVtables global as its + // array of superclass vtable pointers is empty + } + + void initializeTypeMaps() { + initializeClassInfoMap(); + initializeVTableInfoMap(); + } + const ClassInfo& getClassInfo(const std::string& className) { Class2ClassInfoMap::iterator it = c2ciMap_.lower_bound(className); if (it != c2ciMap_.end() && it->first == className) @@ -251,25 +390,16 @@ std::vector elements; ConstantClass* super = cf->getSuperClass(); - const ClassInfo* superCI = - super ? &getClassInfo(super->getName()->str()) : NULL; - if (superCI) - elements.push_back(superCI->type); - else { - // this is java/lang/Object so we must add the opaque - // llvm_java_base type first - Type* base = OpaqueType::get(); - module_->addTypeName("", base); - ci.f2iMap.insert(std::make_pair("", elements.size())); - elements.push_back(base); - } + assert(super && "Class does not have superclass!"); + const ClassInfo& superCI = getClassInfo(super->getName()->str()); + elements.push_back(superCI.type); const Fields& fields = cf->getFields(); for (unsigned i = 0, e = fields.size(); i != e; ++i) { Field* field = fields[i]; if (!field->isStatic()) { - ci.f2iMap.insert(std::make_pair(field->getName()->str(), - elements.size())); + ci.f2iMap.insert( + std::make_pair(field->getName()->str(), elements.size())); elements.push_back(getType(field->getDescriptor())); } } @@ -285,6 +415,43 @@ return ci; } + llvm::Constant* getClassTypeInfo(const std::string& className, + const VTableInfo& vi, + const VTableInfo& superVI) const { + // llvm_java_object_typeinfo has four fields: depth, a pointer + // to the superclasses vtable pointers, a count for interfaces + // and a pointer to the interfaces vtable pointers + + std::vector typeInfoInit; + // the depth + unsigned depth = vi.superVtables.size(); + typeInfoInit.push_back(ConstantUInt::get(Type::UIntTy, depth)); + std::vector vtables; + for (unsigned i = 0, e = depth; i != e; ++i) + vtables.push_back(vi.superVtables[i]); + + ArrayType* vtablesArrayTy = + ArrayType::get(superVI.vtable->getType(), depth); + GlobalVariable* vtablesArray = + new GlobalVariable(vtablesArrayTy, + true, GlobalVariable::ExternalLinkage, + ConstantArray::get(vtablesArrayTy, vtables), + className + "", module_); + + typeInfoInit.push_back(ConstantExpr::getGetElementPtr( + vtablesArray, + std::vector(2, ConstantUInt::get(Type::UIntTy, 0)))); + + // FIXME: interface lists should go here + typeInfoInit.push_back(llvm::ConstantSInt::get(Type::IntTy, -1)); + typeInfoInit.push_back( + llvm::Constant::getNullValue(superVI.vtable->getType())); + + return ConstantStruct::get( + cast(superVI.vtable->getInitializer()->getOperand(0))->getType(), + typeInfoInit); + } + const VTableInfo& getVTableInfo(const std::string& className) { Class2VTableInfoMap::iterator it = c2viMap_.lower_bound(className); if (it != c2viMap_.end() && it->first == className) @@ -299,65 +466,65 @@ std::vector elements; std::vector init; ConstantClass* super = cf->getSuperClass(); - const VTableInfo* superVI = - super ? &getVTableInfo(super->getName()->str()) : NULL; + assert(super && "Class does not have superclass!"); + const VTableInfo& superVI = getVTableInfo(super->getName()->str()); - if (superVI) { - // copy all the types from the super class' vtable - assert(superVI->vtable && "No vtable found for super class!"); - ConstantStruct* superInit = - cast(superVI->vtable->getInitializer()); - const StructType* superVTableTy = superInit->getType(); - std::copy(superVTableTy->element_begin(), - superVTableTy->element_end(), - std::back_inserter(elements)); - for (unsigned i = 0, e = superInit->getNumOperands(); i != e; ++i) - init.push_back(superInit->getOperand(i)); - vi.m2iMap = superVI->m2iMap; - } -// else { -// // this is java/lang/Object so we must add the opaque -// // llvm_java_vtable_base type first -// Type* baseVTable = OpaqueType::get(); -// module_->addTypeName("", baseVTable); -// elements.push_back(baseVTable); -// init.push_back(llvm::Constant::getNullValue(baseVTable)); -// } - - const Methods& methods = cf->getMethods(); - init.resize(elements.size(), NULL); - - for (unsigned i = 0, e = methods.size(); i != e; ++i) { - Method* method = methods[i]; - if (!method->isStatic() && method->getName()->str() != "") { - std::string methodDescr = - method->getName()->str() + - method->getDescriptor()->str(); - - std::string funcName = className + '/' + methodDescr; - const FunctionType* funcTy = cast( - getType(method->getDescriptor(), getClassInfo(className).type)); - - Function* vfun = module_->getOrInsertFunction(funcName, funcTy); - toCompileFunctions_.insert(vfun); - - unsigned& index = vi.m2iMap[methodDescr]; - if (!index) { - index = elements.size(); - elements.resize(index + 1, NULL); - init.resize(index + 1, NULL); - } - elements[index] = vfun->getType(); - init[index] = vfun; + vi.superVtables.push_back(superVI.vtable); + vi.superVtables.reserve(superVI.superVtables.size() + 1); + std::copy(superVI.superVtables.begin(), superVI.superVtables.end(), + std::back_inserter(vi.superVtables)); + + // copy all the types from the super class' vtable + assert(superVI.vtable && "No vtable found for super class!"); + ConstantStruct* superInit = + cast(superVI.vtable->getInitializer()); + const StructType* superVTableTy = superInit->getType(); + std::copy(superVTableTy->element_begin(), + superVTableTy->element_end(), + std::back_inserter(elements)); + for (unsigned i = 0, e = superInit->getNumOperands(); i != e; ++i) + init.push_back(superInit->getOperand(i)); + vi.m2iMap = superVI.m2iMap; + // install the new typeinfo block for this class + init[0] = getClassTypeInfo(className, vi, superVI); + + // add member functions to the vtable + const Methods& methods = cf->getMethods(); + init.resize(elements.size(), NULL); + + for (unsigned i = 0, e = methods.size(); i != e; ++i) { + Method* method = methods[i]; + // the contructor is the only non-static method that is not + // dynamically dispatched so we skip it + if (!method->isStatic() && method->getName()->str() != "") { + std::string methodDescr = + method->getName()->str() + + method->getDescriptor()->str(); + + std::string funcName = className + '/' + methodDescr; + const FunctionType* funcTy = cast( + getType(method->getDescriptor(), getClassInfo(className).type)); + + Function* vfun = module_->getOrInsertFunction(funcName, funcTy); + toCompileFunctions_.insert(vfun); + + unsigned& index = vi.m2iMap[methodDescr]; + if (!index) { + index = elements.size(); + elements.resize(index + 1, NULL); + init.resize(index + 1, NULL); } + elements[index] = vfun->getType(); + init[index] = vfun; } + } - vi.vtable = new GlobalVariable(StructType::get(elements), - true, GlobalVariable::ExternalLinkage, - ConstantStruct::get(init), - className + "", - module_); - return vi; + vi.vtable = new GlobalVariable(StructType::get(elements), + true, GlobalVariable::ExternalLinkage, + ConstantStruct::get(init), + className + "", + module_); + return vi; } Value* getOrCreateLocal(unsigned index, Type* type) { @@ -489,7 +656,7 @@ name += method->getName()->str(); name += method->getDescriptor()->str(); - Function* hook = module_->getOrInsertFunction("llvm_java_static_init", + Function* hook = module_->getOrInsertFunction(LLVM_JAVA_STATIC_INIT, Type::VoidTy, 0); Function* init = module_->getOrInsertFunction(name, Type::VoidTy, 0); @@ -499,7 +666,7 @@ // llvm_java_static_init if (toCompileFunctions_.insert(init)) { assert(hook->front().getTerminator() && - "llvm_java_static_init should have a terminator!"); + LLVM_JAVA_STATIC_INIT " should have a terminator!"); new CallInst(init, "", hook->front().getTerminator()); // we also create the global variables of this class const Fields& fields = classfile->getFields(); @@ -507,8 +674,7 @@ Field* field = fields[i]; if (field->isStatic()) { llvm::Constant* init = NULL; - if (ConstantValueAttribute* cv = - field->getConstantValueAttribute()) + if (ConstantValueAttribute* cv = field->getConstantValueAttribute()) init = getConstant(cv->getValue()); std::string globalName = @@ -549,13 +715,17 @@ Function* compileMethod(Module& module, const std::string& classMethodDesc) { module_ = &module; + // initialize the static initializer function Function* staticInit = - module_->getOrInsertFunction("llvm_java_static_init", + module_->getOrInsertFunction(LLVM_JAVA_STATIC_INIT, Type::VoidTy, 0); BasicBlock* staticInitBB = new BasicBlock("entry", staticInit); new ReturnInst(NULL, staticInitBB); + // initialize type maps and globals (vtables) + initializeTypeMaps(); + // compile the method requested Function* function = compileMethodOnly(classMethodDesc); // compile all other methods called by this method recursively @@ -969,7 +1139,7 @@ Value* objRef = opStack_.top(); // do not pop objRef = new CastInst(objRef, PointerType::get(ci.type), "this", getBBAt(bcI)); - Value* vtable = getField(bcI, className, "", objRef); + Value* vtable = getField(bcI, className, LLVM_JAVA_OBJECT_BASE, objRef); vtable = new CastInst(vtable, PointerType::get(vi.vtable->getType()), TMP, getBBAt(bcI)); vtable = new LoadInst(vtable, TMP, getBBAt(bcI)); @@ -1038,7 +1208,7 @@ Value* objRef = new MallocInst(ci.type, ConstantUInt::get(Type::UIntTy, 0), TMP, getBBAt(bcI)); - Value* vtable = getField(bcI, className, "", objRef); + Value* vtable = getField(bcI, className, LLVM_JAVA_OBJECT_BASE, objRef); vtable = new CastInst(vtable, PointerType::get(vi.vtable->getType()), TMP, getBBAt(bcI)); vtable = new StoreInst(vi.vtable, vtable, getBBAt(bcI)); @@ -1077,12 +1247,13 @@ const VTableInfo& vi = getVTableInfo(className); Value* objRef = opStack_.top(); opStack_.pop(); - Value* vtable = getField(bcI, className, "", objRef); - Function* f = module_->getOrInsertFunction("", + Value* objBase = getField(bcI, className, LLVM_JAVA_OBJECT_BASE, objRef); + Function* f = module_->getOrInsertFunction(LLVM_JAVA_ISINSTANCEOF, Type::IntTy, - vtable->getType(), - vtable->getType(), NULL); - Value* r = new CallInst(f, vtable, vi.vtable, TMP, getBBAt(bcI)); + objBase->getType(), + vi.vtable->getType(), + NULL); + Value* r = new CallInst(f, objBase, vi.vtable, TMP, getBBAt(bcI)); opStack_.push(r); } From alkis at cs.uiuc.edu Mon Sep 13 14:55:04 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Sep 2004 14:55:04 -0500 Subject: [llvm-commits] CVS: llvm-java/test/Makefile.test Message-ID: <200409131955.OAA00557@zion.cs.uiuc.edu> Changes in directory llvm-java/test: Makefile.test updated: 1.12 -> 1.13 --- Log message: Link to the new runtime. --- Diffs of the changes: (+1 -1) Index: llvm-java/test/Makefile.test diff -u llvm-java/test/Makefile.test:1.12 llvm-java/test/Makefile.test:1.13 --- llvm-java/test/Makefile.test:1.12 Wed Jul 28 05:08:57 2004 +++ llvm-java/test/Makefile.test Mon Sep 13 14:54:53 2004 @@ -20,7 +20,7 @@ .PRECIOUS: Output/.dir Output/%.class %.bc %.ll %.llvm.bc %.llvm #rule to link in runtime to raw bytecode -%.linked.bc: %.raw.bc $(LEVEL)/runtime/runtime.bc +%.linked.bc: %.raw.bc $(DESTLIBBYTECODE)/libjrt.bc @$(ECHO) Linking $< with the Java runtime $(LLVMTOOLCURRENT)/llvm-link$(EXEEXT) $^ -o $@ From reid at x10sys.com Mon Sep 13 16:15:30 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 16:15:30 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/Makefile Message-ID: <200409132115.QAA01436@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: Makefile updated: 1.1 -> 1.2 --- Log message: Change banner name to reflect actual program this Makefile is for. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-ld/Makefile diff -u llvm/tools/llvm-ld/Makefile:1.1 llvm/tools/llvm-ld/Makefile:1.2 --- llvm/tools/llvm-ld/Makefile:1.1 Sun Sep 12 20:27:53 2004 +++ llvm/tools/llvm-ld/Makefile Mon Sep 13 16:15:19 2004 @@ -1,4 +1,4 @@ -##===- tools/gccld/Makefile --------------------------------*- Makefile -*-===## +##===- tools/llvm-ld/Makefile ------------------------------*- Makefile -*-===## # # The LLVM Compiler Infrastructure # From alkis at cs.uiuc.edu Mon Sep 13 16:35:27 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Sep 2004 16:35:27 -0500 Subject: [llvm-commits] CVS: llvm-java/test/Programs/SingleSource/UnitTests/InstanceOf.java Message-ID: <200409132135.QAA01687@zion.cs.uiuc.edu> Changes in directory llvm-java/test/Programs/SingleSource/UnitTests: InstanceOf.java added (r1.1) --- Log message: Add testcase for instanceof. --- Diffs of the changes: (+36 -0) Index: llvm-java/test/Programs/SingleSource/UnitTests/InstanceOf.java diff -c /dev/null llvm-java/test/Programs/SingleSource/UnitTests/InstanceOf.java:1.1 *** /dev/null Mon Sep 13 16:35:27 2004 --- llvm-java/test/Programs/SingleSource/UnitTests/InstanceOf.java Mon Sep 13 16:35:17 2004 *************** *** 0 **** --- 1,36 ---- + class A + { + int foo() { return 0; } + int bar() { return 0; } + } + + interface I { + public int baz(); + } + + class B extends A implements I + { + int foo() { return 1; } + public int baz() { return foo(); } + } + + public class InstanceOf + { + public static void main(String[] args) { + A aa = new A(); + A ab = new B(); + B bb = new B(); + + boolean aaA = aa instanceof A; + boolean aaB = aa instanceof B; + boolean aaI = aa instanceof I; + + boolean abA = ab instanceof A; + boolean abB = ab instanceof B; + boolean abI = ab instanceof I; + + boolean bbA = bb instanceof A; + boolean bbB = bb instanceof B; + boolean bbI = bb instanceof I; + } + } From criswell at cs.uiuc.edu Mon Sep 13 16:48:23 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 13 Sep 2004 16:48:23 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/kimwitu++/getopt.h main.cc Message-ID: <200409132148.QAA30922@choi.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/kimwitu++: getopt.h updated: 1.1 -> 1.2 main.cc updated: 1.3 -> 1.4 --- Log message: Manually define the prototypes and externs for the getopt() function and friends. This seems to be the only way to get it to work on all the different platforms. --- Diffs of the changes: (+9 -186) Index: llvm-test/MultiSource/Applications/kimwitu++/getopt.h diff -u llvm-test/MultiSource/Applications/kimwitu++/getopt.h:1.1 llvm-test/MultiSource/Applications/kimwitu++/getopt.h:1.2 --- llvm-test/MultiSource/Applications/kimwitu++/getopt.h:1.1 Tue Apr 6 15:25:11 2004 +++ llvm-test/MultiSource/Applications/kimwitu++/getopt.h Mon Sep 13 16:48:10 2004 @@ -1,182 +1,10 @@ -/* Declarations for getopt. - Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ -/* $Id: getopt.h,v 1.1 2004/04/06 20:25:11 criswell Exp $ - * Modified for kimwitu++ */ - -#ifndef _GETOPT_H - -#ifndef __need_getopt -# define _GETOPT_H 1 +#if 1 +extern int getopt (...); +extern char * optarg; +extern int optind, opterr, optopt; #endif -/* If __GNU_LIBRARY__ is not already defined, either we are being used - standalone, or this is the first header included in the source file. - If we are being used with glibc, we need to include , but - that does not exist if we are standalone. So: if __GNU_LIBRARY__ is - not defined, include , which will pull in for us - if it's from glibc. (Why ctype.h? It's guaranteed to exist and it - doesn't flood the namespace with stuff the way some other headers do.) */ -#if !defined __GNU_LIBRARY__ -# include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -#ifndef __need_getopt -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -# if (defined __STDC__ && __STDC__) || defined __cplusplus - const char *name; -# else - char *name; -# endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -# define no_argument 0 -# define required_argument 1 -# define optional_argument 2 -#endif /* need getopt */ - - -/* Get definitions and prototypes for functions to process the - arguments in ARGV (ARGC of them, minus the program name) for - options given in OPTS. - - Return the option character from OPTS just read. Return -1 when - there are no more options. For unrecognized options, or options - missing arguments, `optopt' is set to the option letter, and '?' is - returned. - - The OPTS string is a list of characters which are recognized option - letters, optionally followed by colons, specifying that that letter - takes an argument, to be placed in `optarg'. - - If a letter in OPTS is followed by two colons, its argument is - optional. This behavior is specific to the GNU `getopt'. - - The argument `--' causes premature termination of argument - scanning, explicitly telling `getopt' that there are no more - options. - - If OPTS begins with `--', then non-option arguments are treated as - arguments to the option '\0'. This behavior is specific to the GNU - `getopt'. */ - -#if (defined __STDC__ && __STDC__) || defined __cplusplus -# ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -/* extern int getopt (int argc, char *const *argv, const char *__shortopts); */ -# else /* not __GNU_LIBRARY__ */ -/* extern int getopt (); */ -# endif /* __GNU_LIBRARY__ */ - -# ifndef __need_getopt -extern int getopt_long (int argc, char *const *argv, const char *__shortopts, - const struct option *__longopts, int *__longind); -extern int getopt_long_only (int argc, char *const *argv, - const char *__shortopts, - const struct option *__longopts, int *__longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int argc, char *const *argv, - const char *__shortopts, - const struct option *__longopts, int *__longind, - int __long_only); -# endif -#else /* not __STDC__ */ -extern int getopt (); -# ifndef __need_getopt -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -# endif -#endif /* __STDC__ */ - -#ifdef __cplusplus -} +#if 0 +#include +#include #endif - -/* Make sure we later can get all the definitions and declarations. */ -#undef __need_getopt - -#endif /* getopt.h */ Index: llvm-test/MultiSource/Applications/kimwitu++/main.cc diff -u llvm-test/MultiSource/Applications/kimwitu++/main.cc:1.3 llvm-test/MultiSource/Applications/kimwitu++/main.cc:1.4 --- llvm-test/MultiSource/Applications/kimwitu++/main.cc:1.3 Mon Sep 13 13:56:48 2004 +++ llvm-test/MultiSource/Applications/kimwitu++/main.cc Mon Sep 13 16:48:10 2004 @@ -5,6 +5,7 @@ #define KC_FUNCTIONS_main_ #include +#include #include "k.h" #include "main.h" namespace kc { } @@ -39,7 +40,7 @@ #ifndef RCSMAKEID # define RCSMAKEID "@(#) Makefile version unknown" #endif -static char kimwc_cAccesSid[] = "@(#)$Id: main.cc,v 1.3 2004/09/13 18:56:48 criswell Exp $"; +static char kimwc_cAccesSid[] = "@(#)$Id: main.cc,v 1.4 2004/09/13 21:48:10 criswell Exp $"; static char kimwitu_release[] = KIMWITURELEASE; // defined in Makefile static char kimwitu_version[] = KIMWITUVERSIONSTRING; // defined in Makefile static char Makefile_AccesSid[] = RCSMAKEID; // defined in Makefile @@ -83,13 +84,7 @@ #include using std::string; -/* LLVM: Remove long option support for compatibility with other platforms */ -#if 0 #include "getopt.h" -#else -#include -#include -#endif extern int yyparse(void); extern void yyrestart(FILE*); From reid at x10sys.com Mon Sep 13 16:48:54 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 16:48:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Program.cpp Message-ID: <200409132148.QAA01930@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Program.cpp updated: 1.3 -> 1.4 --- Log message: Clean up the interface and implementation of sys::Program so that it is cleanly dissociated from the sys::Path class. --- Diffs of the changes: (+16 -15) Index: llvm/lib/System/Unix/Program.cpp diff -u llvm/lib/System/Unix/Program.cpp:1.3 llvm/lib/System/Unix/Program.cpp:1.4 --- llvm/lib/System/Unix/Program.cpp:1.3 Wed Sep 1 17:55:35 2004 +++ llvm/lib/System/Unix/Program.cpp Mon Sep 13 16:48:44 2004 @@ -30,15 +30,15 @@ using namespace sys; // This function just uses the PATH environment variable to find the program. -Program +Path Program::FindProgramByName(const std::string& progName) { // Check some degenerate cases if (progName.length() == 0) // no program - return Program(); - Program temp; + return Path(); + Path temp; if (!temp.set_file(progName)) // invalid name - return Program(); + return Path(); if (temp.executable()) // already executable as is return temp; @@ -47,7 +47,7 @@ // Get the path. If its empty, we can't do anything to find it. const char *PathStr = getenv("PATH"); if (PathStr == 0) - return Program(); + return Path(); // Now we have a colon separated list of directories to search; try them. unsigned PathLen = strlen(PathStr); @@ -56,7 +56,7 @@ const char *Colon = std::find(PathStr, PathStr+PathLen, ':'); // Check to see if this first directory contains the executable... - Program FilePath; + Path FilePath; if (FilePath.set_directory(std::string(PathStr,Colon))) { FilePath.append_file(progName); if (FilePath.executable()) @@ -73,21 +73,22 @@ PathLen--; } } - return Program(); + return Path(); } // int -Program::ExecuteAndWait(const std::vector& args) const { - if (!executable()) - throw get() + " is not executable"; +Program::ExecuteAndWait(const Path& path, + const std::vector& args) { + if (!path.executable()) + throw path.get() + " is not executable"; #ifdef HAVE_SYS_WAIT_H // Create local versions of the parameters that can be passed into execve() // without creating const problems. const char* argv[ args.size() + 2 ]; unsigned index = 0; - std::string progname(this->getLast()); + std::string progname(path.getLast()); argv[index++] = progname.c_str(); for (unsigned i = 0; i < args.size(); i++) argv[index++] = args[i].c_str(); @@ -97,12 +98,12 @@ switch (fork()) { // An error occured: Return to the caller. case -1: - ThrowErrno(std::string("Couldn't execute program '") + get() + "'"); + ThrowErrno(std::string("Couldn't execute program '") + path.get() + "'"); break; // Child process: Execute the program. case 0: - execve (get().c_str(), (char** const)argv, environ); + execve (path.c_str(), (char** const)argv, environ); // If the execve() failed, we should exit and let the parent pick up // our non-zero exit status. exit (errno); @@ -115,13 +116,13 @@ // Parent process: Wait for the child process to terminate. int status; if ((::wait (&status)) == -1) - ThrowErrno(std::string("Failed waiting for program '") + get() + "'"); + ThrowErrno(std::string("Failed waiting for program '") + path.get() + "'"); // If the program exited normally with a zero exit status, return success! if (WIFEXITED (status)) return WEXITSTATUS(status); else if (WIFSIGNALED(status)) - throw std::string("Program '") + get() + "' received terminating signal."; + throw std::string("Program '") + path.get() + "' received terminating signal."; else return 0; From reid at x10sys.com Mon Sep 13 16:48:54 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 16:48:54 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Program.h Message-ID: <200409132148.QAA01933@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Program.h updated: 1.1 -> 1.2 --- Log message: Clean up the interface and implementation of sys::Program so that it is cleanly dissociated from the sys::Path class. --- Diffs of the changes: (+14 -22) Index: llvm/include/llvm/System/Program.h diff -u llvm/include/llvm/System/Program.h:1.1 llvm/include/llvm/System/Program.h:1.2 --- llvm/include/llvm/System/Program.h:1.1 Sun Aug 29 00:29:35 2004 +++ llvm/include/llvm/System/Program.h Mon Sep 13 16:48:44 2004 @@ -21,14 +21,13 @@ namespace sys { /// This class provides an abstraction for programs that are executable by the - /// operating system. It derives from Path because every executable on all - /// known operating systems has a pathname that is needed in order to execute - /// the program. This class provides an operating system agnostic interface - /// for the procedure of finding and executing programs in a variety of ways. + /// operating system. It provides a platform generic way to find executable + /// programs from the path and to execute them. The sys::Path class is used to + /// locate the Program. /// @since 1.4 - /// @brief An abstraction for operating system programs. - class Program : public Path { - /// @name Constructors + /// @brief An abstraction for finding and executing programs. + class Program { + /// @name Methods /// @{ public: /// This static constructor (factory) will attempt to locate a program in @@ -38,20 +37,8 @@ /// Path object that is empty (invalid) if the program could not be found. /// @throws nothing /// @brief Construct a Program by finding it by name. - static Program FindProgramByName(const std::string& name); - - /// This static constructor (factory) constructs a Program object that - /// refers to the currently executing program. - /// @brief Constructs a Program object for the currently executing - /// program. - // static Program This(); - /// FIXME: Not sure if this is currently doable. + static Path FindProgramByName(const std::string& name); - - /// @} - /// @name Methods - /// @{ - public: /// This function executes the program using the \p arguments provided and /// waits for the program to exit. This function will block the current /// program until the invoked program exits. The invoked program will @@ -60,13 +47,18 @@ /// If Path::executable() does not return true when this function is /// called then a std::string is thrown. /// Path::executable() returns true. - /// @param arguments A vector of strings that are passed to the program. + /// @param path A sys::Path object providing the path of the program to be + /// executed. It is presumed this is the result of the FindProgramByName + /// method. + /// @param args A vector of strings that are passed to the program. /// The first element should *not* be the name of the program. /// @returns an integer result code indicating the status of the program. /// @throws std::string on a variety of error conditions or if the invoked /// program aborted abnormally. + /// @see FindProgrambyName /// @brief Executes the program with the given set of \p arguments. - int ExecuteAndWait(const std::vector& arguments) const; + static int ExecuteAndWait(const Path& path, + const std::vector& args); /// @} }; } From criswell at cs.uiuc.edu Mon Sep 13 16:54:25 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 13 Sep 2004 16:54:25 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/kimwitu++/getopt.h Message-ID: <200409132154.QAA30979@choi.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/kimwitu++: getopt.h updated: 1.2 -> 1.3 --- Log message: Add comment about (more or less) copying this from the Linux manual page. And yes, I'm paranoid. --- Diffs of the changes: (+4 -0) Index: llvm-test/MultiSource/Applications/kimwitu++/getopt.h diff -u llvm-test/MultiSource/Applications/kimwitu++/getopt.h:1.2 llvm-test/MultiSource/Applications/kimwitu++/getopt.h:1.3 --- llvm-test/MultiSource/Applications/kimwitu++/getopt.h:1.2 Mon Sep 13 16:48:10 2004 +++ llvm-test/MultiSource/Applications/kimwitu++/getopt.h Mon Sep 13 16:54:12 2004 @@ -1,3 +1,7 @@ +/* + * These values are modified forms of what you will find in the Linux getopt(3) + * manual page. Why I can't get these from unistd.h is beyond me. + */ #if 1 extern int getopt (...); extern char * optarg; From criswell at cs.uiuc.edu Mon Sep 13 17:20:19 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 13 Sep 2004 17:20:19 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/kimwitu++/Makefile Message-ID: <200409132220.RAA31701@choi.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/kimwitu++: Makefile updated: 1.3 -> 1.4 --- Log message: Renamed input files to f.k so that generated header and source files do not conflict with original Kimwitu++ source files. This was causing problems if builddir == sourcedir. --- Diffs of the changes: (+2 -1) Index: llvm-test/MultiSource/Applications/kimwitu++/Makefile diff -u llvm-test/MultiSource/Applications/kimwitu++/Makefile:1.3 llvm-test/MultiSource/Applications/kimwitu++/Makefile:1.4 --- llvm-test/MultiSource/Applications/kimwitu++/Makefile:1.3 Wed Sep 1 09:33:20 2004 +++ llvm-test/MultiSource/Applications/kimwitu++/Makefile Mon Sep 13 17:20:05 2004 @@ -3,5 +3,6 @@ CPPFLAGS=-I$(BUILD_SRC_DIR) -DYYDEBUG=1 LDFLAGS = -lstdc++ LIBS += -lstdc++ -RUN_OPTIONS = -o -v -s kcc $(BUILD_SRC_DIR)/inputs/rpn.k $(BUILD_SRC_DIR)/inputs/main.k $(BUILD_SRC_DIR)/inputs/abs.k +RUN_OPTIONS = -o -v -s kcc $(BUILD_SRC_DIR)/inputs/f3.k $(BUILD_SRC_DIR)/inputs/f2.k $(BUILD_SRC_DIR)/inputs/f1.k include ../../Makefile.multisrc + From criswell at cs.uiuc.edu Mon Sep 13 17:20:22 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 13 Sep 2004 17:20:22 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/kimwitu++/inputs/f1.k f2.k f3.k abs.k main.k rpn.k Message-ID: <200409132220.RAA31711@choi.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/kimwitu++/inputs: f1.k added (r1.1) f2.k added (r1.1) f3.k added (r1.1) abs.k (r1.1) removed main.k (r1.1) removed rpn.k (r1.1) removed --- Log message: Renamed input files to f.k so that generated header and source files do not conflict with original Kimwitu++ source files. This was causing problems if builddir == sourcedir. --- Diffs of the changes: (+209 -0) Index: llvm-test/MultiSource/Applications/kimwitu++/inputs/f1.k diff -c /dev/null llvm-test/MultiSource/Applications/kimwitu++/inputs/f1.k:1.1 *** /dev/null Mon Sep 13 17:20:21 2004 --- llvm-test/MultiSource/Applications/kimwitu++/inputs/f1.k Mon Sep 13 17:20:10 2004 *************** *** 0 **** --- 1,20 ---- + // Reverse Polish Notation, abs.k + // ? 2001, Michael Piefel + + // The abstract syntax of our expressions + line: + Line(expression); + + term: + Number(integer) | Ident(casestring); + + expression: + Term( term ) + | Plus( expression expression ) + | Mul( expression expression ) + | Minus( expression expression ) + | Div( expression expression ) + | Div2( expression casestring expression ) + ; + + Index: llvm-test/MultiSource/Applications/kimwitu++/inputs/f2.k diff -c /dev/null llvm-test/MultiSource/Applications/kimwitu++/inputs/f2.k:1.1 *** /dev/null Mon Sep 13 17:20:22 2004 --- llvm-test/MultiSource/Applications/kimwitu++/inputs/f2.k Mon Sep 13 17:20:10 2004 *************** *** 0 **** --- 1,58 ---- + // Reverse Polish Notation, main.k + // ? 2001, Michael Piefel + + %{ + #include + #include "k.h" + #include "rk.h" + #include "unpk.h" + #include "csgiok.h" + + int yyparse(); + line TheLine; + %} + %{ KC_TYPES_HEADER + extern line TheLine; + %} + + // Yes, create YYSTYPE union for the bison parser. + %option yystype + + // Trivial printer function (ignores view) + void + printer(const char *s, uview v) + { + std::cout << s; + } + + int + main(int argc, char **argv) + { + FILE* f; + + std::cout << " RPN Parser and reformatter " << std::endl; + // If a saved tree is given on command line, read it + if (argc==2) { + f=fopen(argv[1], "r"); + kc::CSGIOread(f, TheLine); + fclose(f); + } else yyparse(); + + line TheCanonLine=TheLine->rewrite(canon); + line TheShortLine=TheCanonLine->rewrite(calculate); + + std::cout << "\nInfix notation:\n"; + TheCanonLine->unparse(printer, infix); + + std::cout << "\n\nCanonical postfix notation:\n"; + TheCanonLine->unparse(printer, postfix); + + std::cout << "\n\nCalculated infix notation:\n"; + TheShortLine->unparse(printer, infix); + + std::cout << "\n\nCalculated canonical postfix notation:\n"; + TheShortLine->unparse(printer, postfix); + + std::cout << std::endl; + } + Index: llvm-test/MultiSource/Applications/kimwitu++/inputs/f3.k diff -c /dev/null llvm-test/MultiSource/Applications/kimwitu++/inputs/f3.k:1.1 *** /dev/null Mon Sep 13 17:20:22 2004 --- llvm-test/MultiSource/Applications/kimwitu++/inputs/f3.k Mon Sep 13 17:20:10 2004 *************** *** 0 **** --- 1,131 ---- + // Reverse Polish Notation, rpn.k + // ? 2001, Michael Piefel + + // Define which views (ie., different paths) we intent to take + // during unparse and rewrite + %uview infix postfix; + %rview canon calculate; + + + // Simple expressions + Plus( exp1, exp2 ) + -> [ infix: exp1 "+" exp2 ] + [ postfix: exp1 " " exp2 " +" ]; + + Minus( exp1, exp2 ) + -> [ infix: exp1 "-" exp2 ] + [ postfix: exp1 " " exp2 " -" ]; + + // Beware of parentheses in infix representation + Mul( exp1, exp2=Plus(*,*) ), + Mul( exp1, exp2=Minus(*,*) ) + -> [ infix: exp1 "*(" exp2 ")" ]; + + Mul( exp1=Plus(*,*), exp2 ), + Mul( exp1=Minus(*,*), exp2 ) + -> [ infix: "(" exp1 ")*" exp2 ]; + + Mul( exp1=Plus(*,*), exp2=Plus(*,*) ), + Mul( exp1=Plus(*,*), exp2=Minus(*,*) ), + Mul( exp1=Minus(*,*), exp2=Plus(*,*) ), + Mul( exp1=Minus(*,*), exp2=Minus(*,*) ) + -> [ infix: "(" exp1 ")*(" exp2 ")" ]; + + Mul( exp1, exp2 ) + -> [ infix: exp1 "*" exp2 ] + [ postfix: exp1 " " exp2 " *"]; + + Div( exp1=Plus(*,*), exp2 ), + Div( exp1=Minus(*,*), exp2 ) + -> [ infix: "(" exp1 ")/" exp2 ]; + + Div( exp1, exp2=Plus(*,*) ), + Div( exp1, exp2=Minus(*,*) ), + Div( exp1, exp2=Mul(*,*) ), + Div( exp1, exp2=Div(*,*) ) + -> [ infix: exp1 "/(" exp2 ")"]; + + Div( exp1=Plus(*,*), exp2=Plus(*,*) ), + Div( exp1=Plus(*,*), exp2=Minus(*,*) ), + Div( exp1=Minus(*,*), exp2=Plus(*,*) ), + Div( exp1=Minus(*,*), exp2=Minus(*,*) ) + -> [ infix: "(" exp1 ")/(" exp2 ")" ]; + + Div( exp1, exp2 ) + -> [ infix: exp1 "/" exp2 ] + [ postfix: exp1 " " exp2 " /" ]; + + + // Calculate all that can be calculated (ie. all where + // we have concrete numbers) + Plus( Term(Number(a)), Term(Number(b)) ) + -> < calculate: Term(Number(plus(a,b)))>; + + Plus( Term(Number(a)), Plus(Term(Number(b)), rest) ) + -> < calculate: Plus(Term(Number(plus(a,b))), rest)>; + + Plus( Term(Number(a)), Minus(Term(Number(b)), rest) ) + -> < calculate: Minus(Term(Number(plus(a,b))), rest)>; + + Minus( Term(Number(a)), Term(Number(b)) ) + -> < calculate: Term(Number(minus(a,b)))>; + + Minus( Term(Number(a)), Minus(Term(Number(b)), rest) ) + -> < calculate: Plus(Term(Number(minus(a,b))), rest)>; + + Minus( Term(Number(a)), Plus(Term(Number(b)), rest) ) + -> < calculate: Minus(Term(Number(minus(a,b))), rest)>; + + Mul( Term(Number(a)), Term(Number(b)) ) + -> < calculate: Term(Number(mul(a,b)))>; + + Mul( Term(Number(a)), Mul(Term(Number(b)), rest) ) + -> < calculate: Mul(Term(Number(mul(a,b))), rest)>; + + Mul( Term(Number(a)), Div(Term(Number(b)), rest) ) + -> < calculate: Div(Term(Number(mul(a,b))), rest)>; + + Div( Term(Number(a)), Term(Number(b)) ) + -> < calculate: Term(Number(divi(a,b)))>; + + Div( Term(Number(a)), Div(Term(Number(b)), rest) ) + -> < calculate: Mul(Term(Number(divi(a,b))), rest)>; + + Div( Term(Number(a)), Mul(Term(Number(b)), rest) ) + -> < calculate: Div(Term(Number(divi(a,b))), rest)>; + + // Helper functions to actually compute + %{ KC_REWRITE + inline integer plus(integer a, integer b) { return mkinteger(a->value+b->value); } + inline integer minus(integer a, integer b) { return mkinteger(a->value-b->value); } + inline integer mul(integer a, integer b) { return mkinteger(a->value*b->value); } + inline integer divi(integer a, integer b) { return mkinteger(b->value==0 ? 0 : a->value / b->value); } + %} + + + // Rewrite to a canonical form of the expression where operators + // are to be put as far to the end as possible + Plus( Plus(a, b), c) + -> < canon: Plus(a, Plus(b, c))>; + + Plus( Minus(a, b), c) + -> < canon: Plus(c, Minus(a, b))>; + + Minus( Plus(a, b), c) + -> < canon: Plus(a, Minus(b, c))>; + + Mul( Mul(a, b), c) + -> < canon: Mul(a, Mul(b, c))>; + + Plus( a=Term(Ident(*)), b=Term(Number(*)) ) + -> < canon: Plus(b, a)>; + + Mul( a=Term(Ident(*)), b=Term(Number(*)) ) + -> < canon: Mul(b, a)>; + + Plus( a=Term(Ident(*)), Plus(b=Term(Number(*)), rest) ) + -> < canon: Plus(b, Plus(a,rest))>; + + Mul( a=Term(Ident(*)), Mul(b=Term(Number(*)), rest) ) + -> < canon: Mul(b, Mul(a,rest))>; + From reid at x10sys.com Mon Sep 13 17:38:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 17:38:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/SunOS/Memory.cpp Message-ID: <200409132238.RAA02463@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/SunOS: Memory.cpp updated: 1.2 -> 1.3 --- Log message: Simplify the sys::Memory interface per Chris' request. --- Diffs of the changes: (+9 -8) Index: llvm/lib/System/SunOS/Memory.cpp diff -u llvm/lib/System/SunOS/Memory.cpp:1.2 llvm/lib/System/SunOS/Memory.cpp:1.3 --- llvm/lib/System/SunOS/Memory.cpp:1.2 Sat Sep 11 15:18:08 2004 +++ llvm/lib/System/SunOS/Memory.cpp Mon Sep 13 17:38:12 2004 @@ -26,8 +26,8 @@ //=== and must not be generic UNIX code (see ../Unix/Memory.cpp) //===----------------------------------------------------------------------===// -void* Memory::AllocateRWX(Memory& M, unsigned NumBytes) { - if (NumBytes == 0) return 0; +MemoryBlock Memory::AllocateRWX(unsigned NumBytes) { + if (NumBytes == 0) return MemoryBlock(); static const long pageSize = Process::GetPageSize(); unsigned NumPages = (NumBytes+pageSize-1)/pageSize; @@ -37,14 +37,15 @@ if (pa == (void*)-1) { throw std::string("Can't allocate RWX Memory: ") + strerror(errno); } - M.Address = pa; - M.AllocSize = NumPages*pageSize; - return pa; + MemoryBlock result; + result.Address = pa; + result.AllocSize = NumPages*pageSize; + return result; } -void Memory::ReleaseRWX(Memory& M) { - if (M.Address == 0 || M.AllocSize == 0) return; - if (0 != munmap(M.Address, M.AllocSize)) { +void Memory::ReleaseRWX(MemoryBlock& M) { + if (M.Address == 0 || M.Size == 0) return; + if (0 != munmap(M.Address, M.Size)) { throw std::string("Can't release RWX Memory: ") + strerror(errno); } } From reid at x10sys.com Mon Sep 13 17:38:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 17:38:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Memory.cpp Message-ID: <200409132238.RAA02468@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Memory.cpp updated: 1.1 -> 1.2 --- Log message: Simplify the sys::Memory interface per Chris' request. --- Diffs of the changes: (+9 -8) Index: llvm/lib/System/Win32/Memory.cpp diff -u llvm/lib/System/Win32/Memory.cpp:1.1 llvm/lib/System/Win32/Memory.cpp:1.2 --- llvm/lib/System/Win32/Memory.cpp:1.1 Fri Sep 10 23:59:30 2004 +++ llvm/lib/System/Win32/Memory.cpp Mon Sep 13 17:38:12 2004 @@ -22,8 +22,8 @@ //=== WARNING: Implementation here must contain only Win32 specific code. //===----------------------------------------------------------------------===// -void* Memory::AllocateRWX(Memory&M, unsigned NumBytes) { - if (NumBytes == 0) return 0; +MemoryBlock Memory::AllocateRWX(unsigned NumBytes) { + if (NumBytes == 0) return MemoryBlock(); unsigned pageSize = Process::GetPageSize(); unsigned NumPages = (NumBytes+pageSize-1)/pageSize; @@ -33,12 +33,13 @@ throw std::string("Couldn't allocate ") + utostr(NumBytes) + " bytes of executable memory!"; } - M.Address = P; - M.AllocSize = NumBytes; - return P; + MemoryBlock result; + result.Address = P; + result.Size = NumBytes; + return result; } -void Memory::ReleaseRWX(Memory& M) { - if (M.Address == 0 ) return; - VirtualFree(M.Address, M.AllocSize, MEM_DECOMMIT, PAGE_NOACCESS); +void Memory::ReleaseRWX(MemoryBlock& M) { + if (M.Address == 0 || M.Size == 0) return; + VirtualFree(M.Address, M.Size, MEM_DECOMMIT, PAGE_NOACCESS); } From reid at x10sys.com Mon Sep 13 17:38:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 17:38:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/AIX/Memory.cpp Message-ID: <200409132238.RAA02467@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/AIX: Memory.cpp updated: 1.2 -> 1.3 --- Log message: Simplify the sys::Memory interface per Chris' request. --- Diffs of the changes: (+9 -8) Index: llvm/lib/System/AIX/Memory.cpp diff -u llvm/lib/System/AIX/Memory.cpp:1.2 llvm/lib/System/AIX/Memory.cpp:1.3 --- llvm/lib/System/AIX/Memory.cpp:1.2 Sat Sep 11 15:18:08 2004 +++ llvm/lib/System/AIX/Memory.cpp Mon Sep 13 17:38:12 2004 @@ -26,8 +26,8 @@ //=== and must not be generic UNIX code (see ../Unix/Memory.cpp) //===----------------------------------------------------------------------===// -void* Memory::AllocateRWX(Memory& M, unsigned NumBytes) { - if (NumBytes == 0) return 0; +MemoryBlock Memory::AllocateRWX(unsigned NumBytes) { + if (NumBytes == 0) return MemoryBlock(); static const long pageSize = Process::GetPageSize(); unsigned NumPages = (NumBytes+pageSize-1)/pageSize; @@ -37,14 +37,15 @@ if (pa == (void*)-1) { throw std::string("Can't allocate RWX Memory: ") + strerror(errno); } - M.Address = pa; - M.AllocSize = NumPages*pageSize; - return pa; + MemoryBlock result; + result.Address = pa; + result.Size = NumPages*pageSize; + return result; } -void Memory::ReleaseRWX(Memory& M) { - if (M.Address == 0 || M.AllocSize == 0) return; - if (0 != munmap(M.Address, M.AllocSize)) { +void Memory::ReleaseRWX(MemoryBlock& M) { + if (M.Address == 0 || M.Size == 0) return; + if (0 != munmap(M.Address, M.Size)) { throw std::string("Can't release RWX Memory: ") + strerror(errno); } } From reid at x10sys.com Mon Sep 13 17:38:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 17:38:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Darwin/Memory.cpp Message-ID: <200409132238.RAA02466@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Darwin: Memory.cpp updated: 1.1 -> 1.2 --- Log message: Simplify the sys::Memory interface per Chris' request. --- Diffs of the changes: (+9 -8) Index: llvm/lib/System/Darwin/Memory.cpp diff -u llvm/lib/System/Darwin/Memory.cpp:1.1 llvm/lib/System/Darwin/Memory.cpp:1.2 --- llvm/lib/System/Darwin/Memory.cpp:1.1 Fri Sep 10 23:59:30 2004 +++ llvm/lib/System/Darwin/Memory.cpp Mon Sep 13 17:38:12 2004 @@ -30,8 +30,8 @@ /// to emit code to the memory then jump to it. Getting this type of memory /// is very OS specific. /// -void* Memory::AllocateRWX(Memory& M, unsigned NumBytes) { - if (NumBytes == 0) return 0; +MemoryBlock Memory::AllocateRWX(unsigned NumBytes) { + if (NumBytes == 0) return MemoryBlock(); static const long pageSize = Process::GetPageSize(); unsigned NumPages = (NumBytes+pageSize-1)/pageSize; @@ -43,14 +43,15 @@ strerror_r(errno, msg, MAXPATHLEN-1); throw std::string("Can't allocate RWX Memory: ") + msg; } - M.Address = pa; - M.AllocSize = NumPages*pageSize; - return pa; + MemoryBlock result; + result.Address = pa; + result.Size = NumPages*pageSize; + return result; } -void Memory::ReleaseRWX(Memory& M) { - if (M.Address == 0 || M.AllocSize == 0) return; - if (0 != munmap(M.Address, M.AllocSize)) { +void Memory::ReleaseRWX(MemoryBlock& M) { + if (M.Address == 0 || M.Size == 0) return; + if (0 != munmap(M.Address, M.Size)) { char msg[MAXPATHLEN]; strerror_r(errno, msg, MAXPATHLEN-1); throw std::string("Can't release RWX Memory: ") + msg; From reid at x10sys.com Mon Sep 13 17:38:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 17:38:24 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Memory.h Message-ID: <200409132238.RAA02469@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Memory.h updated: 1.1 -> 1.2 --- Log message: Simplify the sys::Memory interface per Chris' request. --- Diffs of the changes: (+33 -23) Index: llvm/include/llvm/System/Memory.h diff -u llvm/include/llvm/System/Memory.h:1.1 llvm/include/llvm/System/Memory.h:1.2 --- llvm/include/llvm/System/Memory.h:1.1 Fri Sep 10 23:20:58 2004 +++ llvm/include/llvm/System/Memory.h Mon Sep 13 17:38:12 2004 @@ -11,38 +11,48 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SYSTEM_PATH_H -#define LLVM_SYSTEM_PATH_H - -#include +#ifndef LLVM_SYSTEM_MEMORY_H +#define LLVM_SYSTEM_MEMORY_H namespace llvm { namespace sys { - /// This class provides an abstraction for various memory handling functions + /// This class encapsulates the notion of a memory block which has an address + /// and a size. It is used by the Memory class (a friend) as the result of + /// various memory allocation operations. + /// @see Memory + /// @brief Memory block abstraction. + class MemoryBlock { + public: + void* base() const { return Address; } + unsigned size() const { return Size; } + private: + void * Address; ///< Address of first byte of memory area + unsigned Size; ///< Size, in bytes of the memory area + friend class Memory; + }; + + /// This class provides various memory handling functions that manipulate + /// MemoryBlock instances. /// @since 1.4 - /// @brief An abstraction for operating system paths. + /// @brief An abstraction for memory operations. class Memory { /// @name Functions /// @{ public: - Memory() { Address = 0; AllocSize = 0; } - ~Memory() { ReleaseRWX(*this); } - - /// @throws std::string if an error occurred - static void* AllocateRWX(Memory& block, unsigned NumBytes); - - /// @throws std::string if an error occurred - static void ReleaseRWX(Memory& block); - - char* base() const { return reinterpret_cast(Address); } - unsigned size() const { return AllocSize; } - /// @} - /// @name Data - /// @{ - private: - void * Address; // Address of first byte of memory area - unsigned AllocSize; // Size, in bytes of the memory area + /// This method allocates a block of Read/Write/Execute memory that is + /// suitable for executing dynamically generated code (e.g. JIT). An + /// attempt to allocate \p NumBytes bytes of virtual memory is made. + /// @throws std::string if an error occurred. + /// @brief Allocate Read/Write/Execute memory. + static MemoryBlock AllocateRWX(unsigned NumBytes); + + /// This method releases a block of Read/Write/Execute memory that was + /// allocated with the AllocateRWX method. It should not be used to release + /// any memory block allocated any other way. + /// @throws std::string if an error occurred. + /// @brief Release Read/Write/Execute memory. + static void ReleaseRWX(MemoryBlock& block); /// @} }; } From reid at x10sys.com Mon Sep 13 17:38:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 17:38:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Linux/Memory.cpp Message-ID: <200409132238.RAA02482@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Linux: Memory.cpp updated: 1.1 -> 1.3 --- Log message: Simplify the sys::Memory interface per Chris' request. --- Diffs of the changes: (+9 -8) Index: llvm/lib/System/Linux/Memory.cpp diff -u llvm/lib/System/Linux/Memory.cpp:1.1 llvm/lib/System/Linux/Memory.cpp:1.3 --- llvm/lib/System/Linux/Memory.cpp:1.1 Fri Sep 10 23:59:30 2004 +++ llvm/lib/System/Linux/Memory.cpp Mon Sep 13 17:38:12 2004 @@ -30,8 +30,8 @@ /// to emit code to the memory then jump to it. Getting this type of memory /// is very OS specific. /// -void* Memory::AllocateRWX(Memory& M, unsigned NumBytes) { - if (NumBytes == 0) return 0; +MemoryBlock Memory::AllocateRWX(unsigned NumBytes) { + if (NumBytes == 0) return MemoryBlock(); static const long pageSize = Process::GetPageSize(); unsigned NumPages = (NumBytes+pageSize-1)/pageSize; @@ -43,14 +43,15 @@ strerror_r(errno, msg, MAXPATHLEN-1); throw std::string("Can't allocate RWX Memory: ") + msg; } - M.Address = pa; - M.AllocSize = NumPages*pageSize; - return pa; + MemoryBlock result; + result.Address = pa; + result.Size = NumPages*pageSize; + return result; } -void Memory::ReleaseRWX(Memory& M) { - if (M.Address == 0 || M.AllocSize == 0) return; - if (0 != munmap(M.Address, M.AllocSize)) { +void Memory::ReleaseRWX(MemoryBlock& M) { + if (M.Address == 0 || M.Size == 0) return; + if (0 != munmap(M.Address, M.Size)) { char msg[MAXPATHLEN]; strerror_r(errno, msg, MAXPATHLEN-1); throw std::string("Can't release RWX Memory: ") + msg; From reid at x10sys.com Mon Sep 13 17:38:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 17:38:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Cygwin/Memory.cpp Message-ID: <200409132238.RAA02476@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Cygwin: Memory.cpp updated: 1.2 -> 1.3 --- Log message: Simplify the sys::Memory interface per Chris' request. --- Diffs of the changes: (+8 -7) Index: llvm/lib/System/Cygwin/Memory.cpp diff -u llvm/lib/System/Cygwin/Memory.cpp:1.2 llvm/lib/System/Cygwin/Memory.cpp:1.3 --- llvm/lib/System/Cygwin/Memory.cpp:1.2 Sat Sep 11 15:18:08 2004 +++ llvm/lib/System/Cygwin/Memory.cpp Mon Sep 13 17:38:12 2004 @@ -26,8 +26,8 @@ //=== and must not be generic UNIX code (see ../Unix/Memory.cpp) //===----------------------------------------------------------------------===// -void* Memory::AllocateRWX(Memory& M, unsigned NumBytes) { - if (NumBytes == 0) return 0; +MemoryBlock Memory::AllocateRWX(unsigned NumBytes) { + if (NumBytes == 0) return MemoryBlock(); static const long pageSize = Process::GetPageSize(); unsigned NumPages = (NumBytes+pageSize-1)/pageSize; @@ -37,14 +37,15 @@ if (pa == (void*)-1) { throw std::string("Can't allocate RWX Memory: ") + strerror(errno); } - M.Address = pa; - M.AllocSize = NumPages*pageSize; - return pa; + MemoryBlock result; + result.Address = pa; + result.Size = NumPages*pageSize; + return result; } void Memory::ReleaseRWX(Memory& M) { - if (M.Address == 0 || M.AllocSize == 0) return; - if (0 != munmap(M.Address, M.AllocSize)) { + if (M.Address == 0 || M.Size == 0) return; + if (0 != munmap(M.Address, M.Size)) { throw std::string("Can't release RWX Memory: ") + strerror(errno); } } From reid at x10sys.com Mon Sep 13 17:38:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 17:38:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/Emitter.cpp Message-ID: <200409132238.RAA02475@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: Emitter.cpp updated: 1.44 -> 1.45 --- Log message: Simplify the sys::Memory interface per Chris' request. --- Diffs of the changes: (+2 -2) Index: llvm/lib/ExecutionEngine/JIT/Emitter.cpp diff -u llvm/lib/ExecutionEngine/JIT/Emitter.cpp:1.44 llvm/lib/ExecutionEngine/JIT/Emitter.cpp:1.45 --- llvm/lib/ExecutionEngine/JIT/Emitter.cpp:1.44 Fri Sep 10 23:31:03 2004 +++ llvm/lib/ExecutionEngine/JIT/Emitter.cpp Mon Sep 13 17:38:12 2004 @@ -38,7 +38,7 @@ /// are emitting is. This never bothers to release the memory, because when /// we are ready to destroy the JIT, the program exits. class JITMemoryManager { - sys::Memory MemBlock; // Virtual memory block allocated RWX + sys::MemoryBlock MemBlock; // Virtual memory block allocated RWX unsigned char *MemBase; // Base of block of memory, start of stub mem unsigned char *FunctionBase; // Start of the function body area unsigned char *CurStubPtr, *CurFunctionPtr; @@ -53,7 +53,7 @@ JITMemoryManager::JITMemoryManager() { // Allocate a 16M block of memory... - sys::Memory::AllocateRWX(MemBlock,(16 << 20)); + MemBlock = sys::Memory::AllocateRWX((16 << 20)); MemBase = reinterpret_cast(MemBlock.base()); FunctionBase = MemBase + 512*1024; // Use 512k for stubs From reid at x10sys.com Mon Sep 13 17:38:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 17:38:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Linux/Memory.cpp Message-ID: <200409132238.RAA02493@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Linux: Memory.cpp updated: 1.1 -> 1.2 --- Log message: Simplify the sys::Memory interface per Chris' request. --- Diffs of the changes: (+9 -8) Index: llvm/lib/System/Linux/Memory.cpp diff -u llvm/lib/System/Linux/Memory.cpp:1.1 llvm/lib/System/Linux/Memory.cpp:1.2 --- llvm/lib/System/Linux/Memory.cpp:1.1 Fri Sep 10 23:59:30 2004 +++ llvm/lib/System/Linux/Memory.cpp Mon Sep 13 17:38:12 2004 @@ -30,8 +30,8 @@ /// to emit code to the memory then jump to it. Getting this type of memory /// is very OS specific. /// -void* Memory::AllocateRWX(Memory& M, unsigned NumBytes) { - if (NumBytes == 0) return 0; +MemoryBlock Memory::AllocateRWX(unsigned NumBytes) { + if (NumBytes == 0) return MemoryBlock(); static const long pageSize = Process::GetPageSize(); unsigned NumPages = (NumBytes+pageSize-1)/pageSize; @@ -43,14 +43,15 @@ strerror_r(errno, msg, MAXPATHLEN-1); throw std::string("Can't allocate RWX Memory: ") + msg; } - M.Address = pa; - M.AllocSize = NumPages*pageSize; - return pa; + MemoryBlock result; + result.Address = pa; + result.Size = NumPages*pageSize; + return result; } -void Memory::ReleaseRWX(Memory& M) { - if (M.Address == 0 || M.AllocSize == 0) return; - if (0 != munmap(M.Address, M.AllocSize)) { +void Memory::ReleaseRWX(MemoryBlock& M) { + if (M.Address == 0 || M.Size == 0) return; + if (0 != munmap(M.Address, M.Size)) { char msg[MAXPATHLEN]; strerror_r(errno, msg, MAXPATHLEN-1); throw std::string("Can't release RWX Memory: ") + msg; From reid at x10sys.com Mon Sep 13 17:38:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 17:38:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/FreeBSD/Memory.cpp Message-ID: <200409132238.RAA02477@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/FreeBSD: Memory.cpp updated: 1.2 -> 1.3 --- Log message: Simplify the sys::Memory interface per Chris' request. --- Diffs of the changes: (+9 -7) Index: llvm/lib/System/FreeBSD/Memory.cpp diff -u llvm/lib/System/FreeBSD/Memory.cpp:1.2 llvm/lib/System/FreeBSD/Memory.cpp:1.3 --- llvm/lib/System/FreeBSD/Memory.cpp:1.2 Sat Sep 11 15:18:08 2004 +++ llvm/lib/System/FreeBSD/Memory.cpp Mon Sep 13 17:38:12 2004 @@ -25,8 +25,8 @@ //=== and must not be generic UNIX code (see ../Unix/Memory.cpp) //===----------------------------------------------------------------------===// -void* Memory::AllocateRWX(Memory& M, unsigned NumBytes) { - if (NumBytes == 0) return 0; +MemoryBlock Memory::AllocateRWX(unsigned NumBytes) { + if (NumBytes == 0) return MemoryBlock(); static const long pageSize = Process::GetPageSize(); unsigned NumPages = (NumBytes+pageSize-1)/pageSize; @@ -36,14 +36,16 @@ if (pa == (void*)-1) { throw std::string("Can't allocate RWX Memory: ") + strerror(errno); } - M.Address = pa; - M.AllocSize = NumPages*pageSize; - return pa; + + MemoryBlock result; + result.Address = pa; + result.Size = NumPages*pageSize; + return result; } void Memory::ReleaseRWX(Memory& M) { - if (M.Address == 0 || M.AllocSize == 0) return; - if (0 != munmap(M.Address, M.AllocSize)) { + if (M.Address == 0 || M.Size == 0) return; + if (0 != munmap(M.Address, M.Size)) { throw std::string("Can't release RWX Memory: ") + strerror(errno); } } From reid at x10sys.com Mon Sep 13 17:38:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 17:38:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Interix/Memory.cpp Message-ID: <200409132238.RAA02474@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Interix: Memory.cpp updated: 1.2 -> 1.3 --- Log message: Simplify the sys::Memory interface per Chris' request. --- Diffs of the changes: (+9 -8) Index: llvm/lib/System/Interix/Memory.cpp diff -u llvm/lib/System/Interix/Memory.cpp:1.2 llvm/lib/System/Interix/Memory.cpp:1.3 --- llvm/lib/System/Interix/Memory.cpp:1.2 Sat Sep 11 15:18:08 2004 +++ llvm/lib/System/Interix/Memory.cpp Mon Sep 13 17:38:12 2004 @@ -25,8 +25,8 @@ //=== and must not be generic UNIX code (see ../Unix/Memory.cpp) //===----------------------------------------------------------------------===// -void* Memory::AllocateRWX(Memory& M, unsigned NumBytes) { - if (NumBytes == 0) return 0; +MemoryBlock Memory::AllocateRWX(unsigned NumBytes) { + if (NumBytes == 0) return MemoryBlock(); static const long pageSize = Process::GetPageSize(); unsigned NumPages = (NumBytes+pageSize-1)/pageSize; @@ -36,14 +36,15 @@ if (pa == (void*)-1) { throw std::string("Can't allocate RWX Memory: ") + strerror(errno); } - M.Address = pa; - M.AllocSize = NumPages*pageSize; - return pa; + MemoryBlock result; + result.Address = pa; + result.Size = NumPages*pageSize; + return result; } -void Memory::ReleaseRWX(Memory& M) { - if (M.Address == 0 || M.AllocSize == 0) return; - if (0 != munmap(M.Address, M.AllocSize)) { +void Memory::ReleaseRWX(MemoryBlock& M) { + if (M.Address == 0 || M.Size == 0) return; + if (0 != munmap(M.Address, M.Size)) { throw std::string("Can't release RWX Memory: ") + strerror(errno); } } From brukman at cs.uiuc.edu Mon Sep 13 17:43:05 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon, 13 Sep 2004 17:43:05 -0500 Subject: [llvm-commits] CVS: llvm/projects/Makefile Message-ID: <200409132243.RAA02576@zion.cs.uiuc.edu> Changes in directory llvm/projects: Makefile updated: 1.10 -> 1.11 --- Log message: Sparc cannot link shared objects (libtool issue) which affects Stacker. --- Diffs of the changes: (+5 -0) Index: llvm/projects/Makefile diff -u llvm/projects/Makefile:1.10 llvm/projects/Makefile:1.11 --- llvm/projects/Makefile:1.10 Sat Sep 4 18:07:57 2004 +++ llvm/projects/Makefile Mon Sep 13 17:42:54 2004 @@ -12,4 +12,9 @@ DIRS:= $(filter-out llvm-test,$(patsubst $(SourceDir)/%/Makefile,%,$(wildcard $(SourceDir)/*/Makefile))) +# Sparc cannot link shared libraries (libtool problem?) which Stacker uses +ifeq ($(ARCH), Sparc) +DIRS := $(filter-out Stacker, $(DIRS)) +endif + include $(BUILD_SRC_ROOT)/Makefile.rules From reid at x10sys.com Mon Sep 13 18:44:33 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 18:44:33 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Module.h Message-ID: <200409132344.SAA07642@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Module.h updated: 1.50 -> 1.51 --- Log message: Add support for the link-time pass list to Modules. --- Diffs of the changes: (+30 -1) Index: llvm/include/llvm/Module.h diff -u llvm/include/llvm/Module.h:1.50 llvm/include/llvm/Module.h:1.51 --- llvm/include/llvm/Module.h:1.50 Fri Sep 10 23:22:14 2004 +++ llvm/include/llvm/Module.h Mon Sep 13 18:44:23 2004 @@ -49,6 +49,7 @@ typedef iplist GlobalListType; typedef iplist FunctionListType; typedef SetVector LibraryListType; + typedef std::vector PassListType; // Global Variable iterators... typedef GlobalListType::iterator giterator; @@ -65,6 +66,9 @@ // Library list iterators typedef LibraryListType::const_iterator lib_iterator; + // Link-time Pass list iterators + typedef PassListType::const_iterator pass_iterator; + enum Endianness { AnyEndianness, LittleEndian, BigEndian }; enum PointerSize { AnyPointerSize, Pointer32, Pointer64 }; @@ -72,6 +76,7 @@ GlobalListType GlobalList; // The Global Variables in the module FunctionListType FunctionList; // The Functions in the module LibraryListType LibraryList; // The Libraries needed by the module + PassListType PassList; // The Passes needed by the module at link time SymbolTable *SymTab; // Symbol Table for the module std::string ModuleID; // Human readable identifier for the module std::string TargetTriple; // Platform target triple Module compiled on @@ -227,7 +232,7 @@ inline Function &back() { return FunctionList.back(); } //===--------------------------------------------------------------------===// - // List of dependent library access functionsns + // List of dependent library access functions /// @brief Get a constant iterator to beginning of dependent library list. inline lib_iterator lib_begin() const { return LibraryList.begin(); } @@ -247,6 +252,30 @@ /// @brief Get all the libraries inline const LibraryListType& getLibraries() const { return LibraryList; } + //===--------------------------------------------------------------------===// + // Access functions for Link-time pass list + + /// @brief Get a constant iterator to beginning of pass list. + inline pass_iterator pass_begin() const { return PassList.begin(); } + + /// @brief Get a constant iterator to end of pass list. + inline pass_iterator pass_end() const { return PassList.end(); } + + /// @brief Returns the number of items in the list of passes. + inline unsigned pass_size() const { return PassList.size(); } + + /// @brief Add a library to the list of passes + inline void addPass(const std::string& Pass){ PassList.push_back(Pass); } + + /// @brief Remove a library from the list of passes + void removePass(const std::string& Lib); + + /// @brief Get all the passes + inline const PassListType& getPasses() const { return PassList; } + + //===--------------------------------------------------------------------===// + // Utility functions for printing and dumping Module objects + void print(std::ostream &OS) const { print(OS, 0); } void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const; From reid at x10sys.com Mon Sep 13 18:44:33 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 18:44:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/Lexer.l llvmAsmParser.y Message-ID: <200409132344.SAA07647@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: Lexer.l updated: 1.52 -> 1.53 llvmAsmParser.y updated: 1.201 -> 1.202 --- Log message: Add support for the link-time pass list to Modules. --- Diffs of the changes: (+17 -1) Index: llvm/lib/AsmParser/Lexer.l diff -u llvm/lib/AsmParser/Lexer.l:1.52 llvm/lib/AsmParser/Lexer.l:1.53 --- llvm/lib/AsmParser/Lexer.l:1.52 Sun Jul 25 12:56:00 2004 +++ llvm/lib/AsmParser/Lexer.l Mon Sep 13 18:44:23 2004 @@ -195,6 +195,7 @@ target { return TARGET; } triple { return TRIPLE; } deplibs { return DEPLIBS; } +passes { return PASSES; } endian { return ENDIAN; } pointersize { return POINTERSIZE; } little { return LITTLE; } Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.201 llvm/lib/AsmParser/llvmAsmParser.y:1.202 --- llvm/lib/AsmParser/llvmAsmParser.y:1.201 Wed Sep 1 17:55:35 2004 +++ llvm/lib/AsmParser/llvmAsmParser.y Mon Sep 13 18:44:23 2004 @@ -910,7 +910,7 @@ %token DECLARE GLOBAL CONSTANT VOLATILE %token TO DOTDOTDOT NULL_TOK CONST INTERNAL LINKONCE WEAK APPENDING %token OPAQUE NOT EXTERNAL TARGET TRIPLE ENDIAN POINTERSIZE LITTLE BIG -%token DEPLIBS +%token DEPLIBS PASSES // Basic Block Terminating Operators %token RET BR SWITCH INVOKE UNWIND @@ -1484,6 +1484,8 @@ } | ConstPool DEPLIBS '=' LibrariesDefinition { } + | ConstPool PASSES '=' PassesDefinition { + } | /* empty: end of list */ { }; @@ -1522,6 +1524,19 @@ } ; +PassesDefinition : '[' PassList ']'; +PassList : PassList ',' STRINGCONSTANT { + CurModule.CurrentModule->addLibrary($3); + free($3); + } + | STRINGCONSTANT { + CurModule.CurrentModule->addLibrary($1); + free($1); + } + | /* empty: end of list */ { + } + ; + //===----------------------------------------------------------------------===// // Rules to match Function Headers //===----------------------------------------------------------------------===// From reid at x10sys.com Mon Sep 13 18:44:33 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 18:44:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Module.cpp Message-ID: <200409132344.SAA07639@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.158 -> 1.159 Module.cpp updated: 1.55 -> 1.56 --- Log message: Add support for the link-time pass list to Modules. --- Diffs of the changes: (+20 -0) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.158 llvm/lib/VMCore/AsmWriter.cpp:1.159 --- llvm/lib/VMCore/AsmWriter.cpp:1.158 Wed Sep 1 17:55:36 2004 +++ llvm/lib/VMCore/AsmWriter.cpp Mon Sep 13 18:44:23 2004 @@ -777,6 +777,20 @@ } Out << " ]\n"; } + + // Loop over the link time pass list and emit them + Module::pass_iterator PI = M->pass_begin(); + Module::pass_iterator PE = M->pass_end(); + if (LI != LE) { + Out << "passes = [\n"; + while (LI != LE) { + Out << "\"" << *LI << "\""; + ++LI; + if (LI != LE) + Out << ",\n"; + } + Out << " ]\n"; + } // Loop over the symbol table, emitting all named constants... printSymbolTable(M->getSymbolTable()); Index: llvm/lib/VMCore/Module.cpp diff -u llvm/lib/VMCore/Module.cpp:1.55 llvm/lib/VMCore/Module.cpp:1.56 --- llvm/lib/VMCore/Module.cpp:1.55 Wed Sep 1 17:55:37 2004 +++ llvm/lib/VMCore/Module.cpp Mon Sep 13 18:44:23 2004 @@ -270,6 +270,12 @@ return ""; // Must not have found anything... } +void Module::removePass(const std::string& Lib) { + PassListType::iterator I = find(PassList.begin(),PassList.end(),Lib); + if (I != PassList.end()) + PassList.erase(I); +} + //===----------------------------------------------------------------------===// // Other module related stuff. From reid at x10sys.com Mon Sep 13 18:46:33 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 18:46:33 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200409132346.SAA07695@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.5 -> 1.6 --- Log message: Add the GetLibraryPath method. --- Diffs of the changes: (+11 -0) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.5 llvm/include/llvm/System/Path.h:1.6 --- llvm/include/llvm/System/Path.h:1.5 Fri Sep 10 23:19:17 2004 +++ llvm/include/llvm/System/Path.h Mon Sep 13 18:46:23 2004 @@ -15,6 +15,7 @@ #define LLVM_SYSTEM_PATH_H #include +#include namespace llvm { namespace sys { @@ -61,6 +62,16 @@ /// directory. static Path GetTemporaryDirectory(); + /// Determine the platform-specific location of a library by first + /// searching a list of library paths, then searching a list of "well + /// known" paths for the platform. T + /// @returns a valid Path object if the library was found, an invalid + /// one otherwise. + /// @throws nothing + /// @brief Locate a library in a platform specific manner. + static Path GetLibraryPath(const std::string& basename, + const std::vector& LibPaths); + /// /// Construct a path to the first system library directory. The /// implementation of Path on a given platform must ensure that this /// directory both exists and also contains standard system libraries From reid at x10sys.com Mon Sep 13 19:16:50 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 19:16:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.cpp Message-ID: <200409140016.TAA07995@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.cpp updated: 1.5 -> 1.6 --- Log message: Implement the GetLibraryPath function. --- Diffs of the changes: (+45 -0) Index: llvm/lib/System/Unix/Path.cpp diff -u llvm/lib/System/Unix/Path.cpp:1.5 llvm/lib/System/Unix/Path.cpp:1.6 --- llvm/lib/System/Unix/Path.cpp:1.5 Fri Sep 10 23:55:08 2004 +++ llvm/lib/System/Unix/Path.cpp Mon Sep 13 19:16:39 2004 @@ -44,6 +44,51 @@ return result; } +static inline bool IsLibrary(Path& path, const std::string& basename) { + if (path.append_file(std::string("lib") + basename)) { + if (path.append_suffix(Path::GetDLLSuffix()) && path.readable()) + return true; + else if (path.elide_suffix() && path.append_suffix("a") && path.readable()) + return true; + else if (path.elide_suffix() && path.append_suffix("o") && path.readable()) + return true; + } else if (path.elide_file() && path.append_file(basename)) { + if (path.append_suffix(Path::GetDLLSuffix()) && path.readable()) + return true; + else if (path.elide_suffix() && path.append_suffix("a") && path.readable()) + return true; + else if (path.elide_suffix() && path.append_suffix("o") && path.readable()) + return true; + } + path.clear(); + return false; +} + +Path +Path::GetLibraryPath(const std::string& basename, + const std::vector& LibPaths) { + Path result; + + // Try the paths provided + for (std::vector::const_iterator I = LibPaths.begin(), + E = LibPaths.end(); I != E; ++I ) { + if (result.set_directory(*I) && IsLibrary(result,basename)) + return result; + } + + // Try /usr/lib + if (result.set_directory("/usr/lib/") && IsLibrary(result,basename)) + return result; + + // Try /lib + if (result.set_directory("/lib/") && IsLibrary(result,basename)) + return result; + + // Can't find it, give up and return invalid path. + result.clear(); + return result; +} + Path Path::GetSystemLibraryPath1() { return Path("/lib/"); From alkis at cs.uiuc.edu Mon Sep 13 20:04:53 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Sep 2004 20:04:53 -0500 Subject: [llvm-commits] CVS: llvm-java/include/llvm/Java/ClassFile.h Message-ID: <200409140104.UAA08356@zion.cs.uiuc.edu> Changes in directory llvm-java/include/llvm/Java: ClassFile.h updated: 1.22 -> 1.23 --- Log message: Rename ClassFile::getClassFile() to ClassFile::get(). --- Diffs of the changes: (+1 -1) Index: llvm-java/include/llvm/Java/ClassFile.h diff -u llvm-java/include/llvm/Java/ClassFile.h:1.22 llvm-java/include/llvm/Java/ClassFile.h:1.23 --- llvm-java/include/llvm/Java/ClassFile.h:1.22 Sun Aug 22 18:06:18 2004 +++ llvm-java/include/llvm/Java/ClassFile.h Mon Sep 13 20:04:42 2004 @@ -72,7 +72,7 @@ typedef std::map Name2MethodMap; public: - static ClassFile* getClassFile(const std::string& classname); + static ClassFile* get(const std::string& classname); ~ClassFile(); From alkis at cs.uiuc.edu Mon Sep 13 20:04:53 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Sep 2004 20:04:53 -0500 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200409140104.UAA08350@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.94 -> 1.95 --- Log message: Rename ClassFile::getClassFile() to ClassFile::get(). --- Diffs of the changes: (+8 -8) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.94 llvm-java/lib/Compiler/Compiler.cpp:1.95 --- llvm-java/lib/Compiler/Compiler.cpp:1.94 Mon Sep 13 14:54:11 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Mon Sep 13 20:04:42 2004 @@ -249,7 +249,7 @@ void initializeClassInfoMap() { DEBUG(std::cerr << "Building ClassInfo for: java/lang/Object\n"); - ClassFile* cf = ClassFile::getClassFile("java/lang/Object"); + ClassFile* cf = ClassFile::get("java/lang/Object"); ClassInfo& ci = c2ciMap_["java/lang/Object"]; assert(!ci.type && ci.f2iMap.empty() && "java/lang/Object ClassInfo should not be initialized!"); @@ -286,7 +286,7 @@ void initializeVTableInfoMap() { DEBUG(std::cerr << "Building VTableInfo for: java/lang/Object\n"); - ClassFile* cf = ClassFile::getClassFile("java/lang/Object"); + ClassFile* cf = ClassFile::get("java/lang/Object"); VTableInfo& vi = c2viMap_["java/lang/Object"]; assert(!vi.vtable && vi.m2iMap.empty() && "java/lang/Object VTableInfo should not be initialized!"); @@ -382,7 +382,7 @@ return it->second; DEBUG(std::cerr << "Building ClassInfo for: " << className << '\n'); - ClassFile* cf = ClassFile::getClassFile(className); + ClassFile* cf = ClassFile::get(className); ClassInfo& ci = c2ciMap_[className]; assert(!ci.type && ci.f2iMap.empty() && "got already initialized ClassInfo!"); @@ -458,7 +458,7 @@ return it->second; DEBUG(std::cerr << "Building VTableInfo for: " << className << '\n'); - ClassFile* cf = ClassFile::getClassFile(className); + ClassFile* cf = ClassFile::get(className); VTableInfo& vi = c2viMap_[className]; assert(!vi.vtable && vi.m2iMap.empty() && "got already initialized VTableInfo!"); @@ -574,7 +574,7 @@ // Cast ptr to correct type ptr = new CastInst(ptr, PointerType::get(getClassInfo(className).type), TMP, getBBAt(bcI)); - ClassFile* classfile = ClassFile::getClassFile(className); + ClassFile* classfile = ClassFile::get(className); // deref pointer std::vector indices(1, ConstantUInt::get(Type::UIntTy, 0)); @@ -584,7 +584,7 @@ info.f2iMap.find(fieldName); if (it == info.f2iMap.end()) { className = classfile->getSuperClass()->getName()->str(); - classfile = ClassFile::getClassFile(className); + classfile = ClassFile::get(className); indices.push_back(ConstantUInt::get(Type::UIntTy, 0)); } else { @@ -700,7 +700,7 @@ std::string className = classMethodDesc.substr(0, slash); std::string methodNameAndDescr = classMethodDesc.substr(slash+1); - ClassFile* classfile = ClassFile::getClassFile(className); + ClassFile* classfile = ClassFile::get(className); emitStaticInitializers(classfile); Method* method = classfile->getMethod(methodNameAndDescr); @@ -1201,7 +1201,7 @@ void do_new(unsigned bcI, unsigned index) { ConstantClass* classRef = cf_->getConstantClass(index); const std::string& className = classRef->getName()->str(); - ClassFile* cf = ClassFile::getClassFile(className); + ClassFile* cf = ClassFile::get(className); const ClassInfo& ci = getClassInfo(className); const VTableInfo& vi = getVTableInfo(className); From alkis at cs.uiuc.edu Mon Sep 13 20:04:53 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Sep 2004 20:04:53 -0500 Subject: [llvm-commits] CVS: llvm-java/lib/ClassFile/ClassFile.cpp Message-ID: <200409140104.UAA08351@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/ClassFile: ClassFile.cpp updated: 1.26 -> 1.27 --- Log message: Rename ClassFile::getClassFile() to ClassFile::get(). --- Diffs of the changes: (+1 -1) Index: llvm-java/lib/ClassFile/ClassFile.cpp diff -u llvm-java/lib/ClassFile/ClassFile.cpp:1.26 llvm-java/lib/ClassFile/ClassFile.cpp:1.27 --- llvm-java/lib/ClassFile/ClassFile.cpp:1.26 Fri Sep 10 12:11:21 2004 +++ llvm-java/lib/ClassFile/ClassFile.cpp Mon Sep 13 20:04:42 2004 @@ -211,7 +211,7 @@ throw ClassNotFoundException("Class " + classname + " not found"); } -ClassFile* ClassFile::getClassFile(const std::string& classname) +ClassFile* ClassFile::get(const std::string& classname) { typedef std::map Name2ClassMap; static Name2ClassMap n2cMap_; From alkis at cs.uiuc.edu Mon Sep 13 20:04:53 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Sep 2004 20:04:53 -0500 Subject: [llvm-commits] CVS: llvm-java/tools/classdump/classdump.cpp Message-ID: <200409140104.UAA08359@zion.cs.uiuc.edu> Changes in directory llvm-java/tools/classdump: classdump.cpp updated: 1.14 -> 1.15 --- Log message: Rename ClassFile::getClassFile() to ClassFile::get(). --- Diffs of the changes: (+1 -1) Index: llvm-java/tools/classdump/classdump.cpp diff -u llvm-java/tools/classdump/classdump.cpp:1.14 llvm-java/tools/classdump/classdump.cpp:1.15 --- llvm-java/tools/classdump/classdump.cpp:1.14 Wed Sep 1 23:52:13 2004 +++ llvm-java/tools/classdump/classdump.cpp Mon Sep 13 20:04:42 2004 @@ -31,7 +31,7 @@ "class dump utility"); try { - const Java::ClassFile* cf(Java::ClassFile::getClassFile(InputClass)); + const Java::ClassFile* cf(Java::ClassFile::get(InputClass)); cf->dump(std::cout); } From reid at x10sys.com Mon Sep 13 20:58:55 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 20:58:55 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvmc/llvmc.cpp CompilerDriver.cpp CompilerDriver.h Message-ID: <200409140158.UAA08745@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: llvmc.cpp updated: 1.15 -> 1.16 CompilerDriver.cpp updated: 1.14 -> 1.15 CompilerDriver.h updated: 1.11 -> 1.12 --- Log message: Support the -WX, -f -M options as pass throughs Change force option from -f to -F Support the -strip option Make changes to reflect different interface in sys::Program --- Diffs of the changes: (+234 -112) Index: llvm/tools/llvmc/llvmc.cpp diff -u llvm/tools/llvmc/llvmc.cpp:1.15 llvm/tools/llvmc/llvmc.cpp:1.16 --- llvm/tools/llvmc/llvmc.cpp:1.15 Fri Sep 3 17:59:32 2004 +++ llvm/tools/llvmc/llvmc.cpp Mon Sep 13 20:58:45 2004 @@ -90,6 +90,18 @@ cl::desc("Pass specific options to the linker"), cl::value_desc("option")); +cl::list fOpts("f", cl::ZeroOrMore, cl::Prefix, + cl::desc("Pass through -f options to compiler tools"), + cl::value_desc("optimization option")); + +cl::list MOpts("M", cl::ZeroOrMore, cl::Prefix, + cl::desc("Pass through -M options to compiler tools"), + cl::value_desc("dependency option")); + +cl::list WOpts("W", cl::ZeroOrMore, cl::Prefix, + cl::desc("Pass through -W options to compiler tools"), + cl::value_desc("warnings category")); + //===------------------------------------------------------------------------=== //=== INPUT OPTIONS //===------------------------------------------------------------------------=== @@ -116,7 +128,7 @@ cl::opt OutputFilename("o", cl::desc("Override output filename"), cl::value_desc("filename")); -cl::opt ForceOutput("f", cl::Optional, cl::init(false), +cl::opt ForceOutput("F", cl::Optional, cl::init(false), cl::desc("Force output files to be overridden")); cl::opt OutputMachine("m", cl::Prefix, @@ -128,6 +140,9 @@ cl::opt DebugOutput("g", cl::init(false), cl::desc("Generate objects that include debug symbols")); +cl::opt StripOutput("strip", cl::init(false), + cl::desc("Strip all symbols from linked output file")); + //===------------------------------------------------------------------------=== //=== INFORMATION OPTIONS //===------------------------------------------------------------------------=== @@ -156,10 +171,6 @@ cl::opt ShowStats("stats", cl::Optional, cl::init(false), cl::desc("Print statistics accumulated during optimization")); -cl::list Warnings("W", cl::Prefix, - cl::desc("Provide warnings for additional classes of errors"), - cl::value_desc("warning category")); - //===------------------------------------------------------------------------=== //=== ADVANCED OPTIONS //===------------------------------------------------------------------------=== @@ -264,6 +275,7 @@ if (ShowStats) flags |= CompilerDriver::SHOW_STATS_FLAG; if (TimeActions) flags |= CompilerDriver::TIME_ACTIONS_FLAG; if (TimePassesIsEnabled) flags |= CompilerDriver::TIME_PASSES_FLAG; + if (StripOutput) flags |= CompilerDriver::STRIP_OUTPUT_FLAG; CD->setDriverFlags(flags); // Specify requred parameters @@ -273,6 +285,9 @@ CD->setIncludePaths(Includes); CD->setSymbolDefines(Defines); CD->setLibraryPaths(LibPaths); + CD->setfPassThrough(fOpts); + CD->setMPassThrough(MOpts); + CD->setWPassThrough(WOpts); // Provide additional tool arguments if (!PreprocessorToolOpts.empty()) Index: llvm/tools/llvmc/CompilerDriver.cpp diff -u llvm/tools/llvmc/CompilerDriver.cpp:1.14 llvm/tools/llvmc/CompilerDriver.cpp:1.15 --- llvm/tools/llvmc/CompilerDriver.cpp:1.14 Wed Sep 1 17:55:39 2004 +++ llvm/tools/llvmc/CompilerDriver.cpp Mon Sep 13 20:58:45 2004 @@ -16,8 +16,8 @@ #include "ConfigLexer.h" #include "llvm/Module.h" #include "llvm/Bytecode/Reader.h" +#include "llvm/Support/Timer.h" #include "llvm/System/Signals.h" -#include "llvm/Support/FileUtilities.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/StringExtras.h" #include @@ -153,6 +153,19 @@ LibraryPaths.push_back(libPath); } + virtual void setfPassThrough(const StringVector& fOpts) { + fOptions = fOpts; + } + + /// @brief Set the list of -M options to be passed through + virtual void setMPassThrough(const StringVector& MOpts) { + MOptions = MOpts; + } + + /// @brief Set the list of -W options to be passed through + virtual void setWPassThrough(const StringVector& WOpts) { + WOptions = WOpts; + } /// @} /// @name Functions /// @{ @@ -238,6 +251,9 @@ if (*PI == "%force%") { if (isSet(FORCE_FLAG)) action->args.push_back("-f"); + } else if (*PI == "%fOpts%") { + action->args.insert(action->args.end(), fOptions.begin(), + fOptions.end()); } else found = false; break; @@ -304,6 +320,20 @@ } else found = false; break; + case 'M': + if (*PI == "%Mopts") { + action->args.insert(action->args.end(), MOptions.begin(), + MOptions.end()); + } else + found = false; + break; + case 'W': + if (*PI == "%Wopts") { + action->args.insert(action->args.end(), WOptions.begin(), + WOptions.end()); + } else + found = false; + break; default: found = false; break; @@ -340,7 +370,16 @@ throw std::string("Can't find program '") + action->program.get() + "'"; // Invoke the program - return 0 == action->program.ExecuteAndWait(action->args); + if (isSet(TIME_ACTIONS_FLAG)) { + Timer timer(action->program.get()); + timer.startTimer(); + int resultCode = sys::Program::ExecuteAndWait(action->program,action->args); + timer.stopTimer(); + timer.print(timer,std::cerr); + return resultCode == 0; + } + else + return 0 == sys::Program::ExecuteAndWait(action->program, action->args); } return true; } @@ -349,25 +388,30 @@ /// name to see if it can find an appropriate file to link with /// in the directory specified. llvm::sys::Path GetPathForLinkageItem(const std::string& link_item, - const sys::Path& dir) { + const sys::Path& dir, + bool native = false) { sys::Path fullpath(dir); fullpath.append_file(link_item); - fullpath.append_suffix("bc"); - if (fullpath.readable()) - return fullpath; - fullpath.elide_suffix(); - fullpath.append_suffix("o"); - if (fullpath.readable()) - return fullpath; - fullpath = dir; - fullpath.append_file(std::string("lib") + link_item); - fullpath.append_suffix("a"); - if (fullpath.readable()) - return fullpath; - fullpath.elide_suffix(); - fullpath.append_suffix("so"); - if (fullpath.readable()) - return fullpath; + if (native) { + fullpath.append_suffix("a"); + } else { + fullpath.append_suffix("bc"); + if (fullpath.readable()) + return fullpath; + fullpath.elide_suffix(); + fullpath.append_suffix("o"); + if (fullpath.readable()) + return fullpath; + fullpath = dir; + fullpath.append_file(std::string("lib") + link_item); + fullpath.append_suffix("a"); + if (fullpath.readable()) + return fullpath; + fullpath.elide_suffix(); + fullpath.append_suffix("so"); + if (fullpath.readable()) + return fullpath; + } // Didn't find one. fullpath.clear(); @@ -408,7 +452,7 @@ set.insert(fullpath); // If its an LLVM bytecode file ... - if (CheckMagic(fullpath.get(), "llvm")) { + if (fullpath.is_bytecode_file()) { // Process the dependent libraries recursively Module::LibraryListType modlibs; if (GetBytecodeDependentLibraries(fullpath.get(),modlibs)) { @@ -475,12 +519,20 @@ throw std::string( "An output file name must be specified for linker output"); + // If they are not asking for linking, provided an output file and + // there is more than one input file, its an error + if (finalPhase != LINKING && !Output.is_empty() && + InpList.size() > 1) + throw std::string("An output file name cannot be specified ") + + "with more than one input file name when not linking"; + // This vector holds all the resulting actions of the following loop. std::vector actions; /// PRE-PROCESSING / TRANSLATION / OPTIMIZATION / ASSEMBLY phases // for each input item SetVector LinkageItems; + std::vector LibFiles; sys::Path OutFile(Output); InputList::const_iterator I = InpList.begin(); while ( I != InpList.end() ) { @@ -490,14 +542,17 @@ // If its a library, bytecode file, or object file, save // it for linking below and short circuit the // pre-processing/translation/assembly phases - if (ftype.empty() || ftype == "o" || ftype == "bc") { + if (ftype.empty() || ftype == "o" || ftype == "bc" || ftype=="a") { // We shouldn't get any of these types of files unless we're // later going to link. Enforce this limit now. if (finalPhase != LINKING) { throw std::string( "Pre-compiled objects found but linking not requested"); } - LinkageItems.insert(I->first); + if (ftype.empty()) + LibFiles.push_back(I->first.get()); + else + LinkageItems.insert(I->first); ++I; continue; // short circuit remainder of loop } @@ -520,9 +575,13 @@ // Get the preprocessing action, if needed, or error if appropriate if (!action.program.is_empty()) { if (action.isSet(REQUIRED_FLAG) || finalPhase == PREPROCESSING) { - if (finalPhase == PREPROCESSING) + if (finalPhase == PREPROCESSING) { + if (OutFile.is_empty()) { + OutFile = I->first; + OutFile.append_suffix("E"); + } actions.push_back(GetAction(cd,InFile,OutFile,PREPROCESSING)); - else { + } else { sys::Path TempFile(MakeTempFile(I->first.get(),"E")); actions.push_back(GetAction(cd,InFile,TempFile,PREPROCESSING)); InFile = TempFile; @@ -544,9 +603,13 @@ // Get the translation action, if needed, or error if appropriate if (!action.program.is_empty()) { if (action.isSet(REQUIRED_FLAG) || finalPhase == TRANSLATION) { - if (finalPhase == TRANSLATION) + if (finalPhase == TRANSLATION) { + if (OutFile.is_empty()) { + OutFile = I->first; + OutFile.append_suffix("o"); + } actions.push_back(GetAction(cd,InFile,OutFile,TRANSLATION)); - else { + } else { sys::Path TempFile(MakeTempFile(I->first.get(),"trans")); actions.push_back(GetAction(cd,InFile,TempFile,TRANSLATION)); InFile = TempFile; @@ -582,17 +645,21 @@ if (!isSet(EMIT_RAW_FLAG)) { if (!action.program.is_empty()) { if (action.isSet(REQUIRED_FLAG) || finalPhase == OPTIMIZATION) { - if (finalPhase == OPTIMIZATION) + if (finalPhase == OPTIMIZATION) { + if (OutFile.is_empty()) { + OutFile = I->first; + OutFile.append_suffix("o"); + } actions.push_back(GetAction(cd,InFile,OutFile,OPTIMIZATION)); - else { + } else { sys::Path TempFile(MakeTempFile(I->first.get(),"opt")); actions.push_back(GetAction(cd,InFile,TempFile,OPTIMIZATION)); InFile = TempFile; } // ll -> bc Helper if (action.isSet(OUTPUT_IS_ASM_FLAG)) { - /// The output of the translator is an LLVM Assembly program - /// We need to translate it to bytecode + /// The output of the optimizer is an LLVM Assembly program + /// We need to translate it to bytecode with llvm-as Action* action = new Action(); action->program.set_file("llvm-as"); action->args.push_back(InFile.get()); @@ -617,18 +684,19 @@ /// ASSEMBLY PHASE action = cd->Assembler; - if (finalPhase == ASSEMBLY || isSet(EMIT_NATIVE_FLAG)) { + if (finalPhase == ASSEMBLY) { if (isSet(EMIT_NATIVE_FLAG)) { - if (action.program.is_empty()) { - throw std::string("Native Assembler not specified for ") + - cd->langName + " files"; - } else if (finalPhase == ASSEMBLY) { - actions.push_back(GetAction(cd,InFile,OutFile,ASSEMBLY)); - } else { - sys::Path TempFile(MakeTempFile(I->first.get(),"S")); - actions.push_back(GetAction(cd,InFile,TempFile,ASSEMBLY)); - InFile = TempFile; + // Use llc to get the native assembly file + Action* action = new Action(); + action->program.set_file("llc"); + action->args.push_back(InFile.get()); + action->args.push_back("-f"); + action->args.push_back("-o"); + if (OutFile.is_empty()) { + OutFile = I->first; + OutFile.append_suffix("s"); } + action->args.push_back(OutFile.get()); } else { // Just convert back to llvm assembly with llvm-dis Action* action = new Action(); @@ -639,17 +707,18 @@ action->args.push_back(OutFile.get()); actions.push_back(action); } + + // Short circuit the rest of the loop, we don't want to link + ++I; + continue; } - // Short-circuit remaining actions if all they want is assembly output - if (finalPhase == ASSEMBLY) { ++I; continue; } - - // Register the OutFile as a link candidate + // Register the result of the actions as a link candidate LinkageItems.insert(InFile); // Go to next file to be processed ++I; - } + } // end while loop over each input file /// RUN THE COMPILATION ACTIONS std::vector::iterator AI = actions.begin(); @@ -661,55 +730,76 @@ } /// LINKING PHASE - actions.clear(); if (finalPhase == LINKING) { - if (isSet(EMIT_NATIVE_FLAG)) { - throw std::string( - "llvmc doesn't know how to link native code yet"); - } else { - // First, we need to examine the files to ensure that they all contain - // bytecode files. Since the final output is bytecode, we can only - // link bytecode. - SetVector::const_iterator I = LinkageItems.begin(); - SetVector::const_iterator E = LinkageItems.end(); - std::string errmsg; - - while (I != E && ProcessLinkageItem(*I,LinkageItems,errmsg)) - ++I; - - if (!errmsg.empty()) - throw errmsg; - - // Insert the system libraries. - LibraryPaths.push_back(sys::Path::GetSystemLibraryPath1()); - LibraryPaths.push_back(sys::Path::GetSystemLibraryPath2()); - - // We're emitting bytecode so let's build an llvm-link Action - Action* link = new Action(); - link->program.set_file("llvm-link"); - for (PathVector::const_iterator I=LinkageItems.begin(), - E=LinkageItems.end(); I != E; ++I ) - link->args.push_back(I->get()); - if (isSet(VERBOSE_FLAG)) - link->args.push_back("-v"); - link->args.push_back("-f"); - link->args.push_back("-o"); - link->args.push_back(OutFile.get()); - if (isSet(TIME_PASSES_FLAG)) - link->args.push_back("-time-passes"); - if (isSet(SHOW_STATS_FLAG)) - link->args.push_back("-stats"); - actions.push_back(link); + // Insert the platform-specific system libraries to the path list + LibraryPaths.push_back(sys::Path::GetSystemLibraryPath1()); + LibraryPaths.push_back(sys::Path::GetSystemLibraryPath2()); + + // We're emitting native code so let's build an gccld Action + Action* link = new Action(); + link->program.set_file("llvm-ld"); + + // Add in the optimization level requested + switch (optLevel) { + case OPT_FAST_COMPILE: + link->args.push_back("-O1"); + break; + case OPT_SIMPLE: + link->args.push_back("-O2"); + break; + case OPT_AGGRESSIVE: + link->args.push_back("-O3"); + break; + case OPT_LINK_TIME: + link->args.push_back("-O4"); + break; + case OPT_AGGRESSIVE_LINK_TIME: + link->args.push_back("-O5"); + break; + case OPT_NONE: + break; } - } - /// RUN THE LINKING ACTIONS - AI = actions.begin(); - AE = actions.end(); - while (AI != AE) { - if (!DoAction(*AI)) - throw std::string("Action failed"); - AI++; + // Add in all the linkage items we generated. This includes the + // output from the translation/optimization phases as well as any + // -l arguments specified. + for (PathVector::const_iterator I=LinkageItems.begin(), + E=LinkageItems.end(); I != E; ++I ) + link->args.push_back(I->get()); + + // Add in all the libraries we found. + for (std::vector::const_iterator I=LibFiles.begin(), + E=LibFiles.end(); I != E; ++I ) + link->args.push_back(std::string("-l")+*I); + + // Add in all the library paths to the command line + for (PathVector::const_iterator I=LibraryPaths.begin(), + E=LibraryPaths.end(); I != E; ++I) + link->args.push_back( std::string("-L") + I->get()); + + // Add in other optional flags + if (isSet(EMIT_NATIVE_FLAG)) + link->args.push_back("-native"); + if (isSet(VERBOSE_FLAG)) + link->args.push_back("-v"); + if (isSet(TIME_PASSES_FLAG)) + link->args.push_back("-time-passes"); + if (isSet(SHOW_STATS_FLAG)) + link->args.push_back("-stats"); + if (isSet(STRIP_OUTPUT_FLAG)) + link->args.push_back("-s"); + if (isSet(DEBUG_FLAG)) { + link->args.push_back("-debug"); + link->args.push_back("-debug-pass=Details"); + } + + // Add in mandatory flags + link->args.push_back("-o"); + link->args.push_back(OutFile.get()); + + // Execute the link + if (!DoAction(link)) + throw std::string("Action failed"); } } catch (std::string& msg) { cleanup(); @@ -736,6 +826,9 @@ StringVector Defines; ///< -D options sys::Path TempDir; ///< Name of the temporary directory. StringTable AdditionalArgs; ///< The -Txyz options + StringVector fOptions; ///< -f options + StringVector MOptions; ///< -M options + StringVector WOptions; ///< -W options /// @} }; Index: llvm/tools/llvmc/CompilerDriver.h diff -u llvm/tools/llvmc/CompilerDriver.h:1.11 llvm/tools/llvmc/CompilerDriver.h:1.12 --- llvm/tools/llvmc/CompilerDriver.h:1.11 Mon Aug 30 01:29:06 2004 +++ llvm/tools/llvmc/CompilerDriver.h Mon Sep 13 20:58:45 2004 @@ -68,21 +68,6 @@ FLAGS_MASK = 0x000F, ///< Union of all flags }; - /// @brief Driver specific flags - enum DriverFlags { - DRY_RUN_FLAG = 0x0001, ///< Do everything but execute actions - FORCE_FLAG = 0x0002, ///< Force overwrite of output files - VERBOSE_FLAG = 0x0004, ///< Print each action - DEBUG_FLAG = 0x0008, ///< Print debug information - TIME_PASSES_FLAG = 0x0010, ///< Time the passes as they execute - TIME_ACTIONS_FLAG = 0x0020, ///< Time the actions as they execute - SHOW_STATS_FLAG = 0x0040, ///< Show pass statistics - EMIT_NATIVE_FLAG = 0x0080, ///< Emit native code instead of bc - EMIT_RAW_FLAG = 0x0100, ///< Emit raw, unoptimized bytecode - KEEP_TEMPS_FLAG = 0x0200, ///< Don't delete temporary files - DRIVER_FLAGS_MASK = 0x02FF, ///< Union of the above flags - }; - /// This type is the input list to the CompilerDriver. It provides /// a vector of pathname/filetype pairs. The filetype is used to look up /// the configuration of the actions to be taken by the driver. @@ -96,7 +81,7 @@ /// language. struct Action { Action() : flags(0) {} - sys::Program program; ///< The program to execve + sys::Path program; ///< The program to execve StringVector args; ///< Arguments to the program unsigned flags; ///< Action specific flags void set(unsigned fl ) { flags |= fl; } @@ -128,6 +113,26 @@ virtual void setConfigDir(const sys::Path& dirName) = 0; }; + /// These flags control various actions of the compiler driver. They are + /// used by adding the needed flag values together and passing them to the + /// compiler driver's setDriverFlags method. + /// @see setDriverFlags + /// @brief Driver specific flags + enum DriverFlags { + DRY_RUN_FLAG = 0x0001, ///< Do everything but execute actions + FORCE_FLAG = 0x0002, ///< Force overwrite of output files + VERBOSE_FLAG = 0x0004, ///< Print each action + DEBUG_FLAG = 0x0008, ///< Print debug information + TIME_PASSES_FLAG = 0x0010, ///< Time the passes as they execute + TIME_ACTIONS_FLAG = 0x0020, ///< Time the actions as they execute + SHOW_STATS_FLAG = 0x0040, ///< Show pass statistics + EMIT_NATIVE_FLAG = 0x0080, ///< Emit native code instead of bc + EMIT_RAW_FLAG = 0x0100, ///< Emit raw, unoptimized bytecode + KEEP_TEMPS_FLAG = 0x0200, ///< Don't delete temporary files + STRIP_OUTPUT_FLAG = 0x0400, ///< Strip symbols from linked output + DRIVER_FLAGS_MASK = 0x07FF, ///< Union of the above flags + }; + /// @} /// @name Constructors /// @{ @@ -173,6 +178,15 @@ /// libraries. virtual void addLibraryPath( const sys::Path& libPath ) = 0; + /// @brief Set the list of -f options to be passed through + virtual void setfPassThrough(const StringVector& fOpts) = 0; + + /// @brief Set the list of -M options to be passed through + virtual void setMPassThrough(const StringVector& fOpts) = 0; + + /// @brief Set the list of -W options to be passed through + virtual void setWPassThrough(const StringVector& fOpts) = 0; + /// @} }; } From reid at x10sys.com Mon Sep 13 20:59:41 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 20:59:41 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvmc/ConfigLexer.h ConfigLexer.l Message-ID: <200409140159.UAA08768@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: ConfigLexer.h updated: 1.8 -> 1.9 ConfigLexer.l updated: 1.8 -> 1.9 --- Log message: Support substitution options for the W, M, and f options. --- Diffs of the changes: (+6 -0) Index: llvm/tools/llvmc/ConfigLexer.h diff -u llvm/tools/llvmc/ConfigLexer.h:1.8 llvm/tools/llvmc/ConfigLexer.h:1.9 --- llvm/tools/llvmc/ConfigLexer.h:1.8 Wed Sep 1 15:36:15 2004 +++ llvm/tools/llvmc/ConfigLexer.h Mon Sep 13 20:59:31 2004 @@ -59,6 +59,7 @@ DEFS_SUBST, ///< The substitution item %defs% EQUALS, ///< The equals sign, = FALSETOK, ///< A boolean false value (false/no/off) + FOPTS_SUBST, ///< The substitution item %fOpts% FORCE_SUBST, ///< The substitution item %force% IN_SUBST, ///< The substitution item %in% INCLS_SUBST, ///< The substitution item %incls% @@ -68,6 +69,7 @@ LIBS, ///< The name "libs" (and variants) LIBS_SUBST, ///< The substitution item %libs% LINKER, ///< The name "linker" (and variants) + MOPTS_SUBST, ///< The substitution item %Mopts% NAME, ///< The name "name" (and variants) OPT_SUBST, ///< The substitution item %opt% OPTIMIZER, ///< The name "optimizer" (and variants) @@ -92,6 +94,7 @@ TRUETOK, ///< A boolean true value (true/yes/on) VERBOSE_SUBST,///< The substitution item %verbose% VERSION, ///< The name "version" (and variants) + WOPTS_SUBST, ///< The %WOpts% substitution }; extern ConfigLexerTokens Configlex(); Index: llvm/tools/llvmc/ConfigLexer.l diff -u llvm/tools/llvmc/ConfigLexer.l:1.8 llvm/tools/llvmc/ConfigLexer.l:1.9 --- llvm/tools/llvmc/ConfigLexer.l:1.8 Mon Aug 30 01:29:06 2004 +++ llvm/tools/llvmc/ConfigLexer.l Mon Sep 13 20:59:31 2004 @@ -171,6 +171,9 @@ %target% { return handleSubstitution(TARGET_SUBST); } %time% { return handleSubstitution(TIME_SUBST); } %verbose% { return handleSubstitution(VERBOSE_SUBST); } +%fOpts% { return handleSubstitution(FOPTS_SUBST); } +%MOpts% { return handleSubstitution(MOPTS_SUBST); } +%WOpts% { return handleSubstitution(WOPTS_SUBST); } {BadSubst} { YY_FATAL_ERROR("Invalid substitution token"); } {Assembly} { return handleValueContext(ASSEMBLY); } From reid at x10sys.com Mon Sep 13 21:00:34 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Sep 2004 21:00:34 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvmc/st Message-ID: <200409140200.VAA08816@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: st updated: 1.6 -> 1.7 --- Log message: Update to reflect stkrc's new optimization capabilities. --- Diffs of the changes: (+13 -21) Index: llvm/tools/llvmc/st diff -u llvm/tools/llvmc/st:1.6 llvm/tools/llvmc/st:1.7 --- llvm/tools/llvmc/st:1.6 Sun Aug 29 14:26:56 2004 +++ llvm/tools/llvmc/st Mon Sep 13 21:00:24 2004 @@ -4,19 +4,11 @@ # Language definitions ########################################################## lang.name=Stacker - lang.opt1=-simplifycfg -instcombine -mem2reg - lang.opt2=-simplifycfg -instcombine -mem2reg -load-vn \ - -gcse -dse -scalarrepl -sccp - lang.opt3=-simplifycfg -instcombine -mem2reg -load-vn \ - -gcse -dse -scalarrepl -sccp -branch-combine -adce \ - -globaldce -inline -licm - lang.opt4=-simplifycfg -instcombine -mem2reg -load-vn \ - -gcse -dse -scalarrepl -sccp -ipconstprop \ - -branch-combine -adce -globaldce -inline -licm - lang.opt5=-simplifycfg -instcombine -mem2reg --load-vn \ - -gcse -dse scalarrepl -sccp -ipconstprop \ - -branch-combine -adce -globaldce -inline -licm \ - -block-placement + lang.opt1=-O1 + lang.opt2=-O2 + lang.opt3=-O3 + lang.opt4=-O4 + lang.opt5=-O5 ########################################################## # Pre-processor definitions @@ -33,15 +25,15 @@ # To compile stacker source, we just run the stacker # compiler with a default stack size of 2048 entries. - translator.command=stkrc -s 2048 %in% -o %out% %time% \ - %stats% %force% %args% + translator.command=stkrc -s 2048 %in% -o %out% %opt% \ + %time% %stats% %force% %args% # stkrc doesn't preprocess but we set this to true so # that we don't run the cp command by default. translator.preprocesses=true # The translator is required to run. - translator.required=true + translator.required=false # stkrc doesn't handle the -On options translator.output=bytecode @@ -51,16 +43,16 @@ ########################################################## # For optimization, we use the LLVM "opt" program - optimizer.command=opt %in% -o %out% %opt% %time% %stats% \ - %force% %args% + optimizer.command=stkrc -s 2048 %in% -o %out% %opt% \ + %time% %stats% %force% %args% - optimizer.required = true + optimizer.required = yes # opt doesn't translate - optimizer.translates = no + optimizer.translates = yes # opt doesn't preprocess - optimizer.preprocesses=no + optimizer.preprocesses=yes # opt produces bytecode optimizer.output = bc From lattner at cs.uiuc.edu Mon Sep 13 23:04:26 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Sep 2004 23:04:26 -0500 Subject: [llvm-commits] CVS: poolalloc/include/poolalloc/PoolAllocate.h Message-ID: <200409140404.XAA18782@apoc.cs.uiuc.edu> Changes in directory poolalloc/include/poolalloc: PoolAllocate.h updated: 1.23 -> 1.24 --- Log message: Adjust #includes --- Diffs of the changes: (+3 -3) Index: poolalloc/include/poolalloc/PoolAllocate.h diff -u poolalloc/include/poolalloc/PoolAllocate.h:1.23 poolalloc/include/poolalloc/PoolAllocate.h:1.24 --- poolalloc/include/poolalloc/PoolAllocate.h:1.23 Sun May 23 02:56:05 2004 +++ poolalloc/include/poolalloc/PoolAllocate.h Mon Sep 13 23:04:16 2004 @@ -13,9 +13,9 @@ #include "llvm/Pass.h" #include "llvm/DerivedTypes.h" #include "llvm/Support/CallSite.h" -#include "Support/EquivalenceClasses.h" -#include "Support/VectorExtras.h" -#include "Support/hash_set" +#include "llvm/ADT/EquivalenceClasses.h" +#include "llvm/ADT/VectorExtras.h" +#include "llvm/ADT/hash_set" #include namespace llvm { From lattner at cs.uiuc.edu Mon Sep 13 23:06:38 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Sep 2004 23:06:38 -0500 Subject: [llvm-commits] CVS: poolalloc/lib/PoolAllocate/EquivClassGraphs.h PoolAllocate.cpp TransformFunctionBody.cpp Message-ID: <200409140406.XAA20361@apoc.cs.uiuc.edu> Changes in directory poolalloc/lib/PoolAllocate: EquivClassGraphs.h updated: 1.2 -> 1.3 PoolAllocate.cpp updated: 1.72 -> 1.73 TransformFunctionBody.cpp updated: 1.27 -> 1.28 --- Log message: Adjust to #include movage --- Diffs of the changes: (+8 -8) Index: poolalloc/lib/PoolAllocate/EquivClassGraphs.h diff -u poolalloc/lib/PoolAllocate/EquivClassGraphs.h:1.2 poolalloc/lib/PoolAllocate/EquivClassGraphs.h:1.3 --- poolalloc/lib/PoolAllocate/EquivClassGraphs.h:1.2 Wed Jul 7 01:34:28 2004 +++ poolalloc/lib/PoolAllocate/EquivClassGraphs.h Mon Sep 13 23:06:28 2004 @@ -17,8 +17,8 @@ #include "llvm/Analysis/DataStructure/DataStructure.h" #include "llvm/Analysis/DataStructure/DSGraph.h" -#include "Support/EquivalenceClasses.h" -#include "Support/STLExtras.h" +#include "llvm/ADT/EquivalenceClasses.h" +#include "llvm/ADT/STLExtras.h" #include #include #include Index: poolalloc/lib/PoolAllocate/PoolAllocate.cpp diff -u poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.72 poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.73 --- poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.72 Sun Jul 18 13:20:27 2004 +++ poolalloc/lib/PoolAllocate/PoolAllocate.cpp Mon Sep 13 23:06:28 2004 @@ -20,10 +20,10 @@ #include "llvm/Target/TargetData.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Cloning.h" -#include "Support/CommandLine.h" -#include "Support/Debug.h" -#include "Support/DepthFirstIterator.h" -#include "Support/Statistic.h" +#include "llvm/ADT/DepthFirstIterator.h" +#include "llvm/ADT/Statistic.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/Debug.h" using namespace llvm; using namespace PA; Index: poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp diff -u poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.27 poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.28 --- poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.27 Tue Jul 27 21:36:25 2004 +++ poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Mon Sep 13 23:06:28 2004 @@ -15,8 +15,8 @@ #include "llvm/Instructions.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/InstVisitor.h" -#include "Support/Debug.h" -#include "Support/VectorExtras.h" +#include "llvm/Support/Debug.h" +#include "llvm/ADT/VectorExtras.h" #include using namespace llvm; using namespace PA; From lattner at cs.uiuc.edu Mon Sep 13 23:08:51 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Sep 2004 23:08:51 -0500 Subject: [llvm-commits] CVS: poolalloc/runtime/PoolAllocator/PageManager.cpp Message-ID: <200409140408.XAA21649@apoc.cs.uiuc.edu> Changes in directory poolalloc/runtime/PoolAllocator: PageManager.cpp updated: 1.7 -> 1.8 --- Log message: Adjust to #include movage --- Diffs of the changes: (+3 -3) Index: poolalloc/runtime/PoolAllocator/PageManager.cpp diff -u poolalloc/runtime/PoolAllocator/PageManager.cpp:1.7 poolalloc/runtime/PoolAllocator/PageManager.cpp:1.8 --- poolalloc/runtime/PoolAllocator/PageManager.cpp:1.7 Fri Nov 14 14:20:01 2003 +++ poolalloc/runtime/PoolAllocator/PageManager.cpp Mon Sep 13 23:08:41 2004 @@ -15,9 +15,9 @@ #ifndef _POSIX_MAPPED_FILES #define _POSIX_MAPPED_FILES #endif -#include "Support/MallocAllocator.h" -#include "Config/unistd.h" -#include "Config/sys/mman.h" +#include "llvm/Support/MallocAllocator.h" +#include "llvm/Config/unistd.h" +#include "llvm/Config/sys/mman.h" #include #include From lattner at cs.uiuc.edu Mon Sep 13 23:16:06 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Sep 2004 23:16:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Target.td Message-ID: <200409140416.XAA26794@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target: Target.td updated: 1.37 -> 1.38 --- Log message: Revamp the Register class, and allow the use of the RegisterGroup class to specify aliases directly in register definitions. Patch contributed by Jason Eckhardt! --- Diffs of the changes: (+13 -18) Index: llvm/lib/Target/Target.td diff -u llvm/lib/Target/Target.td:1.37 llvm/lib/Target/Target.td:1.38 --- llvm/lib/Target/Target.td:1.37 Fri Aug 20 21:17:39 2004 +++ llvm/lib/Target/Target.td Mon Sep 13 23:15:53 2004 @@ -43,12 +43,11 @@ // description classes in llvm/Target/MRegisterInfo.h -// Register - You should define one instance of this class for each register in -// the target machine. -// -class Register { +// Register - You should define one instance of this class for each register +// in the target machine. String n will become the "name" of the register. +class RegisterBase { string Namespace = ""; - string Name = ""; + string Name = n; // SpillSize - If this value is set to a non-zero value, it is the size in // bits of the spill slot required to hold this register. If this value is @@ -62,21 +61,17 @@ int SpillAlignment = 0; } -// NamedReg - If the name for the 'def' of the register should not become the -// "name" of the register, you can use this to specify a custom name instead. -// -class NamedReg : Register { - let Name = n; +class Register : RegisterBase { + list Aliases = []; } -// RegisterAliases - You should define instances of this class to indicate which -// registers in the register file are aliased together. This allows the code -// generator to be careful not to put two values with overlapping live ranges -// into registers which alias. -// -class RegisterAliases aliases> { - Register Reg = reg; - list Aliases = aliases; +// RegisterGroup - This can be used to define instances of Register which +// need to specify aliases. +// List "aliases" specifies which registers are aliased to this one. This +// allows the code generator to be careful not to put two values with +// overlapping live ranges into registers which alias. +class RegisterGroup aliases> : Register { + let Aliases = aliases; } // RegisterClass - Now that all of the registers are defined, and aliases From lattner at cs.uiuc.edu Mon Sep 13 23:16:31 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Sep 2004 23:16:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.td Message-ID: <200409140416.XAA26819@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86RegisterInfo.td updated: 1.12 -> 1.13 --- Log message: Revamp the Register class, and allow the use of the RegisterGroup class to specify aliases directly in register definitions. Patch contributed by Jason Eckhardt! --- Diffs of the changes: (+26 -36) Index: llvm/lib/Target/X86/X86RegisterInfo.td diff -u llvm/lib/Target/X86/X86RegisterInfo.td:1.12 llvm/lib/Target/X86/X86RegisterInfo.td:1.13 --- llvm/lib/Target/X86/X86RegisterInfo.td:1.12 Tue Aug 24 03:18:27 2004 +++ llvm/lib/Target/X86/X86RegisterInfo.td Mon Sep 13 23:16:20 2004 @@ -17,56 +17,46 @@ // Register definitions... // let Namespace = "X86" in { + + // In the register alias definitions below, we define which registers alias + // which others. We only specify which registers the small registers alias, + // because the register file generator is smart enough to figure out that + // AL aliases AX if we tell it that AX aliased AL (for example). + // 32-bit registers - def EAX : Register; def ECX : Register; - def EDX : Register; def EBX : Register; - def ESP : Register; def EBP : Register; - def ESI : Register; def EDI : Register; + def EAX : Register<"EAX">; def ECX : Register<"ECX">; + def EDX : Register<"EDX">; def EBX : Register<"EBX">; + def ESP : Register<"ESP">; def EBP : Register<"EBP">; + def ESI : Register<"ESI">; def EDI : Register<"EDI">; // 16-bit registers - def AX : Register; def CX : Register; - def DX : Register; def BX : Register; - def SP : Register; def BP : Register; - def SI : Register; def DI : Register; + def AX : RegisterGroup<"AX", [EAX]>; def CX : RegisterGroup<"CX", [ECX]>; + def DX : RegisterGroup<"DX", [EDX]>; def BX : RegisterGroup<"BX", [EBX]>; + def SP : RegisterGroup<"SP", [ESP]>; def BP : RegisterGroup<"BP", [EBP]>; + def SI : RegisterGroup<"SI", [ESI]>; def DI : RegisterGroup<"DI", [EDI]>; // 8-bit registers - def AL : Register; def CL : Register; - def DL : Register; def BL : Register; - def AH : Register; def CH : Register; - def DH : Register; def BH : Register; + def AL : RegisterGroup<"AL", [AX, EAX]>; def CL : RegisterGroup<"CL", [CX, ECX]>; + def DL : RegisterGroup<"DL", [DX, EDX]>; def BL : RegisterGroup<"BL", [BX, EBX]>; + def AH : RegisterGroup<"AH", [AX, EAX]>; def CH : RegisterGroup<"CH", [CX, ECX]>; + def DH : RegisterGroup<"DH", [DX, EDX]>; def BH : RegisterGroup<"BH", [BX, EBX]>; // Pseudo Floating Point registers - def FP0 : Register; def FP1 : Register; - def FP2 : Register; def FP3 : Register; - def FP4 : Register; def FP5 : Register; - def FP6 : Register; + def FP0 : Register<"FP0">; def FP1 : Register<"FP1">; + def FP2 : Register<"FP2">; def FP3 : Register<"FP3">; + def FP4 : Register<"FP4">; def FP5 : Register<"FP5">; + def FP6 : Register<"FP6">; // Floating point stack registers - def ST0 : NamedReg<"ST(0)">; def ST1 : NamedReg<"ST(1)">; - def ST2 : NamedReg<"ST(2)">; def ST3 : NamedReg<"ST(3)">; - def ST4 : NamedReg<"ST(4)">; def ST5 : NamedReg<"ST(5)">; - def ST6 : NamedReg<"ST(6)">; def ST7 : NamedReg<"ST(7)">; + def ST0 : Register<"ST(0)">; def ST1 : Register<"ST(1)">; + def ST2 : Register<"ST(2)">; def ST3 : Register<"ST(3)">; + def ST4 : Register<"ST(4)">; def ST5 : Register<"ST(5)">; + def ST6 : Register<"ST(6)">; def ST7 : Register<"ST(7)">; // Flags, Segment registers, etc... } //===----------------------------------------------------------------------===// -// Register alias definitions... define which registers alias which others. We -// only specify which registers the small registers alias, because the register -// file generator is smart enough to figure out that AL aliases AX if we tell it -// that AX aliases AL (for example). -// -def : RegisterAliases; def : RegisterAliases; -def : RegisterAliases; def : RegisterAliases; -def : RegisterAliases; def : RegisterAliases; -def : RegisterAliases; def : RegisterAliases; - -def : RegisterAliases; def : RegisterAliases; -def : RegisterAliases; def : RegisterAliases; -def : RegisterAliases; def : RegisterAliases; -def : RegisterAliases; def : RegisterAliases; - -//===----------------------------------------------------------------------===// // Register Class Definitions... now that we have all of the pieces, define the // top-level register classes. The order specified in the register list is // implicitly defined to be the register allocation order. From lattner at cs.uiuc.edu Mon Sep 13 23:16:34 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Sep 2004 23:16:34 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCRegisterInfo.td Message-ID: <200409140416.XAA26825@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCRegisterInfo.td updated: 1.13 -> 1.14 --- Log message: Revamp the Register class, and allow the use of the RegisterGroup class to specify aliases directly in register definitions. Patch contributed by Jason Eckhardt! --- Diffs of the changes: (+49 -29) Index: llvm/lib/Target/PowerPC/PowerPCRegisterInfo.td diff -u llvm/lib/Target/PowerPC/PowerPCRegisterInfo.td:1.13 llvm/lib/Target/PowerPC/PowerPCRegisterInfo.td:1.14 --- llvm/lib/Target/PowerPC/PowerPCRegisterInfo.td:1.13 Tue Aug 17 00:10:31 2004 +++ llvm/lib/Target/PowerPC/PowerPCRegisterInfo.td Mon Sep 13 23:16:24 2004 @@ -10,64 +10,84 @@ // //===----------------------------------------------------------------------===// -class PPCReg : Register { +class PPCReg : Register { let Namespace = "PPC"; } // We identify all our registers with a 5-bit ID, for consistency's sake. // GPR - One of the 32 32-bit general-purpose registers -class GPR num> : PPCReg { +class GPR num, string n> : PPCReg { field bits<5> Num = num; } // SPR - One of the 32-bit special-purpose registers -class SPR num> : PPCReg { +class SPR num, string n> : PPCReg { field bits<5> Num = num; } // FPR - One of the 32 64-bit floating-point registers -class FPR num> : PPCReg { +class FPR num, string n> : PPCReg { field bits<5> Num = num; } // CR - One of the 8 4-bit condition registers -class CR num> : PPCReg { +class CR num, string n> : PPCReg { field bits<5> Num = num; } // General-purpose registers -def R0 : GPR< 0>; def R1 : GPR< 1>; def R2 : GPR< 2>; def R3 : GPR< 3>; -def R4 : GPR< 4>; def R5 : GPR< 5>; def R6 : GPR< 6>; def R7 : GPR< 7>; -def R8 : GPR< 8>; def R9 : GPR< 9>; def R10 : GPR<10>; def R11 : GPR<11>; -def R12 : GPR<12>; def R13 : GPR<13>; def R14 : GPR<14>; def R15 : GPR<15>; -def R16 : GPR<16>; def R17 : GPR<17>; def R18 : GPR<18>; def R19 : GPR<19>; -def R20 : GPR<20>; def R21 : GPR<21>; def R22 : GPR<22>; def R23 : GPR<23>; -def R24 : GPR<24>; def R25 : GPR<25>; def R26 : GPR<26>; def R27 : GPR<27>; -def R28 : GPR<28>; def R29 : GPR<29>; def R30 : GPR<30>; def R31 : GPR<31>; +def R0 : GPR< 0, "R0">; def R1 : GPR< 1, "R1">; +def R2 : GPR< 2, "R2">; def R3 : GPR< 3, "R3">; +def R4 : GPR< 4, "R4">; def R5 : GPR< 5, "R5">; +def R6 : GPR< 6, "R6">; def R7 : GPR< 7, "R7">; +def R8 : GPR< 8, "R8">; def R9 : GPR< 9, "R9">; +def R10 : GPR<10, "R10">; def R11 : GPR<11, "R11">; +def R12 : GPR<12, "R12">; def R13 : GPR<13, "R13">; +def R14 : GPR<14, "R14">; def R15 : GPR<15, "R15">; +def R16 : GPR<16, "R16">; def R17 : GPR<17, "R17">; +def R18 : GPR<18, "R18">; def R19 : GPR<19, "R19">; +def R20 : GPR<20, "R20">; def R21 : GPR<21, "R21">; +def R22 : GPR<22, "R22">; def R23 : GPR<23, "R23">; +def R24 : GPR<24, "R24">; def R25 : GPR<25, "R25">; +def R26 : GPR<26, "R26">; def R27 : GPR<27, "R27">; +def R28 : GPR<28, "R28">; def R29 : GPR<29, "R29">; +def R30 : GPR<30, "R30">; def R31 : GPR<31, "R31">; // Floating-point registers -def F0 : FPR< 0>; def F1 : FPR< 1>; def F2 : FPR< 2>; def F3 : FPR< 3>; -def F4 : FPR< 4>; def F5 : FPR< 5>; def F6 : FPR< 6>; def F7 : FPR< 7>; -def F8 : FPR< 8>; def F9 : FPR< 9>; def F10 : FPR<10>; def F11 : FPR<11>; -def F12 : FPR<12>; def F13 : FPR<13>; def F14 : FPR<14>; def F15 : FPR<15>; -def F16 : FPR<16>; def F17 : FPR<17>; def F18 : FPR<18>; def F19 : FPR<19>; -def F20 : FPR<20>; def F21 : FPR<21>; def F22 : FPR<22>; def F23 : FPR<23>; -def F24 : FPR<24>; def F25 : FPR<25>; def F26 : FPR<26>; def F27 : FPR<27>; -def F28 : FPR<28>; def F29 : FPR<29>; def F30 : FPR<30>; def F31 : FPR<31>; +def F0 : FPR< 0, "F0">; def F1 : FPR< 1, "F1">; +def F2 : FPR< 2, "F2">; def F3 : FPR< 3, "F3">; +def F4 : FPR< 4, "F4">; def F5 : FPR< 5, "F5">; +def F6 : FPR< 6, "F6">; def F7 : FPR< 7, "F7">; +def F8 : FPR< 8, "F8">; def F9 : FPR< 9, "F9">; +def F10 : FPR<10, "F10">; def F11 : FPR<11, "F11">; +def F12 : FPR<12, "F12">; def F13 : FPR<13, "F13">; +def F14 : FPR<14, "F14">; def F15 : FPR<15, "F15">; +def F16 : FPR<16, "F16">; def F17 : FPR<17, "F17">; +def F18 : FPR<18, "F18">; def F19 : FPR<19, "F19">; +def F20 : FPR<20, "F20">; def F21 : FPR<21, "F21">; +def F22 : FPR<22, "F22">; def F23 : FPR<23, "F23">; +def F24 : FPR<24, "F24">; def F25 : FPR<25, "F25">; +def F26 : FPR<26, "F26">; def F27 : FPR<27, "F27">; +def F28 : FPR<28, "F28">; def F29 : FPR<29, "F29">; +def F30 : FPR<30, "F30">; def F31 : FPR<31, "F31">; + // Condition registers -def CR0 : CR<0>; def CR1 : CR<1>; def CR2 : CR<2>; def CR3 : CR<3>; -def CR4 : CR<4>; def CR5 : CR<5>; def CR6 : CR<6>; def CR7 : CR<7>; +def CR0 : CR<0, "CR0">; def CR1 : CR<1, "CR1">; +def CR2 : CR<2, "CR2">; def CR3 : CR<3, "CR3">; +def CR4 : CR<4, "CR4">; def CR5 : CR<5, "CR5">; +def CR6 : CR<6, "CR6">; def CR7 : CR<7, "CR7">; // Floating-point status and control register -def FPSCR : SPR<0>; +def FPSCR : SPR<0, "FPSCR">; // fiXed-point Exception Register? :-) -def XER : SPR<1>; +def XER : SPR<1, "XER">; // Link register -def LR : SPR<2>; +def LR : SPR<2, "LR">; // Count register -def CTR : SPR<3>; +def CTR : SPR<3, "CTR">; // These are the "time base" registers which are read-only in user mode. -def TBL : SPR<4>; -def TBU : SPR<5>; +def TBL : SPR<4, "TBL">; +def TBU : SPR<5, "TBU">; + From lattner at cs.uiuc.edu Mon Sep 13 23:16:54 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Sep 2004 23:16:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Skeleton/SkeletonRegisterInfo.td Message-ID: <200409140416.XAA26838@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/Skeleton: SkeletonRegisterInfo.td updated: 1.2 -> 1.3 --- Log message: Revamp the Register class, and allow the use of the RegisterGroup class to specify aliases directly in register definitions. Patch contributed by Jason Eckhardt! --- Diffs of the changes: (+48 -29) Index: llvm/lib/Target/Skeleton/SkeletonRegisterInfo.td diff -u llvm/lib/Target/Skeleton/SkeletonRegisterInfo.td:1.2 llvm/lib/Target/Skeleton/SkeletonRegisterInfo.td:1.3 --- llvm/lib/Target/Skeleton/SkeletonRegisterInfo.td:1.2 Sun Aug 29 17:03:40 2004 +++ llvm/lib/Target/Skeleton/SkeletonRegisterInfo.td Mon Sep 13 23:16:43 2004 @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -class SkelReg : Register { +class SkelReg : Register { let Namespace = "Skeleton"; } @@ -20,60 +20,79 @@ // GPR - One of the 32 32-bit general-purpose registers -class GPR num> : SkelReg { +class GPR num, string n> : SkelReg { field bits<5> Num = num; } // SPR - One of the 32-bit special-purpose registers -class SPR num> : SkelReg { +class SPR num, string n> : SkelReg { field bits<5> Num = num; } // FPR - One of the 32 64-bit floating-point registers -class FPR num> : SkelReg { +class FPR num, string n> : SkelReg { field bits<5> Num = num; } // CR - One of the 8 4-bit condition registers -class CR num> : SkelReg { +class CR num, string n> : SkelReg { field bits<5> Num = num; } // General-purpose registers -def R0 : GPR< 0>; def R1 : GPR< 1>; def R2 : GPR< 2>; def R3 : GPR< 3>; -def R4 : GPR< 4>; def R5 : GPR< 5>; def R6 : GPR< 6>; def R7 : GPR< 7>; -def R8 : GPR< 8>; def R9 : GPR< 9>; def R10 : GPR<10>; def R11 : GPR<11>; -def R12 : GPR<12>; def R13 : GPR<13>; def R14 : GPR<14>; def R15 : GPR<15>; -def R16 : GPR<16>; def R17 : GPR<17>; def R18 : GPR<18>; def R19 : GPR<19>; -def R20 : GPR<20>; def R21 : GPR<21>; def R22 : GPR<22>; def R23 : GPR<23>; -def R24 : GPR<24>; def R25 : GPR<25>; def R26 : GPR<26>; def R27 : GPR<27>; -def R28 : GPR<28>; def R29 : GPR<29>; def R30 : GPR<30>; def R31 : GPR<31>; +def R0 : GPR< 0, "R0">; def R1 : GPR< 1, "R1">; +def R2 : GPR< 2, "R2">; def R3 : GPR< 3, "R3">; +def R4 : GPR< 4, "R4">; def R5 : GPR< 5, "R5">; +def R6 : GPR< 6, "R6">; def R7 : GPR< 7, "R7">; +def R8 : GPR< 8, "R8">; def R9 : GPR< 9, "R9">; +def R10 : GPR<10, "R10">; def R11 : GPR<11, "R11">; +def R12 : GPR<12, "R12">; def R13 : GPR<13, "R13">; +def R14 : GPR<14, "R14">; def R15 : GPR<15, "R15">; +def R16 : GPR<16, "R16">; def R17 : GPR<17, "R17">; +def R18 : GPR<18, "R18">; def R19 : GPR<19, "R19">; +def R20 : GPR<20, "R20">; def R21 : GPR<21, "R21">; +def R22 : GPR<22, "R22">; def R23 : GPR<23, "R23">; +def R24 : GPR<24, "R24">; def R25 : GPR<25, "R25">; +def R26 : GPR<26, "R26">; def R27 : GPR<27, "R27">; +def R28 : GPR<28, "R28">; def R29 : GPR<29, "R29">; +def R30 : GPR<30, "R30">; def R31 : GPR<31, "R31">; // Floating-point registers -def F0 : FPR< 0>; def F1 : FPR< 1>; def F2 : FPR< 2>; def F3 : FPR< 3>; -def F4 : FPR< 4>; def F5 : FPR< 5>; def F6 : FPR< 6>; def F7 : FPR< 7>; -def F8 : FPR< 8>; def F9 : FPR< 9>; def F10 : FPR<10>; def F11 : FPR<11>; -def F12 : FPR<12>; def F13 : FPR<13>; def F14 : FPR<14>; def F15 : FPR<15>; -def F16 : FPR<16>; def F17 : FPR<17>; def F18 : FPR<18>; def F19 : FPR<19>; -def F20 : FPR<20>; def F21 : FPR<21>; def F22 : FPR<22>; def F23 : FPR<23>; -def F24 : FPR<24>; def F25 : FPR<25>; def F26 : FPR<26>; def F27 : FPR<27>; -def F28 : FPR<28>; def F29 : FPR<29>; def F30 : FPR<30>; def F31 : FPR<31>; +def F0 : FPR< 0, "F0">; def F1 : FPR< 1, "F1">; +def F2 : FPR< 2, "F2">; def F3 : FPR< 3, "F3">; +def F4 : FPR< 4, "F4">; def F5 : FPR< 5, "F5">; +def F6 : FPR< 6, "F6">; def F7 : FPR< 7, "F7">; +def F8 : FPR< 8, "F8">; def F9 : FPR< 9, "F9">; +def F10 : FPR<10, "F10">; def F11 : FPR<11, "F11">; +def F12 : FPR<12, "F12">; def F13 : FPR<13, "F13">; +def F14 : FPR<14, "F14">; def F15 : FPR<15, "F15">; +def F16 : FPR<16, "F16">; def F17 : FPR<17, "F17">; +def F18 : FPR<18, "F18">; def F19 : FPR<19, "F19">; +def F20 : FPR<20, "F20">; def F21 : FPR<21, "F21">; +def F22 : FPR<22, "F22">; def F23 : FPR<23, "F23">; +def F24 : FPR<24, "F24">; def F25 : FPR<25, "F25">; +def F26 : FPR<26, "F26">; def F27 : FPR<27, "F27">; +def F28 : FPR<28, "F28">; def F29 : FPR<29, "F29">; +def F30 : FPR<30, "F30">; def F31 : FPR<31, "F31">; + // Condition registers -def CR0 : CR<0>; def CR1 : CR<1>; def CR2 : CR<2>; def CR3 : CR<3>; -def CR4 : CR<4>; def CR5 : CR<5>; def CR6 : CR<6>; def CR7 : CR<7>; +def CR0 : CR<0, "CR0">; def CR1 : CR<1, "CR1">; +def CR2 : CR<2, "CR2">; def CR3 : CR<3, "CR3">; +def CR4 : CR<4, "CR4">; def CR5 : CR<5, "CR5">; +def CR6 : CR<6, "CR6">; def CR7 : CR<7, "CR7">; // Floating-point status and control register -def FPSCR : SPR<0>; +def FPSCR : SPR<0, "FPSCR">; // fiXed-point Exception Register? :-) -def XER : SPR<1>; +def XER : SPR<1, "XER">; // Link register -def LR : SPR<2>; +def LR : SPR<2, "LR">; // Count register -def CTR : SPR<3>; +def CTR : SPR<3, "CTR">; // These are the "time base" registers which are read-only in user mode. -def TBL : SPR<4>; -def TBU : SPR<5>; +def TBL : SPR<4, "TBL">; +def TBU : SPR<5, "TBU">; /// Register classes: one for floats and another for non-floats. /// From lattner at cs.uiuc.edu Mon Sep 13 23:17:13 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Sep 2004 23:17:13 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/RegisterInfoEmitter.cpp Message-ID: <200409140417.XAA26868@apoc.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: RegisterInfoEmitter.cpp updated: 1.25 -> 1.26 --- Log message: Revamp the Register class, and allow the use of the RegisterGroup class to specify aliases directly in register definitions. Patch contributed by Jason Eckhardt! --- Diffs of the changes: (+5 -8) Index: llvm/utils/TableGen/RegisterInfoEmitter.cpp diff -u llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.25 llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.26 --- llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.25 Wed Sep 1 17:55:40 2004 +++ llvm/utils/TableGen/RegisterInfoEmitter.cpp Mon Sep 13 23:17:02 2004 @@ -139,15 +139,12 @@ OS << " };\n"; // Emit register class aliases... - std::vector RegisterAliasesRecs = - Records.getAllDerivedDefinitions("RegisterAliases"); std::map > RegisterAliases; + const std::vector &Regs = Target.getRegisters(); - for (unsigned i = 0, e = RegisterAliasesRecs.size(); i != e; ++i) { - Record *AS = RegisterAliasesRecs[i]; - Record *R = AS->getValueAsDef("Reg"); - ListInit *LI = AS->getValueAsListInit("Aliases"); - + for (unsigned i = 0, e = Regs.size(); i != e; ++i) { + Record *R = Regs[i].TheDef; + ListInit *LI = Regs[i].TheDef->getValueAsListInit("Aliases"); // Add information that R aliases all of the elements in the list... and // that everything in the list aliases R. for (unsigned j = 0, e = LI->getSize(); j != e; ++j) { @@ -165,7 +162,7 @@ << " specified multiple times!\n"; RegisterAliases[Reg->getDef()].insert(R); } - } + } if (!RegisterAliases.empty()) OS << "\n\n // Register Alias Sets...\n"; From lattner at cs.uiuc.edu Mon Sep 13 23:17:00 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Sep 2004 23:17:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9RegisterInfo.td Message-ID: <200409140417.XAA26857@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9RegisterInfo.td updated: 1.3 -> 1.4 --- Log message: Revamp the Register class, and allow the use of the RegisterGroup class to specify aliases directly in register definitions. Patch contributed by Jason Eckhardt! --- Diffs of the changes: (+17 -9) Index: llvm/lib/Target/SparcV9/SparcV9RegisterInfo.td diff -u llvm/lib/Target/SparcV9/SparcV9RegisterInfo.td:1.3 llvm/lib/Target/SparcV9/SparcV9RegisterInfo.td:1.4 --- llvm/lib/Target/SparcV9/SparcV9RegisterInfo.td:1.3 Sat Aug 21 15:13:09 2004 +++ llvm/lib/Target/SparcV9/SparcV9RegisterInfo.td Mon Sep 13 23:16:49 2004 @@ -12,19 +12,27 @@ //===----------------------------------------------------------------------===// // Ri - One of the 32 64 bit integer registers -class Ri num> : Register { +class Ri num, string n> : Register { field bits<5> Num = num; // Numbers are identified with a 5 bit ID } let Namespace = "SparcV9" in { - def G0 : Ri< 0>; def G1 : Ri< 1>; def G2 : Ri< 2>; def G3 : Ri< 3>; - def G4 : Ri< 4>; def G5 : Ri< 5>; def G6 : Ri< 6>; def G7 : Ri< 7>; - def O0 : Ri< 8>; def O1 : Ri< 9>; def O2 : Ri<10>; def O3 : Ri<11>; - def O4 : Ri<12>; def O5 : Ri<13>; def O6 : Ri<14>; def O7 : Ri<15>; - def L0 : Ri<16>; def L1 : Ri<17>; def L2 : Ri<18>; def L3 : Ri<19>; - def L4 : Ri<20>; def L5 : Ri<21>; def L6 : Ri<22>; def L7 : Ri<23>; - def I0 : Ri<24>; def I1 : Ri<25>; def I2 : Ri<26>; def I3 : Ri<27>; - def I4 : Ri<28>; def I5 : Ri<29>; def I6 : Ri<30>; def I7 : Ri<31>; + def G0 : Ri< 0, "G0">; def G1 : Ri< 1, "G1">; + def G2 : Ri< 2, "G2">; def G3 : Ri< 3, "G3">; + def G4 : Ri< 4, "G4">; def G5 : Ri< 5, "G5">; + def G6 : Ri< 6, "G6">; def G7 : Ri< 7, "G7">; + def O0 : Ri< 8, "O0">; def O1 : Ri< 9, "O1">; + def O2 : Ri<10, "O2">; def O3 : Ri<11, "O3">; + def O4 : Ri<12, "O4">; def O5 : Ri<13, "O5">; + def O6 : Ri<14, "O6">; def O7 : Ri<15, "O7">; + def L0 : Ri<16, "L0">; def L1 : Ri<17, "L1">; + def L2 : Ri<18, "L2">; def L3 : Ri<19, "L3">; + def L4 : Ri<20, "L4">; def L5 : Ri<21, "L5">; + def L6 : Ri<22, "L6">; def L7 : Ri<23, "L7">; + def I0 : Ri<24, "I0">; def I1 : Ri<25, "I1">; + def I2 : Ri<26, "I2">; def I3 : Ri<27, "I3">; + def I4 : Ri<28, "I4">; def I5 : Ri<29, "I5">; + def I6 : Ri<30, "I6">; def I7 : Ri<31, "I7">; // Floating-point registers? // ... } From lattner at cs.uiuc.edu Mon Sep 13 23:51:09 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Sep 2004 23:51:09 -0500 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-out.c Message-ID: <200409140451.XAA29060@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-out.c updated: 1.2 -> 1.3 --- Log message: Make the C/C++ FE emit deplibs that includes the runtime libs for the current language. --- Diffs of the changes: (+12 -0) Index: llvm-gcc/gcc/llvm-out.c diff -u llvm-gcc/gcc/llvm-out.c:1.2 llvm-gcc/gcc/llvm-out.c:1.3 --- llvm-gcc/gcc/llvm-out.c:1.2 Thu Feb 5 10:05:45 2004 +++ llvm-gcc/gcc/llvm-out.c Mon Sep 13 23:50:56 2004 @@ -107,6 +107,18 @@ fprintf(llvm_out_file, "target pointersize = %d\n", POINTER_SIZE); fprintf(llvm_out_file, "target endian = %s\n", (BYTES_BIG_ENDIAN) ? "big" : "little"); + + /* Emit the runtime library requirements for this file depending on what + * language is being compiled. + */ + fprintf(llvm_out_file, "deplibs = ["); + if (c_dialect_cxx()) + fprintf(llvm_out_file, "\"stdc++\", "); + if (c_dialect_objc()) + fprintf(llvm_out_file, "\"objc\", "); + fprintf(llvm_out_file, "\"c\"]\n"); + + fprintf(llvm_out_file, "\n"); } } From lattner at cs.uiuc.edu Mon Sep 13 23:51:54 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Sep 2004 23:51:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Message-ID: <200409140451.XAA29074@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.159 -> 1.160 --- Log message: Don't print newlines between each library in the deplibs list. --- Diffs of the changes: (+6 -6) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.159 llvm/lib/VMCore/AsmWriter.cpp:1.160 --- llvm/lib/VMCore/AsmWriter.cpp:1.159 Mon Sep 13 18:44:23 2004 +++ llvm/lib/VMCore/AsmWriter.cpp Mon Sep 13 23:51:44 2004 @@ -765,15 +765,15 @@ Out << "target triple = \"" << M->getTargetTriple() << "\"\n"; // Loop over the dependent libraries and emit them - Module::lib_iterator LI= M->lib_begin(); - Module::lib_iterator LE= M->lib_end(); + Module::lib_iterator LI = M->lib_begin(); + Module::lib_iterator LE = M->lib_end(); if (LI != LE) { - Out << "deplibs = [\n"; - while ( LI != LE ) { + Out << "deplibs = [ "; + while (LI != LE) { Out << "\"" << *LI << "\""; ++LI; - if ( LI != LE ) - Out << ",\n"; + if (LI != LE) + Out << ", "; } Out << " ]\n"; } From lattner at cs.uiuc.edu Tue Sep 14 00:07:11 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Sep 2004 00:07:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Message-ID: <200409140507.AAA29460@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.160 -> 1.161 --- Log message: Don't print newlines between passes in the pass list. Note to self: sentences end with ".", not "...". Note to reid: sentences end with ".", not "". :) --- Diffs of the changes: (+8 -8) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.160 llvm/lib/VMCore/AsmWriter.cpp:1.161 --- llvm/lib/VMCore/AsmWriter.cpp:1.160 Mon Sep 13 23:51:44 2004 +++ llvm/lib/VMCore/AsmWriter.cpp Tue Sep 14 00:06:58 2004 @@ -764,13 +764,13 @@ if (!M->getTargetTriple().empty()) Out << "target triple = \"" << M->getTargetTriple() << "\"\n"; - // Loop over the dependent libraries and emit them + // Loop over the dependent libraries and emit them. Module::lib_iterator LI = M->lib_begin(); Module::lib_iterator LE = M->lib_end(); if (LI != LE) { Out << "deplibs = [ "; while (LI != LE) { - Out << "\"" << *LI << "\""; + Out << '"' << *LI << '"'; ++LI; if (LI != LE) Out << ", "; @@ -778,21 +778,21 @@ Out << " ]\n"; } - // Loop over the link time pass list and emit them + // Loop over the link time pass list and emit them. Module::pass_iterator PI = M->pass_begin(); Module::pass_iterator PE = M->pass_end(); if (LI != LE) { - Out << "passes = [\n"; + Out << "passes = [ "; while (LI != LE) { - Out << "\"" << *LI << "\""; + Out << '"' << *LI << '"'; ++LI; if (LI != LE) - Out << ",\n"; + Out << ", "; } Out << " ]\n"; } - // Loop over the symbol table, emitting all named constants... + // Loop over the symbol table, emitting all named constants. printSymbolTable(M->getSymbolTable()); for (Module::const_giterator I = M->gbegin(), E = M->gend(); I != E; ++I) @@ -800,7 +800,7 @@ Out << "\nimplementation ; Functions:\n"; - // Output all of the functions... + // Output all of the functions. for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) printFunction(I); } From reid at x10sys.com Tue Sep 14 00:43:33 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Sep 2004 00:43:33 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Module.h Message-ID: <200409140543.AAA10281@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Module.h updated: 1.51 -> 1.52 --- Log message: Okay, the list of link-time passes wasn't such a hot idea. Its prone to error. We'll strategize on this when we have multiple front ends to deal with. For now llvm-ld just runs a standard set of transforms. --- Diffs of the changes: (+0 -26) Index: llvm/include/llvm/Module.h diff -u llvm/include/llvm/Module.h:1.51 llvm/include/llvm/Module.h:1.52 --- llvm/include/llvm/Module.h:1.51 Mon Sep 13 18:44:23 2004 +++ llvm/include/llvm/Module.h Tue Sep 14 00:43:23 2004 @@ -49,7 +49,6 @@ typedef iplist GlobalListType; typedef iplist FunctionListType; typedef SetVector LibraryListType; - typedef std::vector PassListType; // Global Variable iterators... typedef GlobalListType::iterator giterator; @@ -66,9 +65,6 @@ // Library list iterators typedef LibraryListType::const_iterator lib_iterator; - // Link-time Pass list iterators - typedef PassListType::const_iterator pass_iterator; - enum Endianness { AnyEndianness, LittleEndian, BigEndian }; enum PointerSize { AnyPointerSize, Pointer32, Pointer64 }; @@ -76,7 +72,6 @@ GlobalListType GlobalList; // The Global Variables in the module FunctionListType FunctionList; // The Functions in the module LibraryListType LibraryList; // The Libraries needed by the module - PassListType PassList; // The Passes needed by the module at link time SymbolTable *SymTab; // Symbol Table for the module std::string ModuleID; // Human readable identifier for the module std::string TargetTriple; // Platform target triple Module compiled on @@ -253,27 +248,6 @@ inline const LibraryListType& getLibraries() const { return LibraryList; } //===--------------------------------------------------------------------===// - // Access functions for Link-time pass list - - /// @brief Get a constant iterator to beginning of pass list. - inline pass_iterator pass_begin() const { return PassList.begin(); } - - /// @brief Get a constant iterator to end of pass list. - inline pass_iterator pass_end() const { return PassList.end(); } - - /// @brief Returns the number of items in the list of passes. - inline unsigned pass_size() const { return PassList.size(); } - - /// @brief Add a library to the list of passes - inline void addPass(const std::string& Pass){ PassList.push_back(Pass); } - - /// @brief Remove a library from the list of passes - void removePass(const std::string& Lib); - - /// @brief Get all the passes - inline const PassListType& getPasses() const { return PassList; } - - //===--------------------------------------------------------------------===// // Utility functions for printing and dumping Module objects void print(std::ostream &OS) const { print(OS, 0); } From reid at x10sys.com Tue Sep 14 00:43:33 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Sep 2004 00:43:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/Lexer.l llvmAsmParser.y Message-ID: <200409140543.AAA10286@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: Lexer.l updated: 1.53 -> 1.54 llvmAsmParser.y updated: 1.202 -> 1.203 --- Log message: Okay, the list of link-time passes wasn't such a hot idea. Its prone to error. We'll strategize on this when we have multiple front ends to deal with. For now llvm-ld just runs a standard set of transforms. --- Diffs of the changes: (+1 -17) Index: llvm/lib/AsmParser/Lexer.l diff -u llvm/lib/AsmParser/Lexer.l:1.53 llvm/lib/AsmParser/Lexer.l:1.54 --- llvm/lib/AsmParser/Lexer.l:1.53 Mon Sep 13 18:44:23 2004 +++ llvm/lib/AsmParser/Lexer.l Tue Sep 14 00:43:23 2004 @@ -195,7 +195,6 @@ target { return TARGET; } triple { return TRIPLE; } deplibs { return DEPLIBS; } -passes { return PASSES; } endian { return ENDIAN; } pointersize { return POINTERSIZE; } little { return LITTLE; } Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.202 llvm/lib/AsmParser/llvmAsmParser.y:1.203 --- llvm/lib/AsmParser/llvmAsmParser.y:1.202 Mon Sep 13 18:44:23 2004 +++ llvm/lib/AsmParser/llvmAsmParser.y Tue Sep 14 00:43:23 2004 @@ -910,7 +910,7 @@ %token DECLARE GLOBAL CONSTANT VOLATILE %token TO DOTDOTDOT NULL_TOK CONST INTERNAL LINKONCE WEAK APPENDING %token OPAQUE NOT EXTERNAL TARGET TRIPLE ENDIAN POINTERSIZE LITTLE BIG -%token DEPLIBS PASSES +%token DEPLIBS // Basic Block Terminating Operators %token RET BR SWITCH INVOKE UNWIND @@ -1484,8 +1484,6 @@ } | ConstPool DEPLIBS '=' LibrariesDefinition { } - | ConstPool PASSES '=' PassesDefinition { - } | /* empty: end of list */ { }; @@ -1524,19 +1522,6 @@ } ; -PassesDefinition : '[' PassList ']'; -PassList : PassList ',' STRINGCONSTANT { - CurModule.CurrentModule->addLibrary($3); - free($3); - } - | STRINGCONSTANT { - CurModule.CurrentModule->addLibrary($1); - free($1); - } - | /* empty: end of list */ { - } - ; - //===----------------------------------------------------------------------===// // Rules to match Function Headers //===----------------------------------------------------------------------===// From reid at x10sys.com Tue Sep 14 00:43:33 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Sep 2004 00:43:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Module.cpp Message-ID: <200409140543.AAA10278@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.161 -> 1.162 Module.cpp updated: 1.56 -> 1.57 --- Log message: Okay, the list of link-time passes wasn't such a hot idea. Its prone to error. We'll strategize on this when we have multiple front ends to deal with. For now llvm-ld just runs a standard set of transforms. --- Diffs of the changes: (+0 -21) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.161 llvm/lib/VMCore/AsmWriter.cpp:1.162 --- llvm/lib/VMCore/AsmWriter.cpp:1.161 Tue Sep 14 00:06:58 2004 +++ llvm/lib/VMCore/AsmWriter.cpp Tue Sep 14 00:43:23 2004 @@ -778,20 +778,6 @@ Out << " ]\n"; } - // Loop over the link time pass list and emit them. - Module::pass_iterator PI = M->pass_begin(); - Module::pass_iterator PE = M->pass_end(); - if (LI != LE) { - Out << "passes = [ "; - while (LI != LE) { - Out << '"' << *LI << '"'; - ++LI; - if (LI != LE) - Out << ", "; - } - Out << " ]\n"; - } - // Loop over the symbol table, emitting all named constants. printSymbolTable(M->getSymbolTable()); Index: llvm/lib/VMCore/Module.cpp diff -u llvm/lib/VMCore/Module.cpp:1.56 llvm/lib/VMCore/Module.cpp:1.57 --- llvm/lib/VMCore/Module.cpp:1.56 Mon Sep 13 18:44:23 2004 +++ llvm/lib/VMCore/Module.cpp Tue Sep 14 00:43:23 2004 @@ -270,13 +270,6 @@ return ""; // Must not have found anything... } -void Module::removePass(const std::string& Lib) { - PassListType::iterator I = find(PassList.begin(),PassList.end(),Lib); - if (I != PassList.end()) - PassList.erase(I); -} - - //===----------------------------------------------------------------------===// // Other module related stuff. // From alkis at cs.uiuc.edu Tue Sep 14 00:44:54 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Tue, 14 Sep 2004 00:44:54 -0500 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200409140544.AAA10312@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.95 -> 1.96 --- Log message: Since classfiles are unique per classname, use them as keys in class->info maps. This makes code simpler and saves us from a lot of string lookup in the maps. --- Diffs of the changes: (+48 -44) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.95 llvm-java/lib/Compiler/Compiler.cpp:1.96 --- llvm-java/lib/Compiler/Compiler.cpp:1.95 Mon Sep 13 20:04:42 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Tue Sep 14 00:44:43 2004 @@ -138,7 +138,7 @@ typedef std::map Field2IndexMap; Field2IndexMap f2iMap; }; - typedef std::map Class2ClassInfoMap; + typedef std::map Class2ClassInfoMap; Class2ClassInfoMap c2ciMap_; struct VTableInfo { @@ -148,7 +148,7 @@ typedef std::map Method2IndexMap; Method2IndexMap m2iMap; }; - typedef std::map Class2VTableInfoMap; + typedef std::map Class2VTableInfoMap; Class2VTableInfoMap c2viMap_; private: @@ -159,7 +159,8 @@ if (dynamic_cast(c)) // FIXME: should return a String object represeting this ConstantString return ConstantPointerNull::get( - PointerType::get(getClassInfo("java/lang/String").type)); + PointerType::get( + getClassInfo(ClassFile::get("java/lang/String")).type)); else if (ConstantInteger* i = dynamic_cast(c)) return ConstantSInt::get(Type::IntTy, i->getValue()); else if (ConstantFloat* f = dynamic_cast(c)) @@ -175,7 +176,8 @@ Type* getType(JType type) { switch (type) { case REFERENCE: - return PointerType::get(getClassInfo("java/lang/Object").type); + return PointerType::get( + getClassInfo(ClassFile::get("java/lang/Object")).type); case BOOLEAN: return Type::BoolTy; case CHAR: return Type::UShortTy; case FLOAT: return Type::FloatTy; @@ -227,7 +229,7 @@ unsigned e = descr.find(';', i); std::string className = descr.substr(i, e - i); i = e + 1; - return PointerType::get(getClassInfo(className).type); + return PointerType::get(getClassInfo(ClassFile::get(className)).type); } case '[': // FIXME: this should really be a new class @@ -250,7 +252,8 @@ void initializeClassInfoMap() { DEBUG(std::cerr << "Building ClassInfo for: java/lang/Object\n"); ClassFile* cf = ClassFile::get("java/lang/Object"); - ClassInfo& ci = c2ciMap_["java/lang/Object"]; + ClassInfo& ci = c2ciMap_[cf]; + assert(!ci.type && ci.f2iMap.empty() && "java/lang/Object ClassInfo should not be initialized!"); ci.type = OpaqueType::get(); @@ -287,7 +290,8 @@ void initializeVTableInfoMap() { DEBUG(std::cerr << "Building VTableInfo for: java/lang/Object\n"); ClassFile* cf = ClassFile::get("java/lang/Object"); - VTableInfo& vi = c2viMap_["java/lang/Object"]; + VTableInfo& vi = c2viMap_[cf]; + assert(!vi.vtable && vi.m2iMap.empty() && "java/lang/Object VTableInfo should not be initialized!"); @@ -341,8 +345,7 @@ std::string funcName = "java/lang/Object/" + methodDescr; const FunctionType* funcTy = cast( - getType(method->getDescriptor(), - getClassInfo("java/lang/Object").type)); + getType(method->getDescriptor(), getClassInfo(cf).type)); Function* vfun = module_->getOrInsertFunction(funcName, funcTy); toCompileFunctions_.insert(vfun); @@ -376,14 +379,15 @@ initializeVTableInfoMap(); } - const ClassInfo& getClassInfo(const std::string& className) { - Class2ClassInfoMap::iterator it = c2ciMap_.lower_bound(className); - if (it != c2ciMap_.end() && it->first == className) + const ClassInfo& getClassInfo(ClassFile* cf) { + const std::string& className = cf->getThisClass()->getName()->str(); + Class2ClassInfoMap::iterator it = c2ciMap_.lower_bound(cf); + if (it != c2ciMap_.end() && it->first == cf) return it->second; DEBUG(std::cerr << "Building ClassInfo for: " << className << '\n'); - ClassFile* cf = ClassFile::get(className); - ClassInfo& ci = c2ciMap_[className]; + ClassInfo& ci = c2ciMap_[cf]; + assert(!ci.type && ci.f2iMap.empty() && "got already initialized ClassInfo!"); ci.type = OpaqueType::get(); @@ -391,7 +395,8 @@ std::vector elements; ConstantClass* super = cf->getSuperClass(); assert(super && "Class does not have superclass!"); - const ClassInfo& superCI = getClassInfo(super->getName()->str()); + const ClassInfo& superCI = + getClassInfo(ClassFile::get(super->getName()->str())); elements.push_back(superCI.type); const Fields& fields = cf->getFields(); @@ -452,14 +457,15 @@ typeInfoInit); } - const VTableInfo& getVTableInfo(const std::string& className) { - Class2VTableInfoMap::iterator it = c2viMap_.lower_bound(className); - if (it != c2viMap_.end() && it->first == className) + const VTableInfo& getVTableInfo(ClassFile* cf) { + const std::string& className = cf->getThisClass()->getName()->str(); + Class2VTableInfoMap::iterator it = c2viMap_.lower_bound(cf); + if (it != c2viMap_.end() && it->first == cf) return it->second; DEBUG(std::cerr << "Building VTableInfo for: " << className << '\n'); - ClassFile* cf = ClassFile::get(className); - VTableInfo& vi = c2viMap_[className]; + VTableInfo& vi = c2viMap_[cf]; + assert(!vi.vtable && vi.m2iMap.empty() && "got already initialized VTableInfo!"); @@ -467,7 +473,8 @@ std::vector init; ConstantClass* super = cf->getSuperClass(); assert(super && "Class does not have superclass!"); - const VTableInfo& superVI = getVTableInfo(super->getName()->str()); + const VTableInfo& superVI = + getVTableInfo(ClassFile::get(super->getName()->str())); vi.superVtables.push_back(superVI.vtable); vi.superVtables.reserve(superVI.superVtables.size() + 1); @@ -503,7 +510,7 @@ std::string funcName = className + '/' + methodDescr; const FunctionType* funcTy = cast( - getType(method->getDescriptor(), getClassInfo(className).type)); + getType(method->getDescriptor(), getClassInfo(cf).type)); Function* vfun = module_->getOrInsertFunction(funcName, funcTy); toCompileFunctions_.insert(vfun); @@ -543,7 +550,7 @@ // get ClassInfo for class owning the field - this will force // the globals to be initialized - getClassInfo(fieldRef->getClass()->getName()->str()); + getClassInfo(ClassFile::get(fieldRef->getClass()->getName()->str())); std::string globalName = fieldRef->getClass()->getName()->str() + '/' + @@ -560,31 +567,29 @@ Value* getField(unsigned bcI, unsigned index, Value* ptr) { ConstantFieldRef* fieldRef = cf_->getConstantFieldRef(index); ConstantNameAndType* nameAndType = fieldRef->getNameAndType(); - + ClassFile* cf = ClassFile::get(fieldRef->getClass()->getName()->str()); return getField(bcI, - fieldRef->getClass()->getName()->str(), + cf, nameAndType->getName()->str(), ptr); } Value* getField(unsigned bcI, - std::string className, + ClassFile* cf, const std::string& fieldName, Value* ptr) { // Cast ptr to correct type - ptr = new CastInst(ptr, PointerType::get(getClassInfo(className).type), + ptr = new CastInst(ptr, PointerType::get(getClassInfo(cf).type), TMP, getBBAt(bcI)); - ClassFile* classfile = ClassFile::get(className); // deref pointer std::vector indices(1, ConstantUInt::get(Type::UIntTy, 0)); while (true) { - const ClassInfo& info = getClassInfo(className); + const ClassInfo& info = getClassInfo(cf); ClassInfo::Field2IndexMap::const_iterator it = info.f2iMap.find(fieldName); if (it == info.f2iMap.end()) { - className = classfile->getSuperClass()->getName()->str(); - classfile = ClassFile::get(className); + cf = ClassFile::get(cf->getSuperClass()->getName()->str()); indices.push_back(ConstantUInt::get(Type::UIntTy, 0)); } else { @@ -1128,9 +1133,9 @@ ConstantMethodRef* methodRef = cf_->getConstantMethodRef(index); ConstantNameAndType* nameAndType = methodRef->getNameAndType(); - const std::string className = methodRef->getClass()->getName()->str(); - const ClassInfo& ci = getClassInfo(className); - const VTableInfo& vi = getVTableInfo(className); + ClassFile* cf = ClassFile::get(methodRef->getClass()->getName()->str()); + const ClassInfo& ci = getClassInfo(cf); + const VTableInfo& vi = getVTableInfo(cf); std::string methodDescr = nameAndType->getName()->str() + @@ -1139,7 +1144,7 @@ Value* objRef = opStack_.top(); // do not pop objRef = new CastInst(objRef, PointerType::get(ci.type), "this", getBBAt(bcI)); - Value* vtable = getField(bcI, className, LLVM_JAVA_OBJECT_BASE, objRef); + Value* vtable = getField(bcI, cf, LLVM_JAVA_OBJECT_BASE, objRef); vtable = new CastInst(vtable, PointerType::get(vi.vtable->getType()), TMP, getBBAt(bcI)); vtable = new LoadInst(vtable, TMP, getBBAt(bcI)); @@ -1162,8 +1167,8 @@ const std::string& methodDescr = methodName + nameAndType->getDescriptor()->str(); std::string funcName = className + '/' + methodDescr; + const ClassInfo& ci = getClassInfo(ClassFile::get(className)); - const ClassInfo& ci = getClassInfo(className); // constructor calls are statically bound if (methodName == "") { FunctionType* funcType = @@ -1200,15 +1205,14 @@ void do_new(unsigned bcI, unsigned index) { ConstantClass* classRef = cf_->getConstantClass(index); - const std::string& className = classRef->getName()->str(); - ClassFile* cf = ClassFile::get(className); - const ClassInfo& ci = getClassInfo(className); - const VTableInfo& vi = getVTableInfo(className); + ClassFile* cf = ClassFile::get(classRef->getName()->str()); + const ClassInfo& ci = getClassInfo(cf); + const VTableInfo& vi = getVTableInfo(cf); Value* objRef = new MallocInst(ci.type, ConstantUInt::get(Type::UIntTy, 0), TMP, getBBAt(bcI)); - Value* vtable = getField(bcI, className, LLVM_JAVA_OBJECT_BASE, objRef); + Value* vtable = getField(bcI, cf, LLVM_JAVA_OBJECT_BASE, objRef); vtable = new CastInst(vtable, PointerType::get(vi.vtable->getType()), TMP, getBBAt(bcI)); vtable = new StoreInst(vi.vtable, vtable, getBBAt(bcI)); @@ -1243,11 +1247,11 @@ void do_instanceof(unsigned bcI, unsigned index) { ConstantClass* classRef = cf_->getConstantClass(index); - const std::string& className = classRef->getName()->str(); - const VTableInfo& vi = getVTableInfo(className); + ClassFile* cf = ClassFile::get(classRef->getName()->str()); + const VTableInfo& vi = getVTableInfo(cf); Value* objRef = opStack_.top(); opStack_.pop(); - Value* objBase = getField(bcI, className, LLVM_JAVA_OBJECT_BASE, objRef); + Value* objBase = getField(bcI, cf, LLVM_JAVA_OBJECT_BASE, objRef); Function* f = module_->getOrInsertFunction(LLVM_JAVA_ISINSTANCEOF, Type::IntTy, objBase->getType(), From reid at x10sys.com Tue Sep 14 10:42:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Sep 2004 10:42:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/SunOS/Memory.cpp Message-ID: <200409141542.KAA19735@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/SunOS: Memory.cpp updated: 1.3 -> 1.4 --- Log message: Fix a compilation error. --- Diffs of the changes: (+1 -1) Index: llvm/lib/System/SunOS/Memory.cpp diff -u llvm/lib/System/SunOS/Memory.cpp:1.3 llvm/lib/System/SunOS/Memory.cpp:1.4 --- llvm/lib/System/SunOS/Memory.cpp:1.3 Mon Sep 13 17:38:12 2004 +++ llvm/lib/System/SunOS/Memory.cpp Tue Sep 14 10:42:11 2004 @@ -39,7 +39,7 @@ } MemoryBlock result; result.Address = pa; - result.AllocSize = NumPages*pageSize; + result.Size = NumPages*pageSize; return result; } From reid at x10sys.com Tue Sep 14 10:46:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Sep 2004 10:46:23 -0500 Subject: [llvm-commits] CVS: llvm/tools/llee/SysUtils.c Message-ID: <200409141546.KAA19761@zion.cs.uiuc.edu> Changes in directory llvm/tools/llee: SysUtils.c updated: 1.7 -> 1.8 --- Log message: Fix compilation warning. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llee/SysUtils.c diff -u llvm/tools/llee/SysUtils.c:1.7 llvm/tools/llee/SysUtils.c:1.8 --- llvm/tools/llee/SysUtils.c:1.7 Wed Sep 1 17:55:37 2004 +++ llvm/tools/llee/SysUtils.c Tue Sep 14 10:46:13 2004 @@ -115,7 +115,7 @@ * Find a pointer to the *real* execve() function starting the search in the * next library and forward, to avoid finding the one defined in this file. */ - char *error; + const char *error; execveTy execvePtr = (execveTy) dlsym(RTLD_NEXT, "execve"); if ((error = dlerror()) != NULL) { fprintf(stderr, "%s\n", error); From lattner at cs.uiuc.edu Tue Sep 14 11:33:15 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Sep 2004 11:33:15 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/PiNodeInsertion.cpp Message-ID: <200409141633.LAA31537@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: PiNodeInsertion.cpp (r1.17) removed --- Log message: Remove a long-dead pass. Actually, this pass was never used at all. --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Tue Sep 14 11:34:19 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Sep 2004 11:34:19 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Scalar.h Message-ID: <200409141634.LAA01146@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: Scalar.h updated: 1.44 -> 1.45 --- Log message: Remove unused pass --- Diffs of the changes: (+0 -23) Index: llvm/include/llvm/Transforms/Scalar.h diff -u llvm/include/llvm/Transforms/Scalar.h:1.44 llvm/include/llvm/Transforms/Scalar.h:1.45 --- llvm/include/llvm/Transforms/Scalar.h:1.44 Sat Jul 31 05:02:24 2004 +++ llvm/include/llvm/Transforms/Scalar.h Tue Sep 14 11:34:08 2004 @@ -158,29 +158,6 @@ //===----------------------------------------------------------------------===// // -// PiNodeInsertion - This pass inserts single entry Phi nodes into basic blocks -// that are preceeded by a conditional branch, where the branch gives -// information about the operands of the condition. For example, this C code: -// if (x == 0) { ... = x + 4; -// becomes: -// if (x == 0) { -// x2 = phi(x); // Node that can hold data flow information about X -// ... = x2 + 4; -// -// Since the direction of the condition branch gives information about X itself -// (whether or not it is zero), some passes (like value numbering or ABCD) can -// use the inserted Phi/Pi nodes as a place to attach information, in this case -// saying that X has a value of 0 in this scope. The power of this analysis -// information is that "in the scope" translates to "for all uses of x2". -// -// This special form of Phi node is refered to as a Pi node, following the -// terminology defined in the "Array Bounds Checks on Demand" paper. -// -Pass *createPiNodeInsertionPass(); - - -//===----------------------------------------------------------------------===// -// // This pass is used to promote memory references to be register references. A // simple example of the transformation performed by this pass is: // From lattner at cs.uiuc.edu Tue Sep 14 11:43:26 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Sep 2004 11:43:26 -0500 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200409141643.LAA01193@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.236 -> 1.237 --- Log message: Add notes about some buggy passes --- Diffs of the changes: (+2 -2) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.236 llvm/docs/ReleaseNotes.html:1.237 --- llvm/docs/ReleaseNotes.html:1.236 Tue Sep 7 12:52:38 2004 +++ llvm/docs/ReleaseNotes.html Tue Sep 14 11:43:13 2004 @@ -252,7 +252,7 @@ benchmarks. The file llvm/lib/Target/PowerPC/README.txt has details.
  • The following passes are incomplete or buggy: -pgmdep, -memdep, - -ipmodref, -cee
  • + -ipmodref, -cee, -branch-combine, -instloops, -paths
  • The -pre pass is incomplete (there are cases it doesn't handle that it should) and not thoroughly tested.
  • The llvm-ar tool is incomplete and probably buggy.
  • @@ -613,7 +613,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/09/07 17:52:38 $ + Last modified: $Date: 2004/09/14 16:43:13 $ From lattner at cs.uiuc.edu Tue Sep 14 12:15:46 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Sep 2004 12:15:46 -0500 Subject: [llvm-commits] CVS: poolalloc/runtime/FreeListAllocator/PageManager.cpp Message-ID: <200409141715.MAA15381@apoc.cs.uiuc.edu> Changes in directory poolalloc/runtime/FreeListAllocator: PageManager.cpp updated: 1.6 -> 1.7 --- Log message: Adjust to header movage --- Diffs of the changes: (+3 -3) Index: poolalloc/runtime/FreeListAllocator/PageManager.cpp diff -u poolalloc/runtime/FreeListAllocator/PageManager.cpp:1.6 poolalloc/runtime/FreeListAllocator/PageManager.cpp:1.7 --- poolalloc/runtime/FreeListAllocator/PageManager.cpp:1.6 Thu Nov 13 18:16:30 2003 +++ poolalloc/runtime/FreeListAllocator/PageManager.cpp Tue Sep 14 12:15:35 2004 @@ -15,9 +15,9 @@ #ifndef _POSIX_MAPPED_FILES #define _POSIX_MAPPED_FILES #endif -#include "Support/MallocAllocator.h" -#include "Config/unistd.h" -#include "Config/sys/mman.h" +#include "llvm/Support/MallocAllocator.h" +#include "llvm/Config/unistd.h" +#include "llvm/Config/sys/mman.h" #include #include From alkis at cs.uiuc.edu Tue Sep 14 13:00:19 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Tue, 14 Sep 2004 13:00:19 -0500 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200409141800.NAA05852@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.96 -> 1.97 --- Log message: Pass a classfile instance to getClassTypeInfo instead of the classname. --- Diffs of the changes: (+4 -3) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.96 llvm-java/lib/Compiler/Compiler.cpp:1.97 --- llvm-java/lib/Compiler/Compiler.cpp:1.96 Tue Sep 14 00:44:43 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Tue Sep 14 13:00:08 2004 @@ -420,13 +420,14 @@ return ci; } - llvm::Constant* getClassTypeInfo(const std::string& className, + llvm::Constant* getClassTypeInfo(ClassFile* cf, const VTableInfo& vi, const VTableInfo& superVI) const { // llvm_java_object_typeinfo has four fields: depth, a pointer // to the superclasses vtable pointers, a count for interfaces // and a pointer to the interfaces vtable pointers - + const std::string& className = cf->getThisClass()->getName()->str(); + std::vector typeInfoInit; // the depth unsigned depth = vi.superVtables.size(); @@ -493,7 +494,7 @@ init.push_back(superInit->getOperand(i)); vi.m2iMap = superVI.m2iMap; // install the new typeinfo block for this class - init[0] = getClassTypeInfo(className, vi, superVI); + init[0] = getClassTypeInfo(cf, vi, superVI); // add member functions to the vtable const Methods& methods = cf->getMethods(); From brukman at cs.uiuc.edu Tue Sep 14 13:21:13 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue, 14 Sep 2004 13:21:13 -0500 Subject: [llvm-commits] CVS: llvm/projects/Makefile Message-ID: <200409141821.NAA07749@zion.cs.uiuc.edu> Changes in directory llvm/projects: Makefile updated: 1.11 -> 1.12 --- Log message: The Sparc linking .so problem extends to the sample project as well --- Diffs of the changes: (+1 -0) Index: llvm/projects/Makefile diff -u llvm/projects/Makefile:1.11 llvm/projects/Makefile:1.12 --- llvm/projects/Makefile:1.11 Mon Sep 13 17:42:54 2004 +++ llvm/projects/Makefile Tue Sep 14 13:21:03 2004 @@ -15,6 +15,7 @@ # Sparc cannot link shared libraries (libtool problem?) which Stacker uses ifeq ($(ARCH), Sparc) DIRS := $(filter-out Stacker, $(DIRS)) +DIRS := $(filter-out sample, $(DIRS)) endif include $(BUILD_SRC_ROOT)/Makefile.rules From lattner at cs.uiuc.edu Tue Sep 14 14:15:25 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Sep 2004 14:15:25 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/AliasSetTracker.h Message-ID: <200409141915.OAA18498@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: AliasSetTracker.h updated: 1.19 -> 1.20 --- Log message: Add an AliasSetTracker::copyValue method --- Diffs of the changes: (+19 -9) Index: llvm/include/llvm/Analysis/AliasSetTracker.h diff -u llvm/include/llvm/Analysis/AliasSetTracker.h:1.19 llvm/include/llvm/Analysis/AliasSetTracker.h:1.20 --- llvm/include/llvm/Analysis/AliasSetTracker.h:1.19 Wed Sep 1 17:55:34 2004 +++ llvm/include/llvm/Analysis/AliasSetTracker.h Tue Sep 14 14:15:12 2004 @@ -221,7 +221,8 @@ void removeFromTracker(AliasSetTracker &AST); - void addPointer(AliasSetTracker &AST, HashNodePair &Entry, unsigned Size); + void addPointer(AliasSetTracker &AST, HashNodePair &Entry, unsigned Size, + bool KnownMustAlias = false); void addCallSite(CallSite CS, AliasAnalysis &AA); void setVolatile() { Volatile = true; } @@ -286,15 +287,8 @@ bool remove(Instruction *I); void remove(AliasSet &AS); - - /// deleteValue method - This method is used to remove a pointer value from - /// the AliasSetTracker entirely. It should be used when an instruction is - /// deleted from the program to update the AST. If you don't use this, you - /// would have dangling pointers to deleted instructions. - /// - void deleteValue(Value *PtrVal); - /// getAliasSets - Return the alias sets that are active. + /// const ilist &getAliasSets() const { return AliasSets; } /// getAliasSetForPointer - Return the alias set that the specified pointer @@ -313,6 +307,22 @@ /// this tracker. AliasAnalysis &getAliasAnalysis() const { return AA; } + /// deleteValue method - This method is used to remove a pointer value from + /// the AliasSetTracker entirely. It should be used when an instruction is + /// deleted from the program to update the AST. If you don't use this, you + /// would have dangling pointers to deleted instructions. + /// + void deleteValue(Value *PtrVal); + + /// copyValue - This method should be used whenever a preexisting value in the + /// program is copied or cloned, introducing a new value. Note that it is ok + /// for clients that use this method to introduce the same value multiple + /// times: if the tracker already knows about a value, it will ignore the + /// request. + /// + void copyValue(Value *From, Value *To); + + typedef ilist::iterator iterator; typedef ilist::const_iterator const_iterator; From lattner at cs.uiuc.edu Tue Sep 14 14:15:43 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Sep 2004 14:15:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasSetTracker.cpp Message-ID: <200409141915.OAA18508@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasSetTracker.cpp updated: 1.26 -> 1.27 --- Log message: Implement an AliasSetTracker::copyValue method --- Diffs of the changes: (+30 -3) Index: llvm/lib/Analysis/AliasSetTracker.cpp diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.26 llvm/lib/Analysis/AliasSetTracker.cpp:1.27 --- llvm/lib/Analysis/AliasSetTracker.cpp:1.26 Thu Jul 29 12:14:54 2004 +++ llvm/lib/Analysis/AliasSetTracker.cpp Tue Sep 14 14:15:32 2004 @@ -67,12 +67,13 @@ } void AliasSet::addPointer(AliasSetTracker &AST, HashNodePair &Entry, - unsigned Size) { + unsigned Size, bool KnownMustAlias) { assert(!Entry.second.hasAliasSet() && "Entry already in set!"); AliasAnalysis &AA = AST.getAliasAnalysis(); - if (isMustAlias()) // Check to see if we have to downgrade to _may_ alias + // Check to see if we have to downgrade to _may_ alias. + if (isMustAlias() && !KnownMustAlias) if (HashNodePair *P = getSomePointer()) { AliasAnalysis::AliasResult Result = AA.alias(P->first, P->second.getSize(), Entry.first, Size); @@ -400,7 +401,10 @@ // dangling pointers to deleted instructions. // void AliasSetTracker::deleteValue(Value *PtrVal) { - // First, look up the PointerRec for this pointer... + // Notify the alias analysis implementation that this value is gone. + AA.deleteValue(PtrVal); + + // First, look up the PointerRec for this pointer. hash_map::iterator I = PointerMap.find(PtrVal); if (I == PointerMap.end()) return; // Noop @@ -415,6 +419,29 @@ PointerMap.erase(I); } +// copyValue - This method should be used whenever a preexisting value in the +// program is copied or cloned, introducing a new value. Note that it is ok for +// clients that use this method to introduce the same value multiple times: if +// the tracker already knows about a value, it will ignore the request. +// +void AliasSetTracker::copyValue(Value *From, Value *To) { + // Notify the alias analysis implementation that this value is copied. + AA.copyValue(From, To); + + // First, look up the PointerRec for this pointer. + hash_map::iterator I = PointerMap.find(From); + if (I == PointerMap.end() || !I->second.hasAliasSet()) + return; // Noop + + AliasSet::HashNodePair &Entry = getEntryFor(To); + if (Entry.second.hasAliasSet()) return; // Already in the tracker! + + // Add it to the alias set it aliases... + AliasSet *AS = I->second.getAliasSet(*this); + AS->addPointer(*this, Entry, I->second.getSize(), true); +} + + //===----------------------------------------------------------------------===// // AliasSet/AliasSetTracker Printing Support From lattner at cs.uiuc.edu Tue Sep 14 19:59:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Sep 2004 19:59:02 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llx Message-ID: <200409150059.TAA26221@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/LICM: 2004-09-14-AliasAnalysisInvalidate.llx added (r1.1) --- Log message: New testcase for PR420: http://llvm.cs.uiuc.edu/PR420 --- Diffs of the changes: (+22 -0) Index: llvm/test/Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llx diff -c /dev/null llvm/test/Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llx:1.1 *** /dev/null Tue Sep 14 19:58:59 2004 --- llvm/test/Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llx Tue Sep 14 19:58:49 2004 *************** *** 0 **** --- 1,22 ---- + ; RUN: llvm-as < %s | opt -globalsmodref-aa -licm -disable-output + + %PL_regcomp_parse = internal global sbyte* null + + implementation + + void %test() { + br label %Outer + Outer: + br label %Inner + Inner: + %tmp.114.i.i.i = load sbyte** %PL_regcomp_parse + %tmp.115.i.i.i = load sbyte* %tmp.114.i.i.i + + store sbyte* null, sbyte** %PL_regcomp_parse + + br bool false, label %Inner, label %Next + Next: + br bool false, label %Outer, label %Exit + Exit: + ret void + } From lattner at cs.uiuc.edu Tue Sep 14 20:02:43 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Sep 2004 20:02:43 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h Message-ID: <200409150102.UAA26536@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms/Utils: PromoteMemToReg.h updated: 1.5 -> 1.6 --- Log message: Add an optional argument to PromoteMemToReg --- Diffs of the changes: (+5 -1) Index: llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h diff -u llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h:1.5 llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h:1.6 --- llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h:1.5 Tue Nov 11 16:41:31 2003 +++ llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h Tue Sep 14 20:02:30 2004 @@ -23,6 +23,7 @@ class DominatorTree; class DominanceFrontier; class TargetData; +class AliasSetTracker; /// isAllocaPromotable - Return true if this alloca is legal for promotion. /// This is true if there are only loads and stores to the alloca... @@ -34,9 +35,12 @@ /// use of DominanceFrontier information. This function does not modify the CFG /// of the function at all. All allocas must be from the same function. /// +/// If AST is specified, the specified tracker is updated to reflect changes +/// made to the IR. +/// void PromoteMemToReg(const std::vector &Allocas, DominatorTree &DT, DominanceFrontier &DF, - const TargetData &TD); + const TargetData &TD, AliasSetTracker *AST = 0); } // End llvm namespace From lattner at cs.uiuc.edu Tue Sep 14 20:03:07 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Sep 2004 20:03:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200409150103.UAA26561@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.67 -> 1.68 --- Log message: If given an AliasSetTracker object to update, update it. --- Diffs of the changes: (+81 -20) Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.67 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.68 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.67 Fri Sep 3 13:19:51 2004 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Tue Sep 14 20:02:54 2004 @@ -17,13 +17,15 @@ //===----------------------------------------------------------------------===// #include "llvm/Transforms/Utils/PromoteMemToReg.h" -#include "llvm/Analysis/Dominators.h" -#include "llvm/Instructions.h" -#include "llvm/Function.h" #include "llvm/Constant.h" +#include "llvm/DerivedTypes.h" +#include "llvm/Function.h" +#include "llvm/Instructions.h" +#include "llvm/Analysis/Dominators.h" +#include "llvm/Analysis/AliasSetTracker.h" +#include "llvm/ADT/StringExtras.h" #include "llvm/Support/CFG.h" #include "llvm/Support/StableBasicBlockNumbering.h" -#include "llvm/ADT/StringExtras.h" #include using namespace llvm; @@ -116,29 +118,44 @@ namespace { struct PromoteMem2Reg { - // Allocas - The alloca instructions being promoted + /// Allocas - The alloca instructions being promoted. + /// std::vector Allocas; DominatorTree &DT; DominanceFrontier &DF; const TargetData &TD; - // AllocaLookup - Reverse mapping of Allocas + /// AST - An AliasSetTracker object to update. If null, don't update it. + /// + AliasSetTracker *AST; + + /// AllocaLookup - Reverse mapping of Allocas. + /// std::map AllocaLookup; - // NewPhiNodes - The PhiNodes we're adding. + /// NewPhiNodes - The PhiNodes we're adding. + /// std::map > NewPhiNodes; - // Visited - The set of basic blocks the renamer has already visited. + /// PointerAllocaValues - If we are updating an AliasSetTracker, then for + /// each alloca that is of pointer type, we keep track of what to copyValue + /// to the inserted PHI nodes here. + /// + std::vector PointerAllocaValues; + + /// Visited - The set of basic blocks the renamer has already visited. + /// std::set Visited; - // BBNumbers - Contains a stable numbering of basic blocks to avoid - // non-determinstic behavior. + /// BBNumbers - Contains a stable numbering of basic blocks to avoid + /// non-determinstic behavior. StableBasicBlockNumbering BBNumbers; public: PromoteMem2Reg(const std::vector &A, DominatorTree &dt, - DominanceFrontier &df, const TargetData &td) - : Allocas(A), DT(dt), DF(df), TD(td) {} + DominanceFrontier &df, const TargetData &td, + AliasSetTracker *ast) + : Allocas(A), DT(dt), DF(df), TD(td), AST(ast) {} void run(); @@ -166,6 +183,7 @@ // that are live in a single basic block by the basic block they are live in. std::map > LocallyUsedAllocas; + if (AST) PointerAllocaValues.resize(Allocas.size()); for (unsigned AllocaNum = 0; AllocaNum != Allocas.size(); ++AllocaNum) { AllocaInst *AI = Allocas[AllocaNum]; @@ -177,6 +195,7 @@ if (AI->use_empty()) { // If there are no uses of the alloca, just delete it now. + if (AST) AST->deleteValue(AI); AI->getParent()->getInstList().erase(AI); // Remove the alloca from the Allocas list, since it has been processed @@ -198,18 +217,21 @@ // decide whether all of the loads and stores to the alloca are within the // same basic block. RestartUseScan: + Value *AllocaPointerVal = 0; for (Value::use_iterator U =AI->use_begin(), E = AI->use_end(); U != E;++U){ Instruction *User = cast(*U); if (StoreInst *SI = dyn_cast(User)) { // Remember the basic blocks which define new values for the alloca DefiningBlocks.push_back(SI->getParent()); + AllocaPointerVal = SI->getOperand(0); } else if (LoadInst *LI = dyn_cast(User)) { // Otherwise it must be a load instruction, keep track of variable reads UsingBlocks.push_back(LI->getParent()); + AllocaPointerVal = LI; } else if (SelectInst *SI = dyn_cast(User)) { // Because of the restrictions we placed on Select instruction uses - // above things are very simple. Transform the PHI of addresses into a - // select of loaded values. + // above things are very simple. Transform the select of addresses into + // a select of loaded values. LoadInst *Load = cast(SI->use_back()); std::string LoadName = Load->getName(); Load->setName(""); @@ -220,6 +242,13 @@ Value *NewSI = new SelectInst(SI->getOperand(0), TrueVal, FalseVal, Load->getName(), SI); + if (AST && isa(Load->getType())) { + AST->copyValue(Load, TrueVal); + AST->copyValue(Load, FalseVal); + AST->copyValue(Load, NewSI); + AST->deleteValue(Load); + } + Load->replaceAllUsesWith(NewSI); Load->getParent()->getInstList().erase(Load); SI->getParent()->getInstList().erase(SI); @@ -250,6 +279,15 @@ NewPN->addIncoming(NewLoad, Pred); } + if (AST && isa(NewPN->getType())) { + for (std::map::iterator I = NewLoads.begin(), + E = NewLoads.end(); I != E; ++I) + AST->copyValue(PNUser, I->second); + AST->copyValue(PNUser, NewPN); + AST->deleteValue(PNUser); + AST->deleteValue(PN); + } + // Remove the old load. PNUser->replaceAllUsesWith(NewPN); PNUser->getParent()->getInstList().erase(PNUser); @@ -283,6 +321,9 @@ continue; } + if (AST) + PointerAllocaValues[AllocaNum] = AllocaPointerVal; + // If we haven't computed a numbering for the BB's in the function, do so // now. BBNumbers.compute(F); @@ -352,6 +393,8 @@ if (!HasOtherPHIs) NewPhiNodes.erase(PN->getParent()); + if (AST && isa(PN->getType())) + AST->deleteValue(PN); PN->getParent()->getInstList().erase(PN); } @@ -402,6 +445,7 @@ // if (!A->use_empty()) A->replaceAllUsesWith(Constant::getNullValue(A->getType())); + if (AST) AST->deleteValue(A); A->getParent()->getInstList().erase(A); } @@ -508,6 +552,8 @@ if (LoadInst *LI = dyn_cast(U)) { // Must be a load of uninitialized value. LI->replaceAllUsesWith(Constant::getNullValue(AI->getAllocatedType())); + if (AST && isa(LI->getType())) + AST->deleteValue(LI); } else { // Otherwise it must be a store which is never read. assert(isa(U)); @@ -523,6 +569,8 @@ if (LI->getOperand(0) == AI) { // Loads just returns the "current value"... LI->replaceAllUsesWith(CurVal); + if (AST && isa(LI->getType())) + AST->deleteValue(LI); BB->getInstList().erase(LI); } } else if (StoreInst *SI = dyn_cast(Inst)) { @@ -538,6 +586,7 @@ // After traversing the basic block, there should be no more uses of the // alloca, remove it now. assert(AI->use_empty() && "Uses of alloca from more than one BB??"); + if (AST) AST->deleteValue(AI); AI->getParent()->getInstList().erase(AI); } @@ -563,6 +612,8 @@ if (AIt->second == 0) // Uninitialized value?? AIt->second =Constant::getNullValue(AIt->first->getAllocatedType()); LI->replaceAllUsesWith(AIt->second); + if (AST && isa(LI->getType())) + AST->deleteValue(LI); BB->getInstList().erase(LI); } } @@ -587,7 +638,7 @@ bool PromoteMem2Reg::QueuePhiNode(BasicBlock *BB, unsigned AllocaNo, unsigned &Version, std::set &InsertedPHINodes) { - // Look up the basic-block in question + // Look up the basic-block in question. std::vector &BBPNs = NewPhiNodes[BB]; if (BBPNs.empty()) BBPNs.resize(Allocas.size()); @@ -596,10 +647,15 @@ // Create a PhiNode using the dereferenced type... and add the phi-node to the // BasicBlock. - BBPNs[AllocaNo] = new PHINode(Allocas[AllocaNo]->getAllocatedType(), - Allocas[AllocaNo]->getName() + "." + + PHINode *PN = new PHINode(Allocas[AllocaNo]->getAllocatedType(), + Allocas[AllocaNo]->getName() + "." + utostr(Version++), BB->begin()); - InsertedPHINodes.insert(BBPNs[AllocaNo]); + BBPNs[AllocaNo] = PN; + InsertedPHINodes.insert(PN); + + if (AST && isa(PN->getType())) + AST->copyValue(PointerAllocaValues[AllocaNo], PN); + return true; } @@ -644,6 +700,8 @@ // walk the use list of this load and replace all uses with r LI->replaceAllUsesWith(V); + if (AST && isa(LI->getType())) + AST->deleteValue(LI); BB->getInstList().erase(LI); } } @@ -674,10 +732,13 @@ /// use of DominanceFrontier information. This function does not modify the CFG /// of the function at all. All allocas must be from the same function. /// +/// If AST is specified, the specified tracker is updated to reflect changes +/// made to the IR. +/// void llvm::PromoteMemToReg(const std::vector &Allocas, DominatorTree &DT, DominanceFrontier &DF, - const TargetData &TD) { + const TargetData &TD, AliasSetTracker *AST) { // If there is nothing to do, bail out... if (Allocas.empty()) return; - PromoteMem2Reg(Allocas, DT, DF, TD).run(); + PromoteMem2Reg(Allocas, DT, DF, TD, AST).run(); } From lattner at cs.uiuc.edu Tue Sep 14 20:04:20 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Sep 2004 20:04:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LICM.cpp Message-ID: <200409150104.UAA26792@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LICM.cpp updated: 1.65 -> 1.66 --- Log message: Make sure to update alias analysis information as we transform the function. This fixes PR420: http://llvm.cs.uiuc.edu/PR420 and Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llx --- Diffs of the changes: (+57 -21) Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.65 llvm/lib/Transforms/Scalar/LICM.cpp:1.66 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.65 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Transforms/Scalar/LICM.cpp Tue Sep 14 20:04:07 2004 @@ -184,13 +184,13 @@ /// void PromoteValuesInLoop(); - /// findPromotableValuesInLoop - Check the current loop for stores to + /// FindPromotableValuesInLoop - Check the current loop for stores to /// definite pointers, which are not loaded and stored through may aliases. /// If these are found, create an alloca for the value, add it to the /// PromotedValues list, and keep track of the mapping from value to /// alloca... /// - void findPromotableValuesInLoop( + void FindPromotableValuesInLoop( std::vector > &PromotedValues, std::map &Val2AlMap); }; @@ -546,7 +546,7 @@ if (AI) { std::vector Allocas; Allocas.push_back(AI); - PromoteMemToReg(Allocas, *DT, *DF, AA->getTargetData()); + PromoteMemToReg(Allocas, *DT, *DF, AA->getTargetData(), CurAST); } } } @@ -617,20 +617,47 @@ std::vector > PromotedValues; std::map ValueToAllocaMap; // Map of ptr to alloca - findPromotableValuesInLoop(PromotedValues, ValueToAllocaMap); - if (ValueToAllocaMap.empty()) return; // If there are values to promote... + FindPromotableValuesInLoop(PromotedValues, ValueToAllocaMap); + if (ValueToAllocaMap.empty()) return; // If there are values to promote. Changed = true; NumPromoted += PromotedValues.size(); + std::vector PointerValueNumbers; + // Emit a copy from the value into the alloca'd value in the loop preheader TerminatorInst *LoopPredInst = Preheader->getTerminator(); for (unsigned i = 0, e = PromotedValues.size(); i != e; ++i) { - // Load from the memory we are promoting... - LoadInst *LI = new LoadInst(PromotedValues[i].second, - PromotedValues[i].second->getName()+".promoted", - LoopPredInst); - // Store into the temporary alloca... + Value *Ptr = PromotedValues[i].second; + + // If we are promoting a pointer value, update alias information for the + // inserted load. + Value *LoadValue = 0; + if (isa(cast(Ptr->getType())->getElementType())) { + // Locate a load or store through the pointer, and assign the same value + // to LI as we are loading or storing. Since we know that the value is + // stored in this loop, this will always succeed. + for (Value::use_iterator UI = Ptr->use_begin(), E = Ptr->use_end(); + UI != E; ++UI) + if (LoadInst *LI = dyn_cast(*UI)) { + LoadValue = LI; + break; + } else if (StoreInst *SI = dyn_cast(*UI)) { + if (SI->getOperand(1) == LI) { + LoadValue = SI->getOperand(0); + break; + } + } + assert(LoadValue && "No store through the pointer found!"); + PointerValueNumbers.push_back(LoadValue); // Remember this for later. + } + + // Load from the memory we are promoting. + LoadInst *LI = new LoadInst(Ptr, Ptr->getName()+".promoted", LoopPredInst); + + if (LoadValue) CurAST->copyValue(LoadValue, LI); + + // Store into the temporary alloca. new StoreInst(LI, PromotedValues[i].first, LoopPredInst); } @@ -669,45 +696,51 @@ CurLoop->getExitBlocks(ExitBlocks); for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i) if (ProcessedBlocks.insert(ExitBlocks[i]).second) { - // Copy all of the allocas into their memory locations... + // Copy all of the allocas into their memory locations. BasicBlock::iterator BI = ExitBlocks[i]->begin(); while (isa(*BI)) - ++BI; // Skip over all of the phi nodes in the block... + ++BI; // Skip over all of the phi nodes in the block. Instruction *InsertPos = BI; + unsigned PVN = 0; for (unsigned i = 0, e = PromotedValues.size(); i != e; ++i) { - // Load from the alloca... + // Load from the alloca. LoadInst *LI = new LoadInst(PromotedValues[i].first, "", InsertPos); - // Store into the memory we promoted... + + // If this is a pointer type, update alias info appropriately. + if (isa(LI->getType())) + CurAST->copyValue(PointerValueNumbers[PVN++], LI); + + // Store into the memory we promoted. new StoreInst(LI, PromotedValues[i].second, InsertPos); } } // Now that we have done the deed, use the mem2reg functionality to promote - // all of the new allocas we just created into real SSA registers... + // all of the new allocas we just created into real SSA registers. // std::vector PromotedAllocas; PromotedAllocas.reserve(PromotedValues.size()); for (unsigned i = 0, e = PromotedValues.size(); i != e; ++i) PromotedAllocas.push_back(PromotedValues[i].first); - PromoteMemToReg(PromotedAllocas, *DT, *DF, AA->getTargetData()); + PromoteMemToReg(PromotedAllocas, *DT, *DF, AA->getTargetData(), CurAST); } -/// findPromotableValuesInLoop - Check the current loop for stores to definite +/// FindPromotableValuesInLoop - Check the current loop for stores to definite /// pointers, which are not loaded and stored through may aliases. If these are /// found, create an alloca for the value, add it to the PromotedValues list, -/// and keep track of the mapping from value to alloca... +/// and keep track of the mapping from value to alloca. /// -void LICM::findPromotableValuesInLoop( +void LICM::FindPromotableValuesInLoop( std::vector > &PromotedValues, std::map &ValueToAllocaMap) { Instruction *FnStart = CurLoop->getHeader()->getParent()->begin()->begin(); - // Loop over all of the alias sets in the tracker object... + // Loop over all of the alias sets in the tracker object. for (AliasSetTracker::iterator I = CurAST->begin(), E = CurAST->end(); I != E; ++I) { AliasSet &AS = *I; // We can promote this alias set if it has a store, if it is a "Must" alias - // set, if the pointer is loop invariant, if if we are not eliminating any + // set, if the pointer is loop invariant, and if we are not eliminating any // volatile loads or stores. if (!AS.isForwardingAliasSet() && AS.isMod() && AS.isMustAlias() && !AS.isVolatile() && CurLoop->isLoopInvariant(AS.begin()->first)) { @@ -729,6 +762,9 @@ const Type *Ty = cast(V->getType())->getElementType(); AllocaInst *AI = new AllocaInst(Ty, 0, V->getName()+".tmp", FnStart); PromotedValues.push_back(std::make_pair(AI, V)); + + // Update the AST and alias analysis. + CurAST->copyValue(V, AI); for (AliasSet::iterator I = AS.begin(), E = AS.end(); I != E; ++I) ValueToAllocaMap.insert(std::make_pair(I->first, AI)); From lattner at cs.uiuc.edu Tue Sep 14 20:09:38 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Sep 2004 20:09:38 -0500 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200409150109.UAA27659@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.237 -> 1.238 --- Log message: Bug fixed --- Diffs of the changes: (+4 -2) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.237 llvm/docs/ReleaseNotes.html:1.238 --- llvm/docs/ReleaseNotes.html:1.237 Tue Sep 14 11:43:13 2004 +++ llvm/docs/ReleaseNotes.html Tue Sep 14 20:09:25 2004 @@ -158,8 +158,10 @@

    Bugs fixed in the LLVM Core:

      +
    1. [licm] LICM invalidates alias analysis info + and uses broken information (optimizer crash)
    2. [asmwriter] Asmwriter is really slow for - functions with lots of values
    3. + functions with lots of values
    4. [anders-aa] Andersen's AA is completely broken in LLVM 1.3
    5. [bcwriter] Empty compaction tables @@ -613,7 +615,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/09/14 16:43:13 $ + Last modified: $Date: 2004/09/15 01:09:25 $ From lattner at cs.uiuc.edu Tue Sep 14 20:10:46 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Sep 2004 20:10:46 -0500 Subject: [llvm-commits] CVS: llvm-www/releases/1.3/docs/ReleaseNotes.html Message-ID: <200409150110.UAA27705@apoc.cs.uiuc.edu> Changes in directory llvm-www/releases/1.3/docs: ReleaseNotes.html updated: 1.5 -> 1.6 --- Log message: Bug found --- Diffs of the changes: (+6 -2) Index: llvm-www/releases/1.3/docs/ReleaseNotes.html diff -u llvm-www/releases/1.3/docs/ReleaseNotes.html:1.5 llvm-www/releases/1.3/docs/ReleaseNotes.html:1.6 --- llvm-www/releases/1.3/docs/ReleaseNotes.html:1.5 Tue Aug 24 02:42:08 2004 +++ llvm-www/releases/1.3/docs/ReleaseNotes.html Tue Sep 14 20:10:35 2004 @@ -426,7 +426,6 @@
        -
      • In the JIT, dlsym on a symbol compiled by the JIT will not work.
      • @@ -445,8 +444,13 @@ targets whose setjmp/longjmp libraries do not save and restore the entire register file. +
      Bugs in 1.3 fixed in 1.4:
      @@ -779,7 +783,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/08/24 07:42:08 $ + Last modified: $Date: 2004/09/15 01:10:35 $ From lattner at cs.uiuc.edu Tue Sep 14 20:14:21 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Sep 2004 20:14:21 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2000/186.crafty/Makefile Message-ID: <200409150114.UAA28009@apoc.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CINT2000/186.crafty: Makefile updated: 1.7 -> 1.8 --- Log message: Unbork 186.krafty --- Diffs of the changes: (+7 -7) Index: llvm-test/External/SPEC/CINT2000/186.crafty/Makefile diff -u llvm-test/External/SPEC/CINT2000/186.crafty/Makefile:1.7 llvm-test/External/SPEC/CINT2000/186.crafty/Makefile:1.8 --- llvm-test/External/SPEC/CINT2000/186.crafty/Makefile:1.7 Mon Sep 6 23:18:02 2004 +++ llvm-test/External/SPEC/CINT2000/186.crafty/Makefile Tue Sep 14 20:14:09 2004 @@ -3,12 +3,12 @@ STDIN_FILENAME = crafty.in STDOUT_FILENAME = crafty.out CPPFLAGS = -DSPEC_CPU2000 -DLINUX_i386 -Source = $(addprefix $(SPEC_BENCH_DIR)/src/, - attacks.c draw.c enprise.c init.c iterate.c make.c nexte.c output.c \ - preeval.c resign.c searchr.c swap.c utility.c boolean.c drawn.c \ - evaluate.c input.c lookup.c movgen.c nextr.c phase.c quiesce.c \ - root.c setboard.c time.c validate.c edit.c history.c interupt.c \ - main.c next.c option.c ponder.c repeat.c search.c store.c unmake.c \ - valid.c) +Source = $(addprefix $(SPEC_BENCH_DIR)/src/, \ + attacks.c draw.c enprise.c init.c iterate.c make.c nexte.c output.c \ + preeval.c resign.c searchr.c swap.c utility.c boolean.c drawn.c \ + evaluate.c input.c lookup.c movgen.c nextr.c phase.c quiesce.c \ + root.c setboard.c time.c validate.c edit.c history.c interupt.c \ + main.c next.c option.c ponder.c repeat.c search.c store.c unmake.c \ + valid.c) include ../../Makefile.spec2000 From brukman at cs.uiuc.edu Tue Sep 14 20:34:36 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue, 14 Sep 2004 20:34:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Makefile Message-ID: <200409150134.UAA24242@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: Makefile updated: 1.16 -> 1.17 --- Log message: Targets are independent of each other, so compile them in parallel --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/Makefile diff -u llvm/lib/Target/Makefile:1.16 llvm/lib/Target/Makefile:1.17 --- llvm/lib/Target/Makefile:1.16 Thu Aug 5 13:22:30 2004 +++ llvm/lib/Target/Makefile Tue Sep 14 20:34:25 2004 @@ -7,7 +7,7 @@ # ##===----------------------------------------------------------------------===## LEVEL = ../.. -DIRS = CBackend X86 SparcV9 PowerPC Skeleton +PARALLEL_DIRS = CBackend X86 SparcV9 PowerPC Skeleton LIBRARYNAME = target BUILD_ARCHIVE = 1 From brukman at cs.uiuc.edu Tue Sep 14 20:34:52 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue, 14 Sep 2004 20:34:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/Makefile Message-ID: <200409150134.UAA24259@zion.cs.uiuc.edu> Changes in directory llvm/lib: Makefile updated: 1.18 -> 1.19 --- Log message: Wrap long line --- Diffs of the changes: (+2 -1) Index: llvm/lib/Makefile diff -u llvm/lib/Makefile:1.18 llvm/lib/Makefile:1.19 --- llvm/lib/Makefile:1.18 Fri Feb 13 17:29:37 2004 +++ llvm/lib/Makefile Tue Sep 14 20:34:42 2004 @@ -8,7 +8,8 @@ ##===----------------------------------------------------------------------===## LEVEL = .. -PARALLEL_DIRS = VMCore Analysis Transforms AsmParser Bytecode CodeGen Target ExecutionEngine Debugger +PARALLEL_DIRS = VMCore Analysis Transforms AsmParser Bytecode CodeGen Target \ + ExecutionEngine Debugger include $(LEVEL)/Makefile.common From brukman at cs.uiuc.edu Tue Sep 14 20:40:29 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue, 14 Sep 2004 20:40:29 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.td Message-ID: <200409150140.UAA24362@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86RegisterInfo.td updated: 1.13 -> 1.14 --- Log message: Fit long lines into 80 cols via creative space elimination --- Diffs of the changes: (+4 -4) Index: llvm/lib/Target/X86/X86RegisterInfo.td diff -u llvm/lib/Target/X86/X86RegisterInfo.td:1.13 llvm/lib/Target/X86/X86RegisterInfo.td:1.14 --- llvm/lib/Target/X86/X86RegisterInfo.td:1.13 Mon Sep 13 23:16:20 2004 +++ llvm/lib/Target/X86/X86RegisterInfo.td Tue Sep 14 20:40:18 2004 @@ -36,10 +36,10 @@ def SI : RegisterGroup<"SI", [ESI]>; def DI : RegisterGroup<"DI", [EDI]>; // 8-bit registers - def AL : RegisterGroup<"AL", [AX, EAX]>; def CL : RegisterGroup<"CL", [CX, ECX]>; - def DL : RegisterGroup<"DL", [DX, EDX]>; def BL : RegisterGroup<"BL", [BX, EBX]>; - def AH : RegisterGroup<"AH", [AX, EAX]>; def CH : RegisterGroup<"CH", [CX, ECX]>; - def DH : RegisterGroup<"DH", [DX, EDX]>; def BH : RegisterGroup<"BH", [BX, EBX]>; + def AL : RegisterGroup<"AL", [AX,EAX]>; def CL : RegisterGroup<"CL",[CX,ECX]>; + def DL : RegisterGroup<"DL", [DX,EDX]>; def BL : RegisterGroup<"BL",[BX,EBX]>; + def AH : RegisterGroup<"AH", [AX,EAX]>; def CH : RegisterGroup<"CH",[CX,ECX]>; + def DH : RegisterGroup<"DH", [DX,EDX]>; def BH : RegisterGroup<"BH",[BX,EBX]>; // Pseudo Floating Point registers def FP0 : Register<"FP0">; def FP1 : Register<"FP1">; From alkis at cs.uiuc.edu Tue Sep 14 21:32:26 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Tue, 14 Sep 2004 21:32:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp Message-ID: <200409150232.VAA24765@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.105 -> 1.106 --- Log message: When creating constant arrays check that the initializer vector is the same size as the one in the array type. --- Diffs of the changes: (+2 -0) Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.105 llvm/lib/VMCore/Constants.cpp:1.106 --- llvm/lib/VMCore/Constants.cpp:1.105 Thu Sep 9 23:16:59 2004 +++ llvm/lib/VMCore/Constants.cpp Tue Sep 14 21:32:15 2004 @@ -245,6 +245,8 @@ ConstantArray::ConstantArray(const ArrayType *T, const std::vector &V) : Constant(T) { + assert(V.size() == T->getNumElements() && + "Invalid initializer vector for constant array"); Operands.reserve(V.size()); for (unsigned i = 0, e = V.size(); i != e; ++i) { assert((V[i]->getType() == T->getElementType() || From lattner at cs.uiuc.edu Tue Sep 14 21:34:52 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Sep 2004 21:34:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LICM.cpp Message-ID: <200409150234.VAA32409@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LICM.cpp updated: 1.66 -> 1.67 --- Log message: Fix a bug in the previous checkin that broke 255.vortex --- Diffs of the changes: (+1 -1) Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.66 llvm/lib/Transforms/Scalar/LICM.cpp:1.67 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.66 Tue Sep 14 20:04:07 2004 +++ llvm/lib/Transforms/Scalar/LICM.cpp Tue Sep 14 21:34:40 2004 @@ -643,7 +643,7 @@ LoadValue = LI; break; } else if (StoreInst *SI = dyn_cast(*UI)) { - if (SI->getOperand(1) == LI) { + if (SI->getOperand(1) == Ptr) { LoadValue = SI->getOperand(0); break; } From reid at x10sys.com Tue Sep 14 22:55:55 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Sep 2004 22:55:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Cygwin/Memory.cpp Message-ID: <200409150355.WAA25597@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Cygwin: Memory.cpp updated: 1.3 -> 1.4 --- Log message: Fix the interface to ReleaseRWX to take MemoryBlock& not Memory& --- Diffs of the changes: (+1 -1) Index: llvm/lib/System/Cygwin/Memory.cpp diff -u llvm/lib/System/Cygwin/Memory.cpp:1.3 llvm/lib/System/Cygwin/Memory.cpp:1.4 --- llvm/lib/System/Cygwin/Memory.cpp:1.3 Mon Sep 13 17:38:12 2004 +++ llvm/lib/System/Cygwin/Memory.cpp Tue Sep 14 22:55:45 2004 @@ -43,7 +43,7 @@ return result; } -void Memory::ReleaseRWX(Memory& M) { +void Memory::ReleaseRWX(MemoryBlock& M) { if (M.Address == 0 || M.Size == 0) return; if (0 != munmap(M.Address, M.Size)) { throw std::string("Can't release RWX Memory: ") + strerror(errno); From reid at x10sys.com Tue Sep 14 22:55:55 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Sep 2004 22:55:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/FreeBSD/Memory.cpp Message-ID: <200409150355.WAA25600@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/FreeBSD: Memory.cpp updated: 1.3 -> 1.4 --- Log message: Fix the interface to ReleaseRWX to take MemoryBlock& not Memory& --- Diffs of the changes: (+1 -1) Index: llvm/lib/System/FreeBSD/Memory.cpp diff -u llvm/lib/System/FreeBSD/Memory.cpp:1.3 llvm/lib/System/FreeBSD/Memory.cpp:1.4 --- llvm/lib/System/FreeBSD/Memory.cpp:1.3 Mon Sep 13 17:38:12 2004 +++ llvm/lib/System/FreeBSD/Memory.cpp Tue Sep 14 22:55:45 2004 @@ -43,7 +43,7 @@ return result; } -void Memory::ReleaseRWX(Memory& M) { +void Memory::ReleaseRWX(MemoryBlock& M) { if (M.Address == 0 || M.Size == 0) return; if (0 != munmap(M.Address, M.Size)) { throw std::string("Can't release RWX Memory: ") + strerror(errno); From alkis at cs.uiuc.edu Tue Sep 14 23:13:36 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Tue, 14 Sep 2004 23:13:36 -0500 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200409150413.XAA25711@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.97 -> 1.98 --- Log message: We don't need to create the type for the initializer separately. After we construct the ConstantStruct, we can simply get it by calling getType() on it. --- Diffs of the changes: (+8 -15) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.97 llvm-java/lib/Compiler/Compiler.cpp:1.98 --- llvm-java/lib/Compiler/Compiler.cpp:1.97 Tue Sep 14 13:00:08 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Tue Sep 14 23:13:25 2004 @@ -470,8 +470,6 @@ assert(!vi.vtable && vi.m2iMap.empty() && "got already initialized VTableInfo!"); - std::vector elements; - std::vector init; ConstantClass* super = cf->getSuperClass(); assert(super && "Class does not have superclass!"); const VTableInfo& superVI = @@ -482,23 +480,19 @@ std::copy(superVI.superVtables.begin(), superVI.superVtables.end(), std::back_inserter(vi.superVtables)); - // copy all the types from the super class' vtable + // copy all the constants from the super class' vtable assert(superVI.vtable && "No vtable found for super class!"); ConstantStruct* superInit = cast(superVI.vtable->getInitializer()); - const StructType* superVTableTy = superInit->getType(); - std::copy(superVTableTy->element_begin(), - superVTableTy->element_end(), - std::back_inserter(elements)); + std::vector init(superInit->getNumOperands()); for (unsigned i = 0, e = superInit->getNumOperands(); i != e; ++i) - init.push_back(superInit->getOperand(i)); + init[i] = superInit->getOperand(i); vi.m2iMap = superVI.m2iMap; // install the new typeinfo block for this class init[0] = getClassTypeInfo(cf, vi, superVI); // add member functions to the vtable const Methods& methods = cf->getMethods(); - init.resize(elements.size(), NULL); for (unsigned i = 0, e = methods.size(); i != e; ++i) { Method* method = methods[i]; @@ -518,18 +512,17 @@ unsigned& index = vi.m2iMap[methodDescr]; if (!index) { - index = elements.size(); - elements.resize(index + 1, NULL); - init.resize(index + 1, NULL); + index = init.size(); + init.resize(index + 1); } - elements[index] = vfun->getType(); init[index] = vfun; } } - vi.vtable = new GlobalVariable(StructType::get(elements), + llvm::Constant* vtable = ConstantStruct::get(init); + vi.vtable = new GlobalVariable(vtable->getType(), true, GlobalVariable::ExternalLinkage, - ConstantStruct::get(init), + vtable, className + "", module_); return vi; From alkis at cs.uiuc.edu Wed Sep 15 00:41:09 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 15 Sep 2004 00:41:09 -0500 Subject: [llvm-commits] CVS: llvm-java/test/Makefile.test Message-ID: <200409150541.AAA26015@zion.cs.uiuc.edu> Changes in directory llvm-java/test: Makefile.test updated: 1.13 -> 1.14 --- Log message: Pass -f to llvm-link so that stale files are overwritten if they are not up to date. --- Diffs of the changes: (+1 -1) Index: llvm-java/test/Makefile.test diff -u llvm-java/test/Makefile.test:1.13 llvm-java/test/Makefile.test:1.14 --- llvm-java/test/Makefile.test:1.13 Mon Sep 13 14:54:53 2004 +++ llvm-java/test/Makefile.test Wed Sep 15 00:40:59 2004 @@ -22,7 +22,7 @@ #rule to link in runtime to raw bytecode %.linked.bc: %.raw.bc $(DESTLIBBYTECODE)/libjrt.bc @$(ECHO) Linking $< with the Java runtime - $(LLVMTOOLCURRENT)/llvm-link$(EXEEXT) $^ -o $@ + $(LLVMTOOLCURRENT)/llvm-link$(EXEEXT) $^ -f -o $@ # rule to make assembly from bytecode %.dis-ll: %.bc From reid at x10sys.com Wed Sep 15 00:47:50 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Sep 2004 00:47:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Process.cpp Message-ID: <200409150547.AAA26075@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Process.cpp added (r1.1) --- Log message: Initial implementation of the Process abstraction for Win32. --- Diffs of the changes: (+46 -0) Index: llvm/lib/System/Win32/Process.cpp diff -c /dev/null llvm/lib/System/Win32/Process.cpp:1.1 *** /dev/null Wed Sep 15 00:47:50 2004 --- llvm/lib/System/Win32/Process.cpp Wed Sep 15 00:47:40 2004 *************** *** 0 **** --- 1,46 ---- + //===- Win32/Process.cpp - Win32 Process Implementation ------- -*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Jeff Cohen and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file provides the Win32 specific implementation of the Process class. + // + //===----------------------------------------------------------------------===// + + #include "Win32.h" + #include "llvm/System/Process.h" + + //===----------------------------------------------------------------------===// + //=== WARNING: Implementation here must contain only Win32 specific code + //=== and must not be UNIX code + //===----------------------------------------------------------------------===// + + namespace llvm { + using namespace sys; + + // This function retrieves the page size using GetSystemInfo and is present + // solely so it can be called once in Process::GetPageSize to initialize the + // static variable PageSize. + inline unsigned GetPageSizeOnce() { + // NOTE: A 32-bit application running under WOW64 is supposed to use + // GetNativeSystemInfo. However, this interface is not present prior + // to Windows XP so to use it requires dynamic linking. It is not clear + // how this affects the reported page size, if at all. One could argue + // that LLVM ought to run as 64-bits on a 64-bit system, anyway. + SYSTEM_INFO info; + GetSystemInfo(&info); + return static_cast(info.dwPageSize); + } + + unsigned + Process::GetPageSize() { + static const unsigned PageSize = GetPageSizeOnce(); + return PageSize; + } + + } + // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Wed Sep 15 00:48:21 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Sep 2004 00:48:21 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Win32.h Message-ID: <200409150548.AAA26086@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Win32.h added (r1.1) --- Log message: First version of a common header file for Win32 implementations. --- Diffs of the changes: (+33 -0) Index: llvm/lib/System/Win32/Win32.h diff -c /dev/null llvm/lib/System/Win32/Win32.h:1.1 *** /dev/null Wed Sep 15 00:48:21 2004 --- llvm/lib/System/Win32/Win32.h Wed Sep 15 00:48:11 2004 *************** *** 0 **** --- 1,33 ---- + //===- Win32/Win32.h - Common Win32 Include File ----------------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines things specific to Unix implementations. + // + //===----------------------------------------------------------------------===// + + //===----------------------------------------------------------------------===// + //=== WARNING: Implementation here must contain only generic UNIX code that + //=== is guaranteed to work on all UNIX variants. + //===----------------------------------------------------------------------===// + + #include "llvm/Config/config.h" // Get autoconf configuration settings + #include "windows.h" + #include + #include + + inline void ThrowError(const std::string& msg) { + char *buffer = NULL; + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, + NULL, GetLastError(), 0, (LPSTR)&buffer, 1, NULL); + std::string s(msg); + s += buffer; + LocalFree(buffer); + throw s; + } + From reid at x10sys.com Wed Sep 15 00:48:59 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Sep 2004 00:48:59 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/SysConfig.cpp Message-ID: <200409150548.AAA26097@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: SysConfig.cpp added (r1.1) --- Log message: Initial version of the SysConfig abstraction for Win32. --- Diffs of the changes: (+29 -0) Index: llvm/lib/System/Win32/SysConfig.cpp diff -c /dev/null llvm/lib/System/Win32/SysConfig.cpp:1.1 *** /dev/null Wed Sep 15 00:48:59 2004 --- llvm/lib/System/Win32/SysConfig.cpp Wed Sep 15 00:48:49 2004 *************** *** 0 **** --- 1,29 ---- + //===- Win32/SysConfig.cpp - Win32 System Configuration ---------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Jeff Cohen and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines some functions for managing system configuration on Win32. + // + //===----------------------------------------------------------------------===// + + #include "llvm/System/SysConfig.h" + + namespace llvm { + + // Some LLVM programs such as bugpoint produce core files as a normal part of + // their operation. To prevent the disk from filling up, this configuration item + // does what's necessary to prevent their generation. + void sys::PreventCoreFiles() { + // Windows doesn't do core files, so nothing to do. + // Although... it might be nice to prevent the do-you-want-to-debug + // dialog box from coming up. Or maybe not... + } + + } + + // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Wed Sep 15 00:50:00 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Sep 2004 00:50:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Memory.cpp Path.cpp Program.cpp Message-ID: <200409150550.AAA26117@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Memory.cpp updated: 1.2 -> 1.3 Path.cpp updated: 1.1 -> 1.2 Program.cpp updated: 1.1 -> 1.2 --- Log message: Patches to make this file actually compile under windows. Patches submitted by Jeff Cohen. Thanks Jeff! --- Diffs of the changes: (+494 -28) Index: llvm/lib/System/Win32/Memory.cpp diff -u llvm/lib/System/Win32/Memory.cpp:1.2 llvm/lib/System/Win32/Memory.cpp:1.3 --- llvm/lib/System/Win32/Memory.cpp:1.2 Mon Sep 13 17:38:12 2004 +++ llvm/lib/System/Win32/Memory.cpp Wed Sep 15 00:49:50 2004 @@ -2,7 +2,7 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by Reid Spencer and is distributed under the +// This file was developed by Jeff Cohen and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// @@ -12,34 +12,43 @@ // //===----------------------------------------------------------------------===// -#include -#include "windows.h" +#include "Win32.h" +#include "llvm/System/Memory.h" +#include "llvm/System/Process.h" namespace llvm { using namespace sys; //===----------------------------------------------------------------------===// -//=== WARNING: Implementation here must contain only Win32 specific code. +//=== WARNING: Implementation here must contain only Win32 specific code +//=== and must not be UNIX code //===----------------------------------------------------------------------===// MemoryBlock Memory::AllocateRWX(unsigned NumBytes) { if (NumBytes == 0) return MemoryBlock(); - unsigned pageSize = Process::GetPageSize(); + static const long pageSize = Process::GetPageSize(); unsigned NumPages = (NumBytes+pageSize-1)/pageSize; - void *P = VirtualAlloc(0, NumPages*pageSize, MEM_COMMIT, - PAGE_EXECUTE_READWRITE); - if (P == 0) { - throw std::string("Couldn't allocate ") + utostr(NumBytes) + - " bytes of executable memory!"; + + void *pa = VirtualAlloc(NULL, NumPages*pageSize, MEM_COMMIT, + PAGE_EXECUTE_READWRITE); + if (pa == NULL) { + ThrowError("Can't allocate RWX Memory: "); } + MemoryBlock result; - result.Address = P; - result.Size = NumBytes; + result.Address = pa; + result.Size = NumPages*pageSize; return result; } void Memory::ReleaseRWX(MemoryBlock& M) { if (M.Address == 0 || M.Size == 0) return; - VirtualFree(M.Address, M.Size, MEM_DECOMMIT, PAGE_NOACCESS); + if (!VirtualFree(M.Address, 0, MEM_RELEASE)) { + ThrowError("Can't release RWX Memory: "); + } } + +} + +// vim: sw=2 smartindent smarttab tw=80 autoindent expandtab Index: llvm/lib/System/Win32/Path.cpp diff -u llvm/lib/System/Win32/Path.cpp:1.1 llvm/lib/System/Win32/Path.cpp:1.2 --- llvm/lib/System/Win32/Path.cpp:1.1 Fri Sep 10 23:59:30 2004 +++ llvm/lib/System/Win32/Path.cpp Wed Sep 15 00:49:50 2004 @@ -1,10 +1,12 @@ -//===- Win32/Path.cpp - Win32 Path Implementation ---------------*- C++ -*-===// -// +//===- llvm/System/Linux/Path.cpp - Linux Path Implementation ---*- C++ -*-===// +// // The LLVM Compiler Infrastructure // -// This file was developed by Reid Spencer and is distributed under the +// This file was developed by Reid Spencer and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. -// +// +// Modified by Henrik Bach to comply with at least MinGW. +// //===----------------------------------------------------------------------===// // // This file provides the Win32 specific implementation of the Path class. @@ -12,22 +14,343 @@ //===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===// -//=== WARNING: Implementation here must contain only Win32 specific code -//=== and must not be generic UNIX code (see ../Unix/Path.cpp) +//=== WARNING: Implementation here must contain only generic Win32 code that +//=== is guaranteed to work on *all* Win32 variants. //===----------------------------------------------------------------------===// -// Include the generic Unix implementation -#include "../Unix/Path.cpp" +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define MAXPATHLEN PATH_MAX namespace llvm { -using namespace sys; +namespace sys { + +bool +Path::is_valid() const { + if (path.empty()) + return false; +/*hb: char pathname[MAXPATHLEN]; + if (0 == realpath(path.c_str(), pathname)) + if (errno != EACCES && errno != EIO && errno != ENOENT && errno != +ENOTDIR) + return false;*/ + return true; +} + +Path +Path::GetTemporaryDirectory() { + char pathname[MAXPATHLEN]; + if (0 == GetTempPath(MAXPATHLEN,pathname)) + ThrowError(std::string(pathname) + ": Can't create temporary directory"); + Path result; + result.set_directory(pathname); + assert(result.is_valid() && "GetTempPath didn't create a valid pathname!"); + return result; +} + +Path::Path(std::string unverified_path) + : path(unverified_path) +{ + if (unverified_path.empty()) + return; + if (this->is_valid()) + return; + // oops, not valid. + path.clear(); + ThrowError(unverified_path + ": path is not valid"); +} + +Path +Path::GetRootDirectory() { + Path result; + result.set_directory("/"); + return result; +} + +Path +Path::GetSystemLibraryPath1() { + return Path("/lib/"); +} + +Path +Path::GetSystemLibraryPath2() { + return Path("/usr/lib/"); +} +Path +Path::GetLLVMDefaultConfigDir() { + return Path("/etc/llvm/"); +} + +Path +Path::GetLLVMConfigDir() { + Path result; + if (result.set_directory(LLVM_ETCDIR)) + return result; + return GetLLVMDefaultConfigDir(); +} + +Path +Path::GetUserHomeDirectory() { + const char* home = getenv("HOME"); + if (home) { + Path result; + if (result.set_directory(home)) + return result; + } + return GetRootDirectory(); +} + +bool +Path::exists() const { + return 0 == access(path.c_str(), F_OK ); +} + +bool +Path::readable() const { + return 0 == access(path.c_str(), F_OK | R_OK ); +} + +bool +Path::writable() const { + return 0 == access(path.c_str(), F_OK | W_OK ); +} + +bool +Path::executable() const { + return 0 == access(path.c_str(), R_OK | X_OK ); +} std::string -Path::GetDLLSuffix() { - return "dll"; +Path::getLast() const { + // Find the last slash + size_t pos = path.rfind('/'); + + // Handle the corner cases + if (pos == std::string::npos) + return path; + + // If the last character is a slash + if (pos == path.length()-1) { + // Find the second to last slash + size_t pos2 = path.rfind('/', pos-1); + if (pos2 == std::string::npos) + return path.substr(0,pos); + else + return path.substr(pos2+1,pos-pos2-1); + } + // Return everything after the last slash + return path.substr(pos+1); +} + +bool +Path::set_directory(const std::string& a_path) { + if (a_path.size() == 0) + return false; + Path save(*this); + path = a_path; + size_t last = a_path.size() -1; + if (last != 0 && a_path[last] != '/') + path += '/'; + if (!is_valid()) { + path = save.path; + return false; + } + return true; } +bool +Path::set_file(const std::string& a_path) { + if (a_path.size() == 0) + return false; + Path save(*this); + path = a_path; + size_t last = a_path.size() - 1; + while (last > 0 && a_path[last] == '/') + last--; + path.erase(last+1); + if (!is_valid()) { + path = save.path; + return false; + } + return true; +} + +bool +Path::append_directory(const std::string& dir) { + if (is_file()) + return false; + Path save(*this); + path += dir; + path += "/"; + if (!is_valid()) { + path = save.path; + return false; + } + return true; +} + +bool +Path::elide_directory() { + if (is_file()) + return false; + size_t slashpos = path.rfind('/',path.size()); + if (slashpos == 0 || slashpos == std::string::npos) + return false; + if (slashpos == path.size() - 1) + slashpos = path.rfind('/',slashpos-1); + if (slashpos == std::string::npos) + return false; + path.erase(slashpos); + return true; +} + +bool +Path::append_file(const std::string& file) { + if (!is_directory()) + return false; + Path save(*this); + path += file; + if (!is_valid()) { + path = save.path; + return false; + } + return true; +} + +bool +Path::elide_file() { + if (is_directory()) + return false; + size_t slashpos = path.rfind('/',path.size()); + if (slashpos == std::string::npos) + return false; + path.erase(slashpos+1); + return true; +} + +bool +Path::append_suffix(const std::string& suffix) { + if (is_directory()) + return false; + Path save(*this); + path.append("."); + path.append(suffix); + if (!is_valid()) { + path = save.path; + return false; + } + return true; +} + +bool +Path::elide_suffix() { + if (is_directory()) return false; + size_t dotpos = path.rfind('.',path.size()); + size_t slashpos = path.rfind('/',path.size()); + if (slashpos != std::string::npos && dotpos != std::string::npos && + dotpos > slashpos) { + path.erase(dotpos, path.size()-dotpos); + return true; + } + return false; +} + + +bool +Path::create_directory( bool create_parents) { + // Make sure we're dealing with a directory + if (!is_directory()) return false; + + // Get a writeable copy of the path name + char pathname[MAXPATHLEN]; + path.copy(pathname,MAXPATHLEN); + + // Null-terminate the last component + int lastchar = path.length() - 1 ; + if (pathname[lastchar] == '/') + pathname[lastchar] = 0; + + // If we're supposed to create intermediate directories + if ( create_parents ) { + // Find the end of the initial name component + char * next = strchr(pathname,'/'); + if ( pathname[0] == '/') + next = strchr(&pathname[1],'/'); + + // Loop through the directory components until we're done + while ( next != 0 ) { + *next = 0; + if (0 != access(pathname, F_OK | R_OK | W_OK)) + if (0 != mkdir(pathname)) + ThrowError(std::string(pathname) + ": Can't create directory"); + char* save = next; + next = strchr(pathname,'/'); + *save = '/'; + } + } else if (0 != mkdir(pathname)) { + ThrowError(std::string(pathname) + ": Can't create directory"); + } + return true; +} + +bool +Path::create_file() { + // Make sure we're dealing with a file + if (!is_file()) return false; + + // Create the file + if (0 != creat(path.c_str(), S_IRUSR | S_IWUSR)) + ThrowError(std::string(path.c_str()) + ": Can't create file"); + + return true; +} + +bool +Path::destroy_directory(bool remove_contents) { + // Make sure we're dealing with a directory + if (!is_directory()) return false; + + // If it doesn't exist, we're done. + if (!exists()) return true; + + if (remove_contents) { + // Recursively descend the directory to remove its content + std::string cmd("/bin/rm -rf "); + cmd += path; + system(cmd.c_str()); + } else { + // Otherwise, try to just remove the one directory + char pathname[MAXPATHLEN]; + path.copy(pathname,MAXPATHLEN); + int lastchar = path.length() - 1 ; + if (pathname[lastchar] == '/') + pathname[lastchar] = 0; + if ( 0 != rmdir(pathname)) + ThrowError(std::string(pathname) + ": Can't destroy directory"); + } + return true; +} + +bool +Path::destroy_file() { + if (!is_file()) return false; + if (0 != unlink(path.c_str())) + ThrowError(std::string(path.c_str()) + ": Can't destroy file"); + return true; +} + +} } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab + Index: llvm/lib/System/Win32/Program.cpp diff -u llvm/lib/System/Win32/Program.cpp:1.1 llvm/lib/System/Win32/Program.cpp:1.2 --- llvm/lib/System/Win32/Program.cpp:1.1 Sun Aug 29 14:20:41 2004 +++ llvm/lib/System/Win32/Program.cpp Wed Sep 15 00:49:50 2004 @@ -1,8 +1,8 @@ -//===- Win32/Program.cpp - Win32 Program Implelementation ----- -*- C++ -*-===// +//===- Win32/Program.cpp - Win32 Program Implementation ------- -*- C++ -*-===// // // The LLVM Compiler Infrastructure // -// This file was developed by Reid Spencer and is distributed under the +// This file was developed by Jeff Cohen and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// @@ -11,9 +11,143 @@ // //===----------------------------------------------------------------------===// +// Include the generic Unix implementation +#include "Win32.h" +#include "llvm/System/Program.h" +#include + //===----------------------------------------------------------------------===// -//=== WARNING: Implementation here must contain only generic Win32 code that -//=== is guaranteed to work on *all* Win32 variants. +//=== WARNING: Implementation here must contain only Win32 specific code +//=== and must not be UNIX code //===----------------------------------------------------------------------===// +namespace llvm { +using namespace sys; + +// This function just uses the PATH environment variable to find the program. +Path +Program::FindProgramByName(const std::string& progName) { + + // Check some degenerate cases + if (progName.length() == 0) // no program + return Path(); + Path temp; + if (!temp.set_file(progName)) // invalid name + return Path(); + if (temp.executable()) // already executable as is + return temp; + + // At this point, the file name is valid and its not executable. + // Let Windows search for it. + char buffer[MAX_PATH]; + char *dummy = NULL; + DWORD len = SearchPath(NULL, progName.c_str(), ".exe", MAX_PATH, + buffer, &dummy); + + // See if it wasn't found. + if (len == 0) + return Path(); + + // See if we got the entire path. + if (len < MAX_PATH) + return Path(buffer); + + // Buffer was too small; grow and retry. + while (true) { + char *b = reinterpret_cast(_alloca(len+1)); + DWORD len2 = SearchPath(NULL, progName.c_str(), ".exe", len+1, b, &dummy); + + // It is unlikely the search failed, but it's always possible some file + // was added or removed since the last search, so be paranoid... + if (len2 == 0) + return Path(); + else if (len2 <= len) + return Path(b); + + len = len2; + } +} + +// +int +Program::ExecuteAndWait(const Path& path, + const std::vector& args) { + if (!path.executable()) + throw path.get() + " is not executable"; + + // Windows wants a command line, not an array of args, to pass to the new + // process. We have to concatenate them all, while quoting the args that + // have embedded spaces. + + // First, determine the length of the command line. + std::string progname(path.getLast()); + unsigned len = progname.length() + 1; + if (progname.find(' ') != std::string::npos) + len += 2; + + for (unsigned i = 0; i < args.size(); i++) { + len += args[i].length() + 1; + if (args[i].find(' ') != std::string::npos) + len += 2; + } + + // Now build the command line. + char *command = reinterpret_cast(_alloca(len)); + char *p = command; + + bool needsQuoting = progname.find(' ') != std::string::npos; + if (needsQuoting) + *p++ = '"'; + memcpy(p, progname.c_str(), progname.length()); + p += progname.length(); + if (needsQuoting) + *p++ = '"'; + *p++ = ' '; + + for (unsigned i = 0; i < args.size(); i++) { + const std::string& arg = args[i]; + needsQuoting = arg.find(' ') != std::string::npos; + if (needsQuoting) + *p++ = '"'; + memcpy(p, arg.c_str(), arg.length()); + p += arg.length(); + if (needsQuoting) + *p++ = '"'; + *p++ = ' '; + } + + *p = 0; + + // Create a child process. + STARTUPINFO si; + memset(&si, 0, sizeof(si)); + si.cb = sizeof(si); + + PROCESS_INFORMATION pi; + memset(&pi, 0, sizeof(pi)); + + if (!CreateProcess(path.get().c_str(), command, NULL, NULL, FALSE, 0, + NULL, NULL, &si, &pi)) + { + ThrowError(std::string("Couldn't execute program '") + path.get() + "'"); + } + + // Wait for it to terminate. + WaitForSingleObject(pi.hProcess, INFINITE); + + // Get its exit status. + DWORD status; + BOOL rc = GetExitCodeProcess(pi.hProcess, &status); + + // Done with the handles; go close them. + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + + if (!rc) + ThrowError(std::string("Failed getting status for program '") + path.get() + "'"); + + return status; +} + +} // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From alkis at cs.uiuc.edu Wed Sep 15 01:11:19 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 15 Sep 2004 01:11:19 -0500 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200409150611.BAA26229@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.98 -> 1.99 --- Log message: Since we have it use the method decriptor to name the temporary holding the virtual function pointer. --- Diffs of the changes: (+1 -1) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.98 llvm-java/lib/Compiler/Compiler.cpp:1.99 --- llvm-java/lib/Compiler/Compiler.cpp:1.98 Tue Sep 14 23:13:25 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Wed Sep 15 01:11:08 2004 @@ -1148,7 +1148,7 @@ unsigned vSlot = vi.m2iMap.find(methodDescr)->second; indices.push_back(ConstantUInt::get(Type::UIntTy, vSlot)); Value* vfunPtr = new GetElementPtrInst(vtable, indices, TMP, getBBAt(bcI)); - Value* vfun = new LoadInst(vfunPtr, TMP, getBBAt(bcI)); + Value* vfun = new LoadInst(vfunPtr, methodDescr, getBBAt(bcI)); makeCall(vfun, getBBAt(bcI)); } From reid at x10sys.com Wed Sep 15 01:20:04 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Sep 2004 01:20:04 -0500 Subject: [llvm-commits] CVS: llvm/projects/Stacker/autoconf/configure.ac Message-ID: <200409150620.BAA26287@zion.cs.uiuc.edu> Changes in directory llvm/projects/Stacker/autoconf: configure.ac updated: 1.2 -> 1.3 --- Log message: Attempt to solve the libtool problem on Solaris. --- Diffs of the changes: (+14 -3) Index: llvm/projects/Stacker/autoconf/configure.ac diff -u llvm/projects/Stacker/autoconf/configure.ac:1.2 llvm/projects/Stacker/autoconf/configure.ac:1.3 --- llvm/projects/Stacker/autoconf/configure.ac:1.2 Sun Sep 5 11:42:30 2004 +++ llvm/projects/Stacker/autoconf/configure.ac Wed Sep 15 01:19:53 2004 @@ -6,7 +6,8 @@ dnl Place all of the extra autoconf files into the config subdirectory AC_CONFIG_AUX_DIR([autoconf]) -dnl Configure a header file +dnl Verify that the source directory is valid +AC_CONFIG_SRCDIR([Makefile.common.in]) dnl Configure Makefiles dnl List every Makefile that ecists within your source tree @@ -26,9 +27,19 @@ dnl ************************************************************************** dnl * Check for programs. dnl ************************************************************************** +AC_PROG_LIBTOOL +dnl Get libtool's idea of what the shared library suffix is. +dnl (This is a hack; it relies on undocumented behavior.) +AC_MSG_CHECKING([for shared library suffix]) +eval "SHLIBEXT=$shrext" +AC_MSG_RESULT($SHLIBEXT) +dnl Propagate it to the Makefiles and config.h (for gccld & bugpoint). +AC_SUBST(SHLIBEXT,$SHLIBEXT) +AC_DEFINE_UNQUOTED(SHLIBEXT,"$SHLIBEXT", + [Extension that shared libraries have, + e.g., ".so".]) + -dnl Verify that the source directory is valid -AC_CONFIG_SRCDIR([Makefile.common.in]) dnl ************************************************************************** dnl * Check for libraries. From reid at x10sys.com Wed Sep 15 01:20:04 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Sep 2004 01:20:04 -0500 Subject: [llvm-commits] CVS: llvm/projects/Stacker/configure Message-ID: <200409150620.BAA26290@zion.cs.uiuc.edu> Changes in directory llvm/projects/Stacker: configure updated: 1.2 -> 1.3 --- Log message: Attempt to solve the libtool problem on Solaris. --- Diffs of the changes: (+16906 -1) Index: llvm/projects/Stacker/configure diff -u llvm/projects/Stacker/configure:1.2 llvm/projects/Stacker/configure:1.3 --- llvm/projects/Stacker/configure:1.2 Sun Sep 5 11:42:30 2004 +++ llvm/projects/Stacker/configure Wed Sep 15 01:19:53 2004 @@ -243,6 +243,160 @@ $as_unset CDPATH + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +echo=${ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +tagnames=`echo "$tagnames,CXX" | sed 's/^,//'` + +tagnames=`echo "$tagnames,F77" | sed 's/^,//'` + # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. @@ -274,7 +428,44 @@ PACKAGE_BUGREPORT='rspencer at x10sys.com' ac_unique_file="Makefile.common.in" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_SRC LLVM_OBJ LIBOBJS LTLIBOBJS' +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CPP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL SHLIBEXT LLVM_SRC LLVM_OBJ LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -715,6 +906,46 @@ ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_CXXCPP_set=${CXXCPP+set} +ac_env_CXXCPP_value=$CXXCPP +ac_cv_env_CXXCPP_set=${CXXCPP+set} +ac_cv_env_CXXCPP_value=$CXXCPP +ac_env_F77_set=${F77+set} +ac_env_F77_value=$F77 +ac_cv_env_F77_set=${F77+set} +ac_cv_env_F77_value=$F77 +ac_env_FFLAGS_set=${FFLAGS+set} +ac_env_FFLAGS_value=$FFLAGS +ac_cv_env_FFLAGS_set=${FFLAGS+set} +ac_cv_env_FFLAGS_value=$FFLAGS # # Report the --help message. @@ -775,6 +1006,10 @@ _ACEOF cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi @@ -784,12 +1019,45 @@ esac cat <<\_ACEOF +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-shared[=PKGS] + build shared libraries [default=yes] + --enable-static[=PKGS] + build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-tags[=TAGS] + include additional configurations [automatic] --with-llvmsrc Location of LLVM Source Code --with-llvmobj Location of LLVM Object Code +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + F77 Fortran 77 compiler command + FFLAGS Fortran 77 compiler flags + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + Report bugs to . _ACEOF fi @@ -1265,6 +1533,7 @@ + ac_config_commands="$ac_config_commands Makefile" @@ -1288,6 +1557,16608 @@ +# Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi; + +# Check whether --enable-static or --disable-static was given. +if test "${enable_static+set}" = set; then + enableval="$enable_static" + p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi; + +# Check whether --enable-fast-install or --disable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval="$enable_fast_install" + p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi; + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && break + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +SED=$lt_cv_path_SED + +fi + +echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `"$LD" -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' + +echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/${ac_tool_prefix}nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + esac + fi + done + IFS="$lt_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi +echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6 +NM="$lt_cv_path_NM" + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi4*) + 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_test_file=/shlib/libc.so + ;; + +cygwin* | mingw* | pw32*) + # win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='win32_libid' + ;; + +darwin* | rhapsody*) + # this will be overwritten by pass_all, but leave it in just in case + lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' + lt_cv_file_magic_cmd='/usr/bin/file -L' + case "$host_os" in + rhapsody* | darwin1.[012]) + lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System` + ;; + *) # Darwin 1.3 on + lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' + ;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case "$host_cpu" in + 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_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + irix5* | nonstopux*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + case $host_cpu in + alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + 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_test_file=/usr/lib/libnls.so + ;; + +nto-qnx) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' + else + lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' + fi + ;; + +osf3* | osf4* | osf5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 3115 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; + +esac + +need_locks="$enable_libtool_lock" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in dlfcn.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ---------------------------------- ## +## Report this to rspencer at x10sys.com ## +## ---------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cxx_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6 +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$F77"; then + ac_cv_prog_F77="$F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_F77="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_F77"; then + ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_F77="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_F77" && break +done + + F77=$ac_ct_F77 +fi + + +# Provide some information about the compiler. +echo "$as_me:4578:" \ + "checking for Fortran 77 compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +rm -f a.out + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 +if test "${ac_cv_f77_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 +ac_ext=$ac_save_ext +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_f77_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_f77_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_f77_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 +if test "$ac_test_FFLAGS" = set; then + FFLAGS=$ac_save_FFLAGS +elif test $ac_cv_prog_f77_g = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi +else + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-O2" + else + FFLAGS= + fi +fi + +G77=`test $ac_compiler_gnu = yes && echo yes` +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + +# find the maximum length of command line arguments +echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + testring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \ + = "XX$testring") >/dev/null 2>&1 && + new_result=`expr "X$testring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + testring=$testring$testring + done + testring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 +else + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 +fi + + + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris* | sysv5*) + symcode='[BDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGISTW]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6 +else + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 +fi + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6 +objdir=$lt_cv_objdir + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=mklib +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +else + AR="$ac_cv_prog_AR" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool at gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool at gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +enable_dlopen=no +enable_win32_dll=no + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + + +# Check whether --with-pic or --without-pic was given. +if test "${with_pic+set}" = set; then + withval="$with_pic" + pic_mode="$withval" +else + pic_mode=default +fi; +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# +# Check for any special shared library compilation flags. +# +lt_prog_cc_shlib= +if test "$GCC" = no; then + case $host_os in + sco3.2v5*) + lt_prog_cc_shlib='-belf' + ;; + esac +fi +if test -n "$lt_prog_cc_shlib"; then + { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 +echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} + if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : + else + { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 +echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} + lt_cv_prog_cc_can_build_shared=no + fi +fi + + +# +# Check to make sure the static flag actually works. +# +echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_prog_compiler_static" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:5609: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:5613: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + linux*) + case $CC in + icc|ecc) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + ccc) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + sco3.2v5*) + lt_prog_compiler_pic='-Kpic' + lt_prog_compiler_static='-dn' + ;; + + solaris*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:5841: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:5845: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_prog_compiler_pic_works=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 + +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + # According to Tom Tromey, Ian Lance Taylor reported there are C compilers + # that will create temporary files in the current directory regardless of + # the output directory. Thus, making CWD read-only will cause this test + # to fail, enabling locking or at least warning the user not to do parallel + # builds. + chmod -w . + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:5908: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:5912: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag= + enable_shared_with_static_runtimes=no + archive_cmds= + archive_expsym_cmds= + old_archive_From_new_cmds= + old_archive_from_expsyms_cmds= + export_dynamic_flag_spec= + whole_archive_flag_spec= + thread_safe_flag_spec= + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_direct=no + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + link_all_deplibs=unknown + hardcode_automatic=no + module_cmds= + module_expsym_cmds= + always_export_symbols=no + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = yes; then + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + + if test "$GCC" = yes; then + case $host_os in aix4.012|aix4.012.*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec=' ' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + bsdi4*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + archive_cmds_need_lc=no + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag='-flat_namespace -undefined suppress' + ;; + esac + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. Also zsh mangles + # `"' quotes if we put them in here... so don't! + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds='$CC -r ${wl}-bind_at_load -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' + fi + module_cmds='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='-all_load $convenience' + link_all_deplibs=yes + fi + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + ia64*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=no + hardcode_shlibpath_var=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + *) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld='-rpath $libdir' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + + sco3.2v5*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag=' -z text' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=no + hardcode_shlibpath_var=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + no_undefined_flag='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv5*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec= + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6 +test "$ld_shlibs" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var " || \ + test "X$hardcode_automatic"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6 + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # 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}' + sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # 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}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.01* | freebsdelf3.01*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# Report which librarie types wil actually be built +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + archive_cmds_need_lc=no + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag='-flat_namespace -undefined suppress' + ;; + esac + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. Also zsh mangles + # `"' quotes if we put them in here... so don't! + output_verbose_link_cmd='echo' + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='-all_load $convenience' + link_all_deplibs=yes + fi + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler \ + CC \ + LD \ + lt_prog_compiler_wl \ + lt_prog_compiler_pic \ + lt_prog_compiler_static \ + lt_prog_compiler_no_builtin_flag \ + export_dynamic_flag_spec \ + thread_safe_flag_spec \ + whole_archive_flag_spec \ + enable_shared_with_static_runtimes \ + old_archive_cmds \ + old_archive_from_new_cmds \ + predep_objects \ + postdep_objects \ + predeps \ + postdeps \ + compiler_lib_search_path \ + archive_cmds \ + archive_expsym_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + old_archive_from_expsyms_cmds \ + allow_undefined_flag \ + no_undefined_flag \ + export_symbols_cmds \ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ + hardcode_automatic \ + module_cmds \ + module_expsym_cmds \ + lt_cv_prog_compiler_c_o \ + exclude_expsyms \ + include_expsyms; do + + case $var in + old_archive_cmds | \ + old_archive_from_new_cmds | \ + archive_cmds | \ + archive_expsym_cmds | \ + module_cmds | \ + module_expsym_cmds | \ + old_archive_from_expsyms_cmds | \ + export_symbols_cmds | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + { echo "$as_me:$LINENO: creating $ofile" >&5 +echo "$as_me: creating $ofile" >&6;} + + cat <<__EOF__ >> "$cfgfile" +#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# 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 2 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext='$shrext' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# ### END LIBTOOL CONFIG + +__EOF__ + + + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + +# Check whether --with-tags or --without-tags was given. +if test "${with_tags+set}" = set; then + withval="$with_tags" + tagnames="$withval" +fi; + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + else + { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + fi + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in + "") ;; + *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +echo "$as_me: error: invalid tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} + { (exit 1); exit 1; }; } + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && test "X$CXX" != "Xno"; then + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_flag_spec_ld_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_automatic_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +# Source file extension for C++ test sources. +ac_ext=cc + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +compiler_CXX=$CC +cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +else + lt_prog_compiler_no_builtin_flag_CXX= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `"$LD" -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 +ld_shlibs_CXX=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes; then + case $host_os in aix4.012|aix4.012.*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_CXX=yes + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols_CXX=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX=' ' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs_CXX=no + fi + ;; + + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + archive_cmds_need_lc_CXX=no + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag_CXX='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_CXX='-flat_namespace -undefined suppress' + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$CC -r ${wl}-bind_at_load -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' + fi + module_cmds_CXX='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' + + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='-all_load $convenience' + link_all_deplibs_CXX=yes + fi + ;; + + dgux*) + case $cc_basename in + ec++) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd12*) + # C++ shared libraries reported to be fairly broken before switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + freebsd*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + gnu*) + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC) + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + hardcode_libdir_separator_CXX=: + ;; + ia64*) + hardcode_libdir_flag_spec_CXX='-L$libdir' + ;; + *) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case "$host_cpu" in + hppa*64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + *) + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC) + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case "$host_cpu" in + ia64*|hppa*64*) + archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + irix5* | irix6*) + case $cc_basename in + CC) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + ;; + linux*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc) + # Intel C++ + with_gnu_ld=yes + archive_cmds_need_lc_CXX=no + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + cxx) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + mvs*) + case $cc_basename in + cxx) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + osf3*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ + $rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + sco*) + archive_cmds_need_lc_CXX=no + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.0-5 | solaris2.0-5.*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + archive_cmds_need_lc_CXX=no + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; +esac +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +GCC_CXX="$GXX" +LD_CXX="$LD" + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... + +cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + # The `*' in the case matches for architectures that use `case' in + # $output_verbose_cmd can trigger glob expansion during the loop + # eval without this substitution. + output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" + + for p in `eval $output_verbose_link_cmd`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" \ + || test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$rm -f confest.$objext + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + +lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + cxx) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + sco*) + case $cc_basename in + CC) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + *) + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + unixware*) + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:10280: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:10284: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_prog_compiler_pic_works_CXX=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 + +if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + # According to Tom Tromey, Ian Lance Taylor reported there are C compilers + # that will create temporary files in the current directory regardless of + # the output directory. Thus, making CWD read-only will cause this test + # to fail, enabling locking or at least warning the user not to do parallel + # builds. + chmod -w . + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:10347: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:10351: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || \ + test -n "$runpath_var CXX" || \ + test "X$hardcode_automatic_CXX"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$hardcode_action_CXX" >&6 + +if test "$hardcode_action_CXX" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # 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}' + sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # 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}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.01* | freebsdelf3.01*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_CXX \ + CC_CXX \ + LD_CXX \ + lt_prog_compiler_wl_CXX \ + lt_prog_compiler_pic_CXX \ + lt_prog_compiler_static_CXX \ + lt_prog_compiler_no_builtin_flag_CXX \ + export_dynamic_flag_spec_CXX \ + thread_safe_flag_spec_CXX \ + whole_archive_flag_spec_CXX \ + enable_shared_with_static_runtimes_CXX \ + old_archive_cmds_CXX \ + old_archive_from_new_cmds_CXX \ + predep_objects_CXX \ + postdep_objects_CXX \ + predeps_CXX \ + postdeps_CXX \ + compiler_lib_search_path_CXX \ + archive_cmds_CXX \ + archive_expsym_cmds_CXX \ + postinstall_cmds_CXX \ + postuninstall_cmds_CXX \ + old_archive_from_expsyms_cmds_CXX \ + allow_undefined_flag_CXX \ + no_undefined_flag_CXX \ + export_symbols_cmds_CXX \ + hardcode_libdir_flag_spec_CXX \ + hardcode_libdir_flag_spec_ld_CXX \ + hardcode_libdir_separator_CXX \ + hardcode_automatic_CXX \ + module_cmds_CXX \ + module_expsym_cmds_CXX \ + lt_cv_prog_compiler_c_o_CXX \ + exclude_expsyms_CXX \ + include_expsyms_CXX; do + + case $var in + old_archive_cmds_CXX | \ + old_archive_from_new_cmds_CXX | \ + archive_cmds_CXX | \ + archive_expsym_cmds_CXX | \ + module_cmds_CXX | \ + module_expsym_cmds_CXX | \ + old_archive_from_expsyms_cmds_CXX | \ + export_symbols_cmds_CXX | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_CXX + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext='$shrext' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_CXX +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_CXX + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_CXX" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld + + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + + +archive_cmds_need_lc_F77=no +allow_undefined_flag_F77= +always_export_symbols_F77=no +archive_expsym_cmds_F77= +export_dynamic_flag_spec_F77= +hardcode_direct_F77=no +hardcode_libdir_flag_spec_F77= +hardcode_libdir_flag_spec_ld_F77= +hardcode_libdir_separator_F77= +hardcode_minus_L_F77=no +hardcode_automatic_F77=no +module_cmds_F77= +module_expsym_cmds_F77= +link_all_deplibs_F77=unknown +old_archive_cmds_F77=$old_archive_cmds +no_undefined_flag_F77= +whole_archive_flag_spec_F77= +enable_shared_with_static_runtimes_F77=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +objext_F77=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code=" subroutine t\n return\n end\n" + +# Code to be used in simple link tests +lt_simple_link_test_code=" program t\n end\n" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +compiler_F77=$CC +cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` + +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; +aix4*) + test "$enable_shared" = yes && enable_static=no + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + +test "$ld_shlibs_F77" = no && can_build_shared=no + +GCC_F77="$G77" +LD_F77="$LD" + +lt_prog_compiler_wl_F77= +lt_prog_compiler_pic_F77= +lt_prog_compiler_static_F77= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_static_F77='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_F77='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_F77=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_F77=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_F77='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + else + lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_F77='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_F77='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + linux*) + case $CC in + icc|ecc) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-static' + ;; + ccc) + lt_prog_compiler_wl_F77='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_F77='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + + sco3.2v5*) + lt_prog_compiler_pic_F77='-Kpic' + lt_prog_compiler_static_F77='-dn' + ;; + + solaris*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sunos4*) + lt_prog_compiler_wl_F77='-Qoption ld ' + lt_prog_compiler_pic_F77='-PIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_F77='-Kconform_pic' + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_F77"; then + echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_F77=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_F77" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:12596: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:12600: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_prog_compiler_pic_works_F77=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 + +if test x"$lt_prog_compiler_pic_works_F77" = xyes; then + case $lt_prog_compiler_pic_F77 in + "" | " "*) ;; + *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; + esac +else + lt_prog_compiler_pic_F77= + lt_prog_compiler_can_build_shared_F77=no +fi + +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_F77= + ;; + *) + lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" + ;; +esac + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_F77=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + # According to Tom Tromey, Ian Lance Taylor reported there are C compilers + # that will create temporary files in the current directory regardless of + # the output directory. Thus, making CWD read-only will cause this test + # to fail, enabling locking or at least warning the user not to do parallel + # builds. + chmod -w . + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:12663: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:12667: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + lt_cv_prog_compiler_c_o_F77=yes + fi + fi + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag_F77= + enable_shared_with_static_runtimes_F77=no + archive_cmds_F77= + archive_expsym_cmds_F77= + old_archive_From_new_cmds_F77= + old_archive_from_expsyms_cmds_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + thread_safe_flag_spec_F77= + hardcode_libdir_flag_spec_F77= + hardcode_libdir_flag_spec_ld_F77= + hardcode_libdir_separator_F77= + hardcode_direct_F77=no + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=unsupported + link_all_deplibs_F77=unknown + hardcode_automatic_F77=no + module_cmds_F77= + module_expsym_cmds_F77= + always_export_symbols_F77=no + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_F77= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_F77=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_F77=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_F77=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_F77='-L$libdir' + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=no + enable_shared_with_static_runtimes_F77=yes + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + sunos4*) + archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + + if test "$ld_shlibs_F77" = yes; then + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_F77='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_F77= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=yes + archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_F77=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_F77=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_F77='' + hardcode_direct_F77=yes + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + + if test "$GCC" = yes; then + case $host_os in aix4.012|aix4.012.*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_F77=yes + else + # We have old collect2 + hardcode_direct_F77=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_F77=yes + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_libdir_separator_F77= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_F77=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_F77='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_F77="-z nodefs" + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_f77_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_F77=' ${wl}-bernotok' + allow_undefined_flag_F77=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols_F77=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_F77=' ' + archive_cmds_need_lc_F77=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_F77=no + ;; + + bsdi4*) + export_dynamic_flag_spec_F77=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_F77=' ' + allow_undefined_flag_F77=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_F77='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_F77=yes + ;; + + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + archive_cmds_need_lc_F77=no + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag_F77='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_F77='-flat_namespace -undefined suppress' + ;; + esac + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. Also zsh mangles + # `"' quotes if we put them in here... so don't! + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_F77='$CC -r ${wl}-bind_at_load -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' + fi + module_cmds_F77='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + hardcode_direct_F77=no + hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=unsupported + whole_archive_flag_spec_F77='-all_load $convenience' + link_all_deplibs_F77=yes + fi + ;; + + dgux*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + freebsd1*) + ld_shlibs_F77=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld_F77='+b $libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + ;; + ia64*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + *) + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + link_all_deplibs_F77=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + newsos6) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_shlibpath_var_F77=no + ;; + + openbsd*) + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + allow_undefined_flag_F77=unsupported + archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_F77='-rpath $libdir' + fi + hardcode_libdir_separator_F77=: + ;; + + sco3.2v5*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag_F77=' -z text' + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_shlibpath_var_F77=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + esac + link_all_deplibs_F77=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_F77='$CC -r -o $output$reload_objs' + hardcode_direct_F77=no + ;; + motorola) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv4.3*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_F77=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + no_undefined_flag_F77='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv5*) + no_undefined_flag_F77=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec_F77= + hardcode_shlibpath_var_F77=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + *) + ld_shlibs_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6 +test "$ld_shlibs_F77" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_F77" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_F77=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_F77 in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_F77 + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_F77 + allow_undefined_flag_F77= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_F77=no + else + archive_cmds_need_lc_F77=yes + fi + allow_undefined_flag_F77=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_F77= +if test -n "$hardcode_libdir_flag_spec_F77" || \ + test -n "$runpath_var F77" || \ + test "X$hardcode_automatic_F77"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_F77" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && + test "$hardcode_minus_L_F77" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_F77=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_F77=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_F77=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$hardcode_action_F77" >&6 + +if test "$hardcode_action_F77" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # 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}' + sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # 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}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.01* | freebsdelf3.01*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_F77 \ + CC_F77 \ + LD_F77 \ + lt_prog_compiler_wl_F77 \ + lt_prog_compiler_pic_F77 \ + lt_prog_compiler_static_F77 \ + lt_prog_compiler_no_builtin_flag_F77 \ + export_dynamic_flag_spec_F77 \ + thread_safe_flag_spec_F77 \ + whole_archive_flag_spec_F77 \ + enable_shared_with_static_runtimes_F77 \ + old_archive_cmds_F77 \ + old_archive_from_new_cmds_F77 \ + predep_objects_F77 \ + postdep_objects_F77 \ + predeps_F77 \ + postdeps_F77 \ + compiler_lib_search_path_F77 \ + archive_cmds_F77 \ + archive_expsym_cmds_F77 \ + postinstall_cmds_F77 \ + postuninstall_cmds_F77 \ + old_archive_from_expsyms_cmds_F77 \ + allow_undefined_flag_F77 \ + no_undefined_flag_F77 \ + export_symbols_cmds_F77 \ + hardcode_libdir_flag_spec_F77 \ + hardcode_libdir_flag_spec_ld_F77 \ + hardcode_libdir_separator_F77 \ + hardcode_automatic_F77 \ + module_cmds_F77 \ + module_expsym_cmds_F77 \ + lt_cv_prog_compiler_c_o_F77 \ + exclude_expsyms_F77 \ + include_expsyms_F77; do + + case $var in + old_archive_cmds_F77 | \ + old_archive_from_new_cmds_F77 | \ + archive_cmds_F77 | \ + archive_expsym_cmds_F77 | \ + module_cmds_F77 | \ + module_expsym_cmds_F77 | \ + old_archive_from_expsyms_cmds_F77 | \ + export_symbols_cmds_F77 | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_F77 + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_F77 + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_F77 + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_F77 + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_F77 + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext='$shrext' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_F77 +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_F77 + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_F77 +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_F77 +archive_expsym_cmds=$lt_archive_expsym_cmds_F77 +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_F77 +module_expsym_cmds=$lt_module_expsym_cmds_F77 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_F77 + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_F77 + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_F77 + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_F77 + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_F77 + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_F77 + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_F77 + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_F77 + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_F77 + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_F77 + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_F77" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_F77 + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_F77 + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_F77 + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_F77 + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + + + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +objext_GCJ=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +compiler_GCJ=$CC + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +archive_cmds_need_lc_GCJ=no + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... + +lt_prog_compiler_no_builtin_flag_GCJ= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + + echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:14629: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:14633: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl_GCJ= +lt_prog_compiler_pic_GCJ= +lt_prog_compiler_static_GCJ= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_static_GCJ='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_GCJ='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_GCJ=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_GCJ=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_GCJ='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + else + lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + linux*) + case $CC in + icc|ecc) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-static' + ;; + ccc) + lt_prog_compiler_wl_GCJ='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + sco3.2v5*) + lt_prog_compiler_pic_GCJ='-Kpic' + lt_prog_compiler_static_GCJ='-dn' + ;; + + solaris*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sunos4*) + lt_prog_compiler_wl_GCJ='-Qoption ld ' + lt_prog_compiler_pic_GCJ='-PIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_GCJ='-Kconform_pic' + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + uts4*) + lt_prog_compiler_pic_GCJ='-pic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_GCJ"; then + echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_GCJ=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_GCJ" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:14861: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:14865: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + lt_prog_compiler_pic_works_GCJ=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 + +if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then + case $lt_prog_compiler_pic_GCJ in + "" | " "*) ;; + *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; + esac +else + lt_prog_compiler_pic_GCJ= + lt_prog_compiler_can_build_shared_GCJ=no +fi + +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_GCJ= + ;; + *) + lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + ;; +esac + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_GCJ=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + # According to Tom Tromey, Ian Lance Taylor reported there are C compilers + # that will create temporary files in the current directory regardless of + # the output directory. Thus, making CWD read-only will cause this test + # to fail, enabling locking or at least warning the user not to do parallel + # builds. + chmod -w . + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:14928: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:14932: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + lt_cv_prog_compiler_c_o_GCJ=yes + fi + fi + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag_GCJ= + enable_shared_with_static_runtimes_GCJ=no + archive_cmds_GCJ= + archive_expsym_cmds_GCJ= + old_archive_From_new_cmds_GCJ= + old_archive_from_expsyms_cmds_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + thread_safe_flag_spec_GCJ= + hardcode_libdir_flag_spec_GCJ= + hardcode_libdir_flag_spec_ld_GCJ= + hardcode_libdir_separator_GCJ= + hardcode_direct_GCJ=no + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=unsupported + link_all_deplibs_GCJ=unknown + hardcode_automatic_GCJ=no + module_cmds_GCJ= + module_expsym_cmds_GCJ= + always_export_symbols_GCJ=no + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_GCJ= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_GCJ=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_GCJ=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_GCJ=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_GCJ='-L$libdir' + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=no + enable_shared_with_static_runtimes_GCJ=yes + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + sunos4*) + archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + + if test "$ld_shlibs_GCJ" = yes; then + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_GCJ= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=yes + archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_GCJ=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_GCJ=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_GCJ='' + hardcode_direct_GCJ=yes + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + + if test "$GCC" = yes; then + case $host_os in aix4.012|aix4.012.*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_GCJ=yes + else + # We have old collect2 + hardcode_direct_GCJ=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_GCJ=yes + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_libdir_separator_GCJ= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_GCJ=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_GCJ='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_GCJ="-z nodefs" + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_GCJ=' ${wl}-bernotok' + allow_undefined_flag_GCJ=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols_GCJ=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_GCJ=' ' + archive_cmds_need_lc_GCJ=yes + # This is similar to how AIX traditionally builds it's shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_GCJ=no + ;; + + bsdi4*) + export_dynamic_flag_spec_GCJ=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_GCJ=' ' + allow_undefined_flag_GCJ=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_GCJ='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_GCJ=yes + ;; + + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + archive_cmds_need_lc_GCJ=no + case "$host_os" in + rhapsody* | darwin1.[012]) + allow_undefined_flag_GCJ='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' + ;; + esac + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. Also zsh mangles + # `"' quotes if we put them in here... so don't! + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -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' + fi + module_cmds_GCJ='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + hardcode_direct_GCJ=no + hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=unsupported + whole_archive_flag_spec_GCJ='-all_load $convenience' + link_all_deplibs_GCJ=yes + fi + ;; + + dgux*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + freebsd1*) + ld_shlibs_GCJ=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + ;; + ia64*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + *) + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + link_all_deplibs_GCJ=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + newsos6) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_shlibpath_var_GCJ=no + ;; + + openbsd*) + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + allow_undefined_flag_GCJ=unsupported + archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_GCJ='-rpath $libdir' + fi + hardcode_libdir_separator_GCJ=: + ;; + + sco3.2v5*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag_GCJ=' -z text' + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_shlibpath_var_GCJ=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + esac + link_all_deplibs_GCJ=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_GCJ='$CC -r -o $output$reload_objs' + hardcode_direct_GCJ=no + ;; + motorola) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4.3*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_GCJ=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + no_undefined_flag_GCJ='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv5*) + no_undefined_flag_GCJ=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec_GCJ= + hardcode_shlibpath_var_GCJ=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + *) + ld_shlibs_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6 +test "$ld_shlibs_GCJ" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_GCJ" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_GCJ=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_GCJ in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_GCJ + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ + allow_undefined_flag_GCJ= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_GCJ=no + else + archive_cmds_need_lc_GCJ=yes + fi + allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_GCJ= +if test -n "$hardcode_libdir_flag_spec_GCJ" || \ + test -n "$runpath_var GCJ" || \ + test "X$hardcode_automatic_GCJ"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_GCJ" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && + test "$hardcode_minus_L_GCJ" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_GCJ=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_GCJ=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_GCJ=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$hardcode_action_GCJ" >&6 + +if test "$hardcode_action_GCJ" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # 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}' + sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # 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}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.01* | freebsdelf3.01*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != dlopen; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main () +{ +dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_GCJ \ + CC_GCJ \ + LD_GCJ \ + lt_prog_compiler_wl_GCJ \ + lt_prog_compiler_pic_GCJ \ + lt_prog_compiler_static_GCJ \ + lt_prog_compiler_no_builtin_flag_GCJ \ + export_dynamic_flag_spec_GCJ \ + thread_safe_flag_spec_GCJ \ + whole_archive_flag_spec_GCJ \ + enable_shared_with_static_runtimes_GCJ \ + old_archive_cmds_GCJ \ + old_archive_from_new_cmds_GCJ \ + predep_objects_GCJ \ + postdep_objects_GCJ \ + predeps_GCJ \ + postdeps_GCJ \ + compiler_lib_search_path_GCJ \ + archive_cmds_GCJ \ + archive_expsym_cmds_GCJ \ + postinstall_cmds_GCJ \ + postuninstall_cmds_GCJ \ + old_archive_from_expsyms_cmds_GCJ \ + allow_undefined_flag_GCJ \ + no_undefined_flag_GCJ \ + export_symbols_cmds_GCJ \ + hardcode_libdir_flag_spec_GCJ \ + hardcode_libdir_flag_spec_ld_GCJ \ + hardcode_libdir_separator_GCJ \ + hardcode_automatic_GCJ \ + module_cmds_GCJ \ + module_expsym_cmds_GCJ \ + lt_cv_prog_compiler_c_o_GCJ \ + exclude_expsyms_GCJ \ + include_expsyms_GCJ; do + + case $var in + old_archive_cmds_GCJ | \ + old_archive_from_new_cmds_GCJ | \ + archive_cmds_GCJ | \ + archive_expsym_cmds_GCJ | \ + module_cmds_GCJ | \ + module_expsym_cmds_GCJ | \ + old_archive_from_expsyms_cmds_GCJ | \ + export_symbols_cmds_GCJ | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_GCJ + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_GCJ + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_GCJ + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_GCJ + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_GCJ + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext='$shrext' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_GCJ +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_GCJ + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_GCJ +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_GCJ +archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_GCJ +module_expsym_cmds=$lt_module_expsym_cmds_GCJ + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_GCJ + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_GCJ + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_GCJ + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_GCJ + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_GCJ + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_GCJ + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_GCJ + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_GCJ + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_GCJ + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_GCJ" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_GCJ + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_GCJ + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_GCJ + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_GCJ + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + RC) + + + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +objext_RC=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +lt_cv_prog_compiler_c_o_RC=yes + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_RC \ + CC_RC \ + LD_RC \ + lt_prog_compiler_wl_RC \ + lt_prog_compiler_pic_RC \ + lt_prog_compiler_static_RC \ + lt_prog_compiler_no_builtin_flag_RC \ + export_dynamic_flag_spec_RC \ + thread_safe_flag_spec_RC \ + whole_archive_flag_spec_RC \ + enable_shared_with_static_runtimes_RC \ + old_archive_cmds_RC \ + old_archive_from_new_cmds_RC \ + predep_objects_RC \ + postdep_objects_RC \ + predeps_RC \ + postdeps_RC \ + compiler_lib_search_path_RC \ + archive_cmds_RC \ + archive_expsym_cmds_RC \ + postinstall_cmds_RC \ + postuninstall_cmds_RC \ + old_archive_from_expsyms_cmds_RC \ + allow_undefined_flag_RC \ + no_undefined_flag_RC \ + export_symbols_cmds_RC \ + hardcode_libdir_flag_spec_RC \ + hardcode_libdir_flag_spec_ld_RC \ + hardcode_libdir_separator_RC \ + hardcode_automatic_RC \ + module_cmds_RC \ + module_expsym_cmds_RC \ + lt_cv_prog_compiler_c_o_RC \ + exclude_expsyms_RC \ + include_expsyms_RC; do + + case $var in + old_archive_cmds_RC | \ + old_archive_from_new_cmds_RC | \ + archive_cmds_RC | \ + archive_expsym_cmds_RC | \ + module_cmds_RC | \ + module_expsym_cmds_RC | \ + old_archive_from_expsyms_cmds_RC | \ + export_symbols_cmds_RC | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_RC + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_RC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_RC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_RC + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_RC + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext='$shrext' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_RC +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_RC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_RC +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_RC + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_RC + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_RC + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_RC + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_RC + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_RC + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_RC + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_RC + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_RC + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_RC + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_RC + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_RC" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_RC + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_RC + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_RC + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_RC + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + ;; + + *) + { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +echo "$as_me: error: Unsupported tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +echo "$as_me: error: unable to update list of available tagged configurations." >&2;} + { (exit 1); exit 1; }; } + fi +fi + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/mklib' + +# Prevent multiple expansion + + + + + + + + + + + + + + + + + + + + +echo "$as_me:$LINENO: checking for shared library suffix" >&5 +echo $ECHO_N "checking for shared library suffix... $ECHO_C" >&6 +eval "SHLIBEXT=$shrext" +echo "$as_me:$LINENO: result: $SHLIBEXT" >&5 +echo "${ECHO_T}$SHLIBEXT" >&6 +SHLIBEXT=$SHLIBEXT + + +cat >>confdefs.h <<_ACEOF +#define SHLIBEXT "$SHLIBEXT" +_ACEOF + @@ -1978,6 +18849,40 @@ s, at ECHO_N@,$ECHO_N,;t t s, at ECHO_T@,$ECHO_T,;t t s, at LIBS@,$LIBS,;t t +s, at build@,$build,;t t +s, at build_cpu@,$build_cpu,;t t +s, at build_vendor@,$build_vendor,;t t +s, at build_os@,$build_os,;t t +s, at host@,$host,;t t +s, at host_cpu@,$host_cpu,;t t +s, at host_vendor@,$host_vendor,;t t +s, at host_os@,$host_os,;t t +s, at CC@,$CC,;t t +s, at CFLAGS@,$CFLAGS,;t t +s, at LDFLAGS@,$LDFLAGS,;t t +s, at CPPFLAGS@,$CPPFLAGS,;t t +s, at ac_ct_CC@,$ac_ct_CC,;t t +s, at EXEEXT@,$EXEEXT,;t t +s, at OBJEXT@,$OBJEXT,;t t +s, at EGREP@,$EGREP,;t t +s, at LN_S@,$LN_S,;t t +s, at ECHO@,$ECHO,;t t +s, at AR@,$AR,;t t +s, at ac_ct_AR@,$ac_ct_AR,;t t +s, at RANLIB@,$RANLIB,;t t +s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s, at STRIP@,$STRIP,;t t +s, at ac_ct_STRIP@,$ac_ct_STRIP,;t t +s, at CPP@,$CPP,;t t +s, at CXX@,$CXX,;t t +s, at CXXFLAGS@,$CXXFLAGS,;t t +s, at ac_ct_CXX@,$ac_ct_CXX,;t t +s, at CXXCPP@,$CXXCPP,;t t +s, at F77@,$F77,;t t +s, at FFLAGS@,$FFLAGS,;t t +s, at ac_ct_F77@,$ac_ct_F77,;t t +s, at LIBTOOL@,$LIBTOOL,;t t +s, at SHLIBEXT@,$SHLIBEXT,;t t s, at LLVM_SRC@,$LLVM_SRC,;t t s, at LLVM_OBJ@,$LLVM_OBJ,;t t s, at LIBOBJS@,$LIBOBJS,;t t From reid at x10sys.com Wed Sep 15 01:23:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Sep 2004 01:23:05 -0500 Subject: [llvm-commits] CVS: llvm/projects/Stacker/lib/compiler/Makefile Message-ID: <200409150623.BAA26312@zion.cs.uiuc.edu> Changes in directory llvm/projects/Stacker/lib/compiler: Makefile updated: 1.2 -> 1.3 --- Log message: Stacker compiler library doesn't need to be shared and it can cause problems on some platforms (like Solaris). --- Diffs of the changes: (+0 -1) Index: llvm/projects/Stacker/lib/compiler/Makefile diff -u llvm/projects/Stacker/lib/compiler/Makefile:1.2 llvm/projects/Stacker/lib/compiler/Makefile:1.3 --- llvm/projects/Stacker/lib/compiler/Makefile:1.2 Sat Sep 4 14:48:50 2004 +++ llvm/projects/Stacker/lib/compiler/Makefile Wed Sep 15 01:22:54 2004 @@ -8,7 +8,6 @@ # # Give the name of a library. This will build a dynamic version. # -SHARED_LIBRARY=1 LIBRARYNAME=stkr_compiler # From lattner at cs.uiuc.edu Wed Sep 15 12:00:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Sep 2004 12:00:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasSetTracker.cpp Message-ID: <200409151700.MAA07361@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasSetTracker.cpp updated: 1.27 -> 1.28 --- Log message: Add some assertions --- Diffs of the changes: (+3 -2) Index: llvm/lib/Analysis/AliasSetTracker.cpp diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.27 llvm/lib/Analysis/AliasSetTracker.cpp:1.28 --- llvm/lib/Analysis/AliasSetTracker.cpp:1.27 Tue Sep 14 14:15:32 2004 +++ llvm/lib/Analysis/AliasSetTracker.cpp Wed Sep 15 11:59:47 2004 @@ -50,6 +50,7 @@ AS.PtrList = 0; AS.PtrListEnd = &AS.PtrList; + assert(*AS.PtrListEnd == 0 && "End of list is not null?"); } } @@ -70,11 +71,10 @@ unsigned Size, bool KnownMustAlias) { assert(!Entry.second.hasAliasSet() && "Entry already in set!"); - AliasAnalysis &AA = AST.getAliasAnalysis(); - // Check to see if we have to downgrade to _may_ alias. if (isMustAlias() && !KnownMustAlias) if (HashNodePair *P = getSomePointer()) { + AliasAnalysis &AA = AST.getAliasAnalysis(); AliasAnalysis::AliasResult Result = AA.alias(P->first, P->second.getSize(), Entry.first, Size); if (Result == AliasAnalysis::MayAlias) @@ -91,6 +91,7 @@ assert(*PtrListEnd == 0 && "End of list is not null?"); *PtrListEnd = &Entry; PtrListEnd = Entry.second.setPrevInList(PtrListEnd); + assert(*PtrListEnd == 0 && "End of list is not null?"); addRef(); // Entry points to alias set... } From lattner at cs.uiuc.edu Wed Sep 15 12:00:52 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Sep 2004 12:00:52 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/AliasSetTracker.h Message-ID: <200409151700.MAA07672@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: AliasSetTracker.h updated: 1.20 -> 1.21 --- Log message: Make sure to update the list end when an element is removed from it. This fixes a crash in LICM when processing povray. --- Diffs of the changes: (+4 -0) Index: llvm/include/llvm/Analysis/AliasSetTracker.h diff -u llvm/include/llvm/Analysis/AliasSetTracker.h:1.20 llvm/include/llvm/Analysis/AliasSetTracker.h:1.21 --- llvm/include/llvm/Analysis/AliasSetTracker.h:1.20 Tue Sep 14 14:15:12 2004 +++ llvm/include/llvm/Analysis/AliasSetTracker.h Wed Sep 15 12:00:41 2004 @@ -77,6 +77,10 @@ void removeFromList() { if (NextInList) NextInList->second.PrevInList = PrevInList; *PrevInList = NextInList; + if (AS->PtrListEnd == &NextInList) { + AS->PtrListEnd = PrevInList; + assert(*AS->PtrListEnd == 0 && "List not terminated right!"); + } } }; From reid at x10sys.com Wed Sep 15 12:06:53 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Sep 2004 12:06:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Message-ID: <200409151706.MAA07171@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: Execution.cpp updated: 1.132 -> 1.133 --- Log message: Convert code to compile with vc7.1. Patch contributed by Paolo Invernizzi. Thanks Paolo! --- Diffs of the changes: (+3 -2) Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.132 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.133 --- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.132 Wed Sep 1 17:55:35 2004 +++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Wed Sep 15 12:06:41 2004 @@ -679,9 +679,10 @@ // Now loop over all of the PHI nodes setting their values... SF.CurInst = SF.CurBB->begin(); - for (unsigned i = 0; PHINode *PN = dyn_cast(SF.CurInst); - ++SF.CurInst, ++i) + for (unsigned i = 0; isa(SF.CurInst); ++SF.CurInst, ++i) { + PHINode *PN = cast(SF.CurInst); SetValue(PN, ResultValues[i], SF); + } } //===----------------------------------------------------------------------===// From reid at x10sys.com Wed Sep 15 12:06:53 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Sep 2004 12:06:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/LoopInfo.cpp Message-ID: <200409151706.MAA07174@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: LoopInfo.cpp updated: 1.59 -> 1.60 --- Log message: Convert code to compile with vc7.1. Patch contributed by Paolo Invernizzi. Thanks Paolo! --- Diffs of the changes: (+3 -3) Index: llvm/lib/Analysis/LoopInfo.cpp diff -u llvm/lib/Analysis/LoopInfo.cpp:1.59 llvm/lib/Analysis/LoopInfo.cpp:1.60 --- llvm/lib/Analysis/LoopInfo.cpp:1.59 Fri Sep 3 13:19:51 2004 +++ llvm/lib/Analysis/LoopInfo.cpp Wed Sep 15 12:06:41 2004 @@ -404,15 +404,15 @@ return 0; // Loop over all of the PHI nodes, looking for a canonical indvar. - for (BasicBlock::iterator I = H->begin(); - PHINode *PN = dyn_cast(I); ++I) + for (BasicBlock::iterator I = H->begin(); isa(I); ++I) { + PHINode *PN = cast(I); if (Instruction *Inc = dyn_cast(PN->getIncomingValueForBlock(Backedge))) if (Inc->getOpcode() == Instruction::Add && Inc->getOperand(0) == PN) if (ConstantInt *CI = dyn_cast(Inc->getOperand(1))) if (CI->equalsInt(1)) return PN; - + } return 0; } From reid at x10sys.com Wed Sep 15 12:06:53 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Sep 2004 12:06:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Message-ID: <200409151706.MAA07177@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.129 -> 1.130 --- Log message: Convert code to compile with vc7.1. Patch contributed by Paolo Invernizzi. Thanks Paolo! --- Diffs of the changes: (+3 -3) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.129 llvm/lib/Bytecode/Reader/Reader.cpp:1.130 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.129 Fri Sep 3 13:19:51 2004 +++ llvm/lib/Bytecode/Reader/Reader.cpp Wed Sep 15 12:06:41 2004 @@ -347,14 +347,14 @@ } // Check the function level types first... - TypeListTy::iterator I = find(FunctionTypes.begin(), FunctionTypes.end(), Ty); + TypeListTy::iterator I = std::find(FunctionTypes.begin(), FunctionTypes.end(), Ty); if (I != FunctionTypes.end()) return Type::FirstDerivedTyID + ModuleTypes.size() + (&*I - &FunctionTypes[0]); // Check the module level types now... - I = find(ModuleTypes.begin(), ModuleTypes.end(), Ty); + I = std::find(ModuleTypes.begin(), ModuleTypes.end(), Ty); if (I == ModuleTypes.end()) error("Didn't find type in ModuleTypes."); return Type::FirstDerivedTyID + (&*I - &ModuleTypes[0]); @@ -381,7 +381,7 @@ unsigned BytecodeReader::getGlobalTableTypeSlot(const Type *Ty) { if (Ty->isPrimitiveType()) return Ty->getTypeID(); - TypeListTy::iterator I = find(ModuleTypes.begin(), + TypeListTy::iterator I = std::find(ModuleTypes.begin(), ModuleTypes.end(), Ty); if (I == ModuleTypes.end()) error("Didn't find type in ModuleTypes."); From reid at x10sys.com Wed Sep 15 12:06:53 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Sep 2004 12:06:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp CorrelatedExprs.cpp IndVarSimplify.cpp LoopUnroll.cpp LowerSwitch.cpp SCCP.cpp TailDuplication.cpp Message-ID: <200409151706.MAA07198@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ADCE.cpp updated: 1.79 -> 1.80 CorrelatedExprs.cpp updated: 1.24 -> 1.25 IndVarSimplify.cpp updated: 1.69 -> 1.70 LoopUnroll.cpp updated: 1.11 -> 1.12 LowerSwitch.cpp updated: 1.15 -> 1.16 SCCP.cpp updated: 1.100 -> 1.101 TailDuplication.cpp updated: 1.22 -> 1.23 --- Log message: Convert code to compile with vc7.1. Patch contributed by Paolo Invernizzi. Thanks Paolo! --- Diffs of the changes: (+22 -17) Index: llvm/lib/Transforms/Scalar/ADCE.cpp diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.79 llvm/lib/Transforms/Scalar/ADCE.cpp:1.80 --- llvm/lib/Transforms/Scalar/ADCE.cpp:1.79 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Transforms/Scalar/ADCE.cpp Wed Sep 15 12:06:41 2004 @@ -428,7 +428,8 @@ // should be identical to the incoming values for LastDead. // for (BasicBlock::iterator II = NextAlive->begin(); - PHINode *PN = dyn_cast(II); ++II) + isa(II); ++II) { + PHINode *PN = cast(II); if (LiveSet.count(PN)) { // Only modify live phi nodes // Get the incoming value for LastDead... int OldIdx = PN->getBasicBlockIndex(LastDead); @@ -438,6 +439,7 @@ // Add an incoming value for BB now... PN->addIncoming(InVal, BB); } + } } } Index: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp diff -u llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.24 llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.25 --- llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.24 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp Wed Sep 15 12:06:41 2004 @@ -572,8 +572,8 @@ // edge from the PHI node, and we need to replace any references to the PHI // node with a new value. // - for (BasicBlock::iterator I = OldSucc->begin(); - PHINode *PN = dyn_cast(I); ) { + for (BasicBlock::iterator I = OldSucc->begin(); isa(I); ) { + PHINode *PN = cast(I); // Get the value flowing across the old edge and remove the PHI node entry // for this edge: we are about to remove the edge! Don't remove the PHI Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.69 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.70 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.69 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Wed Sep 15 12:06:41 2004 @@ -570,10 +570,11 @@ BasicBlock *Preheader = L->getLoopPreheader(); std::set DeadInsts; - for (BasicBlock::iterator I = Header->begin(); - PHINode *PN = dyn_cast(I); ++I) + for (BasicBlock::iterator I = Header->begin(); isa(I); ++I) { + PHINode *PN = cast(I); if (isa(PN->getType())) EliminatePointerRecurrence(PN, Preheader, DeadInsts); + } if (!DeadInsts.empty()) DeleteTriviallyDeadInstructions(DeadInsts); @@ -597,8 +598,8 @@ // auxillary induction variables. std::vector > IndVars; - for (BasicBlock::iterator I = Header->begin(); - PHINode *PN = dyn_cast(I); ++I) + for (BasicBlock::iterator I = Header->begin(); isa(I); ++I) { + PHINode *PN = cast(I); if (PN->getType()->isInteger()) { // FIXME: when we have fast-math, enable! SCEVHandle SCEV = SE->getSCEV(PN); if (SCEV->hasComputableLoopEvolution(L)) @@ -611,6 +612,7 @@ if (AR->getNumOperands() == 2 && isa(AR->getOperand(1))) IndVars.push_back(std::make_pair(PN, SCEV)); } + } // If there are no induction variables in the loop, there is nothing more to // do. Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.11 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.12 --- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.11 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp Wed Sep 15 12:06:41 2004 @@ -155,8 +155,8 @@ // PHI nodes. Insert associations now. std::map LastValueMap; std::vector OrigPHINode; - for (BasicBlock::iterator I = BB->begin(); - PHINode *PN = dyn_cast(I); ++I) { + for (BasicBlock::iterator I = BB->begin(); isa(I); ++I) { + PHINode *PN = cast(I); OrigPHINode.push_back(PN); if (Instruction *I =dyn_cast(PN->getIncomingValueForBlock(BB))) if (I->getParent() == BB) Index: llvm/lib/Transforms/Scalar/LowerSwitch.cpp diff -u llvm/lib/Transforms/Scalar/LowerSwitch.cpp:1.15 llvm/lib/Transforms/Scalar/LowerSwitch.cpp:1.16 --- llvm/lib/Transforms/Scalar/LowerSwitch.cpp:1.15 Fri Sep 3 13:19:51 2004 +++ llvm/lib/Transforms/Scalar/LowerSwitch.cpp Wed Sep 15 12:06:41 2004 @@ -160,8 +160,8 @@ // If there were any PHI nodes in this successor, rewrite one entry // from OrigBlock to come from NewLeaf. - for (BasicBlock::iterator I = Succ->begin(); - PHINode* PN = dyn_cast(I); ++I) { + for (BasicBlock::iterator I = Succ->begin(); isa(I); ++I) { + PHINode* PN = cast(I); int BlockIdx = PN->getBasicBlockIndex(OrigBlock); assert(BlockIdx != -1 && "Switch didn't go to this successor??"); PN->setIncomingBlock((unsigned)BlockIdx, NewLeaf); @@ -196,8 +196,8 @@ // If there is an entry in any PHI nodes for the default edge, make sure // to update them as well. - for (BasicBlock::iterator I = Default->begin(); - PHINode *PN = dyn_cast(I); ++I) { + for (BasicBlock::iterator I = Default->begin(); isa(I); ++I) { + PHINode *PN = cast(I); int BlockIdx = PN->getBasicBlockIndex(OrigBlock); assert(BlockIdx != -1 && "Switch didn't go to this successor??"); PN->setIncomingBlock((unsigned)BlockIdx, NewDefault); Index: llvm/lib/Transforms/Scalar/SCCP.cpp diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.100 llvm/lib/Transforms/Scalar/SCCP.cpp:1.101 --- llvm/lib/Transforms/Scalar/SCCP.cpp:1.100 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Transforms/Scalar/SCCP.cpp Wed Sep 15 12:06:41 2004 @@ -198,9 +198,10 @@ // The destination is already executable, but we just made an edge // feasible that wasn't before. Revisit the PHI nodes in the block // because they have potentially new operands. - for (BasicBlock::iterator I = Dest->begin(); - PHINode *PN = dyn_cast(I); ++I) + for (BasicBlock::iterator I = Dest->begin(); isa(I); ++I) { + PHINode *PN = cast(I); visitPHINode(*PN); + } } else { DEBUG(std::cerr << "Marking Block Executable: " << Dest->getName()<<"\n"); Index: llvm/lib/Transforms/Scalar/TailDuplication.cpp diff -u llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.22 llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.23 --- llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.22 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Transforms/Scalar/TailDuplication.cpp Wed Sep 15 12:06:42 2004 @@ -214,8 +214,8 @@ for (succ_iterator SI = succ_begin(DestBlock), SE = succ_end(DestBlock); SI != SE; ++SI) { BasicBlock *Succ = *SI; - for (BasicBlock::iterator PNI = Succ->begin(); - PHINode *PN = dyn_cast(PNI); ++PNI) { + for (BasicBlock::iterator PNI = Succ->begin(); isa(PNI); ++PNI) { + PHINode *PN = cast(PNI); // Ok, we have a PHI node. Figure out what the incoming value was for the // DestBlock. Value *IV = PN->getIncomingValueForBlock(DestBlock); From reid at x10sys.com Wed Sep 15 12:06:53 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Sep 2004 12:06:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp CloneTrace.cpp CodeExtractor.cpp InlineFunction.cpp SimplifyCFG.cpp Message-ID: <200409151706.MAA07201@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: BreakCriticalEdges.cpp updated: 1.23 -> 1.24 CloneTrace.cpp updated: 1.8 -> 1.9 CodeExtractor.cpp updated: 1.31 -> 1.32 InlineFunction.cpp updated: 1.26 -> 1.27 SimplifyCFG.cpp updated: 1.51 -> 1.52 --- Log message: Convert code to compile with vc7.1. Patch contributed by Paolo Invernizzi. Thanks Paolo! --- Diffs of the changes: (+41 -31) Index: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp diff -u llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.23 llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.24 --- llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.23 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp Wed Sep 15 12:06:42 2004 @@ -118,8 +118,8 @@ // If there are any PHI nodes in DestBB, we need to update them so that they // merge incoming values from NewBB instead of from TIBB. // - for (BasicBlock::iterator I = DestBB->begin(); - PHINode *PN = dyn_cast(I); ++I) { + for (BasicBlock::iterator I = DestBB->begin(); isa(I); ++I) { + PHINode *PN = cast(I); // We no longer enter through TIBB, now we come in through NewBB. Revector // exactly one entry in the PHI node that used to come from TIBB to come // from NewBB. Index: llvm/lib/Transforms/Utils/CloneTrace.cpp diff -u llvm/lib/Transforms/Utils/CloneTrace.cpp:1.8 llvm/lib/Transforms/Utils/CloneTrace.cpp:1.9 --- llvm/lib/Transforms/Utils/CloneTrace.cpp:1.8 Thu Jul 29 12:21:57 2004 +++ llvm/lib/Transforms/Utils/CloneTrace.cpp Wed Sep 15 12:06:42 2004 @@ -50,16 +50,17 @@ //only do this if we are NOT the first block if(T != origTrace.begin()) { for (BasicBlock::iterator I = clonedBlock->begin(); - PHINode *PN = dyn_cast(I); ++I) { - //get incoming value for the previous BB - Value *V = PN->getIncomingValueForBlock(*(T-1)); - assert(V && "No incoming value from a BasicBlock in our trace!"); - - //remap our phi node to point to incoming value - ValueMap[*&I] = V; - - //remove phi node - clonedBlock->getInstList().erase(PN); + isa(I); ++I) { + PHINode *PN = cast(I); + //get incoming value for the previous BB + Value *V = PN->getIncomingValueForBlock(*(T-1)); + assert(V && "No incoming value from a BasicBlock in our trace!"); + + //remap our phi node to point to incoming value + ValueMap[*&I] = V; + + //remove phi node + clonedBlock->getInstList().erase(PN); } } } Index: llvm/lib/Transforms/Utils/CodeExtractor.cpp diff -u llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.31 llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.32 --- llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.31 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Transforms/Utils/CodeExtractor.cpp Wed Sep 15 12:06:42 2004 @@ -166,8 +166,8 @@ // Okay, everthing within the region is now branching to the right block, we // just have to update the PHI nodes now, inserting PHI nodes into NewBB. - for (AfterPHIs = OldPred->begin(); - PHINode *PN = dyn_cast(AfterPHIs); ++AfterPHIs) { + for (AfterPHIs = OldPred->begin(); isa(AfterPHIs); ++AfterPHIs) { + PHINode *PN = cast(AfterPHIs); // Create a new PHI node in the new region, which has an incoming value // from OldPred of PN. PHINode *NewPN = new PHINode(PN->getType(), PN->getName()+".ce", @@ -644,20 +644,21 @@ // Loop over all of the PHI nodes in the header block, and change any // references to the old incoming edge to be the new incoming edge. - for (BasicBlock::iterator I = header->begin(); - PHINode *PN = dyn_cast(I); ++I) + for (BasicBlock::iterator I = header->begin(); isa(I); ++I) { + PHINode *PN = cast(I); for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) if (!BlocksToExtract.count(PN->getIncomingBlock(i))) PN->setIncomingBlock(i, newFuncRoot); - + } + // Look at all successors of the codeReplacer block. If any of these blocks // had PHI nodes in them, we need to update the "from" block to be the code // replacer, not the original block in the extracted region. std::vector Succs(succ_begin(codeReplacer), succ_end(codeReplacer)); for (unsigned i = 0, e = Succs.size(); i != e; ++i) - for (BasicBlock::iterator I = Succs[i]->begin(); - PHINode *PN = dyn_cast(I); ++I) { + for (BasicBlock::iterator I = Succs[i]->begin(); isa(I); ++I) { + PHINode *PN = cast(I); std::set ProcessedPreds; for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) if (BlocksToExtract.count(PN->getIncomingBlock(i))) Index: llvm/lib/Transforms/Utils/InlineFunction.cpp diff -u llvm/lib/Transforms/Utils/InlineFunction.cpp:1.26 llvm/lib/Transforms/Utils/InlineFunction.cpp:1.27 --- llvm/lib/Transforms/Utils/InlineFunction.cpp:1.26 Tue Jul 20 00:45:24 2004 +++ llvm/lib/Transforms/Utils/InlineFunction.cpp Wed Sep 15 12:06:42 2004 @@ -111,10 +111,11 @@ // If there are PHI nodes in the exceptional destination block, we need to // keep track of which values came into them from this invoke, then remove // the entry for this block. - for (BasicBlock::iterator I = InvokeDest->begin(); - PHINode *PN = dyn_cast(I); ++I) + for (BasicBlock::iterator I = InvokeDest->begin(); isa(I); ++I) { + PHINode *PN = cast(I); // Save the value to use for this edge... InvokeDestPHIValues.push_back(PN->getIncomingValueForBlock(OrigBB)); + } for (Function::iterator BB = FirstNewBlock, E = Caller->end(); BB != E; ++BB) { @@ -149,8 +150,10 @@ // there is now a new entry in them. unsigned i = 0; for (BasicBlock::iterator I = InvokeDest->begin(); - PHINode *PN = dyn_cast(I); ++I, ++i) + isa(I); ++I, ++i) { + PHINode *PN = cast(I); PN->addIncoming(InvokeDestPHIValues[i], BB); + } // This basic block is now complete, start scanning the next one. break; @@ -174,8 +177,10 @@ // there is now a new entry in them. unsigned i = 0; for (BasicBlock::iterator I = InvokeDest->begin(); - PHINode *PN = dyn_cast(I); ++I, ++i) + isa(I); ++I, ++i) { + PHINode *PN = cast(I); PN->addIncoming(InvokeDestPHIValues[i], BB); + } } } Index: llvm/lib/Transforms/Utils/SimplifyCFG.cpp diff -u llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.51 llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.52 --- llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.51 Fri Sep 3 13:19:51 2004 +++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp Wed Sep 15 12:06:42 2004 @@ -52,8 +52,8 @@ if (std::find(BBPreds.begin(), BBPreds.end(), *PI) != BBPreds.end()) { // Loop over all of the PHI nodes checking to see if there are // incompatible values coming in. - for (BasicBlock::iterator I = Succ->begin(); - PHINode *PN = dyn_cast(I); ++I) { + for (BasicBlock::iterator I = Succ->begin(); isa(I); ++I) { + PHINode *PN = cast(I); // Loop up the entries in the PHI node for BB and for *PI if the values // coming in are non-equal, we cannot merge these two blocks (instead we // should insert a conditional move or something, then merge the @@ -68,8 +68,8 @@ } // Loop over all of the PHI nodes in the successor BB. - for (BasicBlock::iterator I = Succ->begin(); - PHINode *PN = dyn_cast(I); ++I) { + for (BasicBlock::iterator I = Succ->begin(); isa(I); ++I) { + PHINode *PN = cast(I); Value *OldVal = PN->removeIncomingValue(BB, false); assert(OldVal && "No entry in PHI for Pred BB!"); @@ -341,10 +341,12 @@ for (succ_iterator I = succ_begin(SI2BB), E = succ_end(SI2BB); I != E; ++I) if (SI1Succs.count(*I)) for (BasicBlock::iterator BBI = (*I)->begin(); - PHINode *PN = dyn_cast(BBI); ++BBI) + isa(BBI); ++BBI) { + PHINode *PN = cast(BBI); if (PN->getIncomingValueForBlock(SI1BB) != PN->getIncomingValueForBlock(SI2BB)) return false; + } return true; } @@ -359,8 +361,8 @@ succ_end(ExistPred) && "ExistPred is not a predecessor of Succ!"); if (!isa(Succ->begin())) return; // Quick exit if nothing to do - for (BasicBlock::iterator I = Succ->begin(); - PHINode *PN = dyn_cast(I); ++I) { + for (BasicBlock::iterator I = Succ->begin(); isa(I); ++I) { + PHINode *PN = cast(I); Value *V = PN->getIncomingValueForBlock(ExistPred); PN->addIncoming(V, NewPred); } @@ -994,7 +996,8 @@ // PHI nodes in EdgeBB, they need entries to be added corresponding to // the number of edges added. for (BasicBlock::iterator BBI = EdgeBB->begin(); - PHINode *PN = dyn_cast(BBI); ++BBI) { + isa(BBI); ++BBI) { + PHINode *PN = cast(BBI); Value *InVal = PN->getIncomingValueForBlock(*PI); for (unsigned i = 0, e = Values.size()-1; i != e; ++i) PN->addIncoming(InVal, *PI); From reid at x10sys.com Wed Sep 15 12:06:53 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Sep 2004 12:06:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelSimple.cpp Message-ID: <200409151706.MAA07204@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelSimple.cpp updated: 1.278 -> 1.279 --- Log message: Convert code to compile with vc7.1. Patch contributed by Paolo Invernizzi. Thanks Paolo! --- Diffs of the changes: (+2 -2) Index: llvm/lib/Target/X86/X86ISelSimple.cpp diff -u llvm/lib/Target/X86/X86ISelSimple.cpp:1.278 llvm/lib/Target/X86/X86ISelSimple.cpp:1.279 --- llvm/lib/Target/X86/X86ISelSimple.cpp:1.278 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Target/X86/X86ISelSimple.cpp Wed Sep 15 12:06:41 2004 @@ -643,8 +643,8 @@ // Loop over all of the PHI nodes in the LLVM basic block... MachineBasicBlock::iterator PHIInsertPoint = MBB.begin(); - for (BasicBlock::const_iterator I = BB->begin(); - PHINode *PN = const_cast(dyn_cast(I)); ++I) { + for (BasicBlock::const_iterator I = BB->begin(); isa(I); ++I) { + PHINode *PN = const_cast(dyn_cast(I)); // Create a new machine instr PHI node, and insert it. unsigned PHIReg = getReg(*PN); From lattner at cs.uiuc.edu Wed Sep 15 12:54:05 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Sep 2004 12:54:05 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Hello/Makefile Message-ID: <200409151754.MAA09370@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Hello: Makefile updated: 1.2 -> 1.3 --- Log message: Add a newline --- Diffs of the changes: (+1 -0) Index: llvm/lib/Transforms/Hello/Makefile diff -u llvm/lib/Transforms/Hello/Makefile:1.2 llvm/lib/Transforms/Hello/Makefile:1.3 --- llvm/lib/Transforms/Hello/Makefile:1.2 Mon Oct 20 17:26:57 2003 +++ llvm/lib/Transforms/Hello/Makefile Wed Sep 15 12:53:52 2004 @@ -6,6 +6,7 @@ # the University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## + LEVEL = ../../.. LIBRARYNAME = hello SHARED_LIBRARY = 1 From alkis at cs.uiuc.edu Wed Sep 15 13:06:58 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 15 Sep 2004 13:06:58 -0500 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200409151806.NAA07405@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.99 -> 1.100 --- Log message: Add typeinfo for interfaces. Implement the invokeinterface bytecode. --- Diffs of the changes: (+245 -65) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.99 llvm-java/lib/Compiler/Compiler.cpp:1.100 --- llvm-java/lib/Compiler/Compiler.cpp:1.99 Wed Sep 15 01:11:08 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Wed Sep 15 13:06:47 2004 @@ -37,7 +37,8 @@ #define LLVM_JAVA_STATIC_INIT "llvm_java_static_init" -#define LLVM_JAVA_ISINSTANCEOF "llvm_java_IsInstanceOf" +#define LLVM_JAVA_ISINSTANCEOF "llvm_java_IsInstanceOf" +#define LLVM_JAVA_GETOBJECTCLASS "llvm_java_GetObjectClass" using namespace llvm; using namespace llvm::Java; @@ -133,10 +134,13 @@ FunctionSet toCompileFunctions_; struct ClassInfo { - ClassInfo() : type(NULL) { } + ClassInfo() : type(NULL), interfaceIdx(0) { } Type* type; + unsigned interfaceIdx; typedef std::map Field2IndexMap; Field2IndexMap f2iMap; + + static unsigned InterfaceCount; }; typedef std::map Class2ClassInfoMap; Class2ClassInfoMap c2ciMap_; @@ -144,9 +148,12 @@ struct VTableInfo { VTableInfo() : vtable(NULL) { } GlobalVariable* vtable; - std::vector superVtables; + std::vector superVtables; typedef std::map Method2IndexMap; Method2IndexMap m2iMap; + + static StructType* VTableTy; + static StructType* TypeInfoTy; }; typedef std::map Class2VTableInfoMap; Class2VTableInfoMap c2viMap_; @@ -285,6 +292,7 @@ assert(ci.type && "ClassInfo not initialized properly!"); emitStaticInitializers(cf); + DEBUG(std::cerr << "Built ClassInfo for: java/lang/Object\n"); } void initializeVTableInfoMap() { @@ -316,9 +324,11 @@ elements.push_back(PointerType::get(PointerType::get(VTtype))); init.push_back(llvm::Constant::getNullValue(elements[3])); - StructType* typeInfoTy = StructType::get(elements); - module_->addTypeName(LLVM_JAVA_OBJECT_TYPEINFO, typeInfoTy); - llvm::Constant* typeInfoInit = ConstantStruct::get(typeInfoTy, init); + // this is a static variable + VTableInfo::TypeInfoTy = StructType::get(elements); + module_->addTypeName(LLVM_JAVA_OBJECT_TYPEINFO, VTableInfo::TypeInfoTy); + llvm::Constant* typeInfoInit = + ConstantStruct::get(VTableInfo::TypeInfoTy, init); // now that we have both the type and initializer for the // llvm_java_object_typeinfo struct we can start adding the @@ -363,15 +373,16 @@ PATypeHolder holder = VTtype; cast(VTtype)->refineAbstractTypeTo(StructType::get(elements)); - VTtype = cast(holder.get()); - vi.vtable = new GlobalVariable(VTtype, + VTableInfo::VTableTy = cast(holder.get()); + module_->addTypeName("java/lang/Object", VTableInfo::VTableTy); + + vi.vtable = new GlobalVariable(VTableInfo::VTableTy, true, GlobalVariable::ExternalLinkage, ConstantStruct::get(init), "java/lang/Object", module_); - // java/lang/Object doesn't have a superVtables global as its - // array of superclass vtable pointers is empty + DEBUG(std::cerr << "Built VTableInfo for: java/lang/Object\n"); } void initializeTypeMaps() { @@ -380,16 +391,21 @@ } const ClassInfo& getClassInfo(ClassFile* cf) { - const std::string& className = cf->getThisClass()->getName()->str(); Class2ClassInfoMap::iterator it = c2ciMap_.lower_bound(cf); if (it != c2ciMap_.end() && it->first == cf) return it->second; + const std::string& className = cf->getThisClass()->getName()->str(); DEBUG(std::cerr << "Building ClassInfo for: " << className << '\n'); ClassInfo& ci = c2ciMap_[cf]; assert(!ci.type && ci.f2iMap.empty() && "got already initialized ClassInfo!"); + + // get the interface id + if (cf->isInterface()) + ci.interfaceIdx = ClassInfo::InterfaceCount++; + ci.type = OpaqueType::get(); std::vector elements; @@ -411,59 +427,148 @@ PATypeHolder holder = ci.type; cast(ci.type)->refineAbstractTypeTo(StructType::get(elements)); ci.type = holder.get(); + + assert(ci.type && "ClassInfo not initialized properly!"); DEBUG(std::cerr << "Adding " << className << " = " << *ci.type << " to type map\n"); module_->addTypeName(className, ci.type); - - assert(ci.type && "ClassInfo not initialized properly!"); emitStaticInitializers(cf); + DEBUG(std::cerr << "Built ClassInfo for: " << className << '\n'); return ci; } - llvm::Constant* getClassTypeInfo(ClassFile* cf, - const VTableInfo& vi, - const VTableInfo& superVI) const { - // llvm_java_object_typeinfo has four fields: depth, a pointer - // to the superclasses vtable pointers, a count for interfaces - // and a pointer to the interfaces vtable pointers - const std::string& className = cf->getThisClass()->getName()->str(); + std::pair + buildSuperClassesVTables(ClassFile* cf, const VTableInfo& vi) const { + ArrayType* vtablesArrayTy = + ArrayType::get(PointerType::get(VTableInfo::VTableTy), + vi.superVtables.size()); + + GlobalVariable* vtablesArray = new GlobalVariable( + vtablesArrayTy, + true, + GlobalVariable::ExternalLinkage, + ConstantArray::get(vtablesArrayTy, vi.superVtables), + cf->getThisClass()->getName()->str() + "", + module_); + + return std::make_pair( + vi.superVtables.size(), + ConstantExpr::getGetElementPtr( + vtablesArray, + std::vector(2, ConstantUInt::get(Type::UIntTy, 0)))); + } + + llvm::Constant* buildInterfaceVTable(ClassFile* cf, ClassFile* interface) { + + const VTableInfo& classVI = getVTableInfo(cf); + const VTableInfo& interfaceVI = getVTableInfo(interface); + const Methods& methods = interface->getMethods(); + + // the size of the initializer will be 1 greater than the number + // of methods for this interface (the first slot is the typeinfo + // struct + std::vector init(interfaceVI.m2iMap.size()+1, NULL); + init[0] = llvm::Constant::getNullValue(VTableInfo::TypeInfoTy); + + for (VTableInfo::Method2IndexMap::const_iterator + i = interfaceVI.m2iMap.begin(), e = interfaceVI.m2iMap.end(); + i != e; ++i) { + std::vector indices; + indices.reserve(2); + indices.push_back(ConstantUInt::get(Type::UIntTy, 0)); + assert(classVI.m2iMap.find(i->first) != classVI.m2iMap.end() && + "Interface method not found in class definition!"); + unsigned classMethodIdx = classVI.m2iMap.find(i->first)->second; + indices.push_back(ConstantUInt::get(Type::UIntTy, classMethodIdx)); + init[i->second] = + ConstantExpr::getGetElementPtr(classVI.vtable, indices); + } + + llvm::Constant* vtable = ConstantStruct::get(init); + const std::string& globalName = + cf->getThisClass()->getName()->str() + '+' + + interface->getThisClass()->getName()->str() + ""; + module_->addTypeName(globalName, vtable->getType()); + + return new GlobalVariable( + vtable->getType(), + true, + GlobalVariable::ExternalLinkage, + vtable, + globalName, + module_); + } + std::pair + buildInterfacesVTables(ClassFile* cf, const VTableInfo& vi) { + + std::vector vtables; + const Classes& interfaces = cf->getInterfaces(); + llvm::Constant* nullVTable = + llvm::Constant::getNullValue(PointerType::get(VTableInfo::VTableTy)); + + for (unsigned i = 0, e = interfaces.size(); i != e; ++i) { + ClassFile* interface = ClassFile::get(interfaces[i]->getName()->str()); + assert(interface->isInterface() && + "Class in interfaces list is not an interface!"); + const ClassInfo& interfaceCI = getClassInfo(interface); + vtables.resize(interfaceCI.interfaceIdx, nullVTable); + vtables[interfaceCI.interfaceIdx] = buildInterfaceVTable(cf, interface); + } + + ArrayType* interfacesArrayTy = + ArrayType::get(PointerType::get(VTableInfo::VTableTy), vtables.size()); + + const std::string& globalName = + cf->getThisClass()->getName()->str() + ""; + module_->addTypeName(globalName, interfacesArrayTy); + + GlobalVariable* interfacesArray = new GlobalVariable( + interfacesArrayTy, + true, + GlobalVariable::ExternalLinkage, + ConstantArray::get(interfacesArrayTy, vtables), + globalName, + module_); + + return std::make_pair( + int(vtables.size())-1, + ConstantExpr::getGetElementPtr( + interfacesArray, + std::vector(2, ConstantUInt::get(Type::UIntTy, 0)))); + } + + llvm::Constant* buildClassTypeInfo(ClassFile* cf, const VTableInfo& vi) { std::vector typeInfoInit; - // the depth - unsigned depth = vi.superVtables.size(); + + unsigned depth; + llvm::Constant* superClassesVTables; + tie(depth, superClassesVTables) = buildSuperClassesVTables(cf, vi); + + // the depth (java/lang/Object has depth 0) typeInfoInit.push_back(ConstantUInt::get(Type::UIntTy, depth)); - std::vector vtables; - for (unsigned i = 0, e = depth; i != e; ++i) - vtables.push_back(vi.superVtables[i]); + // the super classes' vtables + typeInfoInit.push_back(superClassesVTables); - ArrayType* vtablesArrayTy = - ArrayType::get(superVI.vtable->getType(), depth); - GlobalVariable* vtablesArray = - new GlobalVariable(vtablesArrayTy, - true, GlobalVariable::ExternalLinkage, - ConstantArray::get(vtablesArrayTy, vtables), - className + "", module_); - - typeInfoInit.push_back(ConstantExpr::getGetElementPtr( - vtablesArray, - std::vector(2, ConstantUInt::get(Type::UIntTy, 0)))); - - // FIXME: interface lists should go here - typeInfoInit.push_back(llvm::ConstantSInt::get(Type::IntTy, -1)); - typeInfoInit.push_back( - llvm::Constant::getNullValue(superVI.vtable->getType())); - - return ConstantStruct::get( - cast(superVI.vtable->getInitializer()->getOperand(0))->getType(), - typeInfoInit); + int lastInterface; + llvm::Constant* interfacesVTables; + tie(lastInterface, interfacesVTables) = buildInterfacesVTables(cf, vi); + + // the last interface index or the interface index if this is an + // interface + typeInfoInit.push_back(ConstantSInt::get(Type::IntTy, lastInterface)); + // the interfaces' vtables + typeInfoInit.push_back(interfacesVTables); + + return ConstantStruct::get(VTableInfo::TypeInfoTy, typeInfoInit); } const VTableInfo& getVTableInfo(ClassFile* cf) { - const std::string& className = cf->getThisClass()->getName()->str(); Class2VTableInfoMap::iterator it = c2viMap_.lower_bound(cf); if (it != c2viMap_.end() && it->first == cf) return it->second; + const std::string& className = cf->getThisClass()->getName()->str(); DEBUG(std::cerr << "Building VTableInfo for: " << className << '\n'); VTableInfo& vi = c2viMap_[cf]; @@ -475,6 +580,7 @@ const VTableInfo& superVI = getVTableInfo(ClassFile::get(super->getName()->str())); + // copy the super vtables array vi.superVtables.push_back(superVI.vtable); vi.superVtables.reserve(superVI.superVtables.size() + 1); std::copy(superVI.superVtables.begin(), superVI.superVtables.end(), @@ -485,11 +591,13 @@ ConstantStruct* superInit = cast(superVI.vtable->getInitializer()); std::vector init(superInit->getNumOperands()); + // use a null typeinfo struct for now + init[0] = llvm::Constant::getNullValue(VTableInfo::TypeInfoTy); + // fill in the function pointers as they are in the super + // class. overriden methods will be replaced later for (unsigned i = 0, e = superInit->getNumOperands(); i != e; ++i) init[i] = superInit->getOperand(i); vi.m2iMap = superVI.m2iMap; - // install the new typeinfo block for this class - init[0] = getClassTypeInfo(cf, vi, superVI); // add member functions to the vtable const Methods& methods = cf->getMethods(); @@ -499,14 +607,14 @@ // the contructor is the only non-static method that is not // dynamically dispatched so we skip it if (!method->isStatic() && method->getName()->str() != "") { - std::string methodDescr = - method->getName()->str() + - method->getDescriptor()->str(); + const std::string& methodDescr = + method->getName()->str() + method->getDescriptor()->str(); std::string funcName = className + '/' + methodDescr; + + // if this is not an interface we will need to build up the const FunctionType* funcTy = cast( getType(method->getDescriptor(), getClassInfo(cf).type)); - Function* vfun = module_->getOrInsertFunction(funcName, funcTy); toCompileFunctions_.insert(vfun); @@ -519,12 +627,29 @@ } } +#ifndef NDEBUG + for (unsigned i = 0, e = init.size(); i != e; ++i) + assert(init[i] && "No elements in the initializer should be NULL!"); +#endif + + const std::string& globalName = className + ""; + llvm::Constant* vtable = ConstantStruct::get(init); + module_->addTypeName(globalName, vtable->getType()); vi.vtable = new GlobalVariable(vtable->getType(), - true, GlobalVariable::ExternalLinkage, + true, + GlobalVariable::ExternalLinkage, vtable, - className + "", + globalName, module_); + + // Now the vtable is complete, install the new typeinfo block + // for this class: we install it last because we need the vtable + // to exist in order to build it + init[0] = buildClassTypeInfo(cf, vi); + vi.vtable->setInitializer(ConstantStruct::get(init)); + + DEBUG(std::cerr << "Built VTableInfo for: " << className << '\n'); return vi; } @@ -730,7 +855,7 @@ // compile all other methods called by this method recursively for (unsigned i = 0; i != toCompileFunctions_.size(); ++i) { Function* f = toCompileFunctions_[i]; - compileMethodOnly(f->getName()); +// compileMethodOnly(f->getName()); } return function; @@ -1131,24 +1256,31 @@ const ClassInfo& ci = getClassInfo(cf); const VTableInfo& vi = getVTableInfo(cf); - std::string methodDescr = + const std::string& className = cf->getThisClass()->getName()->str(); + const std::string& methodDescr = nameAndType->getName()->str() + nameAndType->getDescriptor()->str(); Value* objRef = opStack_.top(); // do not pop objRef = new CastInst(objRef, PointerType::get(ci.type), "this", getBBAt(bcI)); - Value* vtable = getField(bcI, cf, LLVM_JAVA_OBJECT_BASE, objRef); + Value* objBase = getField(bcI, cf, LLVM_JAVA_OBJECT_BASE, objRef); + Function* f = module_->getOrInsertFunction( + LLVM_JAVA_GETOBJECTCLASS, PointerType::get(VTableInfo::VTableTy), + objBase->getType(), NULL); + Value* vtable = new CallInst(f, objBase, TMP, getBBAt(bcI)); vtable = new CastInst(vtable, PointerType::get(vi.vtable->getType()), TMP, getBBAt(bcI)); - vtable = new LoadInst(vtable, TMP, getBBAt(bcI)); + vtable = new LoadInst(vtable, className + "", getBBAt(bcI)); std::vector indices(1, ConstantUInt::get(Type::UIntTy, 0)); assert(vi.m2iMap.find(methodDescr) != vi.m2iMap.end() && "could not find slot for virtual function!"); unsigned vSlot = vi.m2iMap.find(methodDescr)->second; indices.push_back(ConstantUInt::get(Type::UIntTy, vSlot)); - Value* vfunPtr = new GetElementPtrInst(vtable, indices, TMP, getBBAt(bcI)); + Value* vfunPtr = + new GetElementPtrInst(vtable, indices, TMP, getBBAt(bcI)); Value* vfun = new LoadInst(vfunPtr, methodDescr, getBBAt(bcI)); + makeCall(vfun, getBBAt(bcI)); } @@ -1194,7 +1326,53 @@ } void do_invokeinterface(unsigned bcI, unsigned index) { - assert(0 && "not implemented"); + ConstantMethodRef* methodRef = cf_->getConstantMethodRef(index); + ConstantNameAndType* nameAndType = methodRef->getNameAndType(); + + ClassFile* cf = ClassFile::get(methodRef->getClass()->getName()->str()); + const ClassInfo& ci = getClassInfo(cf); + const VTableInfo& vi = getVTableInfo(cf); + + const std::string& className = cf->getThisClass()->getName()->str(); + const std::string& methodDescr = + nameAndType->getName()->str() + + nameAndType->getDescriptor()->str(); + + Value* objRef = opStack_.top(); // do not pop + objRef = new CastInst(objRef, PointerType::get(ci.type), + "this", getBBAt(bcI)); + Value* objBase = getField(bcI, cf, LLVM_JAVA_OBJECT_BASE, objRef); + Function* f = module_->getOrInsertFunction( + LLVM_JAVA_GETOBJECTCLASS, PointerType::get(VTableInfo::VTableTy), + objBase->getType(), NULL); + Value* vtable = new CallInst(f, objBase, TMP, getBBAt(bcI)); + // get the interfaces array of vtables + std::vector indices(2, ConstantUInt::get(Type::UIntTy, 0)); + indices.push_back(ConstantUInt::get(Type::UIntTy, 3)); + Value* interfaceVTables = + new GetElementPtrInst(vtable, indices, TMP, getBBAt(bcI)); + interfaceVTables = new LoadInst(interfaceVTables, TMP, getBBAt(bcI)); + // get the actual interface vtable + indices.resize(1); + indices.push_back(ConstantUInt::get(Type::UIntTy, ci.interfaceIdx)); + Value* interfaceVTable = + new GetElementPtrInst(vtable, indices, TMP, getBBAt(bcI)); + interfaceVTable = + new CastInst(vtable, PointerType::get(VTableInfo::VTableTy), + TMP, getBBAt(bcI)); + interfaceVTable = + new LoadInst(interfaceVTable, className + "", getBBAt(bcI)); + // get the function pointer + indices.resize(1); + assert(vi.m2iMap.find(methodDescr) != vi.m2iMap.end() && + "could not find slot for virtual function!"); + unsigned vSlot = vi.m2iMap.find(methodDescr)->second; + indices.push_back(ConstantUInt::get(Type::UIntTy, vSlot)); + Value* vfunPtr = + new GetElementPtrInst(interfaceVTable, indices, TMP, getBBAt(bcI)); + Value* vfun = new LoadInst(vfunPtr, methodDescr, getBBAt(bcI)); + + makeCall(vfun, getBBAt(bcI)); } void do_new(unsigned bcI, unsigned index) { @@ -1246,11 +1424,9 @@ Value* objRef = opStack_.top(); opStack_.pop(); Value* objBase = getField(bcI, cf, LLVM_JAVA_OBJECT_BASE, objRef); - Function* f = module_->getOrInsertFunction(LLVM_JAVA_ISINSTANCEOF, - Type::IntTy, - objBase->getType(), - vi.vtable->getType(), - NULL); + Function* f = module_->getOrInsertFunction( + LLVM_JAVA_ISINSTANCEOF, Type::IntTy, + objBase->getType(), PointerType::get(VTableInfo::VTableTy), NULL); Value* r = new CallInst(f, objBase, vi.vtable, TMP, getBBAt(bcI)); opStack_.push(r); } @@ -1270,6 +1446,10 @@ } }; + unsigned CompilerImpl::ClassInfo::InterfaceCount = 0; + StructType* CompilerImpl::VTableInfo::VTableTy; + StructType* CompilerImpl::VTableInfo::TypeInfoTy; + } } } // namespace llvm::Java:: Compiler::Compiler() From alkis at cs.uiuc.edu Wed Sep 15 13:06:57 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 15 Sep 2004 13:06:57 -0500 Subject: [llvm-commits] CVS: llvm-java/runtime/runtime.c Message-ID: <200409151806.NAA07402@zion.cs.uiuc.edu> Changes in directory llvm-java/runtime: runtime.c updated: 1.1 -> 1.2 --- Log message: Add typeinfo for interfaces. Implement the invokeinterface bytecode. --- Diffs of the changes: (+6 -1) Index: llvm-java/runtime/runtime.c diff -u llvm-java/runtime/runtime.c:1.1 llvm-java/runtime/runtime.c:1.2 --- llvm-java/runtime/runtime.c:1.1 Mon Sep 13 14:54:11 2004 +++ llvm-java/runtime/runtime.c Wed Sep 15 13:06:47 2004 @@ -17,8 +17,8 @@ struct llvm_java_object_vtable** vtables; unsigned lastIface; union { - struct llvm_java_object_vtable** interfaces; unsigned interfaceFlag; + struct llvm_java_object_vtable** interfaces; }; }; @@ -26,6 +26,11 @@ struct llvm_java_object_typeinfo typeinfo; }; +struct llvm_java_object_vtable* +llvm_java_GetObjectClass(struct llvm_java_object_base* obj) { + return obj->vtable; +} + int llvm_java_IsInstanceOf(struct llvm_java_object_base* obj, struct llvm_java_object_vtable* clazz) { struct llvm_java_object_vtable* objClazz = obj->vtable; From alkis at cs.uiuc.edu Wed Sep 15 14:01:15 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 15 Sep 2004 14:01:15 -0500 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200409151901.OAA07663@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.100 -> 1.101 --- Log message: Fix function argument passing order. --- Diffs of the changes: (+60 -35) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.100 llvm-java/lib/Compiler/Compiler.cpp:1.101 --- llvm-java/lib/Compiler/Compiler.cpp:1.100 Wed Sep 15 13:06:47 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Wed Sep 15 14:01:04 2004 @@ -1229,16 +1229,12 @@ new StoreInst(v, getField(bcI, index, p), getBBAt(bcI)); } - void makeCall(Value* fun, BasicBlock* bb) { + void makeCall(Value* fun, + const std::vector params, + BasicBlock* bb) { const PointerType* funPtrTy = cast(fun->getType()); - const FunctionType* funTy = cast(funPtrTy->getElementType()); - std::vector params(funTy->getNumParams(), NULL); - for (unsigned i = 0, e = funTy->getNumParams(); i != e; ++i) { - Value* p = opStack_.top(); opStack_.pop(); - const Type* paramTy = funTy->getParamType(i); - params[i] = - p->getType() == paramTy ? p : new CastInst(p, paramTy, TMP, bb); - } + const FunctionType* funTy = + cast(funPtrTy->getElementType()); if (funTy->getReturnType() == Type::VoidTy) new CallInst(fun, params, "", bb); @@ -1248,6 +1244,20 @@ } } + std::vector getParams(FunctionType* funTy, BasicBlock* bb) { + unsigned numParams = funTy->getNumParams(); + std::vector params(numParams); + while (numParams--) { + Value* p = opStack_.top(); opStack_.pop(); + params[numParams] = + p->getType() == funTy->getParamType(numParams) ? + p : + new CastInst(p, funTy->getParamType(numParams), TMP, bb); + } + + return params; + } + void do_invokevirtual(unsigned bcI, unsigned index) { ConstantMethodRef* methodRef = cf_->getConstantMethodRef(index); ConstantNameAndType* nameAndType = methodRef->getNameAndType(); @@ -1261,27 +1271,33 @@ nameAndType->getName()->str() + nameAndType->getDescriptor()->str(); - Value* objRef = opStack_.top(); // do not pop + FunctionType* funTy = + cast(getType(nameAndType->getDescriptor(), ci.type)); + + BasicBlock* BB = getBBAt(bcI); + std::vector params(getParams(funTy, BB)); + + Value* objRef = params.front(); objRef = new CastInst(objRef, PointerType::get(ci.type), - "this", getBBAt(bcI)); + "this", BB); Value* objBase = getField(bcI, cf, LLVM_JAVA_OBJECT_BASE, objRef); Function* f = module_->getOrInsertFunction( LLVM_JAVA_GETOBJECTCLASS, PointerType::get(VTableInfo::VTableTy), objBase->getType(), NULL); - Value* vtable = new CallInst(f, objBase, TMP, getBBAt(bcI)); + Value* vtable = new CallInst(f, objBase, TMP, BB); vtable = new CastInst(vtable, PointerType::get(vi.vtable->getType()), - TMP, getBBAt(bcI)); - vtable = new LoadInst(vtable, className + "", getBBAt(bcI)); + TMP, BB); + vtable = new LoadInst(vtable, className + "", BB); std::vector indices(1, ConstantUInt::get(Type::UIntTy, 0)); assert(vi.m2iMap.find(methodDescr) != vi.m2iMap.end() && "could not find slot for virtual function!"); unsigned vSlot = vi.m2iMap.find(methodDescr)->second; indices.push_back(ConstantUInt::get(Type::UIntTy, vSlot)); Value* vfunPtr = - new GetElementPtrInst(vtable, indices, TMP, getBBAt(bcI)); - Value* vfun = new LoadInst(vfunPtr, methodDescr, getBBAt(bcI)); + new GetElementPtrInst(vtable, indices, TMP, BB); + Value* vfun = new LoadInst(vfunPtr, methodDescr, BB); - makeCall(vfun, getBBAt(bcI)); + makeCall(vfun, params, BB); } void do_invokespecial(unsigned bcI, unsigned index) { @@ -1296,12 +1312,13 @@ const ClassInfo& ci = getClassInfo(ClassFile::get(className)); // constructor calls are statically bound + BasicBlock* BB = getBBAt(bcI); if (methodName == "") { - FunctionType* funcType = + FunctionType* funcTy = cast(getType(nameAndType->getDescriptor(), ci.type)); - Function* function = module_->getOrInsertFunction(funcName, funcType); + Function* function = module_->getOrInsertFunction(funcName, funcTy); toCompileFunctions_.insert(function); - makeCall(function, getBBAt(bcI)); + makeCall(function, getParams(funcTy, BB), BB); } // otherwise we call the superclass' implementation of the method else { @@ -1318,11 +1335,12 @@ nameAndType->getName()->str() + nameAndType->getDescriptor()->str(); - FunctionType* funcType = + FunctionType* funcTy = cast(getType(nameAndType->getDescriptor())); - Function* function = module_->getOrInsertFunction(funcName, funcType); + Function* function = module_->getOrInsertFunction(funcName, funcTy); toCompileFunctions_.insert(function); - makeCall(function, getBBAt(bcI)); + BasicBlock* BB = getBBAt(bcI); + makeCall(function, getParams(funcTy, BB), BB); } void do_invokeinterface(unsigned bcI, unsigned index) { @@ -1338,30 +1356,36 @@ nameAndType->getName()->str() + nameAndType->getDescriptor()->str(); - Value* objRef = opStack_.top(); // do not pop + FunctionType* funTy = + cast(getType(nameAndType->getDescriptor(), ci.type)); + + BasicBlock* BB = getBBAt(bcI); + std::vector params(getParams(funTy, BB)); + + Value* objRef = params.front(); objRef = new CastInst(objRef, PointerType::get(ci.type), - "this", getBBAt(bcI)); + "this", BB); Value* objBase = getField(bcI, cf, LLVM_JAVA_OBJECT_BASE, objRef); Function* f = module_->getOrInsertFunction( LLVM_JAVA_GETOBJECTCLASS, PointerType::get(VTableInfo::VTableTy), objBase->getType(), NULL); - Value* vtable = new CallInst(f, objBase, TMP, getBBAt(bcI)); + Value* vtable = new CallInst(f, objBase, TMP, BB); // get the interfaces array of vtables std::vector indices(2, ConstantUInt::get(Type::UIntTy, 0)); indices.push_back(ConstantUInt::get(Type::UIntTy, 3)); Value* interfaceVTables = - new GetElementPtrInst(vtable, indices, TMP, getBBAt(bcI)); - interfaceVTables = new LoadInst(interfaceVTables, TMP, getBBAt(bcI)); + new GetElementPtrInst(vtable, indices, TMP, BB); + interfaceVTables = new LoadInst(interfaceVTables, TMP, BB); // get the actual interface vtable indices.resize(1); indices.push_back(ConstantUInt::get(Type::UIntTy, ci.interfaceIdx)); Value* interfaceVTable = - new GetElementPtrInst(vtable, indices, TMP, getBBAt(bcI)); + new GetElementPtrInst(vtable, indices, TMP, BB); interfaceVTable = new CastInst(vtable, PointerType::get(VTableInfo::VTableTy), - TMP, getBBAt(bcI)); + TMP, BB); interfaceVTable = - new LoadInst(interfaceVTable, className + "", getBBAt(bcI)); + new LoadInst(interfaceVTable, className + "", BB); // get the function pointer indices.resize(1); assert(vi.m2iMap.find(methodDescr) != vi.m2iMap.end() && @@ -1369,10 +1393,10 @@ unsigned vSlot = vi.m2iMap.find(methodDescr)->second; indices.push_back(ConstantUInt::get(Type::UIntTy, vSlot)); Value* vfunPtr = - new GetElementPtrInst(interfaceVTable, indices, TMP, getBBAt(bcI)); - Value* vfun = new LoadInst(vfunPtr, methodDescr, getBBAt(bcI)); + new GetElementPtrInst(interfaceVTable, indices, TMP, BB); + Value* vfun = new LoadInst(vfunPtr, methodDescr, BB); - makeCall(vfun, getBBAt(bcI)); + makeCall(vfun, params, BB); } void do_new(unsigned bcI, unsigned index) { @@ -1427,7 +1451,8 @@ Function* f = module_->getOrInsertFunction( LLVM_JAVA_ISINSTANCEOF, Type::IntTy, objBase->getType(), PointerType::get(VTableInfo::VTableTy), NULL); - Value* r = new CallInst(f, objBase, vi.vtable, TMP, getBBAt(bcI)); + Value* vtable = new CastInst(vi.vtable, PointerType::get(VTableInfo::VTableTy), TMP, getBBAt(bcI)); + Value* r = new CallInst(f, objBase, vtable, TMP, getBBAt(bcI)); opStack_.push(r); } From alkis at cs.uiuc.edu Wed Sep 15 14:31:32 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 15 Sep 2004 14:31:32 -0500 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200409151931.OAA07779@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.101 -> 1.102 --- Log message: Insert fall through branches to basic blocks without a terminator. These are basic blocks in switch blocks without a break statement. --- Diffs of the changes: (+9 -0) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.101 llvm-java/lib/Compiler/Compiler.cpp:1.102 --- llvm-java/lib/Compiler/Compiler.cpp:1.101 Wed Sep 15 14:01:04 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Wed Sep 15 14:31:21 2004 @@ -767,6 +767,15 @@ new BranchInst(prologue_->getNext(), prologue_); } + // now scan the basic blocks of this function and insert fall + // through branches to all basic blocks that don't have a + // terminator (these are blocks in switch blocks without a break + // statement) + for (Function::iterator + BB = function->begin(), BBE = function->end(); BB != BBE; ++BB) + if (!BB->getTerminator()) + new BranchInst(next(BB), BB); + return function; } From alkis at cs.uiuc.edu Wed Sep 15 15:16:22 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 15 Sep 2004 15:16:22 -0500 Subject: [llvm-commits] CVS: llvm-java/test/Programs/SingleSource/UnitTests/VTable.java InstanceOf.java FieldAccess.java Message-ID: <200409152016.PAA08028@zion.cs.uiuc.edu> Changes in directory llvm-java/test/Programs/SingleSource/UnitTests: VTable.java updated: 1.1 -> 1.2 InstanceOf.java updated: 1.1 -> 1.2 FieldAccess.java updated: 1.1 -> 1.2 --- Log message: Rename test classes to avoid class name conflicts. --- Diffs of the changes: (+28 -36) Index: llvm-java/test/Programs/SingleSource/UnitTests/VTable.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/VTable.java:1.1 llvm-java/test/Programs/SingleSource/UnitTests/VTable.java:1.2 --- llvm-java/test/Programs/SingleSource/UnitTests/VTable.java:1.1 Sat Aug 14 03:58:30 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/VTable.java Wed Sep 15 15:16:12 2004 @@ -1,22 +1,19 @@ -class A +class VTableBase { int foo() { return 0; } int bar() { return 0; } } -class B extends A +public class VTable extends VTableBase { int foo() { return 1; } -} -public class VTable -{ public static void main(String[] args) { - A a = new A(); + VTableBase a = new VTableBase(); a.foo(); a.bar(); - a = new B(); + a = new VTable(); a.foo(); a.bar(); } Index: llvm-java/test/Programs/SingleSource/UnitTests/InstanceOf.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/InstanceOf.java:1.1 llvm-java/test/Programs/SingleSource/UnitTests/InstanceOf.java:1.2 --- llvm-java/test/Programs/SingleSource/UnitTests/InstanceOf.java:1.1 Mon Sep 13 16:35:17 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/InstanceOf.java Wed Sep 15 15:16:12 2004 @@ -1,36 +1,33 @@ -class A +class InstanceOfBase { int foo() { return 0; } int bar() { return 0; } } -interface I { +interface InstanceOfInterface { public int baz(); } -class B extends A implements I +public class InstanceOf extends InstanceOfBase implements InstanceOfInterface { int foo() { return 1; } public int baz() { return foo(); } -} -public class InstanceOf -{ public static void main(String[] args) { - A aa = new A(); - A ab = new B(); - B bb = new B(); - - boolean aaA = aa instanceof A; - boolean aaB = aa instanceof B; - boolean aaI = aa instanceof I; - - boolean abA = ab instanceof A; - boolean abB = ab instanceof B; - boolean abI = ab instanceof I; - - boolean bbA = bb instanceof A; - boolean bbB = bb instanceof B; - boolean bbI = bb instanceof I; + InstanceOfBase aa = new InstanceOfBase(); + InstanceOfBase ab = new InstanceOf(); + InstanceOfInterface bb = new InstanceOf(); + + boolean aaA = aa instanceof InstanceOfBase; + boolean aaB = aa instanceof InstanceOf; + boolean aaI = aa instanceof InstanceOfInterface; + + boolean abA = ab instanceof InstanceOfBase; + boolean abB = ab instanceof InstanceOf; + boolean abI = ab instanceof InstanceOfInterface; + + boolean bbA = bb instanceof InstanceOfBase; + boolean bbB = bb instanceof InstanceOf; + boolean bbI = bb instanceof InstanceOfInterface; } } Index: llvm-java/test/Programs/SingleSource/UnitTests/FieldAccess.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/FieldAccess.java:1.1 llvm-java/test/Programs/SingleSource/UnitTests/FieldAccess.java:1.2 --- llvm-java/test/Programs/SingleSource/UnitTests/FieldAccess.java:1.1 Sun Jul 25 05:32:13 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/FieldAccess.java Wed Sep 15 15:16:12 2004 @@ -1,21 +1,19 @@ -class A { +class FieldAccessBase { int i; float f; } -class B extends A { +public class FieldAccess extends FieldAccessBase +{ int i; double d; -} -public class FieldAccess -{ public static void main(String[] args) { - B b = null; + FieldAccess b = new FieldAccess(); b.d = 4.0; b.i = 3; b.f = 2.0F; - ((A) b).i = 4; - ((A) b).f = 1.0F; + ((FieldAccessBase) b).i = 4; + ((FieldAccessBase) b).f = 1.0F; } } From alkis at cs.uiuc.edu Wed Sep 15 15:26:43 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 15 Sep 2004 15:26:43 -0500 Subject: [llvm-commits] CVS: llvm-java/include/llvm/Java/ClassFile.h Message-ID: <200409152026.PAA08114@zion.cs.uiuc.edu> Changes in directory llvm-java/include/llvm/Java: ClassFile.h updated: 1.23 -> 1.24 --- Log message: Add helper method to get ConstantInterfanceMethodRef's from a classfile. --- Diffs of the changes: (+3 -0) Index: llvm-java/include/llvm/Java/ClassFile.h diff -u llvm-java/include/llvm/Java/ClassFile.h:1.23 llvm-java/include/llvm/Java/ClassFile.h:1.24 --- llvm-java/include/llvm/Java/ClassFile.h:1.23 Mon Sep 13 20:04:42 2004 +++ llvm-java/include/llvm/Java/ClassFile.h Wed Sep 15 15:26:32 2004 @@ -32,6 +32,7 @@ class Constant; class ConstantClass; class ConstantFieldRef; + class ConstantInterfaceMethodRef; class ConstantMethodRef; class ConstantNameAndType; class ConstantUtf8; @@ -83,6 +84,8 @@ ConstantClass* getConstantClass(unsigned index) const; ConstantFieldRef* getConstantFieldRef(unsigned index) const; ConstantMethodRef* getConstantMethodRef(unsigned index) const; + ConstantInterfaceMethodRef* + getConstantInterfaceMethodRef(unsigned index) const; bool isPublic() const { return accessFlags_ & ACC_PUBLIC; } bool isFinal() const { return accessFlags_ & ACC_FINAL; } From alkis at cs.uiuc.edu Wed Sep 15 15:26:43 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 15 Sep 2004 15:26:43 -0500 Subject: [llvm-commits] CVS: llvm-java/lib/ClassFile/ClassFile.cpp Message-ID: <200409152026.PAA08117@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/ClassFile: ClassFile.cpp updated: 1.27 -> 1.28 --- Log message: Add helper method to get ConstantInterfanceMethodRef's from a classfile. --- Diffs of the changes: (+8 -0) Index: llvm-java/lib/ClassFile/ClassFile.cpp diff -u llvm-java/lib/ClassFile/ClassFile.cpp:1.27 llvm-java/lib/ClassFile/ClassFile.cpp:1.28 --- llvm-java/lib/ClassFile/ClassFile.cpp:1.27 Mon Sep 13 20:04:42 2004 +++ llvm-java/lib/ClassFile/ClassFile.cpp Wed Sep 15 15:26:32 2004 @@ -272,6 +272,14 @@ return static_cast(getConstant(index)); } +ConstantInterfaceMethodRef* +ClassFile::getConstantInterfaceMethodRef(unsigned index) const +{ + assert(dynamic_cast(getConstant(index)) && + "Constant is not a ConstantInterfaceMethodRef!"); + return static_cast(getConstant(index)); +} + Method* ClassFile::getMethod(const std::string& nameAndDescr) const { Name2MethodMap::const_iterator it = n2mMap_.find(nameAndDescr); From alkis at cs.uiuc.edu Wed Sep 15 15:27:30 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 15 Sep 2004 15:27:30 -0500 Subject: [llvm-commits] CVS: llvm-java/test/Programs/SingleSource/UnitTests/VTable.java Message-ID: <200409152027.PAA08156@zion.cs.uiuc.edu> Changes in directory llvm-java/test/Programs/SingleSource/UnitTests: VTable.java updated: 1.2 -> 1.3 --- Log message: Modify test to include dynamic dispatch through an interface vtable. --- Diffs of the changes: (+14 -4) Index: llvm-java/test/Programs/SingleSource/UnitTests/VTable.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/VTable.java:1.2 llvm-java/test/Programs/SingleSource/UnitTests/VTable.java:1.3 --- llvm-java/test/Programs/SingleSource/UnitTests/VTable.java:1.2 Wed Sep 15 15:16:12 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/VTable.java Wed Sep 15 15:27:20 2004 @@ -1,12 +1,18 @@ class VTableBase { - int foo() { return 0; } - int bar() { return 0; } + public int foo() { return 0; } + public int bar() { return 0; } } -public class VTable extends VTableBase +interface VTableInterface { - int foo() { return 1; } + public int baz(); +} + +public class VTable extends VTableBase implements VTableInterface +{ + public int foo() { return 1; } + public int baz() { return 2; } public static void main(String[] args) { VTableBase a = new VTableBase(); @@ -16,5 +22,9 @@ a = new VTable(); a.foo(); a.bar(); + ((VTableInterface)a).baz(); + + VTableInterface i = new VTable(); + i.baz(); } } From alkis at cs.uiuc.edu Wed Sep 15 19:09:46 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 15 Sep 2004 19:09:46 -0500 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200409160009.TAA09468@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.102 -> 1.103 --- Log message: Fix invokeinterface codegen. --- Diffs of the changes: (+6 -6) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.102 llvm-java/lib/Compiler/Compiler.cpp:1.103 --- llvm-java/lib/Compiler/Compiler.cpp:1.102 Wed Sep 15 14:31:21 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Wed Sep 15 19:09:36 2004 @@ -1353,7 +1353,8 @@ } void do_invokeinterface(unsigned bcI, unsigned index) { - ConstantMethodRef* methodRef = cf_->getConstantMethodRef(index); + ConstantInterfaceMethodRef* methodRef = + cf_->getConstantInterfaceMethodRef(index); ConstantNameAndType* nameAndType = methodRef->getNameAndType(); ClassFile* cf = ClassFile::get(methodRef->getClass()->getName()->str()); @@ -1386,15 +1387,14 @@ new GetElementPtrInst(vtable, indices, TMP, BB); interfaceVTables = new LoadInst(interfaceVTables, TMP, BB); // get the actual interface vtable - indices.resize(1); + indices.clear(); indices.push_back(ConstantUInt::get(Type::UIntTy, ci.interfaceIdx)); Value* interfaceVTable = - new GetElementPtrInst(vtable, indices, TMP, BB); - interfaceVTable = - new CastInst(vtable, PointerType::get(VTableInfo::VTableTy), - TMP, BB); + new GetElementPtrInst(interfaceVTables, indices, TMP, BB); interfaceVTable = new LoadInst(interfaceVTable, className + "", BB); + interfaceVTable = + new CastInst(interfaceVTable, vi.vtable->getType(), TMP, BB); // get the function pointer indices.resize(1); assert(vi.m2iMap.find(methodDescr) != vi.m2iMap.end() && From alkis at cs.uiuc.edu Wed Sep 15 19:14:55 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 15 Sep 2004 19:14:55 -0500 Subject: [llvm-commits] CVS: llvm-java/test/Programs/SingleSource/Makefile.singlesrc Message-ID: <200409160014.TAA09537@zion.cs.uiuc.edu> Changes in directory llvm-java/test/Programs/SingleSource: Makefile.singlesrc updated: 1.6 -> 1.7 --- Log message: Perform optimizations at link time. --- Diffs of the changes: (+1 -2) Index: llvm-java/test/Programs/SingleSource/Makefile.singlesrc diff -u llvm-java/test/Programs/SingleSource/Makefile.singlesrc:1.6 llvm-java/test/Programs/SingleSource/Makefile.singlesrc:1.7 --- llvm-java/test/Programs/SingleSource/Makefile.singlesrc:1.6 Wed Sep 8 15:28:31 2004 +++ llvm-java/test/Programs/SingleSource/Makefile.singlesrc Wed Sep 15 19:14:45 2004 @@ -10,7 +10,6 @@ # rule to build raw bytecode from a classfile %.raw.bc: %.class $(CLASS2LLVM) @$(ECHO) Compiling $< - $(CLASS2LLVM) -cp $(CLASSPATH):Output $(subst /,.,$(*F)) | \ - $(LOPT) -simplifycfg -mem2reg -instcombine > $@ + $(CLASS2LLVM) -cp $(CLASSPATH):Output $(subst /,.,$(*F)) > $@ include $(LEVEL)/test/Makefile.test From alkis at cs.uiuc.edu Wed Sep 15 19:14:55 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 15 Sep 2004 19:14:55 -0500 Subject: [llvm-commits] CVS: llvm-java/test/Makefile.test Message-ID: <200409160014.TAA09540@zion.cs.uiuc.edu> Changes in directory llvm-java/test: Makefile.test updated: 1.14 -> 1.15 --- Log message: Perform optimizations at link time. --- Diffs of the changes: (+2 -1) Index: llvm-java/test/Makefile.test diff -u llvm-java/test/Makefile.test:1.14 llvm-java/test/Makefile.test:1.15 --- llvm-java/test/Makefile.test:1.14 Wed Sep 15 00:40:59 2004 +++ llvm-java/test/Makefile.test Wed Sep 15 19:14:45 2004 @@ -22,7 +22,8 @@ #rule to link in runtime to raw bytecode %.linked.bc: %.raw.bc $(DESTLIBBYTECODE)/libjrt.bc @$(ECHO) Linking $< with the Java runtime - $(LLVMTOOLCURRENT)/llvm-link$(EXEEXT) $^ -f -o $@ + $(LLVMTOOLCURRENT)/llvm-link$(EXEEXT) $^ -o - | \ + $(LOPT) -simplifycfg -mem2reg -instcombine > $@ # rule to make assembly from bytecode %.dis-ll: %.bc From criswell at cs.uiuc.edu Thu Sep 16 09:11:38 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu, 16 Sep 2004 09:11:38 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200409161411.JAA14167@choi.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.194 -> 1.195 --- Log message: Add dependencies so that project tools are recompiled if LLVM libraries are updated. --- Diffs of the changes: (+8 -3) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.194 llvm/Makefile.rules:1.195 --- llvm/Makefile.rules:1.194 Tue Sep 7 14:03:35 2004 +++ llvm/Makefile.rules Thu Sep 16 09:11:25 2004 @@ -685,6 +685,11 @@ USED_LIB_PATHS_O := $(addprefix $(DESTLIBRELEASE)/, $(STATICUSEDLIBS)) USED_LIB_PATHS_P := $(addprefix $(DESTLIBPROFILE)/, $(STATICUSEDLIBS)) +LLVMSTATICUSEDLIBS := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS))) +LLVM_LIB_PATHS_G := $(addprefix $(LLVMLIBDEBUGSOURCE)/, $(LLVMSTATICUSEDLIBS)) +LLVM_LIB_PATHS_O := $(addprefix $(LLVMLIBRELEASESOURCE)/, $(LLVMSTATICUSEDLIBS)) +LLVM_LIB_PATHS_P := $(addprefix $(LLVMLIBPROFILEOURCE)/, $(LLVMSTATICUSEDLIBS)) + # # Libtool link options: # Ensure that all binaries have their symbols exported so that they can @@ -706,17 +711,17 @@ clean:: $(VERB) $(RM) -f $(TOOLEXENAMES) -$(TOOLEXENAME_G): $(ObjectsG) $(USED_LIB_PATHS_G) $(DESTTOOLDEBUG)/.dir +$(TOOLEXENAME_G): $(ObjectsG) $(USED_LIB_PATHS_G) $(LLVM_LIB_PATHS_G) $(DESTTOOLDEBUG)/.dir @${ECHO} Linking $(TOOLNAME) debug executable $(STRIP_WARN_MSG) $(VERB) $(LinkG) -o $@ $(ObjectsG) $(LIB_OPTS_G) $(LINK_OPTS) $(LIBS) @${ECHO} ======= Finished building $(TOOLNAME) debug executable $(STRIP_WARN_MSG) ======= -$(TOOLEXENAME_O): $(ObjectsO) $(USED_LIB_PATHS_O) $(DESTTOOLRELEASE)/.dir +$(TOOLEXENAME_O): $(ObjectsO) $(USED_LIB_PATHS_O) $(LLVM_LIB_PATHS_O) $(DESTTOOLRELEASE)/.dir @${ECHO} Linking $(TOOLNAME) release executable $(VERB) $(LinkO) -o $@ $(ObjectsO) $(LIB_OPTS_O) $(LINK_OPTS) $(LIBS) @${ECHO} ======= Finished building $(TOOLNAME) release executable ======= -$(TOOLEXENAME_P): $(ObjectsP) $(USED_LIB_PATHS_P) $(DESTTOOLPROFILE)/.dir +$(TOOLEXENAME_P): $(ObjectsP) $(USED_LIB_PATHS_P) $(LLVM_LIB_PATHS_P) $(DESTTOOLPROFILE)/.dir @${ECHO} Linking $(TOOLNAME) profile executable $(VERB) $(LinkP) -o $@ $(ObjectsP) $(LIB_OPTS_P) $(LINK_OPTS) $(LIBS) @${ECHO} ======= Finished building $(TOOLNAME) profile executable ======= From criswell at cs.uiuc.edu Thu Sep 16 09:13:30 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu, 16 Sep 2004 09:13:30 -0500 Subject: [llvm-commits] CVS: llvm-java/Makefile.common.in Message-ID: <200409161413.JAA14186@choi.cs.uiuc.edu> Changes in directory llvm-java: Makefile.common.in updated: 1.3 -> 1.4 --- Log message: Completely changed Makefile.common.in, basing it off of the LLVM sample project. I also re-added all of Alkis's changes (or, at least, I hope I did). This should get the llvm-java build working as a standard LLVM project, enabling building in both srcdir and with a separate objdir. --- Diffs of the changes: (+21 -15) Index: llvm-java/Makefile.common.in diff -u llvm-java/Makefile.common.in:1.3 llvm-java/Makefile.common.in:1.4 --- llvm-java/Makefile.common.in:1.3 Sat May 22 01:21:36 2004 +++ llvm-java/Makefile.common.in Thu Sep 16 09:13:18 2004 @@ -6,38 +6,44 @@ # the University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===# + # -# Configure the location of the LLVM object root. We know it is two -# directories up. The source tree location we do not know; let the LLVM -# Makefiles find it for us. +# Set this variable to the top of the LLVM source tree. # -LLVM_OBJ_ROOT=$(LEVEL)/../.. +LLVM_SRC_ROOT = @LLVM_SRC@ # -# Grab the LLVM configuration file. +# Set this variable to the top level directory where LLVM was built +# (this is *not* the same as OBJ_ROOT as defined in LLVM's Makefile.config). # -include $(LEVEL)/../../Makefile.config +LLVM_OBJ_ROOT = @LLVM_OBJ@ # -# Reconfigure the source directories +# Include LLVM's Master Makefile. # -BUILD_SRC_ROOT:=$(LLVM_SRC_ROOT)/projects/Java -BUILD_SRC_DIR := $(subst //,/,$(BUILD_SRC_ROOT)/$(patsubst $(BUILD_OBJ_ROOT)%,%, $(BUILD_OBJ_DIR))) +include $(LLVM_OBJ_ROOT)/Makefile.config # -# Additional utilities +# Set the source root and source directory pathnames # -JIKES=@JIKES@ -JAVAC=@JAVAC@ -JAVA=@JAVA@ +BUILD_SRC_DIR := $(subst //,/, at abs_top_srcdir@/$(patsubst $(BUILD_OBJ_ROOT)%,%,$(BUILD_OBJ_DIR))) + +BUILD_SRC_ROOT := $(subst //,/, at abs_top_srcdir@) # -# Include LLVM's build rules. +# Include LLVM's Master Makefile. # include $(LLVM_SRC_ROOT)/Makefile.rules # +# Additional utilities +# +JIKES=@JIKES@ +JAVAC=@JAVAC@ +JAVA=@JAVA@ + +# # Include local build rules. # -include $(LEVEL)/Makefile.rules +include $(BUILD_SRC_ROOT)/Makefile.rules From reid at x10sys.com Thu Sep 16 10:53:27 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Sep 2004 10:53:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Signals.cpp Message-ID: <200409161553.KAA22877@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Signals.cpp updated: 1.1 -> 1.2 --- Log message: Implement the signals interface for Win32. Patch provided by Jeff Cohen. Thanks Jeff! --- Diffs of the changes: (+183 -6) Index: llvm/lib/System/Win32/Signals.cpp diff -u llvm/lib/System/Win32/Signals.cpp:1.1 llvm/lib/System/Win32/Signals.cpp:1.2 --- llvm/lib/System/Win32/Signals.cpp:1.1 Sun Aug 29 14:22:48 2004 +++ llvm/lib/System/Win32/Signals.cpp Thu Sep 16 10:53:16 2004 @@ -2,7 +2,7 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by Reid Spencer and is distributed under the +// This file was developed by Jeff Cohen and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// @@ -11,27 +11,204 @@ // //===----------------------------------------------------------------------===// +#include "Win32.h" +#include +#include + +#include "dbghelp.h" +#include "psapi.h" + +#pragma comment(lib, "psapi.lib") +#pragma comment(lib, "dbghelp.lib") + +// Forward declare. +static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep); +static BOOL WINAPI LLVMConsoleCtrlHandler(DWORD dwCtrlType); + +static std::vector *FilesToRemove = NULL; +static std::vector *DirectoriesToRemove = NULL; +static bool RegisteredUnhandledExceptionFilter = false; +static CRITICAL_SECTION CriticalSection; + namespace llvm { -using namespace sys; //===----------------------------------------------------------------------===// //=== WARNING: Implementation here must contain only Win32 specific code -//=== and must not be generic UNIX code (see ../Unix/Signals.cpp) +//=== and must not be UNIX code //===----------------------------------------------------------------------===// + +static void RegisterHandler() { + if (RegisteredUnhandledExceptionFilter) + return; + + // Now's the time to create the critical section. This is the first time + // through here, and there's only one thread. + InitializeCriticalSection(&CriticalSection); + + // Enter it immediately. Now if someone hits CTRL/C, the console handler + // can't proceed until the globals are updated. + EnterCriticalSection(&CriticalSection); + + RegisteredUnhandledExceptionFilter = true; + SetUnhandledExceptionFilter(LLVMUnhandledExceptionFilter); + SetConsoleCtrlHandler(LLVMConsoleCtrlHandler, TRUE); + + // IMPORTANT NOTE: Caller must call LeaveCriticalSection(&CriticalSection) or + // else multi-threading problems will ensue. +} + // RemoveFileOnSignal - The public API -void llvm::RemoveFileOnSignal(const std::string &Filename) { +void sys::RemoveFileOnSignal(const std::string &Filename) { + RegisterHandler(); + + if (FilesToRemove == NULL) + FilesToRemove = new std::vector; + + FilesToRemove->push_back(Filename); + + LeaveCriticalSection(&CriticalSection); } // RemoveDirectoryOnSignal - The public API -void llvm::RemoveDirectoryOnSignal(const llvm::sys::Path& path) { +void sys::RemoveDirectoryOnSignal(const sys::Path& path) { + RegisterHandler(); + + if (path.is_directory()) { + if (DirectoriesToRemove == NULL) + DirectoriesToRemove = new std::vector; + + DirectoriesToRemove->push_back(path); + } + + LeaveCriticalSection(&CriticalSection); } /// PrintStackTraceOnErrorSignal - When an error signal (such as SIBABRT or /// SIGSEGV) is delivered to the process, print a stack trace and then exit. -void llvm::PrintStackTraceOnErrorSignal() { +void sys::PrintStackTraceOnErrorSignal() { + RegisterHandler(); + LeaveCriticalSection(&CriticalSection); } } +static void Cleanup() { + EnterCriticalSection(&CriticalSection); + + if (FilesToRemove != NULL) + while (!FilesToRemove->empty()) { + try { + std::remove(FilesToRemove->back().c_str()); + } catch (...) { + } + FilesToRemove->pop_back(); + } + + if (DirectoriesToRemove != NULL) + while (!DirectoriesToRemove->empty()) { + try { + DirectoriesToRemove->back().destroy_directory(true); + } catch (...) { + } + DirectoriesToRemove->pop_back(); + } + + LeaveCriticalSection(&CriticalSection); +} + +static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep) { + try { + Cleanup(); + + // Initialize the STACKFRAME structure. + STACKFRAME StackFrame; + memset(&StackFrame, 0, sizeof(StackFrame)); + + StackFrame.AddrPC.Offset = ep->ContextRecord->Eip; + StackFrame.AddrPC.Mode = AddrModeFlat; + StackFrame.AddrStack.Offset = ep->ContextRecord->Esp; + StackFrame.AddrStack.Mode = AddrModeFlat; + StackFrame.AddrFrame.Offset = ep->ContextRecord->Ebp; + StackFrame.AddrFrame.Mode = AddrModeFlat; + + HANDLE hProcess = GetCurrentProcess(); + HANDLE hThread = GetCurrentThread(); + + // Initialize the symbol handler. + SymSetOptions(SYMOPT_DEFERRED_LOADS|SYMOPT_LOAD_LINES); + SymInitialize(GetCurrentProcess(), NULL, TRUE); + + while (true) { + if (!StackWalk(IMAGE_FILE_MACHINE_I386, hProcess, hThread, &StackFrame, + ep->ContextRecord, NULL, SymFunctionTableAccess, + SymGetModuleBase, NULL)) { + break; + } + + if (StackFrame.AddrFrame.Offset == 0) + break; + + // Print the PC in hexadecimal. + DWORD PC = StackFrame.AddrPC.Offset; + fprintf(stderr, "%04X:%08X", ep->ContextRecord->SegCs, PC); + + // Print the parameters. Assume there are four. + fprintf(stderr, " (0x%08X 0x%08X 0x%08X 0x%08X)", StackFrame.Params[0], + StackFrame.Params[1], StackFrame.Params[2], StackFrame.Params[3]); + + // Verify the PC belongs to a module in this process. + if (!SymGetModuleBase(hProcess, PC)) { + fputc('\n', stderr); + continue; + } + + // Print the symbol name. + char buffer[512]; + IMAGEHLP_SYMBOL *symbol = reinterpret_cast(buffer); + memset(symbol, 0, sizeof(IMAGEHLP_SYMBOL)); + symbol->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL); + symbol->MaxNameLength = 512 - sizeof(IMAGEHLP_SYMBOL); + + DWORD dwDisp; + if (!SymGetSymFromAddr(hProcess, PC, &dwDisp, symbol)) { + fputc('\n', stderr); + continue; + } + + buffer[511] = 0; + if (dwDisp > 0) + fprintf(stderr, ", %s()+%04d bytes(s)", symbol->Name, dwDisp); + else + fprintf(stderr, ", %s", symbol->Name); + + // Print the source file and line number information. + IMAGEHLP_LINE line; + memset(&line, 0, sizeof(line)); + line.SizeOfStruct = sizeof(line); + if (SymGetLineFromAddr(hProcess, PC, &dwDisp, &line)) { + fprintf(stderr, ", %s, line %d", line.FileName, line.LineNumber); + if (dwDisp > 0) + fprintf(stderr, "+%04d byte(s)", dwDisp); + } + + fputc('\n', stderr); + } + } + catch (...) + { + assert(!"Crashed in LLVMUnhandledExceptionFilter"); + } + + // Allow dialog box to pop up allowing choice to start debugger. + return EXCEPTION_CONTINUE_SEARCH; +} + +static BOOL WINAPI LLVMConsoleCtrlHandler(DWORD dwCtrlType) { + Cleanup(); + + // Allow normal processing to take place. + return FALSE; +} + // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Thu Sep 16 11:36:20 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Sep 2004 11:36:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.cpp Message-ID: <200409161636.LAA23041@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.cpp updated: 1.6 -> 1.7 --- Log message: Allow "bc" as suffix for bytecode files. --- Diffs of the changes: (+8 -0) Index: llvm/lib/System/Unix/Path.cpp diff -u llvm/lib/System/Unix/Path.cpp:1.6 llvm/lib/System/Unix/Path.cpp:1.7 --- llvm/lib/System/Unix/Path.cpp:1.6 Mon Sep 13 19:16:39 2004 +++ llvm/lib/System/Unix/Path.cpp Thu Sep 16 11:36:10 2004 @@ -52,6 +52,8 @@ return true; else if (path.elide_suffix() && path.append_suffix("o") && path.readable()) return true; + else if (path.elide_suffix() && path.append_suffix("bc") && path.readable()) + return true; } else if (path.elide_file() && path.append_file(basename)) { if (path.append_suffix(Path::GetDLLSuffix()) && path.readable()) return true; @@ -59,6 +61,8 @@ return true; else if (path.elide_suffix() && path.append_suffix("o") && path.readable()) return true; + else if (path.elide_suffix() && path.append_suffix("bc") && path.readable()) + return true; } path.clear(); return false; @@ -76,6 +80,10 @@ return result; } + // Try the LLVM lib directory in the LLVM install area + if (result.set_directory(LLVM_LIBDIR) && IsLibrary(result,basename)) + return result; + // Try /usr/lib if (result.set_directory("/usr/lib/") && IsLibrary(result,basename)) return result; From reid at x10sys.com Thu Sep 16 11:41:41 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Sep 2004 11:41:41 -0500 Subject: [llvm-commits] CVS: llvm/LICENSE.TXT Message-ID: <200409161641.LAA23087@zion.cs.uiuc.edu> Changes in directory llvm: LICENSE.TXT updated: 1.20 -> 1.21 --- Log message: Adjust the license files based on the actual content of llvm and llvm-test after llvm-test was split out of llvm. --- Diffs of the changes: (+0 -29) Index: llvm/LICENSE.TXT diff -u llvm/LICENSE.TXT:1.20 llvm/LICENSE.TXT:1.21 --- llvm/LICENSE.TXT:1.20 Tue Aug 24 19:45:35 2004 +++ llvm/LICENSE.TXT Thu Sep 16 11:41:31 2004 @@ -68,35 +68,6 @@ llvm/projects/ModuleMaker/autoconf llvm/projects/sample/autoconf Burg: llvm/utils/Burg - llvm/test/Programs/MultiSource/Applications/Burg -Aha: llvm/test/Programs/MultiSource/Applications/aha -SGEFA: llvm/test/Programs/MultiSource/Applications/sgefa -SIOD: llvm/test/Programs/MultiSource/Applications/siod -Spiff: llvm/test/Programs/MultiSource/Applications/spiff -D: llvm/test/Programs/MultiSource/Applications/d -Lambda: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3 -hbd: llvm/test/Programs/MultiSource/Applications/hbd -treecc: llvm/test/Programs/MultiSource/Applications/treecc -kimwitu++: llvm/test/Programs/MultiSource/Applications/kimwitu++ -obsequi: llvm/test/Programs/MultiSource/Applications/obsequi -Fhourstones: llvm/test/Programs/MultiSource/Benchmarks/Fhourstones -McCat: llvm/test/Programs/MultiSource/Benchmarks/McCat -Olden: llvm/test/Programs/MultiSource/Benchmarks/Olden -OptimizerEval: llvm/test/Programs/MultiSource/Benchmarks/OptimizerEval -Ptrdist: llvm/test/Programs/MultiSource/Benchmarks/Ptrdist -LLUBenchmark: llvm/test/Programs/MultiSource/Benchmarks/llubenchmark -SIM: llvm/test/Programs/MultiSource/Benchmarks/sim -cfrac: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/cfrac -espresso: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/espresso -gs: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/gs -p2c: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/p2c -gawk: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/gawk -make: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make -perl: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/perl -Dhrystone: llvm/test/Programs/SingleSource/Benchmarks/Dhrystone -SingleSource Tests: llvm/test/Programs/SingleSource/Benchmarks/Misc - llvm/test/Programs/SingleSource/CustomChecked - llvm/test/Programs/SingleSource/Gizmos GNU Libc: llvm/runtime/GCCLibraries/libc Zlib Library: llvm/runtime/zlib PNG Library: llvm/runtime/libpng From reid at x10sys.com Thu Sep 16 11:41:42 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Sep 2004 11:41:42 -0500 Subject: [llvm-commits] CVS: llvm-test/LICENSE.TXT Message-ID: <200409161641.LAA23090@zion.cs.uiuc.edu> Changes in directory llvm-test: LICENSE.TXT updated: 1.2 -> 1.3 --- Log message: Adjust the license files based on the actual content of llvm and llvm-test after llvm-test was split out of llvm. --- Diffs of the changes: (+2 -12) Index: llvm-test/LICENSE.TXT diff -u llvm-test/LICENSE.TXT:1.2 llvm-test/LICENSE.TXT:1.3 --- llvm-test/LICENSE.TXT:1.2 Fri Sep 10 09:18:59 2004 +++ llvm-test/LICENSE.TXT Thu Sep 16 11:41:31 2004 @@ -61,14 +61,8 @@ Program Directory ------- --------- -System Library llvm/lib/System -Compiler Driver llvm/tools/llvmc -PowerPC Backend llvm/lib/Target/PowerPC -Autoconf: llvm/autoconf - llvm/projects/ModuleMaker/autoconf - llvm/projects/sample/autoconf -Burg: llvm/utils/Burg - llvm-test/MultiSource/Applications/Burg +Autoconf: llvm-test/autoconf +Burg: llvm-test/MultiSource/Applications/Burg Aha: llvm-test/MultiSource/Applications/aha SGEFA: llvm-test/MultiSource/Applications/sgefa SIOD: llvm-test/MultiSource/Applications/siod @@ -98,7 +92,3 @@ SingleSource Tests: llvm-test/SingleSource/Benchmarks/Misc llvm-test/SingleSource/CustomChecked llvm-test/SingleSource/Gizmos -GNU Libc: llvm/runtime/GCCLibraries/libc -Zlib Library: llvm/runtime/zlib -PNG Library: llvm/runtime/libpng - From reid at x10sys.com Thu Sep 16 22:02:38 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Sep 2004 22:02:38 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Signals.cpp Message-ID: <200409170302.WAA25988@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Signals.cpp updated: 1.2 -> 1.3 --- Log message: Make sure critical sections are entered before trying to leave them. Add some additional commentary about the workings of this module. Patch contributed by Jeff Cohen. Thanks Jeff! --- Diffs of the changes: (+12 -1) Index: llvm/lib/System/Win32/Signals.cpp diff -u llvm/lib/System/Win32/Signals.cpp:1.2 llvm/lib/System/Win32/Signals.cpp:1.3 --- llvm/lib/System/Win32/Signals.cpp:1.2 Thu Sep 16 10:53:16 2004 +++ llvm/lib/System/Win32/Signals.cpp Thu Sep 16 22:02:27 2004 @@ -28,6 +28,10 @@ static std::vector *FilesToRemove = NULL; static std::vector *DirectoriesToRemove = NULL; static bool RegisteredUnhandledExceptionFilter = false; + +// Windows creates a new thread to execute the console handler when an event +// (such as CTRL/C) occurs. This causes concurrency issues with the above +// globals which this critical section addresses. static CRITICAL_SECTION CriticalSection; namespace llvm { @@ -40,7 +44,10 @@ static void RegisterHandler() { if (RegisteredUnhandledExceptionFilter) + { + EnterCriticalSection(&CriticalSection); return; + } // Now's the time to create the critical section. This is the first time // through here, and there's only one thread. @@ -205,9 +212,13 @@ } static BOOL WINAPI LLVMConsoleCtrlHandler(DWORD dwCtrlType) { + // FIXME: This handler executes on a different thread. The main thread + // is still running, potentially creating new files to be cleaned up + // in the tiny window between the call to Cleanup() and process termination. + // Also, any files currently open cannot be deleted. Cleanup(); - // Allow normal processing to take place. + // Allow normal processing to take place; i.e., the process dies. return FALSE; } From lattner at cs.uiuc.edu Thu Sep 16 22:58:52 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 16 Sep 2004 22:58:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp Message-ID: <200409170358.WAA15424@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: ArgumentPromotion.cpp updated: 1.9 -> 1.10 --- Log message: Fix typo in comment --- Diffs of the changes: (+1 -1) Index: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp diff -u llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.9 llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.10 --- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.9 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Transforms/IPO/ArgumentPromotion.cpp Thu Sep 16 22:58:39 2004 @@ -9,7 +9,7 @@ // // This pass promotes "by reference" arguments to be "by value" arguments. In // practice, this means looking for internal functions that have pointer -// arguments. If we can prove, through the use of alias analysis, that that an +// arguments. If we can prove, through the use of alias analysis, that an // argument is *only* loaded, then we can pass the value into the function // instead of the address of the value. This can cause recursive simplification // of code and lead to the elimination of allocas (especially in C++ template From criswell at cs.uiuc.edu Fri Sep 17 10:08:38 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri, 17 Sep 2004 10:08:38 -0500 Subject: [llvm-commits] CVS: llvm/Makefile Message-ID: <200409171508.KAA01626@choi.cs.uiuc.edu> Changes in directory llvm: Makefile updated: 1.29 -> 1.30 --- Log message: Changed the distclean target to handle the new location of config.h. --- Diffs of the changes: (+1 -1) Index: llvm/Makefile diff -u llvm/Makefile:1.29 llvm/Makefile:1.30 --- llvm/Makefile:1.29 Sun Aug 29 14:33:21 2004 +++ llvm/Makefile Fri Sep 17 10:08:25 2004 @@ -21,7 +21,7 @@ distclean:: clean $(VERB) $(RM) -rf $(LEVEL)/Makefile.config \ - $(LEVEL)/include/Config/config.h \ + $(LEVEL)/include/llvm/Config/config.h \ $(LEVEL)/autoconf/autom4te.cache \ $(LEVEL)/config.log \ $(LEVEL)/TAGS From lattner at cs.uiuc.edu Fri Sep 17 19:22:26 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 17 Sep 2004 19:22:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraph.cpp Message-ID: <200409180022.TAA20523@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: CallGraph.cpp updated: 1.41 -> 1.42 --- Log message: Implement new changeFunction method, nuke a never implemented one. --- Diffs of the changes: (+14 -8) Index: llvm/lib/Analysis/IPA/CallGraph.cpp diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.41 llvm/lib/Analysis/IPA/CallGraph.cpp:1.42 --- llvm/lib/Analysis/IPA/CallGraph.cpp:1.41 Wed Sep 1 17:55:35 2004 +++ llvm/lib/Analysis/IPA/CallGraph.cpp Fri Sep 17 19:22:13 2004 @@ -163,14 +163,6 @@ // Implementations of public modification methods // -// Functions to keep a call graph up to date with a function that has been -// modified -// -void CallGraph::addFunctionToModule(Function *F) { - assert(0 && "not implemented"); - abort(); -} - // removeFunctionFromModule - Unlink the function from this module, returning // it. Because this removes the function from the module, the call graph node // is destroyed. This is only valid if the function does not call any other @@ -188,6 +180,20 @@ return F; } +// changeFunction - This method changes the function associated with this +// CallGraphNode, for use by transformations that need to change the prototype +// of a Function (thus they must create a new Function and move the old code +// over). +void CallGraph::changeFunction(Function *OldF, Function *NewF) { + iterator I = FunctionMap.find(OldF); + CallGraphNode *&New = FunctionMap[NewF]; + assert(I != FunctionMap.end() && I->second && !New && + "OldF didn't exist in CG or NewF already does!"); + New = I->second; + FunctionMap.erase(I); +} + + void CallGraph::stub() {} void CallGraphNode::removeCallEdgeTo(CallGraphNode *Callee) { From lattner at cs.uiuc.edu Fri Sep 17 19:22:54 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 17 Sep 2004 19:22:54 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/CallGraph.h Message-ID: <200409180022.TAA20754@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: CallGraph.h updated: 1.39 -> 1.40 --- Log message: Implement new changeFunction method, nuke a never implemented one. Add comments and doxygenify others. --- Diffs of the changes: (+19 -11) Index: llvm/include/llvm/Analysis/CallGraph.h diff -u llvm/include/llvm/Analysis/CallGraph.h:1.39 llvm/include/llvm/Analysis/CallGraph.h:1.40 --- llvm/include/llvm/Analysis/CallGraph.h:1.39 Wed Sep 1 17:55:34 2004 +++ llvm/include/llvm/Analysis/CallGraph.h Fri Sep 17 19:22:43 2004 @@ -124,22 +124,25 @@ //===--------------------------------------------------------------------- // Functions to keep a call graph up to date with a function that has been - // modified + // modified. // - void addFunctionToModule(Function *F); - - // removeFunctionFromModule - Unlink the function from this module, returning - // it. Because this removes the function from the module, the call graph node - // is destroyed. This is only valid if the function does not call any other - // functions (ie, there are no edges in it's CGN). The easiest way to do this - // is to dropAllReferences before calling this. - // + /// removeFunctionFromModule - Unlink the function from this module, returning + /// it. Because this removes the function from the module, the call graph + /// node is destroyed. This is only valid if the function does not call any + /// other functions (ie, there are no edges in it's CGN). The easiest way to + /// do this is to dropAllReferences before calling this. + /// Function *removeFunctionFromModule(CallGraphNode *CGN); Function *removeFunctionFromModule(Function *F) { return removeFunctionFromModule((*this)[F]); } + /// changeFunction - This method changes the function associated with this + /// CallGraphNode, for use by transformations that need to change the + /// prototype of a Function (thus they must create a new Function and move the + /// old code over). + void changeFunction(Function *OldF, Function *NewF); //===--------------------------------------------------------------------- // Pass infrastructure interface glue code... @@ -231,16 +234,21 @@ // modified // + /// removeAllCalledFunctions - As the name implies, this removes all edges + /// from this CallGraphNode to any functions it calls. void removeAllCalledFunctions() { CalledFunctions.clear(); } - // addCalledFunction add a function to the list of functions called by this - // one + /// addCalledFunction add a function to the list of functions called by this + /// one. void addCalledFunction(CallGraphNode *M) { CalledFunctions.push_back(M); } + /// removeCallEdgeTo - This method removes a *single* edge to the specified + /// callee function. Note that this method takes linear time, so it should be + /// used sparingly. void removeCallEdgeTo(CallGraphNode *Callee); private: // Stuff to construct the node, used by CallGraph From lattner at cs.uiuc.edu Fri Sep 17 19:27:33 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 17 Sep 2004 19:27:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraph.cpp Message-ID: <200409180027.TAA21388@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: CallGraph.cpp updated: 1.42 -> 1.43 --- Log message: When changing a function, make sure to update the CallGraphNode for the function, not just the CallGraph. --- Diffs of the changes: (+1 -0) Index: llvm/lib/Analysis/IPA/CallGraph.cpp diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.42 llvm/lib/Analysis/IPA/CallGraph.cpp:1.43 --- llvm/lib/Analysis/IPA/CallGraph.cpp:1.42 Fri Sep 17 19:22:13 2004 +++ llvm/lib/Analysis/IPA/CallGraph.cpp Fri Sep 17 19:27:20 2004 @@ -190,6 +190,7 @@ assert(I != FunctionMap.end() && I->second && !New && "OldF didn't exist in CG or NewF already does!"); New = I->second; + New->F = NewF; FunctionMap.erase(I); } From lattner at cs.uiuc.edu Fri Sep 17 19:32:53 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 17 Sep 2004 19:32:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200409180032.TAA21954@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.68 -> 1.69 --- Log message: Make sure to remove the Select instruction as well --- Diffs of the changes: (+1 -0) Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.68 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.69 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.68 Tue Sep 14 20:02:54 2004 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Fri Sep 17 19:32:40 2004 @@ -247,6 +247,7 @@ AST->copyValue(Load, FalseVal); AST->copyValue(Load, NewSI); AST->deleteValue(Load); + AST->deleteValue(SI); } Load->replaceAllUsesWith(NewSI); From lattner at cs.uiuc.edu Fri Sep 17 19:34:25 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 17 Sep 2004 19:34:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp Message-ID: <200409180034.TAA22263@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: ArgumentPromotion.cpp updated: 1.10 -> 1.11 --- Log message: Convert this pass to be a CallGraphSCCPass instead of a Pass, which eliminates the worklist and makes it more efficient. This does not change functionality at all. --- Diffs of the changes: (+33 -39) Index: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp diff -u llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.10 llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.11 --- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.10 Thu Sep 16 22:58:39 2004 +++ llvm/lib/Transforms/IPO/ArgumentPromotion.cpp Fri Sep 17 19:34:13 2004 @@ -33,9 +33,10 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Module.h" -#include "llvm/Pass.h" +#include "llvm/CallGraphSCCPass.h" #include "llvm/Instructions.h" #include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Analysis/CallGraph.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/CFG.h" @@ -56,23 +57,18 @@ /// ArgPromotion - The 'by reference' to 'by value' argument promotion pass. /// - class ArgPromotion : public Pass { - // WorkList - The set of internal functions that we have yet to process. As - // we eliminate arguments from a function, we push all callers into this set - // so that the by-reference argument can be bubbled out as far as possible. - // This set contains only internal functions. - std::set WorkList; - public: + struct ArgPromotion : public CallGraphSCCPass { virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); AU.addRequired(); + CallGraphSCCPass::getAnalysisUsage(AU); } - virtual bool run(Module &M); + virtual bool runOnSCC(const std::vector &SCC); private: - bool PromoteArguments(Function *F); + bool PromoteArguments(CallGraphNode *CGN); bool isSafeToPromoteArgument(Argument *Arg) const; - void DoPromotion(Function *F, std::vector &ArgsToPromote); + Function *DoPromotion(Function *F, std::vector &ArgsToPromote); }; RegisterOpt X("argpromotion", @@ -83,19 +79,16 @@ return new ArgPromotion(); } -bool ArgPromotion::run(Module &M) { - bool Changed = false; - for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (I->hasInternalLinkage()) - WorkList.insert(I); - - while (!WorkList.empty()) { - Function *F = *WorkList.begin(); - WorkList.erase(WorkList.begin()); +bool ArgPromotion::runOnSCC(const std::vector &SCC) { + bool Changed = false, LocalChange; - if (PromoteArguments(F)) // Attempt to promote an argument. - Changed = true; // Remember that we changed something. - } + do { + LocalChange = false; + // Attempt to promote arguments from all functions in this SCC. + for (unsigned i = 0, e = SCC.size(); i != e; ++i) + LocalChange |= PromoteArguments(SCC[i]); + Changed |= LocalChange; // Remember that we changed something. + } while (LocalChange); return Changed; } @@ -105,8 +98,11 @@ /// example, all callers are direct). If safe to promote some arguments, it /// calls the DoPromotion method. /// -bool ArgPromotion::PromoteArguments(Function *F) { - assert(F->hasInternalLinkage() && "We can only process internal functions!"); +bool ArgPromotion::PromoteArguments(CallGraphNode *CGN) { + Function *F = CGN->getFunction(); + + // Make sure that it is local to this module. + if (!F || !F->hasInternalLinkage()) return false; // First check: see if there are any pointer arguments! If not, quick exit. std::vector PointerArgs; @@ -142,7 +138,10 @@ if (PointerArgs.empty()) return false; // Okay, promote all of the arguments are rewrite the callees! - DoPromotion(F, PointerArgs); + Function *NewF = DoPromotion(F, PointerArgs); + + // Update the call graph to know that the old function is gone. + getAnalysis().changeFunction(F, NewF); return true; } @@ -274,8 +273,10 @@ /// DoPromotion - This method actually performs the promotion of the specified -/// arguments. At this point, we know that it's safe to do so. -void ArgPromotion::DoPromotion(Function *F, std::vector &Args2Prom) { +/// arguments, and returns the new function. At this point, we know that it's +/// safe to do so. +Function *ArgPromotion::DoPromotion(Function *F, + std::vector &Args2Prom) { std::set ArgsToPromote(Args2Prom.begin(), Args2Prom.end()); // Start by computing a new prototype for the function, which is the same as @@ -360,11 +361,6 @@ CallSite CS = CallSite::get(F->use_back()); Instruction *Call = CS.getInstruction(); - // Make sure the caller of this function is revisited now that we promoted - // arguments in a callee of it. - if (Call->getParent()->getParent()->hasInternalLinkage()) - WorkList.insert(Call->getParent()->getParent()); - // Loop over the operands, inserting GEP and loads in the caller as // appropriate. CallSite::arg_iterator AI = CS.arg_begin(); @@ -489,12 +485,9 @@ } } - // If we inserted a new pointer type, it's possible that IT could be - // promoted too. Also, increment I2 past all of the arguments added for - // this promoted pointer. - for (unsigned i = 0, e = ArgIndices.size(); i != e; ++i, ++I2) - if (isa(I2->getType())) - WorkList.insert(NF); + // Increment I2 past all of the arguments added for this promoted pointer. + for (unsigned i = 0, e = ArgIndices.size(); i != e; ++i) + ++I2; } // Notify the alias analysis implementation that we inserted a new argument. @@ -507,4 +500,5 @@ // Now that the old function is dead, delete it. F->getParent()->getFunctionList().erase(F); + return NF; } From lattner at cs.uiuc.edu Fri Sep 17 23:40:59 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 17 Sep 2004 23:40:59 -0500 Subject: [llvm-commits] CVS: llvm/utils/llvmdo llvmgrep Message-ID: <200409180440.XAA26334@apoc.cs.uiuc.edu> Changes in directory llvm/utils: llvmdo updated: 1.1 -> 1.2 llvmgrep updated: 1.4 -> 1.5 --- Log message: Don't include libtool "object" files --- Diffs of the changes: (+2 -0) Index: llvm/utils/llvmdo diff -u llvm/utils/llvmdo:1.1 llvm/utils/llvmdo:1.2 --- llvm/utils/llvmdo:1.1 Mon Jul 26 17:52:44 2004 +++ llvm/utils/llvmdo Fri Sep 17 23:40:46 2004 @@ -18,6 +18,7 @@ \! -name '*~' \ \! -name '#*' \ \! -name '*.ll' \ + \! -name '*.lo' \ \! -name '*.d' \ \! -name '*.dir' \ \! -name 'Sparc.burm.c' \ Index: llvm/utils/llvmgrep diff -u llvm/utils/llvmgrep:1.4 llvm/utils/llvmgrep:1.5 --- llvm/utils/llvmgrep:1.4 Tue Aug 24 12:42:33 2004 +++ llvm/utils/llvmgrep Fri Sep 17 23:40:46 2004 @@ -11,6 +11,7 @@ \! -name '*~' \ \! -name '#*' \ \! -name '*.ll' \ + \! -name '*.lo' \ \! -name '*.d' \ \! -name '*.dir' \ \! -name 'Sparc.burm.c' \ From lattner at cs.uiuc.edu Sat Sep 18 01:28:19 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 18 Sep 2004 01:28:19 -0500 Subject: [llvm-commits] CVS: llvm/docs/WritingAnLLVMBackend.html Message-ID: <200409180628.BAA31163@apoc.cs.uiuc.edu> Changes in directory llvm/docs: WritingAnLLVMBackend.html updated: 1.1 -> 1.2 --- Log message: Make this HTML 4.01 strict Update to reflect changes to the 'Register' tblgen class. --- Diffs of the changes: (+5 -5) Index: llvm/docs/WritingAnLLVMBackend.html diff -u llvm/docs/WritingAnLLVMBackend.html:1.1 llvm/docs/WritingAnLLVMBackend.html:1.2 --- llvm/docs/WritingAnLLVMBackend.html:1.1 Mon Sep 6 17:58:13 2004 +++ llvm/docs/WritingAnLLVMBackend.html Sat Sep 18 01:28:07 2004 @@ -16,7 +16,7 @@
    6. Introduction
    7. Writing a backend
        -
      1. Machine backends
      2. +
      3. Machine backends
        1. Outline
        2. Implementation details
        3. @@ -148,15 +148,15 @@
           // class Register is defined in Target.td
          -class TargetReg : Register {
          +class TargetReg<string name> : Register<name> {
             let Namespace = "Target";
           }
           
          -class IntReg<bits<5> num> : TargetReg {
          +class IntReg<bits<5> num, string name> : TargetReg<name> {
             field bits<5> Num = num;
           }
           
          -def R0 : IntReg<0>;
          +def R0 : IntReg<0, "%R0">;
           ...
           
           // class RegisterClass is defined in Target.td
          @@ -238,7 +238,7 @@
             Misha Brukman
          The LLVM Compiler Infrastructure
          - Last modified: $Date: 2004/09/06 22:58:13 $ + Last modified: $Date: 2004/09/18 06:28:07 $ From lattner at cs.uiuc.edu Sat Sep 18 01:39:48 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 18 Sep 2004 01:39:48 -0500 Subject: [llvm-commits] CVS: llvm/docs/WritingAnLLVMPass.html Message-ID: <200409180639.BAA31204@apoc.cs.uiuc.edu> Changes in directory llvm/docs: WritingAnLLVMPass.html updated: 1.30 -> 1.31 --- Log message: Provide initial docs for CallGraphSCCPass's, and fix several grammar-o's and other problems. --- Diffs of the changes: (+131 -16) Index: llvm/docs/WritingAnLLVMPass.html diff -u llvm/docs/WritingAnLLVMPass.html:1.30 llvm/docs/WritingAnLLVMPass.html:1.31 --- llvm/docs/WritingAnLLVMPass.html:1.30 Wed Jun 30 13:10:30 2004 +++ llvm/docs/WritingAnLLVMPass.html Sat Sep 18 01:39:35 2004 @@ -18,7 +18,7 @@
        4. Setting up the build environment
        5. Basic code required
        6. Running a pass with opt - or analyze
        7. + or analyze
        8. Pass classes and requirements
            @@ -27,6 +27,14 @@ +
          • The CallGraphSCCPass class +
          • The FunctionPass class
            • The doInitialization(Module @@ -100,23 +108,22 @@

              The LLVM Pass Framework is an important part of the LLVM system, because LLVM -passes are where the interesting parts of the compiler exist. Passes perform -the transformations and optimizations that make up the compiler, they build -the analysis results that are used by these transformations, and they are, above -all, a structuring technique for compiler code.

              +passes are where most of the interesting parts of the compiler exist. Passes +perform the transformations and optimizations that make up the compiler, they +build the analysis results that are used by these transformations, and they are, +above all, a structuring technique for compiler code.

              All LLVM passes are subclasses of the Pass class, which implement functionality by overriding virtual methods inherited from Pass. Depending on how your pass works, you may be able to -inherit from the FunctionPass -or BasicBlockPass, -which gives the system more information about what your pass does, and how it -can be combined with other passes. One of the main features of the LLVM Pass -Framework is that it schedules passes to run in an efficient way based on the -constraints that your pass has.

              +inherit from the CallGraphSCCPass, +FunctionPass, or BasicBlockPass classes, which gives the system +more information about what your pass does, and how it can be combined with +other passes. One of the main features of the LLVM Pass Framework is that it +schedules passes to run in an efficient way based on the constraints that your +pass meets (which are indicated by which class they derive from).

              We start by showing you how to construct a pass, everything from setting up the code, to compiling, loading, and executing it. After the basics are down, @@ -134,7 +141,7 @@

              Here we describe how to write the "hello world" of passes. The "Hello" pass is designed to simply print out the name of non-external functions that exist in -the program being compiled. It does not modify the program at all, just +the program being compiled. It does not modify the program at all, it just inspects it. The source code and files for this pass are available in the LLVM source tree in the lib/Transforms/Hello directory.

              @@ -175,7 +182,7 @@ directory are to be compiled and linked together into a lib/Debug/libhello.so shared object that can be dynamically loaded by the opt or analyze tools. If your operating system uses a -suffix other than .so (such as windows of Mac OS/X), the appropriate extension +suffix other than .so (such as windows or Mac OS/X), the appropriate extension will be used.

              Now that we have the build scripts set up, we just need to write the code for @@ -466,6 +473,114 @@

              + +
              + +

              The "CallGraphSCCPass" +is used by passes that need to traverse the program bottom-up on the call graph +(callees before callers). Deriving from CallGraphSCCPass provides some +mechanics for building and traversing the CallGraph, but also allows the system +to optimize execution of CallGraphSCCPass's. If your pass meets the +requirements outlined below, and doesn't meet the requirements of a FunctionPass or BasicBlockPass, you should derive from +CallGraphSCCPass.

              + +

              TODO: explain briefly what SCC, Tarjan's algo, and B-U mean.

              + +

              To be explicit, CallGraphSCCPass subclasses are:

              + +
                + +
              1. ... not allowed to modify any Functions that are not in +the current SCC.
              2. + +
              3. ... allowed to inspect any Function's other than those in the +current SCC and the direct callees of the SCC.
              4. + +
              5. ... required to preserve the current CallGraph object, updating it +to reflect any changes made to the program.
              6. + +
              7. ... not allowed to add or remove SCC's from the current Module, +though they may change the contents of an SCC.
              8. + +
              9. ... allowed to add or remove global variables from the current +Module.
              10. + +
              11. ... allowed to maintain state across invocations of + runOnSCC (including global data).
              12. +
              + +

              Implementing a CallGraphSCCPass is slightly tricky in some cases +because it has to handle SCCs with more than one node in it. All of the virtual +methods described below should return true if they modified the program, or +false if they didn't.

              + +
              + + + + +
              + +
              +  virtual bool doInitialization(Module &M);
              +
              + +

              The doIninitialize method is allowed to do most of the things that +CallGraphSCCPass's are not allowed to do. They can add and remove +functions, get pointers to functions, etc. The doInitialization method +is designed to do simple initialization type of stuff that does not depend on +the SCCs being processed. The doInitialization method call is not +scheduled to overlap with any other pass executions (thus it should be very +fast).

              + +
              + + + + +
              + +
              +  virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCCM) = 0;
              +
              + +

              The runOnSCC method performs the interesting work of the pass, and +should return true if the module was modified by the transformation, false +otherwise.

              + +
              + + + + +
              + +
              +  virtual bool doFinalization(Module &M);
              +
              + +

              The doFinalization method is an infrequently used method that is +called when the pass framework has finished calling runOnFunction for every function in the +program being compiled.

              + +
              + + + @@ -1481,7 +1596,7 @@ Chris Lattner
              The LLVM Compiler Infrastructure
              - Last modified: $Date: 2004/06/30 18:10:30 $ + Last modified: $Date: 2004/09/18 06:39:35 $ From lattner at cs.uiuc.edu Sat Sep 18 11:16:42 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 18 Sep 2004 11:16:42 -0500 Subject: [llvm-commits] CVS: llvm/docs/WritingAnLLVMPass.html Message-ID: <200409181616.LAA32427@apoc.cs.uiuc.edu> Changes in directory llvm/docs: WritingAnLLVMPass.html updated: 1.31 -> 1.32 --- Log message: Misha implemented the ModuleProvider interface back in 9/18/2003. --- Diffs of the changes: (+1 -29) Index: llvm/docs/WritingAnLLVMPass.html diff -u llvm/docs/WritingAnLLVMPass.html:1.31 llvm/docs/WritingAnLLVMPass.html:1.32 --- llvm/docs/WritingAnLLVMPass.html:1.31 Sat Sep 18 01:39:35 2004 +++ llvm/docs/WritingAnLLVMPass.html Sat Sep 18 11:16:28 2004 @@ -89,7 +89,6 @@
            • Future extensions planned
            • @@ -1539,33 +1538,6 @@ - -
              - -

              Currently, the PassManager's run method takes a Module -as input, and runs all of the passes on this module. The problem with this -approach is that none of the PassManager features can be used for -timing and debugging the actual loading of the module from disk or -standard input.

              - -

              To solve this problem, eventually the PassManager class will accept -a ModuleSource object instead of a Module itself. When complete, this -will also allow for streaming of functions out of the bytecode representation, -allowing us to avoid holding the entire program in memory at once if we only are -dealing with FunctionPasses.

              - -

              As part of a different issue, eventually the bytecode loader will be extended -to allow on-demand loading of functions from the bytecode representation, in -order to better support the runtime reoptimizer. The bytecode format is already -capable of this, the loader just needs to be reworked a bit.

              - -
              - - - @@ -1596,7 +1568,7 @@ Chris Lattner
              The LLVM Compiler Infrastructure
              - Last modified: $Date: 2004/09/18 06:39:35 $ + Last modified: $Date: 2004/09/18 16:16:28 $ From reid at x10sys.com Sat Sep 18 14:25:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 18 Sep 2004 14:25:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.cpp Message-ID: <200409181925.OAA22184@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.cpp updated: 1.7 -> 1.8 --- Log message: Get rid of file descriptor leak in create_file. --- Diffs of the changes: (+3 -1) Index: llvm/lib/System/Unix/Path.cpp diff -u llvm/lib/System/Unix/Path.cpp:1.7 llvm/lib/System/Unix/Path.cpp:1.8 --- llvm/lib/System/Unix/Path.cpp:1.7 Thu Sep 16 11:36:10 2004 +++ llvm/lib/System/Unix/Path.cpp Sat Sep 18 14:25:11 2004 @@ -377,8 +377,10 @@ if (!is_file()) return false; // Create the file - if (0 != creat(path.c_str(), S_IRUSR | S_IWUSR)) + int fd = ::creat(path.c_str(), S_IRUSR | S_IWUSR); + if (fd < 0) ThrowErrno(std::string(path.c_str()) + ": Can't create file"); + ::close(fd); return true; } From reid at x10sys.com Sat Sep 18 14:29:26 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 18 Sep 2004 14:29:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.cpp Message-ID: <200409181929.OAA22222@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.cpp updated: 1.2 -> 1.3 --- Log message: Porting of Unix implementation to Win32. Patch contributed by Jeff Cohen. Thanks Jeff! --- Diffs of the changes: (+190 -48) Index: llvm/lib/System/Win32/Path.cpp diff -u llvm/lib/System/Win32/Path.cpp:1.2 llvm/lib/System/Win32/Path.cpp:1.3 --- llvm/lib/System/Win32/Path.cpp:1.2 Wed Sep 15 00:49:50 2004 +++ llvm/lib/System/Win32/Path.cpp Sat Sep 18 14:29:16 2004 @@ -6,6 +6,7 @@ // University of Illinois Open Source License. See LICENSE.TXT for details. // // Modified by Henrik Bach to comply with at least MinGW. +// Ported to Win32 by Jeff Cohen. // //===----------------------------------------------------------------------===// // @@ -18,18 +19,10 @@ //=== is guaranteed to work on *all* Win32 variants. //===----------------------------------------------------------------------===// -#include -#include -#include -#include -#include -#include +#include "Win32.h" #include - -#include -#include - -#define MAXPATHLEN PATH_MAX +#include +#include namespace llvm { namespace sys { @@ -38,23 +31,47 @@ Path::is_valid() const { if (path.empty()) return false; -/*hb: char pathname[MAXPATHLEN]; - if (0 == realpath(path.c_str(), pathname)) - if (errno != EACCES && errno != EIO && errno != ENOENT && errno != -ENOTDIR) - return false;*/ - return true; + + // On Unix, the realpath function is used, which only requires that the + // directories leading up the to final file name are valid. The file itself + // need not exist. To get this behavior on Windows, we must elide the file + // name manually. + Path dir(*this); + dir.elide_file(); + if (dir.path.empty()) + return true; + + DWORD attr = GetFileAttributes(dir.path.c_str()); + return (attr != INVALID_FILE_ATTRIBUTES) && (attr & FILE_ATTRIBUTE_DIRECTORY); } +static Path *TempDirectory = NULL; + Path Path::GetTemporaryDirectory() { - char pathname[MAXPATHLEN]; - if (0 == GetTempPath(MAXPATHLEN,pathname)) - ThrowError(std::string(pathname) + ": Can't create temporary directory"); + if (TempDirectory) + return *TempDirectory; + + char pathname[MAX_PATH]; + if (!GetTempPath(MAX_PATH, pathname)) + ThrowError("Can't determine temporary directory"); + Path result; result.set_directory(pathname); - assert(result.is_valid() && "GetTempPath didn't create a valid pathname!"); - return result; + + // Append a subdirectory passed on our process id so multiple LLVMs don't + // step on each other's toes. + sprintf(pathname, "LLVM_%u", GetCurrentProcessId()); + result.append_directory(pathname); + + // If there's a directory left over from a previous LLVM execution that + // happened to have the same process id, get rid of it. + result.destroy_directory(true); + + // And finally (re-)create the empty directory. + result.create_directory(false); + TempDirectory = new Path(result); + return *TempDirectory; } Path::Path(std::string unverified_path) @@ -69,6 +86,7 @@ ThrowError(unverified_path + ": path is not valid"); } +// FIXME: the following set of functions don't map to Windows very well. Path Path::GetRootDirectory() { Path result; @@ -76,6 +94,59 @@ return result; } +static inline bool IsLibrary(Path& path, const std::string& basename) { + if (path.append_file(std::string("lib") + basename)) { + if (path.append_suffix(Path::GetDLLSuffix()) && path.readable()) + return true; + else if (path.elide_suffix() && path.append_suffix("a") && path.readable()) + return true; + else if (path.elide_suffix() && path.append_suffix("o") && path.readable()) + return true; + else if (path.elide_suffix() && path.append_suffix("bc") && path.readable()) + return true; + } else if (path.elide_file() && path.append_file(basename)) { + if (path.append_suffix(Path::GetDLLSuffix()) && path.readable()) + return true; + else if (path.elide_suffix() && path.append_suffix("a") && path.readable()) + return true; + else if (path.elide_suffix() && path.append_suffix("o") && path.readable()) + return true; + else if (path.elide_suffix() && path.append_suffix("bc") && path.readable()) + return true; + } + path.clear(); + return false; +} + +Path +Path::GetLibraryPath(const std::string& basename, + const std::vector& LibPaths) { + Path result; + + // Try the paths provided + for (std::vector::const_iterator I = LibPaths.begin(), + E = LibPaths.end(); I != E; ++I ) { + if (result.set_directory(*I) && IsLibrary(result,basename)) + return result; + } + + // Try the LLVM lib directory in the LLVM install area + //if (result.set_directory(LLVM_LIBDIR) && IsLibrary(result,basename)) + // return result; + + // Try /usr/lib + if (result.set_directory("/usr/lib/") && IsLibrary(result,basename)) + return result; + + // Try /lib + if (result.set_directory("/lib/") && IsLibrary(result,basename)) + return result; + + // Can't find it, give up and return invalid path. + result.clear(); + return result; +} + Path Path::GetSystemLibraryPath1() { return Path("/lib/"); @@ -93,9 +164,6 @@ Path Path::GetLLVMConfigDir() { - Path result; - if (result.set_directory(LLVM_ETCDIR)) - return result; return GetLLVMDefaultConfigDir(); } @@ -109,25 +177,80 @@ } return GetRootDirectory(); } +// FIXME: the above set of functions don't map to Windows very well. + +bool +Path::is_file() const { + return (is_valid() && path[path.length()-1] != '/'); +} + +bool +Path::is_directory() const { + return (is_valid() && path[path.length()-1] == '/'); +} + +std::string +Path::get_basename() const { + // Find the last slash + size_t slash = path.rfind('/'); + if (slash == std::string::npos) + slash = 0; + else + slash++; + + return path.substr(slash, path.rfind('.')); +} + +bool Path::has_magic_number(const std::string &Magic) const { + size_t len = Magic.size(); + char *buf = reinterpret_cast(_alloca(len+1)); + std::ifstream f(path.c_str()); + f.read(buf, len); + buf[len] = '\0'; + return Magic == buf; +} + +bool +Path::is_bytecode_file() const { + if (readable()) { + return has_magic_number("llvm"); + } + return false; +} + +bool +Path::is_archive() const { + if (readable()) { + return has_magic_number("!\012"); + } + return false; +} bool Path::exists() const { - return 0 == access(path.c_str(), F_OK ); + DWORD attr = GetFileAttributes(path.c_str()); + return attr != INVALID_FILE_ATTRIBUTES; } bool Path::readable() const { - return 0 == access(path.c_str(), F_OK | R_OK ); + // FIXME: take security attributes into account. + DWORD attr = GetFileAttributes(path.c_str()); + return attr != INVALID_FILE_ATTRIBUTES; } bool Path::writable() const { - return 0 == access(path.c_str(), F_OK | W_OK ); + // FIXME: take security attributes into account. + DWORD attr = GetFileAttributes(path.c_str()); + return (attr != INVALID_FILE_ATTRIBUTES) && !(attr & FILE_ATTRIBUTE_READONLY); } bool Path::executable() const { - return 0 == access(path.c_str(), R_OK | X_OK ); + // FIXME: take security attributes into account. + DWORD attr = GetFileAttributes(path.c_str()); + return attr != INVALID_FILE_ATTRIBUTES; } std::string @@ -272,8 +395,8 @@ if (!is_directory()) return false; // Get a writeable copy of the path name - char pathname[MAXPATHLEN]; - path.copy(pathname,MAXPATHLEN); + char *pathname = reinterpret_cast(_alloca(path.length()+1)); + path.copy(pathname,path.length()+1); // Null-terminate the last component int lastchar = path.length() - 1 ; @@ -290,15 +413,14 @@ // Loop through the directory components until we're done while ( next != 0 ) { *next = 0; - if (0 != access(pathname, F_OK | R_OK | W_OK)) - if (0 != mkdir(pathname)) - ThrowError(std::string(pathname) + ": Can't create directory"); + if (!CreateDirectory(pathname, NULL)) + ThrowError(std::string(pathname) + ": Can't create directory: "); char* save = next; next = strchr(pathname,'/'); *save = '/'; } - } else if (0 != mkdir(pathname)) { - ThrowError(std::string(pathname) + ": Can't create directory"); + } else if (!CreateDirectory(pathname, NULL)) { + ThrowError(std::string(pathname) + ": Can't create directory: "); } return true; } @@ -309,9 +431,12 @@ if (!is_file()) return false; // Create the file - if (0 != creat(path.c_str(), S_IRUSR | S_IWUSR)) - ThrowError(std::string(path.c_str()) + ": Can't create file"); + HANDLE h = CreateFile(path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL); + if (h == INVALID_HANDLE_VALUE) + ThrowError(std::string(path.c_str()) + ": Can't create file: "); + CloseHandle(h); return true; } @@ -323,20 +448,23 @@ // If it doesn't exist, we're done. if (!exists()) return true; + char *pathname = reinterpret_cast(_alloca(path.length()+1)); + path.copy(pathname,path.length()+1); + int lastchar = path.length() - 1 ; + if (pathname[lastchar] == '/') + pathname[lastchar] = 0; + if (remove_contents) { // Recursively descend the directory to remove its content - std::string cmd("/bin/rm -rf "); + // FIXME: The correct way of doing this on Windows isn't pretty... + // but this may work if unix-like utils are present. + std::string cmd("rm -rf "); cmd += path; system(cmd.c_str()); } else { // Otherwise, try to just remove the one directory - char pathname[MAXPATHLEN]; - path.copy(pathname,MAXPATHLEN); - int lastchar = path.length() - 1 ; - if (pathname[lastchar] == '/') - pathname[lastchar] = 0; - if ( 0 != rmdir(pathname)) - ThrowError(std::string(pathname) + ": Can't destroy directory"); + if (!RemoveDirectory(pathname)) + ThrowError(std::string(pathname) + ": Can't destroy directory: "); } return true; } @@ -344,8 +472,22 @@ bool Path::destroy_file() { if (!is_file()) return false; - if (0 != unlink(path.c_str())) - ThrowError(std::string(path.c_str()) + ": Can't destroy file"); + + DWORD attr = GetFileAttributes(path.c_str()); + + // If it doesn't exist, we're done. + if (attr == INVALID_FILE_ATTRIBUTES) + return true; + + // Read-only files cannot be deleted on Windows. Must remove the read-only + // attribute first. + if (attr & FILE_ATTRIBUTE_READONLY) { + if (!SetFileAttributes(path.c_str(), attr & ~FILE_ATTRIBUTE_READONLY)) + ThrowError(std::string(path.c_str()) + ": Can't destroy file: "); + } + + if (!DeleteFile(path.c_str())) + ThrowError(std::string(path.c_str()) + ": Can't destroy file: "); return true; } From reid at x10sys.com Sat Sep 18 14:34:20 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 18 Sep 2004 14:34:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Interix/Memory.cpp Message-ID: <200409181934.OAA22292@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Interix: Memory.cpp updated: 1.3 -> 1.4 --- Log message: Use the /dev/zero device as the device on which the pages are mapped. Patch contributed by Henrik Bach. Thanks Henrik! --- Diffs of the changes: (+7 -1) Index: llvm/lib/System/Interix/Memory.cpp diff -u llvm/lib/System/Interix/Memory.cpp:1.3 llvm/lib/System/Interix/Memory.cpp:1.4 --- llvm/lib/System/Interix/Memory.cpp:1.3 Mon Sep 13 17:38:12 2004 +++ llvm/lib/System/Interix/Memory.cpp Sat Sep 18 14:34:09 2004 @@ -15,6 +15,7 @@ // Include the generic unix implementation #include "../Unix/Memory.cpp" #include "llvm/System/Process.h" +#include #include namespace llvm { @@ -30,9 +31,14 @@ static const long pageSize = Process::GetPageSize(); unsigned NumPages = (NumBytes+pageSize-1)/pageSize; + + int fd = open("/dev/zero", O_RDWR); + if (fd == -1) { + throw std::string("Can't open /dev/zero device: ") + strerror(errno); + } void *pa = mmap(0, pageSize*NumPages, PROT_READ|PROT_WRITE|PROT_EXEC, - MAP_PRIVATE|MAP_ANON|MAP_NOCORE, -1, 0); + MAP_SHARED, fd, 0); if (pa == (void*)-1) { throw std::string("Can't allocate RWX Memory: ") + strerror(errno); } From lattner at cs.uiuc.edu Sat Sep 18 16:34:34 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 18 Sep 2004 16:34:34 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/CallGraph.h Message-ID: <200409182134.QAA03475@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: CallGraph.h updated: 1.40 -> 1.41 --- Log message: Add CallGraphNode::removeAnyCallEdgeTo method --- Diffs of the changes: (+5 -0) Index: llvm/include/llvm/Analysis/CallGraph.h diff -u llvm/include/llvm/Analysis/CallGraph.h:1.40 llvm/include/llvm/Analysis/CallGraph.h:1.41 --- llvm/include/llvm/Analysis/CallGraph.h:1.40 Fri Sep 17 19:22:43 2004 +++ llvm/include/llvm/Analysis/CallGraph.h Sat Sep 18 16:34:21 2004 @@ -251,6 +251,11 @@ /// used sparingly. void removeCallEdgeTo(CallGraphNode *Callee); + /// removeAnyCallEdgeTo - This method removes any call edges from this node to + /// the specified callee function. This takes more time to execute than + /// removeCallEdgeTo, so it should not be used unless necessary. + void removeAnyCallEdgeTo(CallGraphNode *Callee); + private: // Stuff to construct the node, used by CallGraph friend class CallGraph; From lattner at cs.uiuc.edu Sat Sep 18 16:34:44 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 18 Sep 2004 16:34:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraph.cpp Message-ID: <200409182134.QAA03482@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: CallGraph.cpp updated: 1.43 -> 1.44 --- Log message: Add CallGraphNode::removeAnyCallEdgeTo method --- Diffs of the changes: (+12 -0) Index: llvm/lib/Analysis/IPA/CallGraph.cpp diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.43 llvm/lib/Analysis/IPA/CallGraph.cpp:1.44 --- llvm/lib/Analysis/IPA/CallGraph.cpp:1.43 Fri Sep 17 19:27:20 2004 +++ llvm/lib/Analysis/IPA/CallGraph.cpp Sat Sep 18 16:34:34 2004 @@ -206,3 +206,15 @@ } } } + +// removeAnyCallEdgeTo - This method removes any call edges from this node to +// the specified callee function. This takes more time to execute than +// removeCallEdgeTo, so it should not be used unless necessary. +void CallGraphNode::removeAnyCallEdgeTo(CallGraphNode *Callee) { + for (std::vector::iterator I = CalledFunctions.begin(), + E = CalledFunctions.end(); I != E; ++I) + if (*I == Callee) { + CalledFunctions.erase(I); + E = CalledFunctions.end(); + } +} From lattner at cs.uiuc.edu Sat Sep 18 16:37:14 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 18 Sep 2004 16:37:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/Inliner.cpp Message-ID: <200409182137.QAA03799@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: Inliner.cpp updated: 1.22 -> 1.23 --- Log message: Fix the inliner to always delete any edges from the external call node to a function being deleted. Due to optimizations done while inlining, there can be edges from the external call node to a function node that were not apparent any longer. This fixes the compiler crash while compiling 175.vpr --- Diffs of the changes: (+7 -8) Index: llvm/lib/Transforms/IPO/Inliner.cpp diff -u llvm/lib/Transforms/IPO/Inliner.cpp:1.22 llvm/lib/Transforms/IPO/Inliner.cpp:1.23 --- llvm/lib/Transforms/IPO/Inliner.cpp:1.22 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Transforms/IPO/Inliner.cpp Sat Sep 18 16:37:03 2004 @@ -168,22 +168,21 @@ for (CallGraph::iterator I = CG.begin(), E = CG.end(); I != E; ++I) { CallGraphNode *CGN = I->second; if (Function *F = CGN ? CGN->getFunction() : 0) { - // If the only remaining users of the function are dead constants, - // remove them. - bool HadDeadConstantUsers = !F->use_empty(); + // If the only remaining users of the function are dead constants, remove + // them. F->removeDeadConstantUsers(); if ((F->hasLinkOnceLinkage() || F->hasInternalLinkage()) && F->use_empty()) { + // Remove any call graph edges from the function to its callees. while (CGN->begin() != CGN->end()) CGN->removeCallEdgeTo(*(CGN->end()-1)); - // If the function has external linkage (basically if it's a linkonce - // function) remove the edge from the external node to the callee - // node. - if (!F->hasInternalLinkage() || HadDeadConstantUsers) - CG.getExternalCallingNode()->removeCallEdgeTo(CGN); + // Remove any edges from the external node to the function's call graph + // node. These edges might have been made irrelegant due to + // optimization of the program. + CG.getExternalCallingNode()->removeAnyCallEdgeTo(CGN); // Removing the node for callee from the call graph and delete it. FunctionsToRemove.insert(CGN); From lattner at cs.uiuc.edu Sat Sep 18 20:05:29 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 18 Sep 2004 20:05:29 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp Message-ID: <200409190105.UAA05200@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: ArgumentPromotion.cpp updated: 1.11 -> 1.12 --- Log message: Add comment --- Diffs of the changes: (+1 -1) Index: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp diff -u llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.11 llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.12 --- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.11 Fri Sep 17 19:34:13 2004 +++ llvm/lib/Transforms/IPO/ArgumentPromotion.cpp Sat Sep 18 20:05:16 2004 @@ -82,7 +82,7 @@ bool ArgPromotion::runOnSCC(const std::vector &SCC) { bool Changed = false, LocalChange; - do { + do { // Iterate until we stop promoting from this SCC. LocalChange = false; // Attempt to promote arguments from all functions in this SCC. for (unsigned i = 0, e = SCC.size(); i != e; ++i) From reid at x10sys.com Sun Sep 19 00:37:50 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Sep 2004 00:37:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Signals.cpp Message-ID: <200409190537.AAA26427@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Signals.cpp updated: 1.3 -> 1.4 --- Log message: Minor correction to Signals implementation. Patch submitted by Jeff Cohen. Thanks Jeff! --- Diffs of the changes: (+24 -14) Index: llvm/lib/System/Win32/Signals.cpp diff -u llvm/lib/System/Win32/Signals.cpp:1.3 llvm/lib/System/Win32/Signals.cpp:1.4 --- llvm/lib/System/Win32/Signals.cpp:1.3 Thu Sep 16 22:02:27 2004 +++ llvm/lib/System/Win32/Signals.cpp Sun Sep 19 00:37:39 2004 @@ -28,6 +28,8 @@ static std::vector *FilesToRemove = NULL; static std::vector *DirectoriesToRemove = NULL; static bool RegisteredUnhandledExceptionFilter = false; +static bool CleanupExecuted = false; +static PTOP_LEVEL_EXCEPTION_FILTER OldFilter = NULL; // Windows creates a new thread to execute the console handler when an event // (such as CTRL/C) occurs. This causes concurrency issues with the above @@ -43,8 +45,7 @@ static void RegisterHandler() { - if (RegisteredUnhandledExceptionFilter) - { + if (RegisteredUnhandledExceptionFilter) { EnterCriticalSection(&CriticalSection); return; } @@ -58,7 +59,7 @@ EnterCriticalSection(&CriticalSection); RegisteredUnhandledExceptionFilter = true; - SetUnhandledExceptionFilter(LLVMUnhandledExceptionFilter); + OldFilter = SetUnhandledExceptionFilter(LLVMUnhandledExceptionFilter); SetConsoleCtrlHandler(LLVMConsoleCtrlHandler, TRUE); // IMPORTANT NOTE: Caller must call LeaveCriticalSection(&CriticalSection) or @@ -69,6 +70,9 @@ void sys::RemoveFileOnSignal(const std::string &Filename) { RegisterHandler(); + if (CleanupExecuted) + throw std::string("Process terminating -- cannot register for removal"); + if (FilesToRemove == NULL) FilesToRemove = new std::vector; @@ -81,6 +85,9 @@ void sys::RemoveDirectoryOnSignal(const sys::Path& path) { RegisterHandler(); + if (CleanupExecuted) + throw std::string("Process terminating -- cannot register for removal"); + if (path.is_directory()) { if (DirectoriesToRemove == NULL) DirectoriesToRemove = new std::vector; @@ -103,6 +110,12 @@ static void Cleanup() { EnterCriticalSection(&CriticalSection); + // Prevent other thread from registering new files and directories for + // removal, should we be executing because of the console handler callback. + CleanupExecuted = true; + + // FIXME: open files cannot be deleted. + if (FilesToRemove != NULL) while (!FilesToRemove->empty()) { try { @@ -144,7 +157,7 @@ // Initialize the symbol handler. SymSetOptions(SYMOPT_DEFERRED_LOADS|SYMOPT_LOAD_LINES); - SymInitialize(GetCurrentProcess(), NULL, TRUE); + SymInitialize(hProcess, NULL, TRUE); while (true) { if (!StackWalk(IMAGE_FILE_MACHINE_I386, hProcess, hThread, &StackFrame, @@ -158,7 +171,7 @@ // Print the PC in hexadecimal. DWORD PC = StackFrame.AddrPC.Offset; - fprintf(stderr, "%04X:%08X", ep->ContextRecord->SegCs, PC); + fprintf(stderr, "%08X", PC); // Print the parameters. Assume there are four. fprintf(stderr, " (0x%08X 0x%08X 0x%08X 0x%08X)", StackFrame.Params[0], @@ -166,7 +179,7 @@ // Verify the PC belongs to a module in this process. if (!SymGetModuleBase(hProcess, PC)) { - fputc('\n', stderr); + fputs(" \n", stderr); continue; } @@ -201,21 +214,18 @@ fputc('\n', stderr); } - } - catch (...) - { + } catch (...) { assert(!"Crashed in LLVMUnhandledExceptionFilter"); } // Allow dialog box to pop up allowing choice to start debugger. - return EXCEPTION_CONTINUE_SEARCH; + if (OldFilter) + return (*OldFilter)(ep); + else + return EXCEPTION_CONTINUE_SEARCH; } static BOOL WINAPI LLVMConsoleCtrlHandler(DWORD dwCtrlType) { - // FIXME: This handler executes on a different thread. The main thread - // is still running, potentially creating new files to be cleaned up - // in the tiny window between the call to Cleanup() and process termination. - // Also, any files currently open cannot be deleted. Cleanup(); // Allow normal processing to take place; i.e., the process dies. From alkis at cs.uiuc.edu Sun Sep 19 01:05:58 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Sun, 19 Sep 2004 01:05:58 -0500 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200409190605.BAA26930@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.103 -> 1.104 --- Log message: Fix type for member functions. --- Diffs of the changes: (+8 -3) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.103 llvm-java/lib/Compiler/Compiler.cpp:1.104 --- llvm-java/lib/Compiler/Compiler.cpp:1.103 Wed Sep 15 19:09:36 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Sun Sep 19 01:05:48 2004 @@ -343,6 +343,8 @@ const Methods& methods = cf->getMethods(); + const ClassInfo& ci = getClassInfo(cf); + // add member functions to the vtable for (unsigned i = 0, e = methods.size(); i != e; ++i) { Method* method = methods[i]; @@ -355,7 +357,7 @@ std::string funcName = "java/lang/Object/" + methodDescr; const FunctionType* funcTy = cast( - getType(method->getDescriptor(), getClassInfo(cf).type)); + getType(method->getDescriptor(), ci.type)); Function* vfun = module_->getOrInsertFunction(funcName, funcTy); toCompileFunctions_.insert(vfun); @@ -723,14 +725,17 @@ Function* compileMethodOnly(const std::string& classMethodDesc) { Method* method; tie(cf_, method) = findClassAndMethod(classMethodDesc); + const ClassInfo& ci = getClassInfo(cf_); std::string name = cf_->getThisClass()->getName()->str(); name += '/'; name += method->getName()->str(); name += method->getDescriptor()->str(); - Function* function = module_->getOrInsertFunction - (name, cast(getType(method->getDescriptor()))); + FunctionType* funcTy = cast( + getType(method->getDescriptor(), method->isStatic() ? NULL : ci.type)); + + Function* function = module_->getOrInsertFunction(name, funcTy); function->setLinkage(method->isPrivate() ? Function::InternalLinkage : Function::ExternalLinkage); From lattner at cs.uiuc.edu Sun Sep 19 13:43:15 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 19 Sep 2004 13:43:15 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/load.ll Message-ID: <200409191843.NAA06981@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: load.ll updated: 1.6 -> 1.7 --- Log message: Add two new testcases that instcombine should handle --- Diffs of the changes: (+23 -0) Index: llvm/test/Regression/Transforms/InstCombine/load.ll diff -u llvm/test/Regression/Transforms/InstCombine/load.ll:1.6 llvm/test/Regression/Transforms/InstCombine/load.ll:1.7 --- llvm/test/Regression/Transforms/InstCombine/load.ll:1.6 Thu May 27 12:43:33 2004 +++ llvm/test/Regression/Transforms/InstCombine/load.ll Sun Sep 19 13:43:01 2004 @@ -4,6 +4,7 @@ ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep load %X = constant int 42 +%X2 = constant int 47 %Y = constant [2 x { int, float }] [ { int, float } { int 12, float 1.0 }, { int, float } { int 37, float 1.2312 } ] %Z = constant [2 x { int, float }] zeroinitializer @@ -31,3 +32,25 @@ %B = load int* %A ret int %B } + +; load (select (Cond, &V1, &V2)) --> select(Cond, load &V1, load &V2) +int %test5(bool %C) { + %Y = select bool %C, int* %X, int* %X2 + %Z = load int* %Y + ret int %Z +} + +; load (phi (&V1, &V2, &V3)) --> phi(load &V1, load &V2, load &V3) +int %test6(bool %C) { +entry: + br bool %C, label %cond_true.i, label %cond_continue.i + +cond_true.i: + br label %cond_continue.i + +cond_continue.i: + %mem_tmp.i.0 = phi int* [ %X, %cond_true.i ], [ %X2, %entry ] + %tmp.3 = load int* %mem_tmp.i.0 + ret int %tmp.3 +} + From lattner at cs.uiuc.edu Sun Sep 19 13:43:57 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 19 Sep 2004 13:43:57 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200409191843.NAA06992@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.240 -> 1.241 --- Log message: Make instruction combining a bit more aggressive in the face of volatile loads, and implement two new transforms: InstCombine/load.ll:test[56]. --- Diffs of the changes: (+60 -3) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.240 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.241 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.240 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sun Sep 19 13:43:46 2004 @@ -2983,7 +2983,8 @@ // the same size. Instead of casting the pointer before the load, cast // the result of the loaded value. Value *NewLoad = IC.InsertNewInstBefore(new LoadInst(CI->getOperand(0), - CI->getName()), LI); + CI->getName(), + LI.isVolatile()),LI); // Now cast the result of the load. return new CastInst(NewLoad, LI.getType()); } @@ -2991,12 +2992,17 @@ return 0; } +/// isSafeToLoadUnconditionally - Return true if we know that executing a load +/// from this value cannot trap. +static bool isSafeToLoadUnconditionally(Value *V) { + return isa(V) || isa(V); +} + Instruction *InstCombiner::visitLoadInst(LoadInst &LI) { Value *Op = LI.getOperand(0); - if (LI.isVolatile()) return 0; if (Constant *C = dyn_cast(Op)) - if (C->isNullValue()) // load null -> 0 + if (C->isNullValue() && !LI.isVolatile()) // load null -> 0 return ReplaceInstUsesWith(LI, Constant::getNullValue(LI.getType())); // Instcombine load (constant global) into the value loaded... @@ -3021,6 +3027,57 @@ if (Instruction *Res = InstCombineLoadCast(*this, LI)) return Res; + if (!LI.isVolatile() && Op->hasOneUse()) { + // Change select and PHI nodes to select values instead of addresses: this + // helps alias analysis out a lot, allows many others simplifications, and + // exposes redundancy in the code. + // + // Note that we cannot do the transformation unless we know that the + // introduced loads cannot trap! Something like this is valid as long as + // the condition is always false: load (select bool %C, int* null, int* %G), + // but it would not be valid if we transformed it to load from null + // unconditionally. + // + if (SelectInst *SI = dyn_cast(Op)) { + // load (select (Cond, &V1, &V2)) --> select(Cond, load &V1, load &V2). + if (isSafeToLoadUnconditionally(SI->getOperand(1)) && + isSafeToLoadUnconditionally(SI->getOperand(2))) { + Value *V1 = InsertNewInstBefore(new LoadInst(SI->getOperand(1), + SI->getOperand(1)->getName()+".val"), *SI); + Value *V2 = InsertNewInstBefore(new LoadInst(SI->getOperand(2), + SI->getOperand(2)->getName()+".val"), *SI); + return new SelectInst(SI->getCondition(), V1, V2); + } + + } else if (PHINode *PN = dyn_cast(Op)) { + // load (phi (&V1, &V2, &V3)) --> phi(load &V1, load &V2, load &V3) + bool Safe = true; + for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) + if (!isSafeToLoadUnconditionally(PN->getIncomingValue(i))) { + Safe = false; + break; + } + if (Safe) { + // Create the PHI. + PHINode *NewPN = new PHINode(LI.getType(), PN->getName()); + InsertNewInstBefore(NewPN, *PN); + std::map LoadMap; // Don't insert duplicate loads + + for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) { + BasicBlock *BB = PN->getIncomingBlock(i); + Value *&TheLoad = LoadMap[BB]; + if (TheLoad == 0) { + Value *InVal = PN->getIncomingValue(i); + TheLoad = InsertNewInstBefore(new LoadInst(InVal, + InVal->getName()+".val"), + *BB->getTerminator()); + } + NewPN->addIncoming(TheLoad, BB); + } + return ReplaceInstUsesWith(LI, NewPN); + } + } + } return 0; } From lattner at cs.uiuc.edu Sun Sep 19 13:45:56 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 19 Sep 2004 13:45:56 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/ScalarRepl/phinodepromote.ll select_promote.ll Message-ID: <200409191845.NAA07021@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/ScalarRepl: phinodepromote.ll updated: 1.1 -> 1.2 select_promote.ll updated: 1.1 -> 1.2 --- Log message: Instcombine now helps out with these --- Diffs of the changes: (+7 -4) Index: llvm/test/Regression/Transforms/ScalarRepl/phinodepromote.ll diff -u llvm/test/Regression/Transforms/ScalarRepl/phinodepromote.ll:1.1 llvm/test/Regression/Transforms/ScalarRepl/phinodepromote.ll:1.2 --- llvm/test/Regression/Transforms/ScalarRepl/phinodepromote.ll:1.1 Sun Jan 11 19:17:42 2004 +++ llvm/test/Regression/Transforms/ScalarRepl/phinodepromote.ll Sun Sep 19 13:45:45 2004 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep alloca +; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | not grep alloca ; ; This tests to see if mem2reg can promote alloca instructions whose addresses ; are used by PHI nodes that are immediately loaded. The LLVM C++ front-end @@ -6,12 +6,14 @@ ; lvalues), so handling this simple extension is quite useful. ; ; This testcase is what the following program looks like when it reaches -; mem2reg: +; instcombine: ; ; template ; const T& max(const T& a1, const T& a2) { return a1 < a2 ? a1 : a2; } ; int main() { return max(0, 1); } ; +; This test checks to make sure the combination of instcombine and mem2reg +; perform the transformation. int %main() { entry: Index: llvm/test/Regression/Transforms/ScalarRepl/select_promote.ll diff -u llvm/test/Regression/Transforms/ScalarRepl/select_promote.ll:1.1 llvm/test/Regression/Transforms/ScalarRepl/select_promote.ll:1.2 --- llvm/test/Regression/Transforms/ScalarRepl/select_promote.ll:1.1 Thu Apr 8 14:59:22 2004 +++ llvm/test/Regression/Transforms/ScalarRepl/select_promote.ll Sun Sep 19 13:45:45 2004 @@ -1,6 +1,7 @@ -; Test promotion of loads that use the result of a select instruction. +; Test promotion of loads that use the result of a select instruction. This +; should be simplified by the instcombine pass. -; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep alloca +; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | not grep alloca int %main() { %mem_tmp.0 = alloca int ; [#uses=3] From lattner at cs.uiuc.edu Sun Sep 19 13:52:04 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 19 Sep 2004 13:52:04 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200409191852.NAA07554@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.69 -> 1.70 --- Log message: Remove a whole bunch of horrible hacky code that was used to promote allocas whose addresses where used by trivial phi nodes and select instructions. This is now performed by the instcombine pass, which is more powerful, is much simpler, and is faster. This allows the deletion of a bunch of code, two FIXME's and two gotos. --- Diffs of the changes: (+7 -145) Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.69 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.70 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.69 Fri Sep 17 19:32:40 2004 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sun Sep 19 13:51:51 2004 @@ -8,11 +8,11 @@ //===----------------------------------------------------------------------===// // // This file promote memory references to be register references. It promotes -// alloca instructions which only have loads and stores as uses (or that have -// PHI nodes which are only loaded from). An alloca is transformed by using -// dominator frontiers to place PHI nodes, then traversing the function in -// depth-first order to rewrite loads and stores as appropriate. This is just -// the standard SSA construction algorithm to construct "pruned" SSA form. +// alloca instructions which only have loads and stores as uses. An alloca is +// transformed by using dominator frontiers to place PHI nodes, then traversing +// the function in depth-first order to rewrite loads and stores as appropriate. +// This is just the standard SSA construction algorithm to construct "pruned" +// SSA form. // //===----------------------------------------------------------------------===// @@ -30,8 +30,7 @@ using namespace llvm; /// isAllocaPromotable - Return true if this alloca is legal for promotion. -/// This is true if there are only loads and stores to the alloca... of if there -/// is a PHI node using the address which can be trivially transformed. +/// This is true if there are only loads and stores to the alloca. /// bool llvm::isAllocaPromotable(const AllocaInst *AI, const TargetData &TD) { // FIXME: If the memory unit is of pointer or integer type, we can permit @@ -45,72 +44,8 @@ } else if (const StoreInst *SI = dyn_cast(*UI)) { if (SI->getOperand(0) == AI) return false; // Don't allow a store OF the AI, only INTO the AI. - } else if (const PHINode *PN = dyn_cast(*UI)) { - // We only support PHI nodes in a few simple cases. The PHI node is only - // allowed to have one use, which must be a load instruction, and can only - // use alloca instructions (no random pointers). Also, there cannot be - // any accesses to AI between the PHI node and the use of the PHI. - if (!PN->hasOneUse()) return false; - - // Our transformation causes the unconditional loading of all pointer - // operands to the PHI node. Because this could cause a fault if there is - // a critical edge in the CFG and if one of the pointers is illegal, we - // refuse to promote PHI nodes unless they are obviously safe. For now, - // obviously safe means that all of the operands are allocas. - // - // If we wanted to extend this code to break critical edges, this - // restriction could be relaxed, and we could even handle uses of the PHI - // node that are volatile loads or stores. - // - for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) - if (!isa(PN->getIncomingValue(i))) - return false; - - // Now make sure the one user instruction is in the same basic block as - // the PHI, and that there are no loads or stores between the PHI node and - // the access. - BasicBlock::const_iterator UI = cast(PN->use_back()); - if (!isa(UI) || cast(UI)->isVolatile()) return false; - - // Scan looking for memory accesses. - // FIXME: this should REALLY use alias analysis. - for (--UI; !isa(UI); --UI) - if (isa(UI) || isa(UI) || isa(UI)) - return false; - - // If we got this far, we can promote the PHI use. - } else if (const SelectInst *SI = dyn_cast(*UI)) { - // We only support selects in a few simple cases. The select is only - // allowed to have one use, which must be a load instruction, and can only - // use alloca instructions (no random pointers). Also, there cannot be - // any accesses to AI between the PHI node and the use of the PHI. - if (!SI->hasOneUse()) return false; - - // Our transformation causes the unconditional loading of all pointer - // operands of the select. Because this could cause a fault if there is a - // critical edge in the CFG and if one of the pointers is illegal, we - // refuse to promote the select unless it is obviously safe. For now, - // obviously safe means that all of the operands are allocas. - // - if (!isa(SI->getOperand(1)) || - !isa(SI->getOperand(2))) - return false; - - // Now make sure the one user instruction is in the same basic block as - // the PHI, and that there are no loads or stores between the PHI node and - // the access. - BasicBlock::const_iterator UI = cast(SI->use_back()); - if (!isa(UI) || cast(UI)->isVolatile()) return false; - - // Scan looking for memory accesses. - // FIXME: this should REALLY use alias analysis. - for (--UI; &*UI != SI; --UI) - if (isa(UI) || isa(UI) || isa(UI)) - return false; - - // If we got this far, we can promote the select use. } else { - return false; // Not a load, store, or promotable PHI? + return false; // Not a load or store. } return true; @@ -216,7 +151,6 @@ // As we scan the uses of the alloca instruction, keep track of stores, and // decide whether all of the loads and stores to the alloca are within the // same basic block. - RestartUseScan: Value *AllocaPointerVal = 0; for (Value::use_iterator U =AI->use_begin(), E = AI->use_end(); U != E;++U){ Instruction *User = cast(*U); @@ -228,78 +162,6 @@ // Otherwise it must be a load instruction, keep track of variable reads UsingBlocks.push_back(LI->getParent()); AllocaPointerVal = LI; - } else if (SelectInst *SI = dyn_cast(User)) { - // Because of the restrictions we placed on Select instruction uses - // above things are very simple. Transform the select of addresses into - // a select of loaded values. - LoadInst *Load = cast(SI->use_back()); - std::string LoadName = Load->getName(); Load->setName(""); - - Value *TrueVal = new LoadInst(SI->getOperand(1), - SI->getOperand(1)->getName()+".val", SI); - Value *FalseVal = new LoadInst(SI->getOperand(2), - SI->getOperand(2)->getName()+".val", SI); - - Value *NewSI = new SelectInst(SI->getOperand(0), TrueVal, - FalseVal, Load->getName(), SI); - if (AST && isa(Load->getType())) { - AST->copyValue(Load, TrueVal); - AST->copyValue(Load, FalseVal); - AST->copyValue(Load, NewSI); - AST->deleteValue(Load); - AST->deleteValue(SI); - } - - Load->replaceAllUsesWith(NewSI); - Load->getParent()->getInstList().erase(Load); - SI->getParent()->getInstList().erase(SI); - - // Restart our scan of uses... - DefiningBlocks.clear(); - UsingBlocks.clear(); - goto RestartUseScan; - } else { - // Because of the restrictions we placed on PHI node uses above, the PHI - // node reads the block in any using predecessors. Transform the PHI of - // addresses into a PHI of loaded values. - PHINode *PN = cast(User); - assert(PN->hasOneUse() && "Cannot handle PHI Node with != 1 use!"); - LoadInst *PNUser = cast(PN->use_back()); - std::string PNUserName = PNUser->getName(); PNUser->setName(""); - - // Create the new PHI node and insert load instructions as appropriate. - PHINode *NewPN = new PHINode(AI->getAllocatedType(), PNUserName, PN); - std::map NewLoads; - for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) { - BasicBlock *Pred = PN->getIncomingBlock(i); - LoadInst *&NewLoad = NewLoads[Pred]; - if (NewLoad == 0) // Insert the new load in the predecessor - NewLoad = new LoadInst(PN->getIncomingValue(i), - PN->getIncomingValue(i)->getName()+".val", - Pred->getTerminator()); - NewPN->addIncoming(NewLoad, Pred); - } - - if (AST && isa(NewPN->getType())) { - for (std::map::iterator I = NewLoads.begin(), - E = NewLoads.end(); I != E; ++I) - AST->copyValue(PNUser, I->second); - AST->copyValue(PNUser, NewPN); - AST->deleteValue(PNUser); - AST->deleteValue(PN); - } - - // Remove the old load. - PNUser->replaceAllUsesWith(NewPN); - PNUser->getParent()->getInstList().erase(PNUser); - - // Remove the old PHI node. - PN->getParent()->getInstList().erase(PN); - - // Restart our scan of uses... - DefiningBlocks.clear(); - UsingBlocks.clear(); - goto RestartUseScan; } if (OnlyUsedInOneBlock) { From lattner at cs.uiuc.edu Sun Sep 19 14:01:19 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 19 Sep 2004 14:01:19 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraph.cpp Message-ID: <200409191901.OAA08783@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: CallGraph.cpp updated: 1.44 -> 1.45 --- Log message: Fix a nasty iterator invalidation problem I introduced yesterday. This unfortunately is the cause of a bunch of failures from tonight, and the reason the tester is running so slow :( --- Diffs of the changes: (+5 -5) Index: llvm/lib/Analysis/IPA/CallGraph.cpp diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.44 llvm/lib/Analysis/IPA/CallGraph.cpp:1.45 --- llvm/lib/Analysis/IPA/CallGraph.cpp:1.44 Sat Sep 18 16:34:34 2004 +++ llvm/lib/Analysis/IPA/CallGraph.cpp Sun Sep 19 14:01:06 2004 @@ -211,10 +211,10 @@ // the specified callee function. This takes more time to execute than // removeCallEdgeTo, so it should not be used unless necessary. void CallGraphNode::removeAnyCallEdgeTo(CallGraphNode *Callee) { - for (std::vector::iterator I = CalledFunctions.begin(), - E = CalledFunctions.end(); I != E; ++I) - if (*I == Callee) { - CalledFunctions.erase(I); - E = CalledFunctions.end(); + for (unsigned i = 0, e = CalledFunctions.size(); i != e; ++i) + if (CalledFunctions[i] == Callee) { + CalledFunctions[i] = CalledFunctions.back(); + CalledFunctions.pop_back(); + --i; --e; } } From lattner at cs.uiuc.edu Sun Sep 19 14:17:23 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 19 Sep 2004 14:17:23 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/CPP_min_max.llx Message-ID: <200409191917.OAA09504@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: CPP_min_max.llx added (r1.1) --- Log message: New testcase for PR362: http://llvm.cs.uiuc.edu/PR362 : Icky code generated for std::min/std::max --- Diffs of the changes: (+34 -0) Index: llvm/test/Regression/Transforms/InstCombine/CPP_min_max.llx diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/CPP_min_max.llx:1.1 *** /dev/null Sun Sep 19 14:17:20 2004 --- llvm/test/Regression/Transforms/InstCombine/CPP_min_max.llx Sun Sep 19 14:17:10 2004 *************** *** 0 **** --- 1,34 ---- + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep select | not grep 'int\*' + + ; This testcase corresponds to PR362, which notices that this horrible code + ; is generated by the C++ front-end and LLVM optimizers, which has lots of + ; loads and other stuff that are unneeded. + ; + ; Instcombine should propagate the load through the select instructions to + ; allow elimination of the extra stuff by the mem2reg pass. + + implementation ; Functions: + + void %_Z5test1RiS_(int* %x, int* %y) { + entry: + %tmp.1.i = load int* %y ; [#uses=1] + %tmp.3.i = load int* %x ; [#uses=1] + %tmp.4.i = setlt int %tmp.1.i, %tmp.3.i ; [#uses=1] + %retval.i = select bool %tmp.4.i, int* %y, int* %x ; [#uses=1] + %tmp.4 = load int* %retval.i ; [#uses=1] + store int %tmp.4, int* %x + ret void + } + + void %_Z5test2RiS_(int* %x, int* %y) { + entry: + %tmp.0 = alloca int ; [#uses=2] + %tmp.2 = load int* %x ; [#uses=2] + store int %tmp.2, int* %tmp.0 + %tmp.3.i = load int* %y ; [#uses=1] + %tmp.4.i = setlt int %tmp.2, %tmp.3.i ; [#uses=1] + %retval.i = select bool %tmp.4.i, int* %y, int* %tmp.0 ; [#uses=1] + %tmp.6 = load int* %retval.i ; [#uses=1] + store int %tmp.6, int* %y + ret void + } From lattner at cs.uiuc.edu Sun Sep 19 14:18:21 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 19 Sep 2004 14:18:21 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200409191918.OAA09515@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.241 -> 1.242 --- Log message: Make isSafeToLoadUnconditionally a bit smarter, implementing PR362: http://llvm.cs.uiuc.edu/PR362 and Regression/Transforms/InstCombine/CPP_min_max.llx --- Diffs of the changes: (+28 -6) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.241 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.242 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.241 Sun Sep 19 13:43:46 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sun Sep 19 14:18:10 2004 @@ -2993,9 +2993,30 @@ } /// isSafeToLoadUnconditionally - Return true if we know that executing a load -/// from this value cannot trap. -static bool isSafeToLoadUnconditionally(Value *V) { - return isa(V) || isa(V); +/// from this value cannot trap. If it is not obviously safe to load from the +/// specified pointer, we do a quick local scan of the basic block containing +/// ScanFrom, to determine if the address is already accessed. +static bool isSafeToLoadUnconditionally(Value *V, Instruction *ScanFrom) { + // If it is an alloca or global variable, it is always safe to load from. + if (isa(V) || isa(V)) return true; + + // Otherwise, be a little bit agressive by scanning the local block where we + // want to check to see if the pointer is already being loaded or stored + // from/to. If so, the previous load or store would hav already trapped, so + // there is no harm doing an extra load (also, CSE will later eliminate the + // load entirely). + BasicBlock::iterator BBI = ScanFrom, E = ScanFrom->getParent()->begin(); + + do { + --BBI; + + if (LoadInst *LI = dyn_cast(BBI)) { + if (LI->getOperand(0) == V) return true; + } else if (StoreInst *SI = dyn_cast(BBI)) + if (SI->getOperand(1) == V) return true; + + } while (BBI != E); + return false; } Instruction *InstCombiner::visitLoadInst(LoadInst &LI) { @@ -3040,8 +3061,8 @@ // if (SelectInst *SI = dyn_cast(Op)) { // load (select (Cond, &V1, &V2)) --> select(Cond, load &V1, load &V2). - if (isSafeToLoadUnconditionally(SI->getOperand(1)) && - isSafeToLoadUnconditionally(SI->getOperand(2))) { + if (isSafeToLoadUnconditionally(SI->getOperand(1), SI) && + isSafeToLoadUnconditionally(SI->getOperand(2), SI)) { Value *V1 = InsertNewInstBefore(new LoadInst(SI->getOperand(1), SI->getOperand(1)->getName()+".val"), *SI); Value *V2 = InsertNewInstBefore(new LoadInst(SI->getOperand(2), @@ -3053,7 +3074,8 @@ // load (phi (&V1, &V2, &V3)) --> phi(load &V1, load &V2, load &V3) bool Safe = true; for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) - if (!isSafeToLoadUnconditionally(PN->getIncomingValue(i))) { + if (!isSafeToLoadUnconditionally(PN->getIncomingValue(i), + PN->getIncomingBlock(i)->getTerminator())) { Safe = false; break; } From lattner at cs.uiuc.edu Sun Sep 19 14:21:39 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 19 Sep 2004 14:21:39 -0500 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200409191921.OAA09541@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.238 -> 1.239 --- Log message: better code Move other things to the right sections --- Diffs of the changes: (+7 -5) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.238 llvm/docs/ReleaseNotes.html:1.239 --- llvm/docs/ReleaseNotes.html:1.238 Tue Sep 14 20:09:25 2004 +++ llvm/docs/ReleaseNotes.html Sun Sep 19 14:21:26 2004 @@ -86,6 +86,8 @@ @@ -140,10 +144,8 @@ @@ -615,7 +617,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
              - Last modified: $Date: 2004/09/15 01:09:25 $ + Last modified: $Date: 2004/09/19 19:21:26 $ From reid at x10sys.com Sun Sep 19 16:47:58 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Sep 2004 16:47:58 -0500 Subject: [llvm-commits] CVS: llvm/autoconf/m4/libtool.m4 Message-ID: <200409192147.QAA12152@zion.cs.uiuc.edu> Changes in directory llvm/autoconf/m4: libtool.m4 added (r1.1) --- Log message: Add our own version of libtool.m4 instead of relying on the installed one. This is a potential version mismatch problem because this file came from libtool 1.5.10. If you're running a different version of libtool, the checks in this file may not be quite right. Having our own version of this file violates the spirit of libtool and is only provided to change the name of "libtool" to "mklib". This is done so that the name "libtool" does not conflict with the "lib" directory when doing tab completion and your $objdir == $srcdir. --- Diffs of the changes: (+6010 -0) Index: llvm/autoconf/m4/libtool.m4 diff -c /dev/null llvm/autoconf/m4/libtool.m4:1.1 *** /dev/null Sun Sep 19 16:47:57 2004 --- llvm/autoconf/m4/libtool.m4 Sun Sep 19 16:47:47 2004 *************** *** 0 **** --- 1,6010 ---- + ############################################################################### + ############################################################################### + ############ READ THIS: + ############ The only difference between this version of libtool.m4 and the one + ############ provided with libtool 1.5.10 is this warning header and changing + ############ the name of libtool to mklib. AutoRegen.sh checks for version + ############ 1.5.10 of libtool so attempts to use another version with this + ############ AC_PROG_LIBTOOL definition should fail. You've been warned. + ############################################################################### + ############################################################################### + # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + ## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 + ## Free Software Foundation, Inc. + ## Originally by Gordon Matzigkeit , 1996 + ## + ## 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 2 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, write to the Free Software + ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + ## + ## As a special exception to the GNU General Public License, if you + ## distribute this file as part of a program that contains a + ## configuration script generated by Autoconf, you may include it under + ## the same distribution terms that you use for the rest of that program. + + # serial 47 AC_PROG_LIBTOOL + + + # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) + # ----------------------------------------------------------- + # If this macro is not defined by Autoconf, define it here. + m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + + # AC_PROG_LIBTOOL + # --------------- + AC_DEFUN([AC_PROG_LIBTOOL], + [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl + dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX + dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) + dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 + ])]) + + dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. + dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run + dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) + ])])# AC_PROG_LIBTOOL + + + # _AC_PROG_LIBTOOL + # ---------------- + AC_DEFUN([_AC_PROG_LIBTOOL], + [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl + AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl + AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl + AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + + # This can be used to rebuild libtool when needed + LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + + # Always use our own libtool. + LIBTOOL='$(SHELL) $(top_builddir)/mklib' + AC_SUBST(LIBTOOL)dnl + + # Prevent multiple expansion + define([AC_PROG_LIBTOOL], []) + ])# _AC_PROG_LIBTOOL + + + # AC_LIBTOOL_SETUP + # ---------------- + AC_DEFUN([AC_LIBTOOL_SETUP], + [AC_PREREQ(2.50)dnl + AC_REQUIRE([AC_ENABLE_SHARED])dnl + AC_REQUIRE([AC_ENABLE_STATIC])dnl + AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl + AC_REQUIRE([AC_CANONICAL_BUILD])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_PROG_LD])dnl + AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl + AC_REQUIRE([AC_PROG_NM])dnl + + AC_REQUIRE([AC_PROG_LN_S])dnl + AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl + # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + AC_REQUIRE([AC_OBJEXT])dnl + AC_REQUIRE([AC_EXEEXT])dnl + dnl + + AC_LIBTOOL_SYS_MAX_CMD_LEN + AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + AC_LIBTOOL_OBJDIR + + AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + _LT_AC_PROG_ECHO_BACKSLASH + + case $host_os in + aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; + esac + + # Sed substitution that helps us do robust quoting. It backslashifies + # metacharacters that are still active within double-quoted strings. + Xsed='sed -e s/^X//' + [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + + # Same as above, but do not quote variable references. + [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + + # Sed substitution to delay expansion of an escaped shell variable in a + # double_quote_subst'ed string. + delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + + # Sed substitution to avoid accidental globbing in evaled expressions + no_glob_subst='s/\*/\\\*/g' + + # Constants: + rm="rm -f" + + # Global variables: + default_ofile=libtool + can_build_shared=yes + + # All known linkers require a `.a' archive for static linking (except M$VC, + # which needs '.lib'). + libext=a + ltmain="$ac_aux_dir/ltmain.sh" + ofile="$default_ofile" + with_gnu_ld="$lt_cv_prog_gnu_ld" + + AC_CHECK_TOOL(AR, ar, false) + AC_CHECK_TOOL(RANLIB, ranlib, :) + AC_CHECK_TOOL(STRIP, strip, :) + + old_CC="$CC" + old_CFLAGS="$CFLAGS" + + # Set sane defaults for various variables + test -z "$AR" && AR=ar + test -z "$AR_FLAGS" && AR_FLAGS=cru + test -z "$AS" && AS=as + test -z "$CC" && CC=cc + test -z "$LTCC" && LTCC=$CC + test -z "$DLLTOOL" && DLLTOOL=dlltool + test -z "$LD" && LD=ld + test -z "$LN_S" && LN_S="ln -s" + test -z "$MAGIC_CMD" && MAGIC_CMD=file + test -z "$NM" && NM=nm + test -z "$SED" && SED=sed + test -z "$OBJDUMP" && OBJDUMP=objdump + test -z "$RANLIB" && RANLIB=: + test -z "$STRIP" && STRIP=: + test -z "$ac_objext" && ac_objext=o + + # Determine commands to create old-style static archives. + old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' + old_postinstall_cmds='chmod 644 $oldlib' + old_postuninstall_cmds= + + if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + fi + + cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` + + # Only perform the check for file, if the check method requires it + case $deplibs_check_method in + file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; + esac + + AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) + AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], + enable_win32_dll=yes, enable_win32_dll=no) + + AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) + test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + + AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) + test -z "$pic_mode" && pic_mode=default + + # Use C for the default configuration in the libtool script + tagname= + AC_LIBTOOL_LANG_C_CONFIG + _LT_AC_TAGCONFIG + ])# AC_LIBTOOL_SETUP + + + # _LT_AC_SYS_COMPILER + # ------------------- + AC_DEFUN([_LT_AC_SYS_COMPILER], + [AC_REQUIRE([AC_PROG_CC])dnl + + # If no C compiler was specified, use CC. + LTCC=${LTCC-"$CC"} + + # Allow CC to be a program name with arguments. + compiler=$CC + ])# _LT_AC_SYS_COMPILER + + + # _LT_AC_SYS_LIBPATH_AIX + # ---------------------- + # Links a minimal program and checks the executable + # for the system default hardcoded library path. In most cases, + # this is /usr/lib:/lib, but when the MPI compilers are used + # the location of the communication and MPI libs are included too. + # If we don't find anything, use the default library path according + # to the aix ld manual. + AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], + [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ + aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } + }'` + # Check for a 64-bit object if we didn't find anything. + if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } + }'`; fi],[]) + if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + ])# _LT_AC_SYS_LIBPATH_AIX + + + # _LT_AC_SHELL_INIT(ARG) + # ---------------------- + AC_DEFUN([_LT_AC_SHELL_INIT], + [ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) + $1 + AC_DIVERT_POP + ])# _LT_AC_SHELL_INIT + + + # _LT_AC_PROG_ECHO_BACKSLASH + # -------------------------- + # Add some code to the start of the generated configure script which + # will find an echo command which doesn't interpret backslashes. + AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], + [_LT_AC_SHELL_INIT([ + # Check that we are running under the correct shell. + SHELL=${CONFIG_SHELL-/bin/sh} + + case X$ECHO in + X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; + esac + + echo=${ECHO-echo} + if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : + elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : + else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} + fi + + if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + + if test -z "$ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string="`eval $cmd`") 2>/dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done + fi + + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi + fi + fi + + # Copy echo and quote the copy suitably for passing to libtool from + # the Makefile, instead of quoting the original, which is used later. + ECHO=$echo + if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" + fi + + AC_SUBST(ECHO) + ])])# _LT_AC_PROG_ECHO_BACKSLASH + + + # _LT_AC_LOCK + # ----------- + AC_DEFUN([_LT_AC_LOCK], + [AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) + test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + + # Some flags need to be propagated to the compiler or linker for good + # libtool support. + case $host in + ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; + *-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + + x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + + *-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; + AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], + [*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) + esac + + need_locks="$enable_libtool_lock" + + ])# _LT_AC_LOCK + + + # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, + # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) + # ---------------------------------------------------------------- + # Check whether the given compiler option works + AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], + [AC_REQUIRE([LT_AC_PROG_SED]) + AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + $2=yes + fi + fi + $rm conftest* + ]) + + if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) + else + ifelse([$6], , :, [$6]) + fi + ])# AC_LIBTOOL_COMPILER_OPTION + + + # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, + # [ACTION-SUCCESS], [ACTION-FAILURE]) + # ------------------------------------------------------------ + # Check whether the given compiler option works + AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], + [AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + ]) + + if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) + else + ifelse([$5], , :, [$5]) + fi + ])# AC_LIBTOOL_LINKER_OPTION + + + # AC_LIBTOOL_SYS_MAX_CMD_LEN + # -------------------------- + AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], + [# find the maximum length of command line arguments + AC_MSG_CHECKING([the maximum length of command line arguments]) + AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* ) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for *BSD + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + ;; + + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac + ]) + if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) + else + AC_MSG_RESULT(none) + fi + ])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + + # _LT_AC_CHECK_DLFCN + # -------------------- + AC_DEFUN([_LT_AC_CHECK_DLFCN], + [AC_CHECK_HEADERS(dlfcn.h)dnl + ])# _LT_AC_CHECK_DLFCN + + + # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, + # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) + # ------------------------------------------------------------------ + AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], + [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl + if test "$cross_compiling" = yes; then : + [$4] + else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < + #endif + + #include + + #ifdef RTLD_GLOBAL + # define LT_DLGLOBAL RTLD_GLOBAL + #else + # ifdef DL_GLOBAL + # define LT_DLGLOBAL DL_GLOBAL + # else + # define LT_DLGLOBAL 0 + # endif + #endif + + /* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ + #ifndef LT_DLLAZY_OR_NOW + # ifdef RTLD_LAZY + # define LT_DLLAZY_OR_NOW RTLD_LAZY + # else + # ifdef DL_LAZY + # define LT_DLLAZY_OR_NOW DL_LAZY + # else + # ifdef RTLD_NOW + # define LT_DLLAZY_OR_NOW RTLD_NOW + # else + # ifdef DL_NOW + # define LT_DLLAZY_OR_NOW DL_NOW + # else + # define LT_DLLAZY_OR_NOW 0 + # endif + # endif + # endif + # endif + #endif + + #ifdef __cplusplus + extern "C" void exit (int); + #endif + + void fnord() { int i=42;} + int main () + { + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); + }] + EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_unknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi + fi + rm -fr conftest* + ])# _LT_AC_TRY_DLOPEN_SELF + + + # AC_LIBTOOL_DLOPEN_SELF + # ------------------- + AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], + [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown + else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen"